text:
Remove extra digits in OBJ file export
In my OBJ file (exported with Blender), I noticed that there are many digits:
o MyObject
v 0.900000 10.750000 -0.750000
v 0.900000 9.250000 -0.750000
v 0.750000 10.750000 0.900000
v 0.750000 9.250000 0.900000
...

Is there any ways to reduce the exported file size by removing those extra 0?
Example:
o MyObject
v .9 10.75 -.75
v .9 9.25 -.75
v .75 10.75 0.9
v .75 9.25 0.9
...

And if not, is there any add-on, open source software or online tool that allows you to simplify OBJ files like this?

Thanks for the information. Yes, an OBJ file can be manually minified like this and still by readable, I tried and it works.

oh, good. Without knowing you were here, I reposted my comment as an answer.

Blender does not have such tools, except for the inbuilt python interpreter, which definitely has the necessary programming power to do this. However, an external python interpreter can also do it. This is not really about Blender, since most OBJ files I’ve seen also have these extra decimal places. I’m not sure if removing them would leave the file still readable. It might, though, and if you’re really desperate I could try to point you in the right direction in terms of code.
Edit: Run this code in any python interpreter, with the two variables FILE_IN and FILE_OUT configured appropriately. If you are using the blender python interpreter, I recommend placing this in blender’s text editor first, then clicking the little run button in the header.
#OBJ zero stripper v1.0

“””
This version of the script is blender compatible:
While it does not use or rely on any Blender API features,
it can be run inside the Blender interpreter without a hitch.

Configure the absolute variables, respectively FILE_IN and FILE_OUT,
appropriately before running.
"""

#File input and output variables
FILE_IN="C:\\Users\\BarryCap\\3D Objects\\untitled.obj"
FILE_OUT="C:\\Users\\BarryCap\\3D Objects\\untitled_zerostripped.obj"

#Open and read the file.
f=open(FILE_IN)
lines=f.read().splitlines()
f.close()

lines_new=[] #The new file's lines

for l in lines: #For every line from the file...

    nl="" #The new file line

    for item in l.split(" "): #For every space-separated item in the line...

        try: #Attempt converting the item to a float
            item=float(item)

            #Convert the number back to a string, processing the extra zeros out of it based on its numeric value
            if item < 0: #If the item is negative, process the minus sign
                item="-"+str(abs(item)).strip("0")
            elif item == 0: #If the item is zero, avoid the unneeded decimal point
                item="0"
            elif item>0: #If the item is greater than zero, simply strip off the zeros.
                item=str(item).strip("0")

        except ValueError: #If conversion to a float raises a ValueError, do not preprocess the item
            pass

        nl+=item+" " #Add the item to the new file line with a space (leaves one at the end)

    lines_new.append(nl) #...and add the finished line to the new file lines

f=open(FILE_OUT, "w") #Open the new file in write/create mode

#For each new file line...
for nl in lines_new:

    #...strip off the trailing space from earlier (the if statement is in case the line is empty)
    if nl[-1]==" ":
        nl=nl[:-1]
    f.write(nl+"\n") #...and write the line to the file.

f.close() #Close the file (saves automatically).

#S.D.G.

Yes, it would be great if you could do that! I merely don't know anything about Python, though.

@BarryCap Working…

@BarryCap done!

Thanks! I'll try that.

Where can I use this code? Like I said before, I don't know much of Python and it's implementation in Blender. Can you please be more specific on how to use this code?

@BarryCap I updated the answer a little. For more information, see the blender docs on scripting, or the python docs on python.

Thank you for updating your answer. I tried what you told me, but after exporting my OBJ file as untitled.obj and launching the script, in the system console it said either FileNotFoundError: [Errno 2] No such file or directory: 'untitled.obj', or SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape location: <unknown location>:-1 when trying with the full file path. I realize that / has to be used in Python, not \\\, and the parsing worked (Info: Saved "untitled.blend"), but the file didn't changed at all.

not a back slash (having trouble with this one in MarkDown…)

@BarryCap Umm… Well, Python takes \ as the escape sequence for \ so… IDK.

Just a backslash: . My file path was C:\Users\barrycap\Desktop\untitled.obj, and I changed to C:/Users/barrycap/Desktop/untitled.obj

@BarryCap did you have the quotes in place?

Yes:
FILE_IN="C:/Users/barrycap/Desktop/untitled.obj" FILE_OUT="C:/Users/barrycap/Desktop/untitled_zerostripped.obj"

@BarryCap OK, well, try a \ instead of each of the the /‘s

It worked! It stripped all useless zeros! I'll validate your answer as it answers better my question. Though @batFINGER did great work too!

@BarryCap TYG !

Great script, thanks! I also added in an initial round to further reduce the file size, which works fine for my particular models:
try: #Attempt converting the item to a float             item=float(item)             item=round(item,4)

@snibbe Ooh, that’s risky: Actual data being destroyed there. In your case it won’t cause trouble, but it easily could.

@TheLabCat - definitely - this is only useful if you know you can get away with the rounding and really need to make your file smaller!

Edit the exporter.
Will run thru how to edit changes into addon to do this, .. although for the most part do not recommend making edits to addons....
The addon used to export blend scene to obj is available in the addons folder and can be edited. Make a backup copy to revert... or an addon copy
In version (3.8.0) of the obj exporter that ships with blender, circa line 453 in /addons/io_scene_obj/export_obj.py
        # Vert
        for v in me_verts:
            fw('v %.6f %.6f %.6f\n' % v.co[:])

is where the vertex coordinates are written to file.  The %.6f is formatting the float to be written with 6 decimal places.
For example can limit to 4 decimal places with:
        # Vert
        for v in me_verts:
            fw('v %.4f %.4f %.4f\n' % v.co[:])

Please note, this is simply explaining where and why the exporter is writing a consistent n decimal places. Reducing the number will reduce the accuracy for numbers with significant digits outside reduced range
See  suggestions  given in this stackoverflow post https://stackoverflow.com/questions/41275396/limiting-floats-to-reduce-data-size
Using :n or :g formatting to remove 'insignificant trailing zeros' with:
        # Vert
        for v in me_verts:
            fw('v %g %g %g\n' % v.co[:])

Before:
o Cube
v 1.000000 1.550000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
...

After:
o Cube
v 1 1.55 -1
v 1 -1 -1
v 1 1 1
...

or a combination of two answers,
import re

def fmt(s):
    def repl(matchobj):
         return ''.join(i for i in matchobj.groups() if i)
    return re.sub(
            r"(-?)(?:\b0+(\.\d)(\d*)(?<!-0\.0)(?<!0\.0)\b|\b([1-9]\d*)\.0+\b)|-?(0)+\.0\b",
            repl ,
            s)

fw(fmt("v %g %g %g" % (1.000000 , 0.550000, -1.000000)))

#v 1 .55 -1

Similar could also be used to simply read and rewrite the obj file
Instead would  look at uitilizing using a tool like sed which can be programmed to look for and replace patterns.  If you are familiar with the vi editor, will be familiar with sed commands.
This I feel is somewhat outside the scope of BSE.
https://stackoverflow.com/questions/6916695/sed-for-removing-trailing-zeroes-regex-nongreedy

Setting it to %.4f Wood strip off sixth Place decimal places if the numbers were there. The idea is to get rid of extra zeros completely, not reduce their number and strip extra data if it is present.

Editing default decimal number is working, but what I want is to reduce without loss. For example, if %.1f is set, 0.750000 will be written as 0.8, and what I want is .75. But thanks for your help!

Was just an example, see the edit @ZargulTheWizard

@p2or Cheers for the edit!.

@p2or I did not know about that formatting. Very good, and thank you :-)

Thank you for editing your answer! I tried editing the export_obj.py file and it's working!

Thanks, appreciated.

There may be an easier way to do it but I found plugging into the file stream would be a good idea. There are actually 2 files created during the export, a .obj and a .mtl.
You need to open in a text editor the file called export_obj.py located in your blender installation folder/2.**/scripts/addons/io_scene_obj.
Then copy and paste the following lines in two locations :
with open(filepath, "w", encoding="utf8", newline="\n") as file:
        def ensure_no_leading_or_trailing_zero(input):
            if input.startswith(("v", "vt", "vn", "Ns", "Ka", "Kd", "Ks", "Ke", "Ni", "d")):
                if input.endswith("\n"):
                    input = input[:-1] # Strip the EOL character
                words = input.split(' ') # Splits the different words
                input = ""
                for i, word in enumerate(words):
                    if i > 0:  # Add space between each "word"
                        input += ' '
                    word = word.rstrip('0').rstrip('.') # Remove trailing zeroes
                    if word.startswith("0."): # Remove leading zeroes
                        word = word[1:]
                    if word.startswith("-0."): # Remove leading zeroes
                        word = "-" + word[2:]
                    input += word
                input += "\n"
            file.write(input)

        fw = ensure_no_leading_or_trailing_zero

First location, around the line 50. Replace the line that starts with with open(... and also the line fw = f.write.
Second location, around line 3000, do the same thing.
It should look like this :

And this :

Remember, in python, the indentation is very important. You can create an indentation if need be with 4 spaces.
Once the text file is edited, save it and close it. You then need to launch blender again for the new exporter settings to load.


text:
Seismograph, but a weird scaling effect happens
I want to create a seismograph-like curve writing like here: https://youtu.be/7nnB1EVvGzU?t=39
[For tryout, I use the wiggle random values like in the blender noise modifier. Later, I wanna apply sound data etc.]
In my first version, where my pointer (small red square) is constantly moving along the x-axis (starting at x=0, from left to right), it works fine.

But I want to write new values always at the beginning (x=0) and let go the rest along the x axis, like a seismograph (like in the video link above).
So for every new point written on the x-axis, I move the whole curve one point to the right on the x-axis. Thereby every new point is written at x=0, and now the whole curve is moving from left to right. But then it strangely creates a kind of scaling, the curve frequency becomes lower and lower.
You see here that the curve is at the right rather smooth and dense, but as time goes by (newer points written on x=0), the curve towards the left becomes more and more stretched, which is not wanted.

Thanks for help.
Update: Solution found. Since the curve is re-written every frame, one has only to re-shift it generally by a value.

Seems the problem is transforming a spline / curve which is constantly getting bigger and bigger. To get a constant shift on x-axis, one has to decrease the transform speed over time. Anyone knows an exact formula therefore..?

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
I can‘t assign three materials and UV maps to multiple objects
I am making a beverage can factory animation now. Movement of cans is completed and now I made material of can (lid, label and bottom). Top and bottom lid are with image texture and color ramp, label with image texture in color. UV mapping is also completed and finally I tried to assign all the material to multiple objects. All objects are the same cans.

I selected multiple objects, original can at last. Object > make links > materials. They are successfully assigned. Then UV mapping. I bring the can lid material on top then….
Object > make links > transfer UV maps.

Iron texture is successfully assigned. Then the label.

It is also assigned. But as you can see, this is NOT what I want.
I want to assign all three materials (a top lid, label and bottom) at the same time.
Same geometry, same materials… some may think “why don’t you simply duplicate them?” But I can’t. Because I already made quite complicated movements of cans, animation, Rigid body constraint, shape keys and so on. And it took a whole month to do it. I can’t do it all over again. I just want to assign three materials to finish the process. My job is almost completed but I can’t move forward now. Does anybody help me? It will be very much appreciated.
2021・04・21
Thanks for your advice. I have made a lot of progress.
I combined the image texture in one.
"3 materials in one"
And 3 of them are successfully assigned. Now I have to adjust the surface.

I followed the Gordon Brinkmann's advice, made it black and white.
And plugged the image texture to basic color and color ramp to metallic.

They are all successfully assigned.
Still there are a lot of thing to add or adjust. I'll keep working on it.
There is one problem.

About painting black and white, looking from the side, it looks good. But when I looked from the top....

This is no good.
I think I'll try texture painting next.

are they not supposed to share the same mesh? To do so, shift select them all, select the one you want to copy at last, then Ctrl L (Make Links) > Object & Data?

I upvoted this comment because I thought it's a good way and I would usually do it like that, too. But after reading his explanation why he just isn't duplicating them I see the problem - rigid body constraints, shape keys etc. will all be copied from the object they are linked to, and I guess they are not all the same on each can...

Thank you for comments.
moonboots
All are sharing the same mesh. I can assign a single material. But the problem is why not three of them at the same time.

Another way is to model a single can and UV map the textures. Then duplicate your textured can as many times as needed and, the last step, animate the cans. I learned that Blender often requires the right order to achieve the desired effect.

Thank you for the answer!! I gradually realized that there is The right order as you said. What I did was opposite way. Even from the beginning of animation I started with simple meshed cylinders and then I made cans with complicated mesh. After replacing the object, the movement became heavy. This was also opposite way.

I was deliberately not giving the answer how he should have done it right from the start because in the question he said he wouldn't want to do all the cans all over again... my answer was aiming at his question to keep the cans as they are.

@Varrick To mark answer as accepted is definitely your privilege, but I'm also surprised how quickly you are able switch from one state - "I can't do it all over again." to "Thank  you I will start from beginning." and throw away a month of work :) BTW Gordon's merging material into single one is possible and seems to me as the best solution in your situation.

@vklidu Well, I won't complain about which answer he chooses, I just wanted to make clear it is still maybe easier to do it my way if it isn't too late now and he already started from the beginning ;) But since I don't really know how much work starting again it will be actually, my way might not be so good.

@GordonBrinkmann ... but I want. I'm kidding, peace to all of you :) I just that this answer (doesn't matter what s the best) is not an answer to given question how it stated.

The comment that moonboots gave is the best answer if all your cans are exactly the same. However, if the constraints and shape keys on them are differing from each other, those individual informations would be lost. So this might help as a workaround (if they still share the same mesh):

Select all cans so that the one with the correct UVs is the active one. Then Ctrl+L > Make Links > Transfer UV Maps. This way they have all the same UV maps.
Now you have to link all materials to the other cans. Ctrl+L > Make Links > Materials. Now all materials, no matter how many, are put on all the other cans.
The problem with this is, since you can copy materials to different objects that not necessarily share the same geometry, Blender doesn't transfer the information to which faces they are assigned. That's what you have to do manually.

It's still a lot of work I guess, but maybe less than having to do all constraints, shape keys, rotations, etc. over again. If someone knows how to copy face assignments for materials, please edit this answer.
A different solution would be: combine all three different materials in one material and separate them by masks and UVs, then all cans would only share one material with one UV map and there was no need for re-assigning faces.

I think it's the best one can do at this stage.

@MaulikSharma I edited my answer, at the bottom I've got another solution. In the end it's not necessary to have many different materials on one object, you could make a single one of them.

Why didn't I think of that. I have used that approach so many times in my projects♂♂

Thank you for the comment!! Gordon Brinkmann. You gave me many hints. I'll try several ways for assigning. Whether I succeed or not, I'll leave the comment later. I need some time.

I tried your suggestion. I combined all material in one. The lid, the bottom and label were assigned. But there is a problem. I want the lid and bottom look metallic and the label not metallic. I want it look like plastic because it is painted material. So the result was not perfect. As Lukusc-z40sth said there is the right order. If there is no alternative way, I have to start all over again. Thanks for the answer anyway, Gordon Brinkmann. I learned a lot of lesson here.

Of course this would have been the right order - but in your question you said you can't or don't want to duplicate the one can because you put so much effort in the others before. The problem you describe can be easily solved with a mask texture. Make it black where it should be plastic and white where it should be metal. Plug that into the Metallic input of a Principled BSDF. Now you have metal and plastic masked out. If you want different Roughness for plastic and metal, e.g. 0.2 for plastic and 0.4 for metal than map the 0 and 1 to 0.2 and 0.4 with a Color Ramp or Map Range node.

Thank you for comment again, Gordon Brinkmann!! I'll try a mask texture. Today is a very exciting day. Blender3d world  is awesome.

It is really, always feel free to ask questions here. Some of the times Blender can be frustrating when you can't get a special thing done - but sometimes it's a problem that can be solved and maybe easier than you think, it just doesn't come to your mind. This happens most of the time I got a problem :D

I think I found the big solution. Everything is assigned successfully. There are a lot of thing to do but I'll keep working on it. I added postscript to my post with pictures. No need to start all over again.  Thank you for your advice.

If I've seen it correctly you've used the Z direction for masking. That's of course a good and easy way if the plastic / metal areas are distributed like this. What I actually meant was a black and white mask texture. This should be black in those areas where in the UV map the plastic faces are located and white in those areas of the metal faces.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How to make this animation smoother? / Trouble with rotation in pose mode
So I have this skateboarding animation I'm trying to make and right nows its really choppy :
https://www.youtube.com/watch?v=ScIIR_mVqUE
Im trying to recreate this trick: https://www.youtube.com/watch?v=ySGpAXXeL1g
I rigged the board so one bone tilts the board itself and the root bone controls the entire thing for moevement. When I was rotating the board during the trick I was having a really hard time even rotating it as when I did get the final rotation the Y-value would be much higher then the rest in order for it to flip all the way causing it to just spin super fast.
How would I go about making this smoother? I feel like there's something I'm missing or could do better.

I think you're overcomplicating things a tad.
If you examine the key poses of the sample animation, its basically:
1: Jump
2: Before landing; board flips on local z 180 degrees.
3: Before landing; board flips on  local x/y (whichever is the "roll axis") 360 degrees.
4: Land
So if you just break each part into its constituent elements, basically just:
Frame 0 - Key location  at beginning, rotation.
Frame end: Key location at end, rotate board on 180/360 degrees on relevant axes, key rotation.
middle frame: Key board location to be at "Jump height".
Then you can just tweak curves after that to get the timing right.
I'm no animator, but this is what I got after fiddling for like 7 minutes.

Obviously this is highly imperfect, but I just made this example to make sure it wasn't gimbal lock or something.

Thank you for the response, you think its better to do first frame, end frame, then middle rather then going frame by frame until the end?

Yes, absolutely, that is standard practice. Get the key poses > Set in between frames > Tweak curves to refine timing.


text:
How to get rid of these black lines?
Hey it's my first time using Blender and these black lines are around all my light's and certain object's, how do i get rid of them without hiding the light/object :) (a few pics below)

Toggle viewport overlays. Top right corner of the viewport.

Default shortcut should be Alt+Shift+Z


text:
When i tried to bevel, half is happening outside and another half is happening inside of the object
As u can see in the picture when i tried to bevel the circle, half is happening inside while other half half is outside
What was mistake i have done to make this happen and how to recover from this situation?
Link to Blend file

Not sure how you modelled that object, but you have hundreds of overlapping vertices plus the fact that all the faces of the entire model are inverted! In Edit mode, select All > M > Merge by distance, then open the settings in the bottom-left corner and increase the merge distance to .0200. You'll then be able to bevel without problem. Shift > N will correct the inverted faces and you'll need to do that on the 3 key objects too.

Thanks man, it worked like magic

You're welcome. I can only imagine that you extruded that circle of verts a couple of times without actually moving them when you were creating the bell of the trumpet because there were at least 3 sets of vertices sitting on top of each other where you were trying to bevel.


text:
Why does this normal map look weird when I use it?
I'm not really sure how to explain my problem, but basically what is happening is when I use the normal map to this model it makes the arms, hands, and feet look funky and weird.

I've tried different things like flipping the Normals n' such but it still looks weird or only fixes a specific area and makes other areas look wonky.

This could be an issue with the texture itself, with UV unwrapping, with material settings, with the geometry etc. Can you share the blend file? Or at least some more details, like the material setup, the texture, geometry, UV map...

Here's the link to the blend file with the normal maps and whatnot.
https://drive.google.com/file/d/1WzB_JWiDCEFxoObC__7TU7TiaRYl86-B/view

Looks very much like what you get when you don't set the normal map image texture node to "Non-Color"

I have non-color on. Ill share the model with the node setup in a little bit

In my experience, I have seen things like this occur when there are duplicated vertices. My fix is to select all vertices in the area and go to Mesh > Merge > By Distance. A pop-up window in the bottom left will allow you to change the distance to merge vertices.

I dont think this is the problem. The vertices are fine. I have left a blend file with the model, textures, and normals

I did some messing around with the file and the way UV was applied was slightly off. I fixed the error by changing the Normal Map node setting to Object Space (as seen here: https://i.imgur.com/c2prsWi.png).


text:
Geo Node Bounding Box UVs similar to Correct Face Attributes
I would like a bounding box created by geometry nodes to function as a boolean, and to use the texture of the bounding box for the texture of the hole.
Normally, the texture changes when the main object is scaled.

However, when the object has certain dimensions the object scales similar to "Correct Face Attributes".

The uv behavior here makes the bounding box real convenient as a boolean!

The uv behavior is also consistent with various dimensions.

However, the uvs always change sizes once a certain width is reached. I'm wondering if any uv guru can figure out a way to keep the "correct face attributes" behavior regardless of the width of the object?


text:
Problem with subdivision modifier making a hard edge have curves between each vert
I have encountered a problem while using the subdivision modifier I also have on it a mirror modifier (image below of their hierarchy if that is what's effecting the outcome)

The outcome is that there is a wave like texture/look to the asset. image blow is it without the the wire mesh on and the one below that is with it on. I have tried changing the subdivision mod to being simple but to no avail and I have tried to move the verts about to make them able to work without the weird bendy waves and again to no avail.

Thank you for reading.
Edit the fix I had found was that the creases was only marked at 98% which was the culprit to there being the wavy lines.

Edit the fix I had found was that the creases was only marked at 98% which was the culprit to there being the wavy lines.

Looks more like the topology of your mesh needs some improvements.
Look at this two images and the way they look with a subdivision modifier because of the topology.


text:
How do I fade a procedural clouds on the edges of a bounding box?
I have procedural clouds made following Default Cube's tutorial, the node group looks like this:

The whole thing is bounded by a large cube, and I want to fade the clouds near the edges so that they don't just cut off. Clouds are distributed using the Voronoi texture, so originally, I wanted to do this by adjusting the Voronoi texture using a Separate XYZ node and a color ramp, but it didn't work how I thought it would. How should I do it?
Here is the blend file:

please provide your blend file so we can improve it

It is added now!

Basically you can try it with this setup and tweak a bit the values to your needs:
What it does: a spherical gradient texture influences (multiplies) the value of the clouds so that they "disappear" to the edges of the sphere.
Of course you could do something similar with a box if you prefer box-like-clouds.

result:


text:
Artifacts in cycles clouds and volumetric atmosphere
I am shading a planet, made up of three ico spheres, one for the planet itself, one for the clouds, and one for the atmosphere. However, the cloud layer is introducing this weird band/artifact on the planet that runs behind the beginning of the shadow. Up close, it almost looks like water caustics.

Here is the node group for the cloud layer.

The atmosphere also produces a similar effect, but it is harder to see. It is clearest on the edges of the planet.

In the Render Settings under Light Paths > Max Bounces, how much have you set for Transparency?

I have 10 set for transparency, my total is 16.

Hmmm... for this setup I would suspect 10 to be enough (total bounces are irrelevant for transparency, they are only for the other bounce settings). And the screenshots are Rendered View in Cycles?

Yep, the screenshots are using rendered view in the viewport with Cycles. I did a full render just to check but the artifacts are still there.

I found a Blender file for an Earth based on Andrew Price's tutorial. The atmosphere looked fine, and I appended the atmosphere object and material to my project, but the bands were still there. So the problem seems to be from a setting in my own project.

Ok, after trying many different things, the problem is that my clouds and atmosphere were too far above the surface of the planet. The light would pass through one side of the icosphere, above the surface of the planet, and come out through another side of the icosphere. The weird caustic effect is caused by the normals of the icosphere, since it doesn't have thickness. This means that the normals were correct for the outer face and incorrect for the inner face, which meant the light came out weird.
The fix for this is can be found in this article: https://www.katsbits.com/codex/backface-culling/#rendered-cycles. The geometry node has a "backfacing" output, which means that putting that into the factor of a mix shader connected to the main texture and a transparent BSDF will make the light hitting the interior of the icosphere transparent, fixing the banding problem.

Oh I see, I didn't really look at the height of your cloud and atmospheric layers... in my Earth model I don't need backfacing information since my layers are much closer to Earth's sphere - though still not as close as they are in reality proportional to Earth's diameter. You see, if you take Blender's default UV Sphere with a diameter of 2, then the cloud layer sphere would have a diameter of 2.0003 up to 2.003, while the atmospheric "glow" sphere would be about 2.015 in diameter. That's pretty close to the Earth's surface


text:
Black hole behind glass
I made a black hole following this tutorial, and I want to put it behind some glass. However, because of the way the shader uses the facing node from the layer weight (at least I think this is what causes the problem), the black hole disappears when glass is in front of it. How would I fix this? This is in Cycles.
Here is the black hole shader (the accretion disk is a separate object).

This is how the black hole looks normally.

And this is what it looks like with a plane of glass in front of it.

That happens because you disabled Transmission in Object Properties>Ray Visibility for the Black Hole. But if you enable that, the black hole doesn't look as good. You could make the plane transparant to create fake glass. Or you have to simply remove the glass plane. If you want, I could give a simple setup.

Oh, I totally forgot about that! Thank you.

Because the answers don't cover everything, I wanted to write my own. The reason why the black hole doesn't show through glass is because the "transmission" under ray visibility for the black hole object isn't checked (to make the black hole look better/more realistic), which is the type of ray that the glass BSDF shader uses. To fix this, you can fake a glass shader using transparency, but some don't work that well with different shapes. This is the one I found that is the most versatile.

There is some refraction going on that is reducing the clarity of the BH showing through the glass -- in other words I would focus on the glass material, not the BH material.
At first I thought your "test" Material IOR (at 1.45) was too high, but a value of "1.0" (no refraction) didn't do the trick.  I tried another Material I use for glass, and that one works.


text:
Generate curves to connect instances in 3D space

Hi everyone. The empties are created as instances, and what I need is to create individual straight curves using them as start/end points (the blue lines represent what I want to achieve). The thing is that I tried using the indexes of the instances to do it, but sometimes they are not organized as I would like (ideally, from bottom to top). Sometimes, for example, the top one has index 0 and the bottom one index 1, and it’s pretty random. How can I control it? And also, how can I generate this "array" of curves without making them individually? Because this is supposed to be variable in height, so maybe I will have 3 empties or 5.

Here for example is correct but if i change the seed this could happened:

Because indexes goes completely unpredictable, not by position

Pretty straightforward. Just use a Sort Elements node with the Z position as the sort sort weight. Then sample that index and set the position of each correlated index in the mesh line to set it's position.

The number of segments is taken from the size of the instance collection so it will dynamically update to match.


text:
Rendering artifacts in flat grease pencil scenes
I'm using Blender to create explanatory videos for highschool-level maths.
In this setting, I often have lines intersecting each other, and this results
in unexpected effects in the rendered images: The line in front seems
to cause a "reflection" on the line below.
To illustrate, here is an example of a circle over a grid
(which is supposed to represent the students' note paper).
In the areas marked pink the circle influences the
grid further than would be explained by anti-aliasing. By playing with
world lighting, I found that the color overlayed over the line is indeed
the world light.

I have already tried different variants (and a lot more over many hours
of tinkering and learning :))

The effect is the same, whether I use different layers within one grease pencil
object or different grease pencil objects arranged in 3D space.
(The latter would be the goal, because it facilitates animations.)

The same effect occurs both in EVEE and workbench engines and is
independent of sampling / anti-aliasing settings.

I plan to use an orthographic camera (and the above images are
with that camera), because I want 3D-objects to render the "math-book"-style.
The effect seems to be less pronounced with a "perspective" camera,
but it is still noticable, as the following example shows.

To test the hypothesis that some "light reflection" takes place,
I have placed a rectangle behind the drawing (in the 3D space) in
the upper-left area of the circle. My idea was that this rectangle would
perhaps "shield" the drawing from the background light and would prevent the
reflection of that light on the circle. And, in fact, there is a notable
difference in the rendered image in this area compared to the others,
though the effect is still present.

This is the setup in 3D space: the rectangle is a grease pencil
object behing the drawing:

What I would want to achieve as an ideal for my use case would be a
plain "one-to-one" rendering of the drawing, but I do appreciate that
this is not what Blender was made for. In fact, my last experiment
suggests that the "reflection" is the intended behaviour for Blender's
real use cases. (I'm new to Blender, but have a background in CompSci.)
Are there any tweaks in setting up the rendering and/or the scene that
would still reduce the effect some more? Thanks so much for any ideas!

Can you share your Blender project file? Instructions for sharing.

My first thought would be to create a plain "notebook" render that you can then reimport as a single image plane to use as the background, rather than doing everything with actual GP objects across the board. Break it into chunks and see what you can "bake down" to simpler objects and try that. I'm not sure it will fix it but it does seem like it's some kind of sampling artefact between where the GP curves "intersect" in an orthographic view. The technique I propose might avoid that.

I hope this is the right way to share via Blend-Exchange (thanks for that service!)

I edited your post (you can do that as well) and pasted that link into the body of your question. That's the official way to do it.

There are two things you can do to face the problem:
1 - enable Z Pass in the View Layer properties, as you should always do when rendering GP Objects.
2 - Play with the GP AntiAliasing threshold in the Render properties until you're satisfied with the result.


text:
Example for creating and rotating of a mathematical function in a script
I want to make a body by rotating of this function in a script:
Function
X equation
(ln( ((v*pi)/1)-(pi/2) ) *(1/pi)+3)*sin(u)
Y equation
(ln( ((v*pi)/1)-(pi/2) )*(1/pi)+3)*cos(u)
Z equation
v
Are there any examples how I can do this?

Please use the search function first. You have a parenthesis mismatch. I have not figured out how to use log with this addon.

As it stands, your expressions have mismatched brackets -  (e.g. the right bracket just before +3 in the X equation) - so they are ambiguous ..

try animation nodes. I already tried it and it works for this type of things.

@Hen Would you mind writing that into an answer with easy to follow steps how one could create this mathematical surface?

@Leander I am currently not at my PC but in 3h I could do that.

Felix, please don't remove the backticks of my edit. I have added them back in. Without them your multiplication sign*` works as a markdown cursive indicator and is not shown.

what is meant with "by rotating of this function". If it means that you take a uv plane and map it to 3D with that function then my answer will be correct

Your Animation Nodes Node Setup would look like this:

Basically it takes a generated grid mesh and deforms it with your functions to your 3D object which also gets constructed at the end. I used Math Nodes everywhere, but if you find out how you could use expressions or phython scripts to do that. The problem which I faced with expressions was the type being a list. Math Nodes handle that automatically so you dont have to worry about that. The generated Object would look like this:

Add an XYZ Math Surface
With the addon Add Mesh: Extra Objects enabled, you can add with Add > Mesh > Math Function > XYZ Math Surface lots of different mathematical surfaces.
You will see a lot of options for this operator also x, y and z. But just pasting the terms you stated in your question doesn't work:
There is an error because there are 3 things wrong with you python code:

The python function for the natural logarithm $\ln$ in Blender is log(), not ln()
As @Leander pointed out there is a paranthesis mismatch. In this explanation I will just assume that closure of the first "(" is on the very end of each term.
$\ln(x)$ is not defined for values of $x<0$. Your code without sine/cosine part in maths is
$\frac{1}{\pi}\ln(\frac{v\pi}{1}-\frac{\pi}{2})) +3$
or simplyfied
$\frac{\ln(\pi(v-0.5))}{\pi} +3$.
Here we easily spot that we have to prevent $v$ from being less or equal than $0.5$, because otherwise the $\ln$ is undefined and an error will be raised. Unfortunately the V min value in the options of the Add XYZ Math Surface operator cannot be set to a number greater 0 so we have to hack a bit:

The solution is to use a helper function in which v is checked if it is greater than 0.5. If not, the helper function will set the result to 0. In the following image you can see all the options used to plot

I never knew Math Function exists and I am seeing Mechanical beneath. I will explore them today. Thank you for posting this.

For Python scripting, you might look first at
Spin mesh (to create solid of revolution)
Then with your formulae, observe the x and y are of the form
x = r * sin,  y = r * cos
with r as function of v --- r(v) = (ln( ((v*pi)/1)-(pi/2) ) *(1/pi)+3)
So build a 'mesh' of single joined lines, say in the y, z plane.
To get the vertices (0,y,z), pick a series of z values and find the y's
y = r(v) same here as y = r(z).
Then use spin() to get your body of rotation.


text:
why is the chatacter rigg not working?
So i'm following a cg geek tutorial on animation and I open the character in blender but none of the rigs are working instead it's all acting as one single block. https://www.youtube.com/watch?v=HyVvi-TjHlM&t=1037s
Am i missing something here?
Whenever i try moving the rig the whole thing moves instead.

maybe because its in Object Mode? try going into Pose Mode

awesome thanks so much. its working great now, newb mistakes. :P


text:
Why shadow catcher effect is messy in Bender?
i am new to Blender , i render text object with shadow catcher , but fount it was so messy compared to the one without shadow catcher
Here is the original complete one

Here is the one with shadow catcher

As you can see ,shadow effect is messy and darker
what i have tried to solve this ?
1.I use composite node to separate shadow and object and decrease the intensity of shadow , but i meet such new problem!There is white edge !!

2.maybe i can create a duplicated text object and offset to inside direction and use that one's shadow to avoid white edge , but it is so troublesome..
3.maybe i can try to separate alpha of object and subtract it with shadow catcher one , and then affect shadow so that avoid white edge , but it is troublesome too
Is there any efficient method to make shadow catcher effect smoother and more beautiful?

the most common use for shadow catchers is compositing 3D rendered objects on top of real/preexisting footage. Seems like your scene is completely CG – is there a specific reason you are using a shadow catcher?

Well, generate multiple object PNG render images in Python , maybe  10 thousands single image, so i must need shadow catcher


text:
Use Python to add multiple colors to a NURBS curve
I have a NURBS curve which has some thickness (since I set the Bevel Object to be a circle).

I have a list of RGB values specifying what color the curve should be at each point along the NURBS curve.
How can I achieve this with Python?  It may have been easy if NURBS curves allowed vertex painting, but it appears that they don't.

I figured out a way to do it.
I created a script that first remembers all the locations of the control points of the NURBS curve (each of which has a color associated with it in a separate variable).  Then I converted the curve to a mesh.
Next, for each vertex of the mesh, I loop through all the original NURBS control points, see which one is closest, and then color the vertex of the mesh with the corresponding color.
Here is the result:

It's not perfect, it would be better if the colors slowly blended into each other, but if you have many control points, it might be OK.
I'll include the script I used in case anyone finds it useful:
import bpy
from mathutils import Vector
import copy

def color_nurbs_curve(nurbs_obj, color_list):
    """Converts the NURBS curve which should already have a bevel object so it has some width.

    color_list should be a list of colors each of which is a 3 element list with [R,G,B]."""

    nurbs_coords = copy.deepcopy( [ nurbs_obj.data.splines[0].points[i].co for i in range(len(nurbs_obj.data.splines[0].points)) ] )

    #Error checking
    if len(nurbs_coords) != len(color_list):
        raise RuntimeError('The color list must have a number of colors equal to the number of control points of your bezier curve')
    if nurbs_obj.data.bevel_object == None:
        raise RuntimeError('Your NURBS curve must have a bevel object')

    scn = bpy.context.scene

    #Convert to mesh
    scn.objects.active = nurbs_obj
    nurbs_obj.select = True
    bpy.ops.object.convert( target='MESH' )
    #sometimes this conversion results in a bunch of doubles, so I remove the doubles
    remove_doubles(nurbs_obj)

    mesh = nurbs_obj.data

    if len(mesh.vertex_colors) == 0:
        bpy.ops.mesh.vertex_color_add()

    nurbs_obj.active_material = bpy.data.materials.new('material')
    nurbs_obj.active_material.use_vertex_color_paint = True

    print("test",nurbs_coords[1])

    #loop through each vertex
    num_verts = len(mesh.vertices)
    for vert_i in range(num_verts):

        #record shortest separation. -99 signals unset.
        shortest_sep = -99

        #loop through all the original bezier points to see
        #which one is closest and then color it with the corresponding color
        count=0
        for b_point in nurbs_coords:

            b_point.resize_3d()
            temp_sep = (mesh.vertices[vert_i].co -  b_point).length

            if temp_sep < shortest_sep or shortest_sep == -99:
                shortest_sep = temp_sep
                color = color_list[count]

            count += 1

        color_vertex( nurbs_obj, vert_i, color )
        print( "Finished vertex: " + str(vert_i) + "/" + str(num_verts) )

def color_vertex(obj, vert, color=[1,0,0]):
    """
    Paints a single vertex

    """
    mesh = obj.data
    scn = bpy.context.scene

    #check if our mesh already has Vertex Colors, and if not add some... (first we need to make sure it's the active object)
    scn.objects.active = obj
    obj.select = True
    if len(mesh.vertex_colors) == 0:
        bpy.ops.mesh.vertex_color_add()

    i=0
    for poly in mesh.polygons:
        for vert_side in poly.loop_indices:
            global_vert_num = poly.vertices[vert_side-min(poly.loop_indices)]
            if vert == global_vert_num:
                mesh.vertex_colors[0].data[i].color = color

            i += 1

def remove_doubles(obj):
    """ Removes doubles using default settings"""
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_all(action='TOGGLE') #I believe objects are created with the vertices all not selected
    bpy.ops.mesh.remove_doubles()
    bpy.ops.object.mode_set(mode='OBJECT')

##Example Usage
##nurbs_obj = bpy.data.objects['NurbsCurve']
##color_list = [  [1.0, 0.0, 0.0], [1.0, 0.25, 0.0], [1.0, 0.5, 0.0], [0.5, 0.0, 0.0], [0.0, 0.75, 0.0], [0.0, 1.0, 0.0], [0.5, 0.5, 0.5], [0.75, 0.15, 0.9]   ]
##color_nurbs_curve(nurbs_obj, color_list)

BTW, I'd be interested in hearing more ideas for solving this problem.

You could use a Colour Ramp to get a variation of colour along a curve but I don't see an easy way to match a point on a curve to a point in the ramp.
I think you may want to create a mesh cylinder and define the colours on it at the locations you want and then use a curve modifier to deform the mesh to the shape you want.
Also the python to create the material will vary depending on whether you are going to use blender internal or cycles.

Good ideas, I wasn't able to get them working but it seems like they should work.  I found another way, which I'll post.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

authors: Николай Соха


text:
Different camera settings for different render layers?
I have a scene with two objects.  I need one to be rendered with the camera set to Perspective and the other to be rendered with an Orthographic camera.
I've put them on separate render layers, but it seems there can only be a single camera for both render layers.  Is that true?
What's the best way to achieve this?

You could use a different scene. (I think. I'll test in a second..)

You can have multiple cameras, but only one can be used at a time.
As a workaround, you can use two scenes.

Move the object to be rendered in Perspective to the first layer and the object to be rendered in Orthographic to the second layer.
Go to the Layers tab and select Layer 1 to be rendered.

Create a new scene by clicking the + in the Info Panel:

Select Link Objects.
In the new scene, select the camera and press U> Object and Data to make the camera's transforms and settings independent from the original scene.  Then set the camera to be orthographic in Properties > Object data > Lens.
Still in the new scene, go to the Layers tab and select Layer 2 to be rendered.
Set the background to transparent by enabling Transparent in Render settings > Film.
In the composite nodes (for either scene, just keep in mind that they are independent so it's easiest to keep all the nodes in one scene) duplicate the Render Layers node and pick the other scene:

You can now combine them however you want using the compositor. E.g. with an Alpha Over node:

In this render, Suzanne is in orthographic and the rest is in perspective.

Good call, that's not too painful.  But I have some edits to suggest since I wanted just one object to be in Orthographic and the rest of the scene in Perspective.

It turned out to be more editing that I thought, but let me know what you think.

@Garry I adjusted it slightly (creating two renderlayers in each scene is unnecessary), but good job otherwise :)

nice, that simplifies thing.

Does this question need to be updated for 2.8?

@use877329 indeed, I'll see what I can do.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Scene clip in Video Editor affects the image strip above it
In the Video Sequence Editor, I have added a scene and over top I added an image strip.

The image strip is set to 100% opacity and therefore should not be affected by whether the scene is underneath it or not.
However, frame 15 is darker than frame 30.

What could be the cause of this?

I submitted a false bug report on this issue and a developer, Sergey, explained the problem: Color Management had been turned off.
Color management is on by default, and Sergey suggests not messing with it.  (someone else edited my .blend file)
To re-enable Color Management, go to the Scene tab of the Properties window and under Display Device, select sRGB.

The problem should be gone.  Please see the bug report for details on why this occurs.


text:
Find bpy function in source code
What is the best way to locate a function from the bpy module in Blender's source code?  I've downloaded the source code and I'm aware you can also browse through it online.
As an example, I would like to inspect bpy.ops.render.render().

Get the idname like:
bpy.ops.render.render.idname()
# 'RENDER_OT_render'

(or simply take render.render and replace the . by _OT_)
Search that operator in the source code, and find it here:
blender\source\blender\editors\render\render_internal.c

/* contextual render, using current scene, view3d? */
void RENDER_OT_render(wmOperatorType *ot)
{
    PropertyRNA *prop;

    /* identifiers */
    ot->name = "Render";
    ot->description = "Render active scene";
    ot->idname = "RENDER_OT_render";

    /* api callbacks */
    ot->invoke = screen_render_invoke;
    ot->modal = screen_render_modal;
    ot->cancel = screen_render_cancel;
    ot->exec = screen_render_exec;

You'll likely wanna look for the exec function code (screen_render_exec) and see what it does.

How can I find classes that have no idname() like bpy.types.Scene in the code?

I would search the folder structure and by filename for those. Regarding the Scene type, check blenkernel, makesrna and makesdna: https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/BKE_scene.h / https://developer.blender.org/diffusion/B/browse/master/source/blender/makesdna/DNA_scene_types.h / https://developer.blender.org/diffusion/B/browse/master/source/blender/makesrna/intern/rna_scene.c / https://developer.blender.org/diffusion/B/browse/master/source/blender/makesrna/intern/rna_scene_api.c

Thanks, but I am searching for the python definition of the normal bpy.types.Scene() class

To my knowledge, it is only defined in the C code in rna_scene.c. Are you looking for the glue code that exposes the properties and methods to Python?

Yes, that's what I am looking for

I assume this is the most relevant part: intern/bpy.c:285 https://goo.gl/RUkrYc (shortened URL because SO breaks Phabricator deep links). The Scene type is not exposed explicitly anywhere as far as I can tell, because it is part of the DNA/RNA system and all types are exposed my generic code to make the properties and functions defined in the C code available in the bpy python interface. If you need more information, I suggest to contact the Blender developers via IRC.

Python offers a module for live inspection.  If the function is a python function located in a .py file, you can use these functions.
For example,
import bpy
import inspect

#get sourcefile of a panel
inspect.getfile(bpy.types.VIEW3D_PT_transform_orientations)
#...blender-2.69-windows64\blender-2.69-windows64\2.69\scripts\startup\bl_ui\space_view3d.py

bpy.data.texts.new('source').write(
    inspect.getsource(bpy.types.VIEW3D_PT_transform_orientations)
    )

(for the difference between .getfile and .getsourcefile see this post on stackoverflow)

Why does inspect.getfile(bpy.ops.render.render) not work?  I get a TypeError error saying it is not a module, class, method, function, traceback, frame, or code object.

pink vertex's example shows inspect.getfile() using a bpy.types class. So the proper call for an operator is inspect.getfile(getattr(bpy.types, bpy.ops.render.render.idname())), which will raise a TypeError: <RNA_Types object at 0x0000000003A875A0> is a built-in class. You need search it in the C code (see my answer where to find it).


text:
Lossless compression for video with audio
What are the best settings to render if I want lossless compression of the video and audio?
(I'm rendering a small clip that will be added to the Video Editor of multiple Blender files)

I couldn't get DNxHD to work (which isn't lossless, but very close to it), so I suggest the following options, which work for me:

Output Format H.264 (RGB)

Encoding Preset H264

Lossless Output (none of the values in the panel matter)

Audio Codec FLAC (bitrate doesn't matter again)

This will give you great quality at a relatively small filesize.

It appears that even with these settings, the bitrate does matter (for the video, but not audio). As an extreme example, I rendered once with bitrate 6000 and once with bitrate 50.  This first file was 559KB and seemed lossless to the eye.  The second was 266KB and clearly had undergone lossy compression (as seen be playing in VLC or importing into VSE).  You can see a comparison of a single frame here.  Should I report his as a bug?

Definately, that shouldn't happen. The options should also be grayed out, so you know they won't do anything.

The bug has been fixed and although the boxes don't get grayed out, I've confirmed that your answer works.

That screenshot is from an old version of Blender (2.78 or older)

There is a preset for "AVI Raw" which is lossless, when a video format is selected you have some options within the Encoding panel. When H.264 is selected for Format you get a Lossless output option, when avi, quicktime, ogg or matroska are selected for Format you have several Codec options - of which PNG should be lossless. For audio, FLAC and PCM would appear to be the lossless options.
Normally to keep video in a lossless quality an image sequence is used, PNG, TIFF and OpenEXR are common formats used. If the audio length matches the entire video then it is easy to align both to the same start frame when adding to a new blend file. Once added they can be merged a a meta strip to keep them together.

Garrett asked for Audio+Video, AVI Raw does not output any audio.

The best quality option for lossless video output with audio would be HuffYUV or H.264 w/ Lossless Output mentioned previously.
Filesize with H.264 lossless output is dramatically smaller than HuffYUV. I'm not sure exactly how lossless it really is. Use PCM or FLAC to preserve audio quality.
I've gotten DNxHD to work in the past by using values from this table of supported resolutions. Blender fails to encode unless a compatible set of values is used. Albeit lossy, DNxHD is a pretty nice compression format for size/quality ratio.
Depending on your needs and preferences, it might be a good idea to render animations to lossless image sequences (e.g. PNG, OpenEXR, or TIFF, etc.). That way, you can tweak small portions of your animation or stop and resume rendering at a later time, without needing to re-render the whole sequence.

Lossless means lossless, doesn't it? h264 lossless coding

There may be some loss in precision during conversion from RGB to YUV, H.264's native colorspace. It may not be visually significant however, and the space savings may be well worth it. I like to use H.264 lossless for final output, and HuffYUV for portions that go into VSE or other NLE.

I render with perceptually lossless and then I use FFmpeg to compress it later. FFmpeg reduces the bitrate and the size(myvideo: 7.9GB to 1.7GB) without effecting the original quality. Of course, you will need to install it here.
https://www.ffmpeg.org/download.html
And here's the command to compress it.
ffmpeg -i input.mp4 -vcodec libx265 -crf 20 output.mp4


text:
Use Animation Playback when frames have different names
My addon renders frames whose names are not constant.  How can I use Python to get the playback to work?
I'm working on a time remapping addon and wanted to give the user the option to include the true frame number in the filename, e.g.:
1.00_0001.png
1.25_0002.png
1.50_0003.png
But bpy.ops.render.play_rendered_anim() doesn't work on these, although importing these images into the Video Editor works fine.

The operator doesn't expose any options you could set, but this seems to be the command it uses:
'C:\\Program Files\\Blender Foundation\\Blender\\blender.exe -a -f 24 1.0 -s 1 -e 250 -j 1 C:\\tmp\\0001.png'

There's even a step / frame jump parameter:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Command_Line#Animation_Playback_Options:
But it doesn't really help in your case. You need to specify every single frame:
blender -a -f 24 1.0 00_0001.png 25_0002.png 50_0003.png 75_0004.png

That command helps.  I suppose one option would be to modify the line in the file screen_play_rendered_anim.py where the command blender -a ... is defined and then bundle the modified file with my addon.  I'll have to decide if this functionality is worth having an extra file.

You could change that script and submit to the patch tracker as proposal, to make it more generic. It could be changed to optionally accept a callback function to find the right files.


text:
For Fluid Simulation, what do the Start, End and Speed settings mean?
How do the Start, End and Speed settings work?
Isn't the Speed setting determined by the Start and End settings?
For example, say I have 120 frames (at 30fps, thus 4s), and I set "Start: 0", "End: 8", then the fluid will move around twice as fast as a normal fluid.  But then if I set "Speed: 1", doesn't it contradict the previous settings?

The Start and End values tells the simulator how much "real time" it must calculate within your scene's start and end frames. Note that they are in seconds and not frames, because it should be considered as "real world" timing, included within your animation timing.
The Speed value is like the "motion speed" of the simulation. Lower value will give you "slow-motion" style animation, while higher value will result in a hi-speed animation.
So first you have to take care about how many frames you have in your animation, and the framerate you set in the Render panel, in order to have the corresponding "real world" timing.
Example, as you stated :

start frame: 0
end frame: 120
framerate: 30 fps
real-world timing: 120/30 = 4 seconds

Now you can set your start value as you wish, in order to offset the beginning of the animation, while there is 4 seconds between start and end. (0 → 4, or 1.5 → 5.5, or 6 → 10 for instance).
The speed value, indeed, will allow you to speed up or down the animation. The difference is that the simulation won't take too long to calculate if you  slow down the speed (at, say, 0.1), making possible to keep only 120 frames of animation, on which you can simulate a small moment of the simulation (for example, the moment where the little wave of a drop reach back and separate)
Here you can watch a video by Daniel Kreuter explaining this feature with some examples :
http://www.youtube.com/watch?v=mxG8KbJPNI4
Beware still, at the time of this video, there were no speed value. Instead we were able to tweak the speed with the Real world size property, which is not exactly the same.


text:
Candy Picking Simulation
I want to create a simulation. It will be like: A bowl of candy and a tong. the thong will dive in and will pick one of the candies. I want candies to collide with tongs physic etc.
How can I achieve something like this?
Here is what i'm thinking:
For the scene:
Bowl: Rigidbody (Passive)
Candies: (Particles + molecular script)
Tong: Rigidbody (Active) + Collison
For the animation: Just right one of the candies and parent it to the tong?
I don't know I might be wrong. Any help would be helpful. Or is there any other way to achieve this kind of animation?
Found a photo basically would be something like this:

Thanks in advance.

For future reference, you can paste your images into the post itself rather than as a link. This improves readability and makes your question easier to answer.

You already seem to have a decent Idea of how to start. Why not give it a go and ask questions if you encounter issues and get stuck?

Shouldn't a few particles be rigid bodies so you actually can move and grab them? (I am not sure if the grab will work without further adjustments.)

I also would use a simple rig to animate the tong. Then add a collision modifier. I still don't think you can grab particles (candy). But honestly, I never tried the molecular add-on. I would make the candy (or just a part of them) a rigid body, cloth, or soft body to get the physic simulated.

Here is an example with two Cloth simulations. A Soft Body simulation and Rigid Body simulation should work, too. The physic settings for Rigid Body are a bit different.

You need the following:

a bowl object with Collision modifier
a rigged tong with a Collision modifier. With the Skin modifier you can create a simple tong mesh and armature quickly. Just extrude 4 vertices, and mirror them. Extrude the root, and create the armature with the Skin modifier button. Rename the bones and add a postfix (.L/.R) so you can mirror and symmetrize them. Apply the skin modifier and bind the mesh to the armature with automatic weights.
optional, a bunch of static candy (the white ones). Use your favorite physic sim or particles to fill the bowl. Apply modifier/transformation so it's static.
more sweets with a Cloth simulation (yellow ones). When you have candies of different colors and shapes it might be a good idea to join them into different objects (making groups) and add a Cloth modifier to each candy object. Enable Collision and Self Collision for the Cloth and add a Collision modifier.
the chosen candy that you want to pick (the red one). Add a Vertex Weight Edit modifier, a Cloth modifier, and a Collision modifier. Also, add a Child Of object constraint and choose one of the tip bones as target.

Settings:

enable Pressure for the Cloth to make the candy a little more rigid (red one in the example) -or- enable Internal Springs if you like them more squishy like gums (yellow ones in the example)
adjust the Collision Distance value in the Cloth settings so it fits your object sizes.
for the chosen candy create an empty Vertex Group and add it to the Pin Group in the Cloth settings. The Pin group is needed to grab the candy.

Simulation and Animation
The first 149 frames are just for the Cloth simulation so it can scatter the yellow spheres and they settle down.
For the red candy, the weight for the Pin group and the Influence value of the Child Of constraint are set to 0 for these first 149 frames. The weight is controlled by the Default Value of the Vertex Weight Edit modifier. The Pin weight is basically the switch between simulated and animated. With a Pin weight of 0 the Cloth simulation controls it. A weight of 1 pins the object and you can keyframe its position or let its parent control its position.

To grab the candy you need to do three things:

set the weight of the Pin vertex group to 1 by setting the Default Value of the Vertex Weight Edit modifier to 1. The Cloth simulation no longer controls the object and you can animate it now.
set Influence of the Child Of modifier to 1 so that the picked candy becomes a child of the tong's tip bone.
move the picked candy to the simulated position → keyframe its position. The Cloth simulation only moves the mesh and leaves the object's position untouched. Watch the origin (orange dot) the example animation. When you "pin" the object in step 1, the mesh is reset to it's original position and "teleports" the candy back.

To get the exact position, copy of the simulated candy. Rename the objects. The copy becomes the new original and the old one will be a helper object. Apply the cloth modifier of the simulated candy (=now helper object). Then run the simulation again, and go to the desired frame. Now move the candy to the helper object (Shift+S) and keyframe its position.

Note: there are two keyframes at frame 1 and frame 149 to keep the values constantly at 0 (=sim phase). Frame 150 and 179 keep the values at 1 (=grab & drag animation), and frame 180 sets them back to 0 (=drop the candy). Alternatively, set the Interpolation Type to Constant in the Graph Editor.

To drop the candy just do step 1 and 2 from above with 0 values. That is, set the weight of the Pin group and the Influence of the Child Of modifier to 0, and the physic simulation will make it drop.
A Rigid Body Simulation works the same, except that you need no Pin group, no Collision modifiers. Keyframe the Animated checkbox to switch between simulation and animation. The tong must be a passive rigid body and Deform must be enabled.

Wow! You are amazing Blunder! Thanks for the detailed answer.

Great answer ‼


text:
Can not display a single mesh as solid
I am switching from an old version of Blender to the newest one. But I found that the texture still shows even though I set the Viewport Display to "Solid". Does anyone know how to fix it? Thanks in advance.

Are you in Rendered/Material preview mode? Try pushing Z/Shift Z to open the render view mode pie menu and switch to "Solid" there.

You don't show the top menu, but I'm quite sure you're in Material Preview mode. The Display As option is for Solid View only. It will not affect the Material Preview or the Rendered View.

Your screenshot looks like you're in Material Preview mode. The settings "Solid" and "Textured" under Object Properties > Viewport Display > Display As are only to choose different display color modes for Solid mode. (Because the other modes already determine what surface color to show: either a preview of the material or how it looks rendered.)

Here is a "short" summary with examples what all the options for Solid mode mean. In Solid mode, you have six different coloring methods to choose from:

Material
Object
Attribute
Single
Random
Texture

With Single you can choose a single color for all objects in the viewport or Random lets Blender give different random colors, to each object its own.
First of all, I show you an object in Material Preview. This mode shows, what the actual Material Output nodes of the assigned materials produce. In my example, the cube has two materials: a green/orange material and a blue material on the front face.

Now I switch to Solid view, the default color option is usually Material. In this case the object shows the colors which are set in the Material Properties under Viewport Display. Each material can have its own display color.

If you choose the option Object, the cube will show the color that's set under Object Properties > Viewport Display > Color. Since this color is set per object, it will always only show this one color, no matter how many materials it has.

The most confusing option for Solid mode might be Attribute. It looks by default as if it was the same as Object, but that's just as long as there are no Color Attributes on the object. They are located under Object Data Properties and hold for example vertex paint maps. Other than the modes before, the displayed color(s) can change because it will always show the active color attribute, i.e. the one that's selected (no matter if it's set to use for rendering or not).

The last option to explain is Texture - and this is the only one where it makes a difference if the Display As setting is on "Solid" or "Textured". With "Solid" enabled, it will only show the colors from the material settings. With "Textured" enabled, it will show Image Textures which are in the material - no matter if they are connected to the material output or not. If there's only one, it will show that. If there are multiple textures, it will show the selected one or (if none is selected) the one which was the last one selected. And important: only images, other texture nodes like Noise, Voronoi etc. will only show the material color if they are selected (or were the last selected texture).

My question is solved. Thank you very much for your help!

@Kevin You're welcome. You might consider accepting one of these answers as  the solution?

I just selected it, let me know if it does not show up

It's not clear in what mode you are.
If you are in Solid mode, which is the mode where you can display the color you're highlighting, once you've chosen your color in the Object panel > Viewport Display you need to go into the Viewport Shading panel and choose Object:

If you want to change the material only for a custom color you need to stay in Material mode in the Viewport Shading panel then go into the Material panel > Viewport Display and choose your color:

Actually that's not correct. To show the color chosen in the Viewport Display settings you have to switch to Object. If you switch to Attribute it will show the active color attribute. It only shows the object color as default when there is no color attribute.

oh sorry I'm going to correct

@moonboots Thank you very much for your help!

First question to clarify:
In what view are you right now in that picture?

After clarification, I am still a bit confused about what you are trying to achieve... Viewport Display in Object Properties is not meant to be used for that, it doesn't even activate your texture if you change it to the texture, you are in the wrong settings.
What about this part?

Or this part?

I will later edit this answer when you clarify those few things

Thanks for the help! My question is already solved


text:
How do I make a game with multiple levels?
I want to make a full fan made Mario 3D world style 2 player game. How do I make a game with multiple levels in blender? Is there something like a sequence editor for video game levels or files?

A blend file can contain multiple scenes, each game level is created in its own scene. The scene actuator then changes the current scene in a game.

Set a property on the player. Select the end of level object. Open the Logic Editor. Add a Collision Sensor and add the players property into the Property field. Add a Scene Actuator, change the mode to Set Scene, and type in the desired scene. Connect the Sensor and Actuator (an And Controller will appear between them automatically).

Thank you very much.


text:
Can I snap to face during transformation in animation?
I have this character with eyes on a body that I want to be able to squash and stretch. I am using "snap to face" when moving the eyes, but when use proportional editing on the body (later on I will be using shape keys for this) the eyes won't automatically snap. Of course I could "resnap" them, but in a 24 fps animation, this would be tidious.
Is there any way to automatically snap objects to a face when that object changes?
Here are som pictures to illsutrate the problem:

As the last picture illustrates, the eyes are on longer snapped to the surface.
Thanks for any answers!

Try the vertex parenting:https://docs.blender.org/manual/en/latest/editors/3dview/object/properties/relations/parents.html#vertex-parent or SHrinkwrap

I just tried vertex parenting, but this makes me unable to maintain the proper control of the eye. I can't snap it to the surface properly that way. Maybe I am doing something wrong. I duplicated an eye, snapped it to the surface, then vertex parented it. This distances the eye from the surface. Would there be anyway to adjust the settings to still make it snap to the surface, but also follow an invidual vertex of the body when transformed? Thanks

Check this answer out, because your eyes have some thickness. I've been trying it.. it's practical to parent the Lattice object to a vertex in the sphere, and shrinkwrap the lattice to the sphere, and assign a lattice-deform to the eye-disk, using it.

There are a number of ways to do this.  Discussed in comments is vertex parenting; another way is to use a shrinkwrap constraint.  Different techniques are often going to give different results-- there's more than one way to snap to the face.

I'm comparing a shrinkwrap constraint to vertex parenting here.  The shrinkwrap constraint is shown; it depends on the object axes of the "eye" because it is set to align the object with the normal of the target.  We can see that when the "head" deforms, the constrained objects remain basically where they were, and just snap to the nearest point of the mesh object.  Note that we're not fully defining our rotation here, and because of that, we might see changes in the target mesh leading to apparent rotation about the Z axis of the eye; it depends on the starting rotation and the nature of the target.
On the right, we see that vertex parenting doesn't behave the same way.  I've parented these eyes not just with vertex parenting, but with vertex (triangle), parenting them to three vertices (the three closest, chosen symmetrically for each pupil.)  These actually move with the head, following its rotation and movement-- we see that when we stretch the head up, the eyes move up, unlike with the shrinkwrap constraint.
Either of these are computed live, adapting to each frame, to each change you make to the head.  But if you intend to use in other applications than Blender, you will probably need to bake the animation after it's finished, as these techniques are specific to Blender and don't get exported.

Maybe "Parent" Helps.
First select the eyes, then the head with your Shift down to make a multi-select, hit Ctrl+P (Parent) and select "Object (Keep Transform)", then the head will be the parent of the eyes, the eyes will be the children of the head. The eyes will follow the head's transformation.
But I'd recommend you to apply rotation & scales before you do it. Check if the scale properties of the objects are set to "1.0" by poping up properties with hotkey "N". If not "1.0", then press Ctrl+A and hit "Rotation & Scales" to apply the both to the objects. That's because the rotation & scale you've made haven't been consequently applied to the object before you confirm your application.
For more info, check this out: https://docs.blender.org/manual/en/latest/editors/3dview/object/properties/relations/parents.html

Also try Join by "Ctrl+J", two objects can be connected into one.


text:
How would I make a cloudy backdrop in cycles?
I'm attempting to recreate a scene with a cloudy backdrop from blender render to cycles.
I have a metaball which I've applied the cloud tool on to make good looking clouds and have set a plane with transparency and a cloud texture, on top of that the world color is a color which compliments the other colors in the scene.
I am unsure as to how I would go about converting this to cycles.

Depending on what you want, your best option may be to just make a procedural sky.  Here is a great tutorial for that: https://www.youtube.com/watch?v=Tr6wTyfAO04  Making the clouds procedural will save you a ton on render times.  Although, if you are trying to fly through the clouds, they would need to be more volumetric and realistic.  Here is a great tutorial by BlenderGuru just for that: https://www.youtube.com/watch?v=TJ_OcBh7F5I
To make a simple cloud all you really need to do is connect a Volume Scatter node to your materials volume input.

You can raise the density for a more stormy look.

Thanks, that helped a lot! I could find tutorials and ways to make the clouds themselves but I couldnt find the way to make the sky that way as well, thanks for that.

add some noise texture to the Density and a bit of variation to the color to fake detail within the volume. this way your model can stay quite simple.


text:
How to create a hologram projection with light rays?
I am attempting to make a template for holographic effects in blender for a project I'm working on, however I'm not sure how to create a lighting effect for the projection of the hologram (The god rays and volumetric effect around the globe). Below I have included the blender file along with an example of the type of effect I'm looking to reproduce. Any help would be appreciated.

Edit
With some minor tweaks and modifications I was able to make an effect that looked pretty much exactly as I wanted. Thanks to PGmath, Shady Puck and everyone else for the helpful suggestions and tips.
Final Result:

Hello and welcome. You have not included the texture, so it is hard to see. Can you indicate a new link for it or upload again your blend file with "pack external data" option ?

Added the .blend with external data packed

I'd use a cone with some volumetric emission and a vertically stretched noise texture driving the strength.  The trick would be to get the rays to come from a point instead of going straight up.  (I am working on a solution now.)

Check my answer here, the technique to create crepuscular rays in the batman symbol also applies to make the holographic symbol http://blender.stackexchange.com/questions/52884/project-light-through-shape-text-or-symbol-to-appear-in-cloud-or-mist

How's this?  I'll post an answer with it once I polish it up.

@DuarteFarrajotaRamos  I disagree, this question is asking about making the rays specifically, not the hologram itself as in your dupe #1.  And this type of ray is actually different from the crepuscular rays your dupe #2 is addressing (i.e. these are sci-fi hologram type rays as opposed to normal light bouncing off dust/mist).

@someonewithpc  That question doesn't address the rays of light this question is asking about, only creating the cone.  It is similar, but making those rays is actually quite complex so I think it deserves a question all of its own.

Both my dupes refer to the 'god rays' or 'crepuscular rays' effect not the hologram itself. They are different phenomenon indeed, but could easily be simulated using the same technique, which is using a volumetric material and a light source to the create rays.

@DuarteFarrajotaRamos  Those answers may apply to this question, but that doesn't mean the questions are duplicates.  See this meta post.  Note that while some of those techniques may work here, there are other (better IMO) techniques that would apply here that wouldn't work there (such as using emission instead of scattering).

I was able to produce the following result. The planet is all one mesh with complex nodes. The god rays are a separate mesh with a keyframed Vector > Mapping > Location: value. The base is separate as well and uses the setup from How do I create metal materials in Cycles?

Geometry
The planet is a UV sphere. The "god rays" are a Cone. The steel emitter is a Cylinder with a Bevel modifier and some Edit Mode editing (closing the gap between the beveled edges, adding the depression in the middle, etc.). There is also an Edge Split modifier and a Subdivision Surface modifier in that order, which were added after the Bevel modifier was applied.
Bevel modifier settings:

Current modifier stack:

Nodes
The following is the nodes for the planet. The leftmost nodes are mostly for mapping and bumping the Image Texture. The leftmost Layer Weight and Math > Add mix adds the Emission ring around the outside of the sphere. The Layer Weight > Facing and ColorRamp add some transparency around the edges. The Wireframe is self-explanatory. The Light Path > Is Shadow Ray takes away most of the object's original too-visible shadow, making it just visible enough.

The following is the nodes for the "god rays." These could probably be improved on a bit. The yellow Vector > Mapping value is obviously keyframed; it's what created the cool shifting effect at the beginning. The small Vector > Mapping > Scale: > Z: value stretches out the Noise Texture to make the rays look more straight. The Light Path > Is Camera Ray makes it a bit more transparent. The Light Path > Is Shadow Ray takes away most of the object's original too-visible shadow, making it just visible enough.

The following is the nodes for the steel emitter. They are better explained in How do I create metal materials in Cycles?

The .blend file:

Edit:
I personally would not recommend any more transparency (mistiness) because you start to lose visible detail. However, if you are dead set on it, you can do one thing.
Before the Wireframe factored shader, add another Mix Shader with the previous and transparency. Add a Noise Texture run through a Bright/Contrast node. This will create a patchy effect.
Nodes:

Test render with new nodes:

As for straight up mist, you would be best to go with volumetrics, but that's not exactly my speciality. You can look at Holographic lighting in Cycles for suggestions, though. There are some pretty good ones.

Thanks for the very helpful suggestions, this is the end result after following your advice, its pretty close to what I was looking for, except I was hoping for something slightly more misty looking, what would I do if I wanted to give it a sort of falloff effect? https://i.gyazo.com/dfb181fc8d382ed1158379e693bb32ad.png

@user27370 I'll see what I can do later; I'm out now. If my answer helped, please consider accepting it.

@user27370 edited.

Some of those node trees are a little hard to see clearly.  Would it be possible to pack the nodes a little closer together so you can zoom in more (like I did with mine)?  Thanks!

Here's the result I got:

And here are my nodes:

Note: the Translate and Scale group nodes are homemade equivalents of the corresponding parts of the mapping node.  They are explained here.  I am using them here because they allow me to plug inputs into the transform values instead of being static like the mapping node is.
The basic idea is to use a noise texture to drive the emission strength of a volumetric emission material on a cone (actually a frustum).  The noise texture is scaled up on the z-axis to create the vertical stripes.  The real trick is to get the stripes to angle out from a point instead of just going straight up, and that is what all those other nodes are doing.  (Sorry for the massive node spaghetti, I had to move them around to get it to all fit on my screen and be readable.)
Here's the basic flow:

Start with generated mapping coordinates and scale the z-axis up (smaller scale value) to make the vertical stripes.  The Translate node is just to move the origin of the coordinates to the XY center of the object (i.e. center of the base of the object).
The Z component of the generated coordinates is extracted to use as a vertical linear gradient to scale the rays in towards the bottom, which has the effect of slanting them out from the base.  The RGB Curves node remaps the gradient from 0.0-1.0 to 0.5-1.0, I am using 0.5 because the base of my frustum is one half (0.5) the diameter of the top of the frustum.  The Math > Divide node is used to invert the scale factor since we want to scale the texture in instead of the texture coordinates.
The resulting mashed-up texture coordinates are used for a noise texture.  The color ramp node is used to adjust the contrast of the rays (i.e. make it look more ray-like).
To get the rays to fade out vertically instead of coming to an abrupt stop at the top of the mesh I used the generated coordinates z-component gradient again. The RGB Curves node is to reverse the gradient and make adjust the falloff curve.  By multiplying it with the rays from the Color Ramp I created the desired falloff.
The final Multiply node is to adjust the overall brightness/strength of the rays.

Here is a .blend:

The above .blend contains a couple of enhancements.  I set up a very simple armature to make adjusting the size and shape of the beam easier.  I set up some drivers in the material so that the scale values are adjusted to match the armature-deformed frustum.  It also contains the rest of the above scene.

I followed your directions and when I render the scene the cone does not show at all, does it look like something in the nodes was set up improperly?  https://i.gyazo.com/f0a9b9c32813c9be4f1fc0a09cc5741c.png

@user27370  What does the render look like?  What does your mesh look like?

https://i.gyazo.com/d36b6eb222678396058b0c779963c3d3.png

@user27370  Would it be possible to upload a .blend?  (I will add one with my setup once I fix a couple other issues.)

 Might be part of the way I set up the scene, going to be out for a while

@user27370  I found 2 problems (both pertaining to the scale node) 1. you had an extraneous input called "value" plugged into where the z-scale input should be (inside the node group), and 2. the mapping vector from the Translate node was plugged into the "value" socket instead of the "vector" socket.  Fixing those two fixed the result.

@user27370  Found 2 more problems: the far left RGB Curves node's Fac was set to 0, effectively muting it.  I also brought down the z-scale value to 0.01 to fit with the overall scale of your scene.  Just as an aside, there is a very useful addon called node wrangler (bundled with Blender by default) made by Greg Zaal which (among other really neat things) allows you to shift+click a node to visualize it like in the compositor, it's an absolute must to debugging node setups like this.

@user27370  OK, I added a .blend.

You can do this easily with a combination of a black and white map image with a brick texture to give you the dots.

Thanks for the suggestion i'll definitely save that for later, however I moreso meant the lighting effects below and around it rather than the globe itself. Sorry for the confusion.

The globe can be generated by a simple sphere with a transparent texture on it.
All the other effects (light rays, lens effects, etc) have to be added afterwards in the compositor (or in an external tool like fusion or Photoshop/After Effects). They are no real geometry, they are only 2D textures, that are composed into the scene.
The topic would be to big for a single thread answer. if you need further intel, i suggest you read some general compositing guides.

Thanks for the info, was hoping to find a way to create a similar effect in 3d.

Why not try the light beam effect from the Blender Cloud? https://cloud.blender.org/p/caminandes-3/56c6da5cc379cf0079716873 Theres a bit of tricky vector math going on to tailor the texture to a cone. Seems like it would be perfect for this use.


text:
Preview material texture defferent than render
I'm having problems with making realistic texture. Following Blender Guru tutorial from a year ago I made a plane with custom material using nodes and few images from CrazyBump.
For some reason internal material preview shows my material exactly how I want it, but render is different (both full render [F12] and render preview). There is some data "getting trough" because the plane have a different colour but that's it.

I tried manipulating the nodes, subdividing a plane but nothing seems to work.
Is that just a wrong workflow, or maybe a bug? Am I missing something?
Would appreciate any help. :)
here's a file:

The textures are not included in your blend file... so nothing is visible. Can you pack them in the file (file/external data/automatically...) ? Also, please use this site to upload : http://blend-exchange.giantcowfilms.com/

Fixed it ? You mean the file or your problem ?

No - I meant the link to the file with attached textures - this time..

OK... simply add an input node "Texture coordinate", then link the "generated" slot of it (as you dont have uv map) to ALL the textures inputs (the 4)

WOW. Thank you. So the set up was ok, but I DID miss the coordinates of the texture. I have to read more about it. Thanks again!


text:
Network Render for one image using tiles?
Hi fellas is there a way to use network render for one image? Mean like for anim when idle computer start to compute next image but using tiles so the idle computer will start the next tile.
I know its possible on one computer using CUDA CPU + GPU that idle HW start next one but is there a way to use second computer? I mean in Cycles for sure.
I think there has to be a way because using SheepIt render farm You could divide every single image into multiple "instances" and these are rendered on different computers as far as I know.
I dont want to combine two images with different seeds and half samples like its answered in many different questions but wonder if someone know the system used on the farm mentioned above.
Sincerely, Jan
REM: If Im not mistaken V-Ray could be used like this? So Cycles?

I think its not a duplicate Duarte cause Im wondering if someone knows how its done on SheepIt Farm cause I dont want to combine two images with different seeds of sampling.

@JanMatys If you animate the seed, you can use SheepIt to get multiple frames w/ different seeds, then combine as explained in the question linked above.

Hm, I think there is no need when using SheepIt to use multiple frames cause there is always someone with a DAMN fast computer ;). Im only asking cause maybe here is also someone who could solve it directly in Blender with some addon...


text:
Insect wings bump texture

Hi fellas any idea how to "bump"-map the wings of this cockroach without using sculpting? Its bent stripes from the center of the object imo (but could be something else good looking). I tried to use the WAVE texture but with no luck. Have NO UV for now but if needed than I will do for sure.
In fact Im not good with procedural things in Node Editor.
Sincerely, Jan

You can unwrap the wing mesh and then either paint in Blender the ridges or save the texture and paint in another program. Then you can use this texture as the input of Bump map. Nodes can be daunting at first but after you have played with them for a bit they make sense

I know rob but in fact dunno how to manually paint the texture in ie Photoshop and be somehow "symetrical" along the way to look good.


text:
Edge angle dependent material apply
Hi is there a way to apply a material on certain parts of an object? What I mean is this ... I have for example RUST and PAINT and in the MIX shader I could assign a texture (ie NOISE) so white parts will be one mat and black another or I could paint a texture myself on UV unwrapped surface to design exactly what I want but... Is there a way to AUTOMACIALY "assign" the RUST to the "sharper" edges/corners?
I know Pointiness could do something like this but dunno if there is a way how to "randomly" fade it out cause have rust exactly only on edges and with the same "amount" all the way along does not look "real". Im looking for effect in top-right corner (Wall-e material).
REM: SHARPER mean NOT with assigned sharpness but angle dependent so as could be seen on the picture below ONLY on the edges of the cube.

Sinerely, Jan

Sorry I don't understand if you want a way to create the "stencils" (i.e. the textures that define the areas with material 1 and the areas with material 2) and paint them, or to procedurally create the stencils from geometry information

Yep, from GEOMETRY information buddy.

...but in fact I need it with a kinda "fade-out" or set the width of the effect cause texturing only the edges (corners) will be almost invisible.

I only just noticed your edit, so I've edited my answer..

@RobinBetts answer is a good solution for more recent blender builds (as he mentions). However, if you are using the 2.79 stable release then the solution that I detailed here should achieve the procedural weathering mask effects that you're looking for: https://blender.stackexchange.com/questions/55991/blurring-feathering-a-procedural-pointiness-mask

@Hexbob6  gotta give it to  you.. yours is more logical, and easier to manipulate, I think.. (Also, AO is slow). IMO that's the one.. so far. Next trick.... bias/scale the noise in the right places, so as to procedurally  simulate the effect of water streaming/rising  and the corrosion it creates?  :D...I think that aspect is hand-painted in the example?

@Hexbob6: Do You have the .blend file? Im looking for the effect You made with the 1st texture in the part "Using Image Textures". I hate that Blender could not simply detect edges like other programs. That pointiness seams NOT to work with my objects so far (too much poly-flow/count related)...

The traditional method for dirt/wear mapping has been to use an Ambient Occlusion shader to catch recesses, with the normals flipped for convex protrusions. In the AO node available in more recent builds of 2.79, the normals are flipped by using the 'inside' option.

AO is not strictly responding to the angle between adjacent faces, it's  a representation of how many hits there have been within a distance threshold, from a sample of rays fired in the hemisphere of directions surrounding the surface normal at that point.
A more specific response to the curvature of a surface can be obtained from its 'Pointiness' value, which you can get from the Geometry input node:

... which as far as I can gather uses angles between adjacent edges to approximate curvature.
In order to make it work here, this cube had to be subdivided. A Simple subdivision will do, or, as illustrated, Catmull-Clark with a bevel to hold the edges.
The values generated from these shaders can be used to control the mix of other shaders or colors,  or anything you like that can be controlled by a number. If different gradations are needed, you can put the values through a color ramp, curves, or map them to another range in some other way, as in the second example.
They can be combined in ways like this:

Or this, using AO alone, which is not toplology-dependent.

Tried in Blender 2.79 but NOT working for me, I have only the "AO" out and "Color" in in that AO Fade node so I could see only GRAY cube (no texture) after that ColourRamp. SOLVED ... need the new daily build - THX!!!

Yup the standard stable build is getting quite old now... I don't know when or if it gets updated.... before 2.8 is a stable release... Check out the @Hexbob6 answer, too, it will run more quickly, in any release.

Sadly its not compatible with bevel somehow and it looks there is no way how to alter/change the size of the FX on the edge - mean when there are additional loops near edges the rust almost disappears (looks like its HARD topology-depending)... Is there a way how to contact You Robin please?

...any chance to make this working for Bevel around 0.005 (0.01 MAX)?

Hi, sorry, been away today. This example was really to illustrate the potential of both methods of detecting edges. Pointiness is topology dependent. If I understand you, you want a very crisp edge, and a spread of the effect? If so we are probably looking at the AO method alone.

@JanMatys... see latest edit

I need bigger "islands" instead of small "dots" but still THX for another good idea buddy! What about that contact anyway? ;)

The size of the islands in the last example will depend on the style of noise in the node I've  labelled 'Edge Breakup'. Also, these examples only use multiplication to combine the layers of masks; you could consider adding/ subtracting them as well. When experimenting, I suggest you use the features of the 'Node Wrangler' add-on to isolate the various influences and look at them one at a time. There are tutorials out there on that one. I'm wary of sprinkling contact details over the net, and I don't have a website atm..

Hi Robin THX for the explanation I will try! Understand about that details so I will find another way ;) BTW I could not find anything about Edge Break-Up...

Ouch, found out that all is just renamed. Sadly - dunno why - the "mask" works fine only when used "inverted", ie if the WHITE is rust nad BLACK is paint than I get almost no rust but when WHITE is paint and BLACK is rust (makes no sence I know - paint on edges) the result is PERFECT! Why the factor in MixNode is so weird in that??? Or its because of brightness of the material?

Why not just swap the inputs of the 'perfect' mix? ..Hard to say, otherwise, without seeing... post a new question if you like .. be as specific as you can about whatever it is you don't understand.

Check this buddy: http://pasteall.org/blend/index.php?id=50579. For starters U could see how much white and blue is on the cube when U load it and then try to swich the inputs. See? When the white was on the edges there was A LOT of it but blue colour NOT SO MUCH ... why? I could send the original with the paint and rust but there are BIG textures so the file will be probably HUGE but think this is enough cause the problem is the same in fact ... take white as PAINT and blue as RUST.

Your 2nd .blend file looks PERFECT when paint is on the white parts but when I switch inputs there is almost NO rust and dunno why. I could raise the contrast for sure but in that case the "transition" between paint and rust is almost gone and the material looks weird.

There is something non-linear going on.. i think something to do with mixing Colors where I should have been mixing Facs, at this time of night for me, rather than rebuild the group, I just hacked it by putting a 'Color>Invert' node followed by a 'Gamma' node after the group, which gets close. I'll go back later if I need to....

Yep, inverting and ramp was the same I did but it does NOT work well with Your 2nd file buddy (1st one looks good now)...

So far so good using Your 1st material Buddy: http://pasteall.org/pic/46f67302c4b07353b677839fa3863b5c - just to let U know Mate... Yep, almost every object need some tweaks so huge number of materials but no 100s of image textures needed - real memory saver!

Impressive. Persist with your own experimentation and understanding.. you're making better stuff in your field of interest than I ever could. For example, I'm having to play with all the settings in Musgrave noise independently, sketchbook style, with no particular end in mind, to get my head around them.

Hi mate, body completed somehow: http://pasteall.org/pic/11416574fd0b63ddda3e9843ab08340b ...not a copy I know but close enough imo ;).

Beta... http://pasteall.org/pic/8fec7ced50d92f138eec867c674f006f

It looks great .. How do you create a chat- room to contain this exchange of comments?

Comments are not for extended discussion; this conversation has been moved to chat.