text:
Geometry Node: Scale faces along their own individual single axis?
I've been trying for a while to do this task that seem so simple.. I'm still learning Geometry Node so I apologies if the answer is pretty obvious. ^^
I have a bunch of faces, not attached, that I would like to scale along there own axis (relative to their Normal), perhaps using the scale elements node?
Maybe there is a better node for that but this is the closest I could find although it's hard for me to get the correct nodes in the Axis input.
I manage to make it work somehow in both axis but it doesn't work for every face orientation :/
Any ideas for that?
Thank you!

If your question was solved, please be so kind and mark the answer that contributed to the solution as "Accepted Answer". This will make it easier for others to see which way leads to the solution, and the question will no longer appear as unsolved. Thank you! Here you can find more information: What should I do when someone answers my question?. If you still didn't get a solution to your question, please be kind enough to address it.

You would use the Scale Elements node in Single Axis mode, but of course by default, the Axis values there is only really useful if you want to scale the elements on one of the three directions (X, Y, Z) of the global coordinates (global in the context of the object, not the Blender file at large). If your geometry is somehow rotated off-axis, you need to provide the axis you'd want to use with some vector math. Here's a setup where I'm scaling one face (with Index 98) of my torus on that face's shorter dimension. I get that direction by subtracting the positions of the edges (with Index 130 and 195) on both ends of that direction. The Position input gives us the middle points of those edges:

It's not possible (afaik) to know which indices belong to which elements just by the help of the Spreadsheet, so I'm using the free Attribute Viewer by Ginyumbi here.

thanks for sharing the attribute viewer....man, what a node tree!!!!

Yeah once I tried changing some options inside but my brain (and eyes) caught on fire in a couple of minutes. Very useful though.

This Attribute viewer is really nice! The method works great too :) Thank you! I got to figure out how to make it more dynamic, so I don't have to enter Index value by hand.

You would just have to use the Scale Elements node and apply a selection to it.
Something like that:

The vector you use for Axis is then the direction of the scaling.
If you take the cross product of your normals, you can switch the direction:

Thank you!It makes sense. This is way simpler than expected :)


text:
Geometry Node - Preserving Custom Split Normal Data
I have an object with Sharp_Edges Attribute and Custom Split Normals Data.
I'm instancing it using Geometry Node. But when I try to use the Separate Geometry, Delete Geometry Node, or Realize Instance Node, I'm loosing the Custom Normals.

On the right, original object with Custom split normals, on the left, the objects instanced + Separate nodes or realize instances, as we can see the normals are smoothed out.
I'm using Blender 4.1.1 and I know I could be using the new Smooth By Angle group but in my case it doesn't give the same result.
Any help would be greatly appreciated :)

source: Stack Exchange

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

sort: votes


text:
How to create a custom transform operator?
I'm starting to learn the gears of Scripting and I'm trying to do something quite simple but that seem to end up way more complex than expected for the add-on I'm writing.
I want my add-on to add a Transform Modal shortcut: You would press SPACEBAR to move your current selection in the 3D View, then if you press SPACEBAR again it will constrain the move only to the Y axis.
I can make this behavior easily by adding the shortcut myself in the keymap but I cannot find any solutiong to do that via scripting.
One other post is saying we cannot edit modal keymap via add-on right now. The best would be to re-create a similar operator in order to do what we need from it. In my case, the Transform operator.
How would you proceed from there?
Here is my attempt, the operator is called when pressing SPACEBAR once:
class HP_TranslateModalOperator(bpy.types.Operator):
bl_idname = "object.modal_translate"
bl_label = "Modal Translate"
bl_options = {'REGISTER', 'UNDO'}

is_moving: bpy.props.BoolProperty(default=False)
constrain_y: bpy.props.BoolProperty(default=False)

def modal(self, context, event):
    if event.type == 'SPACE' and event.value == 'PRESS':
        self.constrain_y = not self.constrain_y
        bpy.ops.transform.translate(
            'INVOKE_DEFAULT',
            constraint_axis=(False, self.constrain_y, False)  # X, Y, Z constraints
        )
        return {'RUNNING_MODAL'}

    if event.type in {'LEFTMOUSE', 'RET'}:  # Confirm operation
        self.is_moving = False
        return {'FINISHED'}

    elif event.type in {'RIGHTMOUSE', 'ESC'}:  # Cancel operation
        self.is_moving = False
        bpy.ops.ed.undo()  # Undo the transform
        return {'CANCELLED'}

    return {'RUNNING_MODAL'}

def invoke(self, context, event):
    self.is_moving = True
    self.constrain_y = False  # Default: no constraint
    bpy.ops.transform.translate('INVOKE_DEFAULT')
    context.window_manager.modal_handler_add(self)
    return {'RUNNING_MODAL'}

Of course the behavior is really not what is expected but I'm not sure I understand what I'm doing wrong.
Thank you for your help!

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


text:
How to make solid hair for girl (not strand by strand)

How can I make the hair as such? It is not strand by strand as I've seen from tutorials.

Typically this is one or a couple of meshes, so it is mainly matter of picking the proper path rather than choosing a specific tool.
A way to approach would be sculpting indeed, if you prefer modeling it then create a rough mesh which will follow roughly the shape of the head, then extrude few faces to make this spiky ends of the strands and apply a subdivision modifier.
There must be plenty of examples out there, try the combination of keywords "sculpting hair mesh" either on google or youtube.

If you don't want to use a hair particle system you need to model hair as a mesh.
Here are two tutorials that go into the details of this kind of workflow:

https://www.youtube.com/watch?v=t2XjdzzWCqI
https://www.youtube.com/watch?v=lo_FxdSe_F8

In a nutshell:

You need to model the hair as a mesh, just like the head and and other solid object.
Non-destructive editing (via modifiers) would save a lot of time and give some flexibility make changes later.
In 1st video I have shared a fairly classic method of hair modelling is described; a curve to determine the flow of hair and another curve to serve as profile.  I think working on a single clump of hair (as described there) is a great start.

Also you can check out this tutorial for making a stylistic hair material: https://www.youtube.com/watch?v=kxWWBmIUxbc


text:
Is there a setting to outline child objects when the parent is selected?
I'm still newish to blender.
Is there a setting to outline child objects when the parent is selected?
In Maya, when you select a parent object, all the children objects are highlighted as well.
In Blender, only the selected object gets outlined.  So far the only way I know how to outline all the child objects is by "Shift + G" or "Select Hierarchy".  This way isn't very efficient if you have a large scene with lots of groups and you want to quickly see all the children objects of each group down the outliner.
Is there a setting to outline/highlight child objects when the parent is selected, without having to actually select the entire hierarchy?

I don't know if you can highlight only but you can select the children, see here: https://blender.stackexchange.com/questions/42369/is-there-a-way-to-select-the-children-of-a-parent-object


text:
FBX file did not support Simple Deform Modifier?
I try to create the bending animation and then add it to Unity but it did not work. The final FBX file has no animation.
I wonder that is FBX file does not support the Simple Deform or not. If not, would you mind giving me some instructions to create the bending animation and then import it to Unity?.
I already searched around but can not fix this problem.
I used blender 2.83LTS and unity editor 20.3.31f.
Thanks.

No, the FBX file doesn't support the Simple Deform modifier (I guess that's what you're talking about?), like most file formats don't support Blender modifiers. The modifiers are Blender-specific tools which are not the same in other programs. You could go to the modifier and choose "Apply as Shape Key", but beware: the frame you're on and the amount of bending there will be the one that's saved as the maximum effect of the shape key. So if you animate bending from 0° on frame #1 to 90° on frame #20, then the shape key will only have 90° at value 1 when you apply the modifier on frame #20.

Thank you for your comment, "Apply as Shape Key" looks good, I will try with it.

Just be aware that a shape key animation moves the vertices from their base position to the shape position in a linear movement, so the shortest path from start to end position. If you have a bending animation where you have a curved motion this will look different. Example: bending vs. shape key


text:
How to separate painted texture portions from original mesh. The main goal is for just the symbol I've drawn to have a holdout shader
I've drawn a symbol on a shield, and for a particular render, I need just the shield (without the symbol) to be visible, with the symbol having an holdout shader.

This can be accomplished with a Mix Shader Node using an image of your symbol (in this example a black'n'white render of Greasepencil Suzanne stands in for that) as the Factor input, the Shader inputs being a Holdout node and a version of your shield texture without the symbol on it.  Remember that the Render Engine must be Cycles, Render Properties > Film > Transparent must be checked, and the render must be saved in a format that can handle transparency.

Thank you very much! And what if I wanted to show just the symbol, with the rest of the surface of the shield being the holdout?

Flipping the Shader inputs to the Mix Shader node is the easiest way I'd say - in the example above link the Holdout node's output to the bottom Shader input, and the shield's texture (this time the one with the symbol on it) in the top Shader input of the Mix Shader Node.


text:
How do you mark (and measure) the intersection of two lines without adding vertices?
My issue is that I would like to mark and measure the intersection of two lines so that I can run a driver off the resulting measurement. I thought of adding a vertex, however this will cause the line to bend as it will need to be hooked to the intersecting line. I need to be able to move the two lines independently, maintaining their straightness, but measure where they intersect.  Any ideas on how this might be done? Thank you very much for your help!!


text:
Is there a way to remove brushes from the brush browser?
It's surprisingly hard to find any info about this and it has only led to me accidentally creating more and more duplicates

Maybe in the outliner change the mode to "Blender File" and there look into "Brushes". Or, since it looks like your brushes aren't marked as protected ("fake single user"), you can use "Orphan Data" instead, there mark the brushes you want to keep as protected ("fake single user" shield icon) and then remove orphans.

@Markus von Broady I guess you can write this as an answer, weird that they didn't create a simple remove button

Turn off "Fake user"  for each brush you want to remove, you can do it by choosing each brush in the "Active Tool and Workspace Settings"  and clicking the shield icon, or later in step 4.
Make sure none of the brushes you want to delete remain chosen as the active brush.
In the Outliner switch the mode to Orphan Data.
If you haven't done so already, disable the shield icons for the brushes you want to delete by clicking on the shield icons .
Click the "Purge" button.


text:
Removing weightpaint does not remove objects
I'm using a geometry node to place a bunch of objects on my plane. However, whenever I erase some of the weight the objects remain. Anyone who might know why?

I think you're not decreasing it all the way to 0, just low enough that it seams to be the same as on the rest of the image.


text:
How to control the "Pick Instance" slot on an "Instances on Points" node
I am scattering a collection of objects on a mesh through the Instances on Points node using Geometry Nodes. The Collection Info node is going into the Instance slot on the Instances on Points node. The checkbox for Pick Instance is turned on.
How would I be able to control how much of each instance is being 'picked'?

The instances of a collection are selected according to the order in which they are stored in the collection.
This order is determined by the name of the object (alphabetical sorting).
So if you have the following objects, they have the following index

Name
Index

Cube
0

Cube.001
1

Cube.002
2

If you have now activated Pick Instances and use a value at Instance Index, always the object with the corresponding index from your collection will be used.
So to be able to selectively or with a certain probability use objects from your collection, you would have to pass the corresponding values to the Instance Index input.

For example, if a value is passed that exceeds the number of objects in your collection, the count starts again at $0$, so your first object is selected.
This is illustrated in the following table:

Instance Index
Name
Object Index

0
Cube
0

1
Cube.001
1

2
Cube.002
2

3
Cube
0

4
Cube.001
1

5
Cube.002
2

I believe, OP asked about a slightly different thing, like in this question: https://blender.stackexchange.com/questions/261922/is-there-a-way-to-control-the-percentages-of-random-instances?rq=1

@Crantisz Ah, OK, you might be right! I'll leave the answer anyway ...maybe it will help someone else.

Crantisz answered my question.

@Crantisz Sorry, I didn't mean to diminish the quality of your existing answer by choosing another duplicate as you suggested initially. I just wanted to target as a moderator the answer that explained the topic in more detail. Thank you for your understanding.


text:
Exporting Geometry Nodes to Unity
I need to export a geometry node-generated tree from Blender to Unity with its wind animations, but each time if I export it as an FBX it exports with no animation. A USD export shows the animation, but Unity doesn't accept USD files.

https://blender.stackexchange.com/questions/258216/can-i-export-a-geometry-node-animation-to-an-fbx-in-3-1/258217#258217

Thanks for the tip!

Probably not what you wanted to hear, but you're welcome! :^)

Yeah! ;D Thanks again!

I figured it out, and so this can be closed. Turns out you can't directly export blender objects to unity. (See link in comments for details.)


text:
Can't subdivide my human face model
I model my face Via KeeenTool add on and want to use a sculpt brush for skin texturing , but when I subdivide it it looks unsmooth// like everything cover with squares!
I've tried to subdivide it with normal right click in Edit Mode, with the Subdivision Subsurface modifier, and also with the Multiresolution and all do the same.


text:
What does the axis mean?
You know how there is the x, y, z-axis. Why is there no a,b,c. Also, there should also be a w axis to allow for zooming in and out. Plus a v axis for rotation, as their is no rotating button the use. So can the editors add that two axes to, therefore, have v, w, x, y, z-axis.
Also, I don't know what the axis' means. is it some sort of secret code i don't know about?

"guru"... There is no need for new axes as with the current cartesian coordinates you can describe geometry and motion with no issues. There is no need for a solution for a non problem. And by the way U,V, and W are used for textues. And Yes, there is a secret code you can read all about it here: https://en.wikipedia.org/wiki/Cartesian_coordinate_system and https://en.wikipedia.org/wiki/UV_mapping#:~:text=latitude%20and%20longitude.-,UV%20unwrapping,each%20vertex%20in%20the%20mesh.&text=Often%20a%20UV%20map%20will,to%20minimize%20seams%20and%20overlaps.

You do know this forum is for the 3d animation software 'Blender' - https://www.blender.org/

Is anyone seeing this? What is broken, your mixer grinder ? I am afraid this is the wrong place to post such things.

@Nxdhin2005  see the edit revisions IMO it's Best to simply ignore the obtuse

Axis are just a set of planes in which an image can exist, hence there are three axis, to correlate with the three planes in a 3d mesh, unless you are doing 2d animation.

Thanks. Quite helpful. So there is no secret code whatsoever. Also what about my idea of two new axes. I think it would be quite useful!!!


text:
Why do I get “baking map saved to internal image, save it externally or pack it” when baking with baking type combine? What does it mean?
Why do I get a message saying

Baking map saved to internal image, save it externally or pack it

when baking with baking type Combine?
What does Internal Image, Save Externally and Pack mean?

It means that the bake worked, now you need to save the image that the bake has created, open the Image Editor or UV Editor and either pack it into the blend file itself or save it in a folder:


text:
My mesh doesnt follow my bone
I have this model of a truck and I'm setting up the bone structure for a UE4 vehicle project. The armature consists of six "wheel bones" and one root bone for all other parts.
I've manage to connect all meshes to corresponding bone besides my mesh called "additional lights". When I change pose, everything follows as intended but not this mesh (additional lights).
What have I missed?

Is this mesh parented to the bones? Are the vertices assigned to the root group?

The mesh is parented to the armature. I have then selected the vertices and assigned them to the root bone.

And thanks for the reply btw.. Here is a picture of the hierarchy: https://imgur.com/xpMC6zl

Except if filtered in the image in the comment above, I think 'additional lights' should have an armature modifier (some modifier visible in the outliner tree).

THANK YOU! Once I added the armature modifier to the light they followed the root bone. I've never had to add the modifier manually, but they have appeared in some magical way... Anyway, big thanks.


text:
How to add faces while using a Mirror modifier?

While I was making this chair leg I wanted to add faces on the front side of the leg (picture), but I couldn't or they were quite glitchy.
How do I solve this?

From your screenshot, your Mirror modifier doesn't have "Clipping" checked.  For what you're doing you should, this prevents geometry from crossing the 0 point (on the X axis, according to your settings) which can cause what your describing.
I recommend you turn off your mirror modifier (or delete it), make sure none of your geometry is on the made-by-mirror side of 0 on the X axis (not so much as a single vertex), then start using the Mirror modifier again with Clipping checked.  (Remember the position of Mirror in your modifier stack, you'll usually want it at or near the top.)


text:
How to import obj in Blender 4.0 with python?
I used to use bpy.ops.import_scene.obj() in my addon.
which can import .obj object and set it a selected object.(not active)
But in Blender 4.0. this does not work any more.
I know the code bpy.ops.wm.obj_import() does the similar thing. but this code import an obj and set it active which I do not wish.
So I want to know what is the bpy.ops.import_scene.obj() in Blender 4.0, or is there a way to change the bpy.ops.wm.obj_import() code not import an obj in active mode?

On the operator side, I don't think there is a way to get the behavior of the old operator using the new operator which replaces the old one in Blender 4.0. However, I think it's relatively easy to save the active object before running the operator, and restore it after it finishes.
Something like this:
active_object = bpy.context.active_object
# Run bpy.ops.wm.obj_import()
bpy.context.view_layer.objects.active = active_object


text:
How to add multiple images upon glass texture on a mesh?
I know what you are thinking: "This question has been asked before!" Well, this is a bit different. I am designing a glass plate, and I want to have two little checkmarks on the bottom, on either corner. Now, how can I layer the two images upon the glass plate? I have gotten fairly close, where each checkmark is in the right spot, the glass texture is correct, yadda yadda yadda, but I don't know exactly how to mix them with the glass texture, so they are like stickers. Should I be using a MixRGB node or a MixShader node...?

Use a mix shader combining your checkmarks with the glass material, using a black and white (Rgb to Bw + ColorRamp) version of the checkmarks as a mask (mix factor).

Thanks so much! That worked!

Credit to @Christopher Bennet (see comments) for this answer:

Use a mix shader combining your checkmarks with the glass material, using a black and white (Rgb to Bw + ColorRamp) version of the checkmarks as a mask (mix factor).

Thanks Chris! It worked!


text:
Changing amount of instances scattered based on height
I am trying to scatter instances on a mesh, but I want to be able to control the amount of instances scattered based on the height they are on the mesh.
How would I accomplish this? (I have a feeling it has something to do with Vectors and the Color Ramp node, but I don't know.)

https://blender.stackexchange.com/questions/285896/whats-the-best-method-to-model-this-atomizer-with-varying-size-and-thickness/286105#286105

Should be like this one:

The important point is that Density is calculated per face. So you have to have enough polygons to do that (That's why I've added subdivide mesh)

I'll try this out later today. Thanks!

That's how I would have done it as well.

You could also try to change the input to the Selection slot on the Instance on Points node based on your height value. Something like height - randomValueZeroToOne * height * modifier > threshold could work.
edit: image of setup as requested in comments
You can use the value, B input of compare node or the float curve in the threshold group to control die distribution (the float curve isn't really that necessary but gives a very nice and specific control)

Do you mind sharing a screenshot of this node setup?

Sure thing, too bad I can not upload the blend file :-/
I don't really get why this post got downvoted.. except maybe that it took me two days to reply?


text:
Scattering Instances on Upward Facing Normals
I am a newbie to Geometry Nodes am am trying to scatter some instances on a mesh, but only on the upward facing normals. Is there any way for geometry nodes to do this?
If not, is there any way to only scatter instances on upward-facing faces? That could work for me to.

Here the node Compare helps you.

Set this to Vector, Dot Product and Greater Than or Equal, and use as second vector $(0,0,1)$ (pointing up).
This selects the upward pointing faces, which you can use directly with Distribute Points on Faces.

Once again, you are the best. Thanks so much!

@BlenderMaster15 Thank you! You're welcome!


text:
Linearly Decimating a Mesh Relative to an Object’s Distance From the Camera
This is pretty complex, and I am fairly sure it is impossible to create, but I will ask around anyway.
Basically, I am looking for a way to linearly decimate a mesh relative to an object’s distance from the camera. (see attached drawing)
Preferably, this would be best done with geometry nodes, although I’d use a drivers solution if that is most optimal.

Fig. A: Mesh’s average polygon size increases as it gets farther away from the camera.
Fig. B: To the viewer, every mesh’s subdivision/average polygon size looks the same (appears to be the same size)
Fig. C: But in reality, the average polygon sizes are different sizes, saving memory
PS. Sorry for the crude drawing; I think better drawing things out! ;)

If we had a Decimate node this would be trivial, but unfortunately it's not here yet. I drew a blank on implementing a setup with more than two levels, but if that's enough, we could take advantage of the fact that subsequent modifiers on the stack can act only on realized geometry, by only realizing instances that are sufficiently far away from the camera:

A more flexible method would be to implement a LOD system, with progressively simpler pre-made variations of an object getting instanced as the distance increases:

Update: Here's a setup with a simpler index selection method. It snaps the camera distance to multiples of a certain number (our threshold), then divides those by themselves so we get a ladder of $0,1,2,3...$ for consecutive patches of equal distance, which corresponds to the indicies of the LODs, clamped at their max index so they don't loop. Simply put, it switches to the next index/simpler LOD every n-th meters from the camera, but it stops at the simplest LOD, dynamically. You just need to make sure your LODs are listed alphabetically in the collection.

That second one has a smoother transition of decimated/simplified geometry; I like that. I'll try this setup to see if I can realize my goal with it. I'll keep you posted. If this works I'll approve the answer.

@BlenderMaster15 Updated the answer with a simpler and more robust index selection method.

Is there any way to use this so that there is only one mesh, and it changes LODs based on the distance from the camera?

Like I said, I think we'd need a Decimate node for that; unless you want to make your own fake-decimate node like this or something similar: https://blenderartists.org/t/geometry-nodes-decimate/1387248/3 If you wanna do that, you could just use the setup from the first screenshot, separate by distance and "decimate" your instances inside GN.

Ah! That makes sense.

Do you mind if I keep this question active for a bit? I want to see if anyone else has any other ideas.

Of course, I hope someone does have an answer that better fits the criteria. Are you trying to solve this problem for a specific mesh, or are you looking for a general solution that would work for any object? If it's a specific mesh, and it's a subdividable one (like Suzanne) I thought you could do a reverse-decimate perhaps, where you use a Subdivide Surface node and increase its Level as it gets nearer the camera. So your base mesh would be the simplest one, and it'd get subdivided as it gets closer to the camera—no LODs. Just another idea. I hope we get a Decimate node soon though.

This is for any mesh; a general solution. Hopefully we get a decimate node in the future!

Wouldn't this be a wonderful case for the node Map Range?
This could translate a certain distance of a given range into another, which corresponds to the number of instances in a collection.
Something like this:

(Blender 3.3+)


text:
Increase max transparency bounces past 1024
I am rendering a large grassy field with each grass blade being an alpha-clipped plane. I need to go past 1024 transparency bounces in Cycles but it won't let me and the grass looks black. How can I go past 1024 bounces?

You can't change that limit without modifying Blender's C code.

Okay. Thanks @Marty Fouts.

So what should I do? Is there an alpha clip alternative in cycles? (Because I know that that is an option in eevee.)

As you get further from the camera you need less detail, you can possibly get away with a very simple mesh and a particle emitter for the distant areas.

Another option is to render a bunch of your current grass to one image with a transparent background so that you're getting much more grass per transparent bounce, and then instance that in your scene.

Good idea. I think I'll try that.


text:
Copy string output from geometry nodes
Hey guys I got a question!
Is it possible to get the text from blenders geo nodes out to a text file? Like at the very least copy the final string to use it outside of blender? So I'd like to have merged text test copied so i can paste it into a text file. Or a python code to acces the data of the geo node so i can copy it from a print or something

Apparently can't be done as it would require accessing the data from a node socket and that's not supported.

I don't know if it works but maybe you can create the strings with a python script where you can export them to a txt file and use the script to pass the string to geometry nodes

I just tried and it works,
you can use a script to pass a string to your geometry nodes and save it as a txt file.
just set up your geometry nodes tree with one String node like this:

and then use the following script to change the string:
import bpy

my_string = "replace with your string"

def main(my_string):

    #Make sure that 'Geometry Nodes' is the name of your Node tree. If it is not you have to change it in the line below.
    bpy.data.node_groups['Geometry Nodes'].nodes['String'].string = my_string

    #This will create the txt file in the same folder your .blend file is in
    text_file = open(bpy.path.abspath("//my_string.txt"), "w")
    text_file.write(my_string)
    text_file.close()

main(my_string)

To run the script, open a text editor window in blender, paste the code and press the run script button.
An alternative way is to check the Join String node you have for its inputting nodes and get the strings from there:
import bpy

my_string = ""
for i in bpy.data.node_groups['Geometry Nodes'].nodes['Join Strings'].inputs[1].links:
    my_string += i.from_node.string
text_file = open(bpy.path.abspath("//my_string.txt"), "w")
text_file.write(my_string)
text_file.close()

True, the second approach in my answer extraxts the strings from the join string node though.


text:
State of NanoVDB in Blender 3.1

Is NanoVDB enabled by default? If not, how?
Does one have to convert/modify a "normal" OpenVDB file in any way to let Blender know to use the NanoVDB library instead of the OpenVDB library? If this is necessary, how?
Are there any limitations towards compatibility of GPUs?

If I understand the whole concept of NanoVDB wrong, please let me know.
Many thanks in advance :)

I might be wrong on this but I think all of Blender's implementation of nanoVDB is here as a rendering acceleration only : https://developer.blender.org/T81454

Does this mean that 1) it is already enabled 2) i can use "normal" vdb files and dont have to convert them in any way


text:
Object info "Vertex Normal" for texture projecting in shader node on objeckts
I'm trying to use Blenders Shader Nodes (or maybe it's possible with Geometry Nodes?) to project textures on objects similar how it in 3D-Coat works.
This is how 3D-Coats projects a simple brick texture on this objects

I can't do it that way in Blender. For this I would need the info of the face normal.
In Blender it looks like this for example. Pretty crooked.

I made that this way in Blender. Is there a way to make it with Blender 3.1 so that it looks similar to 3D-Coat?

The projection you want is built into image texture nodes as "box" (rather than "flat") mapping, with a "blend" greater than 0.  Check it out, you probably don't have to build anything.  You can't get the vertex normals for your samples, but you can get the sample's interpolated face normal or the true face normal, with geometry/normal and geometry/true normal respectively.

The first image look like box projection. The image texture node already has that built-in.

I looked at the brick and immediately though it's Brick Texture rather than Image Texture node :D Still there is a subtle difference - I added a comparison to my answer.

Do you mean something like this?

Comparison with Aryan's answer - the one with bigger top is mine:

The below reproduces box projection except it flips the direction of some sides:

This is much more flexible. You can use it with procedural textures and image textures alike. Can you try threshold value of 0.707 = 1 / sqrt(2) on the top Greater Than node. I think that should make it equivalent to box projection, and have less stretching (near top face B8 UV box)

@ShantanuAryan https://i.imgur.com/YGwctwT.png

Looks great : )

@ShantanuAryan See edit :)

Thank you. It's exactly what I was looking for :-)

I figured out how I can get the face normal

I get this result. It's better but still not good


text:
Is there a way to convert Map Range Smoother Step to Color Ramp B-Spline?
Map Range makes it possible to place the nodes inside the group and adjust them at its discretion due to the presence of several input sockets. In this, its advantage compared to Color Ramp, but Color Ramp has B-Spline interpolation. I tried to connect mathematical nodes as shown in the screenshot. At the same time, it was possible to get a roughly similar image, but when the slider moves the texture group, the texture still behaves differently.
Question: Is there a way to repeat the B-Spline interpolation using Map Range and manage it outside the group?
Thank you!

I've looked through several pages of math explanations for b-spline interpolation and found loads of complex functions incl. matrix formulas, but no simple "summary" yet. A workaround would be to use values as drivers for the sliders of a Color Ramp set to b-spline interpolation. Using those maybe in combination with a Mix RGB node you could "import" the settings through a group input. Example here in my answer: Color and position input for Color Ramp node

You can put drivers on the stop-positions in a color-ramp, and drive them from the input fields on a containing group, but I haven't figured out a way to use 'self' or somesuch to copy the group for re-use with independent inputs.. it has to be rebuilt for each copy.

@RobinBetts Yes, this is definitely not the best solution... but as long as nobody presents a formula (but I guess there is one) for the b-spline interpolation, I don't know a better way.


text:
Is the similar function random.uniform() supported in the OSL?
Python has a random module that allows you to get the following values
a = round(random.uniform(min, max), 4) - float number in the given range with rounding
b = random.random() - float number in range 0-1
Is it possible to implement these functions in OSL?
I tried different ways with rand() or random value() but the output is error message.
Thank you!

Random value between 0 and 1.
float random_value = noise("uperlin", Seed)

Random value between min and max.

float random_uniform = min + random_value * (max - min)

I don't know OSL, but perlin noise probably doesn't yield uniform distribution and tends to be closer to 0.5?


text:
The option in the panel shows the length of the Grease Pencil line when drawing
This code shows the parameter change on Panel, BUT it is done after releasing the mouse button.
If I replace return {'PASS_THROUGH'} with return {'RUNNING_MODAL'}, the parameter is updated correctly, but the cursor is blocked for drawing.
Is there any way to do it at the same time, when the parameter changes while drawing?
Thank you!

'''
    import bpy
    from bpy.props import IntProperty, FloatProperty

    class SimplePanel(bpy.types.Panel):
        bl_label = "Panel"
        bl_idname = "VIEW3D_PT_simple_value"
        bl_space_type = 'VIEW_3D'
        bl_region_type = 'UI'
        bl_category = 'Custom'

        def draw(self, context):
            layout = self.layout
            layout.prop(context.scene, "delta_value")

    class ModalOperator(bpy.types.Operator):
        bl_idname = "object.modal_operator"
        bl_label = "Simple Modal Operator"

        first_mouse_x: IntProperty()
        first_value: FloatProperty()

        def __init__(self):
            print("Start")

        def __del__(self):
            print("End")

        def execute(self, context):       # ???

            return {'FINISHED'}           # ???

        def modal(self, context, event):
            if event.type == 'LEFTMOUSE':
                if event.value == 'PRESS':
                    self.first_mouse_x = event.mouse_x
                    self.left_mouse_pressed = True
                elif event.value == 'RELEASE':
                    self.left_mouse_pressed = False

            if event.type == 'MOUSEMOVE':
                self.execute(context) # ???
                delta = event.mouse_x - self.first_mouse_x
                self.first_mouse_x = event.mouse_x
                context.scene.delta_value += abs(delta) * 0.01
                for area in bpy.context.screen.areas:
                    if area.type == 'VIEW_3D':
                        area.tag_redraw()

            elif event.type in {'RIGHTMOUSE', 'ESC'}:
                print("Exiting modal operator")
                return {'CANCELLED'}

            return {'PASS_THROUGH'}#return {'RUNNING_MODAL'}

        def invoke(self, context, event):
            if context.object:
                self.delta_value = context.scene.delta_value
                self.first_mouse_x = event.mouse_x
                context.window_manager.modal_handler_add(self)
                return {'RUNNING_MODAL'}
            else:
                self.report({'WARNING'}, "No active object, could not finish")
                return {'CANCELLED'}

        def menu_func(self, context):
            self.layout.operator(ModalOperator.bl_idname, text=ModalOperator.bl_label)

    def register():
        bpy.utils.register_class(ModalOperator)
        bpy.types.VIEW3D_MT_object.append(menu_func)
        bpy.utils.register_class(SimplePanel)
        bpy.types.Scene.delta_value = FloatProperty(name="Delta Value", default=0.0, description="A floating point value to be adjusted")

    def unregister():
        bpy.utils.unregister_class(ModalOperator)
        bpy.types.VIEW3D_MT_object.remove(menu_func)
        bpy.utils.unregister_class(SimplePanel)
        del bpy.types.Scene.delta_value

    if __name__ == "__main__":
        register()

    # test call
        bpy.ops.object.modal_operator('INVOKE_DEFAULT')

'''


text:
Soft body disappear in Animation
I have a problem regarding a soft body-cloth interaction. I want to create an animation of a cube falling onto a cloth and both objects reacting accordingly, with different reaction depending on the weight of the cube. When I start the animation, if I put 1 kg as the weight of the cube the cube disappears, whereas if I make the cube heavier (e.g. 10 kg), the animation works. Does anyone know why this happens?
Thank you in advance for your help!

I tried to recreate a simple test according to your description, but things just worked fine with default values. Honestly you are not providing many details, so I would just list what I've done and you could double-check what is going on.
The followings are done in Blender 4.2.

Create a plane, scale it up in Edit Mode (Simulation things always get weird when scaling in object mode without applying the scale) and subdivide it for 10 times; Add a subdivision modifier and switch to Simple with level 2;
Assign four corner vertexes of the plane to a pin group; In the physics tab add Cloth and Collision; In the shape tab of the Cloth settings set the pin group;
Create a cube, move it above the plane and simply add Collision and Soft-body in the physics tab(I assume that you may want this cube as soft body? Because you are talking about soft body-cloth interaction); Uncheck the Goal option so that the cube may fall when hit play;
Now, as I don't know if there are some other settings that you may want, I just simply hit play and the animation went smoothly. I tried to change the cube's weight for several different values, nothing went wrong, except that if the weight went too heavy the cube just cracked itself, but it is not about the disappearance of animation.

I think it is working fine with default settings, so I suppose that it might be either you are making some advanced settings that make a difference, or that you are missing some necessary steps as I have shown you above. Sorry if this did not help you, but anyway there is too little information according to your description. Better share your .blend file, or at least state your project configurations with some screen shots, so that people can help you with enough knowledge about your question.

Thank you for your answer!
Yes, by leaving all settings as default the animation works, but I played with a lot of settings to get an animation as realistic as possible. It works fine for weights > 3Kg, but if I go under the cube just disappears, does this mean that the settings can make the object completely disappear just by changing the weight instead of just changing the interaction?


text:
How can I UV map a very complex model?
i am doing a project in which i have to create different models of the same object to make it appear to be made of different materials. To do so, i believe i need to UV unwrap such model, which is composed of thousands of triangles. I am new to blender, so at the moment i am using the seams island technique, but my problem is that since is a complex model there are not many places to cut which are not visible, therefore once i apply the textures to the uv mapping the cuts are very much noticeable in the object. Do you have any advice on how to overcome this problem? I will attach some images of the object so that you can better understand what i mean.
Thanks in advance to anyone willing to help me

I'm not entirely sure what your use case is, but ideally you would create a model with a clean topology first. This greatly helps with UV unwrapping. With regard to seams, this can be overcome by texture painting with takes the seams into consideration. Would this be an option for you?

The sort answer is you should try to avoid it. There are retopology tools available for Blender, some free, some paid for. You can also try other softs like meshlab or instant meshes which have ready made retopology tools

if you plan to paint it in the 3D view you can simply unwrap with the Smart UV Project mode

thanks everybody, i already tried using the Smart UV project mode but the result was not good enough. I had not thought of creating a new model with a simpler topology and try then to unwrap this new model, I will try it now! Thank you very much!


text:
Why is my baked object different from the original?
I need to bake an image from blender in order to export it to Unity. I have done this several times, but this time I am finding a bit of a problem. Once i bake the image it gets darker and does not look anything like the image i had obtained earlier. Does anyone know how to solve this problem? I will attach some images to show you what I mean. Thanks in advance to anyone willing to help me

hello could you please share your file? maybe it's a refresh problem and replug the Normal Map?

Sure, what do i have to do to share the file? I can only see how to share images or links

Save the file with the high-poly + low-poly, then upload and copy paste the URL it will create: https://pasteall.org/blend/

Thank you! this should be the link: https://pasteall.org/blend/4140c47e3658474fbf952311eddbddf1, let me know if it works

I can only see the low-poly version (I guess it's the low-poly), plus you didn't pack the normal map image, so maybe at least pack it (File > External Data > Pack Resources) and share again?

never mind, i am new to blender and don't know how to do what you ask. Thank you anyway, i will try something else, if i can later i will share the file as you ask!

I think i solved the problem, i made some mistakes in the uv unwrapping, thank you again!

Oh ok, great then   ;)


text:
How do you type a square root for the surface plotter?
For the "Add Z function surface" addon, I tried typing $(1 - x**2 - y**2)**(1/2)$ and $pow(1 - x**2 - y**2,(1/2))$ and neither plotted, what do I do differently?

can you add a screen shot of precisely what you've typed that generates the error?

Assuming you mean the XYZ Math Surface function, just use sqrt.  The equations are python expressions, if that helps.
Also, you don't use x and y directly to set z.  If your equation is simple, set x to u and y to v and use u and v instead.
Here is a working example:

If you're getting an error with this, it's probably because you have U and V ranges set up so that you're trying to take the square root of a negative number.  It has nothing to do with the equation input format, although the error messages might make it look that way.
If you are getting an error message, look at your system console.  If you find something like this:
[Add X, Y, Z Function Surface]:

 Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\addons\add_mesh_extra_objects\add_mesh_3d_function_surface.py", line 327, in xyz_function_surface_faces
    float(eval(*expr_args_z))))
ValueError: math domain error

that is the reason.

Nope, still get an error.

If you have more complicated expressions like xy^2 + x^2y + x - y - y^2 + xy and so on, how do you efficiently calculate the min and max for the square root function?

@StackQuest functions like sqrt(x) have a domain: values of x that they are defined for.  In the case of sqrt(x) the domain requires x to be >= 0. so if you want to use, say x^2 - y^2 for 'x' you find the domain by using x^2 - y^2 >= 0 or x^2 >= y^2.  It's not always easy.


text:
Is there a way to fade influence in editor mode?
I'm trying to bend vertices into a loose spiral, but the "bend" tool is too loose and it doesn't let me constrain it to axis.
So, what I thought is I can rotate the vertices, but with a type of fuzzy or faded gradient influence. Is there a way to do this in editor mode for a mesh?

You are probably looking for "Proportional editing

Yup, thank you.


text:
How can I bevel the edges of a cube with geometry nodes?
I would like to use Geometry Nodes to add beveled edges to a cube, exactly (!) like the modifier Bevel would do.

I am interested in reconstructing the effect as detailed as possible.
Any ideas?

Progress on a new Bevel Geometry Node

Adding the progress of the Bevel V2 here https://projects.blender.org/blender/blender/issues/98674

Since you're creating a new cube, it makes the problem simpler, as you can easily create a desired topology when creating a new cube (subdivision has limitations). And since you're using default profile, the problem comes down to casting a cube to a sphere...

First squeeze middle faces (those that are supposed to be flat and that visually are the original geometry remaining after beveling) to 0:

Now cast to a sphere: (shader shows distance to origin)

Reproducing the modifier in geometry nodes is trivial:

Finally reverse the move towards 0 offset from p. 1. This could be done by capturing the attribute before Set Position node, and saving it on geometry, but instead, let's do it all in a single node tree, with a single Set Position:

The shader below is Normal -> Vector Math: Snap to 0.999×3 to show only normals aligned with axes:

So that's it, a beveled cube. It might not seem like it, it might look more like a sphere (in fact it's almost a perfect sphere), but that's because the bevel width is very high, you can decrease it, by multiplying the last step. Normalizing the resulting shape is easy with dividing the coordinates by range...

Spacing the edges correctly
How to ensure bevel segments of equal width? Working backwards, knowing where the vertices are going to end (on a sphere, on the diagram where the orange dotted lines $\color{#D60}{·····}$ and blue dashed lines ${\color{#44D}{---}}$ meet), calculate where they have to be before normalization - that's where the green arrows $\color{#080}{→}$ point:

So the angle increments are constant: $\color{#B00}{∡}α = {{45°}\over{\mathrm{resolution}-1}}$
It's the horizontal increment that is variable and needs to be calculated. It's sine, but we don't know the ("radius") multiplier.
Positions of those arrows could be discovered with raycasting, but obviously a math solution is faster. Calculate the $\cos(α)$, then the reciprocal $1\over{\cos(α)}$ is the "radius". Let's try it:

The function works: ${1\over\cos(α)}\times\sin(α)$ which btw is just $\tan(α)$ (reinventing the wheel again).
Correct Bevel Width
Reversing the offset was stupid. After normalization the sphere's radius (and so bevel width) is $1$, so:

multiply the coords by bevel %, and then offset them by (1 - bevel%)*sign to get a normalized beveled cube, then scale to the desired size;

or to allow for a cuboid:

multiply the coords by bevel width (not percent), then offset them by (axis size - bevel width)*sign

I chose the first solution, since the question asks for a cube:

White cube is mine, black is the vanilla Bevel modifier. The z-fighting shows the edges are great, but the corners are clearly not-so-great ;)

This is incredibly great, brilliant approach to the solution! I am very excited to see the finished answer, because it definitely deserves a star!

... a gold star, and I'll polish it for you. :)

Thanks for the reward, @RobinBetts! I've been looking into improving the corners, but it seems the procedural nature of the intersection grid fill Blender does is hard to reproduce mathematically (I didn't investigate the source code, though).

@MarkusvonBroady ...that's exactly what I meant, it's really not an easy task. I have now also come to take a closer look at your solution, and still find it ingenious! I am very curious if you manage to solve the puzzle completely. ;-)

An exact reconstruction would probably require studying the source code, as well as a myriad of nodes.
Therefore, there can really only be one approximation to the optimal reconstruction.
Here's how I would do it:

Create a cube and extrude the faces.

Then create another cube, in the size of your beveled edge, and apply the node Subdivision Surface.
This will give you a (relatively accurately) mesh for the corners.
However, applying Subdivision Surface also made the mesh a little smaller, so capture the size of the result and scale the mesh again to match the specified radius of the beveled edge.
Unfortunately, the node doesn't really produce a sphere either, so I additionally bring the individual points to the radius of a sphere here.

Then instantiate the "spheres" at the vertices of your cube and merge the previously extruded shape with these instantiated objects.

Finally, use the Convex Hull node, which turns the outer hull of all objects into a new mesh.

Since this method triangulates the mesh at the corners, I have to use the modifier Decimate to convert these triangulated faces back into quads.
Except for this last step, this produces a similar result as the modifier with Geometry Nodes only. Similar and not the same, because I did not reproduce the algorithm here, but only used similar shapes.

On the left is the result created with Geometry Nodes, on the right a cube with the Bevel modifier.

However, if you want to keep it simple, you can directly apply the node Convex Hull to the cube with the extruded faces:


text:
How can I enter multiple values into a vector field at the same time?
I'm wondering if there isn't an easy way to enter multiple values into a vector field at the same time, instead of filling in all the input fields individually.
How does this work?

Left click on the top or bottom value, keep the left click pressed, drag down or up, type the value:

Also a node that may save you time sometimes is the Input > Value:

Simple question, competent and quick answer! Very fine, I could not find this question/answer here on BSE yet ;-)

You're welcome, also sometimes if your node has an input you can use the Input > Value node


text:
How can I influence the mesh of a character with a garment?
I want to have a garment, previously created in another program and imported into Blender as an Alembic, affect and deform the mesh of a character in some places:
Some parts of the tank top and the armband are to influence the body, to simulate a tight fit:

I think there must be some "magic trick" here, right?
What is the best way to solve this and what possibilities do I have with modifiers in Blender?

Reduced to the essential part, one could also take the following example:
Suppose I have a cylinder (the finger) and a torus (the ring), and I want the torus to compress the cylinder.

Bonus (but I'll probably have to discuss that in more detail in another question, but mention it anyway because it's the same issue, just with animation):
Is there a solution/technique that can also work reliably in an animation?

Please understand that I can't share this file with the character here, because it has a size of ~30GB including animation...


text:
How can I match the noise to a wavy pattern?

This question is a follow-up to this one, which fortunately I was able to successfully solve with the help of @Chris and @MarkusvonBroady:
How to create a seamless diagonal wavy pattern with opposing waves?

Now, on my shader nodes learning path, I'm trying to apply a gently noise to the pattern that smoothly follows the wavy curve.
I managed to get a noise into the pattern that is about what I imagine:

Only I am not clear with which parameters I should control this "distortion". My goal would be to add noise that slightly conforms to the curve, as seen in this bumbling sketch:

Any ideas?
(Blender 3.4+)

The setup thickens vertical (mute rotation to see originally it's $y$ axis) stripes using the height, so using $y$ which is passed to a sine. Since sine is symmetric/continuous (like ping-pong, not like wrap), you know by how much you thicken, but not in which direction. So use the input to the function, wrap in $0..τ$ range and check the distance to $π$ (that's the middle of the stripes), then do some calculation based on that distance, here I'm just arbitrarily multiplying it by $-0.18$, but you could use a map range for example… Maybe you want to → absolute → map range / power → multiply → sign instead.

Fantastic! This is exactly what I was looking for. Thanks for letting me learn something interesting from you! ...I like shader nodes more and more ;-)


text:
How can I read the properties of a node group in a blend file?
Is it possible with Python to detect if a nodegroup is embedded in a frame in another blend file without adding it first?
I have several blend files with the following structure:

The main group always contains a certain name (in this example "_TEST"), and in it are other nodegroups.
Some of them are embedded in frames, some are not.
And from another file, before I add/process a certain nodegroup from these files, I want to check if it is embedded in a frame or not.
Basically reading the file works fine, and I can add the nodes, but in this step I always get only the name of the group, but not its properties, like parent:
with bpy.data.libraries.load(filepath) as (data_from, data_to):
    for group_name in data_from.node_groups:
        print(group_name)

If I have a node group in the same blend file, it works fine with the following code:
maingroup = bpy.data.node_groups['_TEST'].nodes
for n in maingroup:
    if n.parent == maingroup['Frame']:
        print("Node '" + n.node_tree.name + "' is framed")

But when I try to read the information of a node group that is in another file, unfortunately it doesn't work.
Any suggestions for a solution?

Uh, I don't think so. We need some library (maybe it already exists) for parsing .blend files. I think currently one option is to run Blender in a separate process, opening a file and reading necessary information there… I think I've seen some existing answers on BSE using this technique.

@MarkusvonBroady Thanks for your feedback! ...that's what I was afraid of. Is there instead a way to add the nodegroups, then process them, and finally reliably remove them (without accidentally deleting existing nodegroups)?

But the question is why would you need to check this? What are you trying to solve? :D

@HarryMcKenzie I want to create a submenu structure for node groups ...a further development of the "Node Presets" addon: https://github.com/quellenform/blender-NodePresetsExtended Here, all nodes that are packed into frames are to be put into a submenu.

https://projects.blender.org/blender/blender-asset-tracer  "BAT can be used as a Python library to inspect the contents of blend files, without having to open Blender itself. "

Here's another approach using subprocess to spawn a separate process so you don't have to directly load and store the data into the current blend file's bpy.data, but unfortunately it is a bit slow. I'm not sure how frequently you will need to invoke this. If the call is just made once to make all the checks, then I guess it might suffice for your addon. But nevertheless it might still be interesting.
import subprocess

return_keyword = "RETURN_VALUE:"

def check_blend_file(file_path, group_name):

    script = """
import bpy

def load_test():
    file_path = "{}"
    group_name = "{}"
    with bpy.data.libraries.load(file_path) as (data_from, data_to):
        data_to.node_groups.append(group_name)
    maingroup = bpy.data.node_groups[group_name].nodes
    for n in maingroup:
        if n.parent == maingroup['Frame']:
            return "Node '" + n.node_tree.name + "' is framed"
    return group_name + " not found"

result = load_test()
print("{}", result)
    """.format(file_path, group_name, return_keyword)

    command = ["blender", "--background", "--python-expr", script]

    result = subprocess.check_output(command, stderr=subprocess.STDOUT, text=True)
    return_value = "No result found"

    for line in result.splitlines():
        if return_keyword in line:
           return_value = line.replace(return_keyword, "")

    return return_value

return_value = check_blend_file("C:/Users/harry/Downloads/test.blend", "_TEST")

print("Return value:", return_value)

This looks very promising! Please give me a little time to try around with it....

Regarding the question asked, this solution works perfectly, so I mark it as Accepted Answer. However, it is unfortunately not suitable for my use case, because the background process simply takes too long. The script would be called only once, but always when the submenu is opened for the first time. Fortunately, I came up with a simpler solution in the meantime, and now control the submenu items via the name of the node group (via a split character). I will then publish the changes on Github. Thanks again!

awesome! glad u were able to come up with a solution to your issue!

....But... I may solve it this way after all. Then I could even spare myself the different paths in the preferences and solve it there via a button, as well as use a JSON file as a cache. Hm. Off-topic, but what do you think about it? Chat?

how does chat work? when u open blender doesnt all the loading for different addons happen there then u can cache the results?

Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on [meta], or in [chat]. Comments continuing discussion may be removed.

Thanks to @MarkusVonBroady for his contribution to the previous script version, here is the final script that should work. Since the libraries.load only loads object names, by adding the names we want to load to data_to, i.e. data_to.node_groups.append('_TEST'), only then will the data we specify get loaded into bpy.data after the with block exists, that is when the Context Manager's __exit__ method gets called. This way you can control what data to load and you can do your checks.
import bpy

def load_test():
    file_path = "C:/Users/harry/Downloads/test.blend"
    with bpy.data.libraries.load(file_path) as (data_from, data_to):
        data_to.node_groups.append('_TEST')
    maingroup = bpy.data.node_groups['_TEST'].nodes
    for n in maingroup:
        if n.parent == maingroup['Frame']:
            print("Node '" + n.node_tree.name + "' is framed")
    return True

success = load_test() # succeeds and test for frame works

I think instead of data_to.node_groups = [group_name] you want data_to.node_groups.append(group_name), otherwise you will keep overwriting the node_groups, and will only import the last found node_group. Another problem is the general exception statement, I recommend you let the exception happen, and once it does, note the error type and ignore it specifically.

And your problem seems to be, that you try to read the newly added node_group from bpy.data, but it's not there yet: the actual import happens at the end of the with block, when the context manager's __exit__ method is called. So you assemble a structure of things to load, then the with ends, the stuff in data_to is actually loaded, and then you can access it.

Thanks for your answer! Yes, I had tried that with data_to, and as soon as the nodes are loaded with it, of course all information is available, but thereby all nodes are always imported (which I can't use in this case, unfortunately).  ...unless the nodes imported in this way can be reliably removed again after parsing, but so far I have not succeeded in doing that either.

I think this code is equivalent to the above: https://pastebin.com/fakbFC1v - I haven't tested and I already noticed I forgot to add maingroup = bpy.data.node_groups['_TEST'] between lines 6 and 7 but you get the idea.

@MarkusvonBroady hey cool you made it work! i'll update the answer! ok now i understand that the with completes the load only after it exists. thanks for your input! Since the libraries.load only loads all the names, by adding the names to the data_to like data_to.node_groups.append('_TEST') only then will the specific data we specify get loaded into bpy.data after the with exists, so not everything is loaded if i understood it correctly.

@quellenform I'd like to clarify. so you don't want anything to get loaded at all into bpy.data and just directly be able to parse the blend to do the checks? so if you don't want anything loaded into the current bpy.data, will it suffice if this was done in another subprocess? if not then you will definitely need a binary parsing method which i doubt exists as of the moment :(

@HarryMcKenzie Yes, that is correct. The addon is about reading the node groups contained in a blend file and wrapping them in a menu. Currently, however, all node groups are not listed hierarchically, which quickly becomes confusing with many groups. To create submenus, I would have to be able to recognize how they should be nested when reading the file, and a direct import does not help me. The idea of a subprocess sounds interesting though! I just have no idea how this works. And I wonder why Blender doesn't have a parser for its own file format, but that's another story.


text:
Why does changing the curve radius not produce smooth transitions when using Curve to Mesh?
I have a curve here where the curve points are given different values for Radius.
With these radii I want to control the extrusion of the curve when using Curve to Mesh, so that the mesh gets thicker or thinner.
This works very well, however I don't get smooth transitions but wherever I use different values for Radius, hard corners appear in the mesh that I wouldn't expect.

Why is this? How can I smooth the result?

The Curve to Mesh node uses the lineary interpolated values between the points, so a change in the radius from $0 - 1 - 0$, for example, will be displayed with a hard edge.
It is also very difficult to smooth the mesh afterwards, so you would have to change the radius along the curve points beforehand.
Exactly for such purposes the node Blur Attribute is available since version 3.5+.
This node smooths the values between a specified number (Iterations) of neighboring elements with a specified strength (Weight):

Depending on the nature of your curve, however, you would have to make sure that it has enough points at all, which is why you would usually have to give the curve a higher resolution with Resample Curve, Subdivide Curve and/or Set Resolution.
This is important because the number of points or the resolution of the curve always works in combination with the value for Iterations, because with this you control how many neighboring elements/points are used for smoothing:

(Changing Iterations from 0 - 250 - 0)

By the way, Blur Attribute is a pretty ingenious node, and is often underestimated or ignored.
With it you can also smooth the positions of points, for example:

Also in combination with a Noise this node can be very helpful and achieve interesting results.
Always note, however:
With many elements and a high iteration value this node also needs a lot of computing power!
Therefore try to choose the use consciously, use the node sparingly and only as high iteration values as absolutely needed.

From the comments:

Of course, you could also process the radii with a Map Range node (Set to Smooth Step or Smoother Step). However, radii with values higher than $1$ (even if they are changed with From Max and To Max) cannot be processed correctly then because this also changes the interpolation. The result is still nice in most cases.

Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on [meta], or in [chat]. Comments continuing discussion may be removed.


text:
How can I distort randomly generated lines along a pattern so that they flow around the bright areas of the pattern like a gravitational lens?
Day 4 of my personal Shader Nodes learning path.
Please forgive me if the title is worded a bit stupid. I still hope to add value to this platform and ask an interesting question.

Basically, this question is based on the following previously created questions:

How to create a seamless diagonal wavy pattern with opposing waves?
How can I match the noise to a wavy pattern?

...but with a completely different goal.

Let's say I have the following pattern, which I created using the question/answer posed earlier:

And in addition to that, I have created diagonal lines using a Noise Texture:

And now I would like to distort the lines so that they curve around the brighter areas. So to speak, to avoid this or to be distorted/pushed away by it, so something like this, only I imagine it to be much more intensive:

However, if I increase the amplitude of the sine waves on the basis of my current setup, discontinuities arise in the lines, since it is a matter of two functions working separately from each other that are pieced together.

As a reminder, this approach, no doubt bungled by me, is based on two such patterns, one of which is processed inverted:

It is clear to me that the previous approach is not correct for this, and that a completely different mechanism is needed here.
Only which one?
In this example, I am not necessarily concerned with representing exactly as I use it in my examples, but primarily with the question of how diagonally running lines can be bent in a wave-like manner around certain points. It should just look cool, because if it looks cool, it's right!
Please help a Blender novice* in exploring this universe. Thanks!
* In the shader-nodes section
Here is the node tree and blend file I use to create the examples shown above:

(Blender 3.4+)

After receiving some great guidance from @RobinBetts and @MarkusvonBroady on this question, I was able to solve this task to my satisfaction.
And the answer seems to be simpler than I originally thought.
Stupidly, my current knowledge of shader-nodes is not yet sufficient to describe it all with the quality you've come to expect from me on geometry-nodes, but I'll post the answer in a nutshell:

Essentially, what I'm doing here is simply adding the value that results from multiplying sine and cosine to the x-axis of the vector for the noise texture.
This pattern looks like this:

And the end result is distorted diagonal curves:

Here is the blend file for it:
(Blender 3.4+)

.. can't really improve on this answer, but this sort of approach might be of interest. I find it's often useful to think of a 2D texture as a height-map into, or a slice out of, a 3D texture. See here or here, for example. Thinking of your tone as a 'height' map, you can even explore using its gradient as a parameter, by putting it through Vector > Bump


text:
How to correct curve tilt, tangents and normals of a curve?
If you separate the faces of a mesh with Split Edges and convert them to curves with Mesh to Curve, these curves are twisted in various directions.
Depending on the mesh, in some results the indices and thus the tangents are oriented clockwise, and in some counterclockwise:

The problem becomes even more apparent when the mesh is a three-dimensional structure:

If you then use these curves to instantiate objects, or use Curve to Mesh with a non-closed profile curve, the generated faces point in different directions.

The following questions have been asked before in this context:

Transfer/Align curves normals to faces normals
How to unify the direction (Tangent direction) of the curve?

However, even though the answer sought here is the solution to both of these questions, each of these questions treats the issue from two different point of view and does not fully discuss the underlying problem:

One question deals with aligning the tangents uniformly.
The other question is about adjusting the Curve Tilt to match the normal of the faces.

However, the actual question and solution would have to address both issues equally, since these two things are related in this use case.

Therefore again and as summary the question:

How can the curves generated from a mesh be aligned according to the normals of the original faces, so that their tangents run in a uniform direction, and the curve tilt is aligned according to the normals of the faces?

So the task is to align the direction of the curves uniformly, and to adjust the Curve Tilt so that it follows a given vector.
This can be solved as follows:

First, the direction of the curve must be corrected, so that it is clear for the curves once at all where "inside" and where "outside" lies.
Then the curve is rotated by adjusting the value for Curve Tilt at the given vector.
PS: I just wanted to quickly share these nodes with you, so this answer is currently still very short and in progress. I will go into it in more detail shortly and explain it with a better example.
(Blender 3.2)

I skimmed the question,  looked at the answer, then went  back to the question for more detail. Thinkin'.. 'what an incredibly well-constructed question' ... +1 ... 'I wonder who this is?'  Ahhhhh .... OK! :D But seriously, very handy. Look forward to your expansion.


text:
How can I change the background of the material preview?
I wonder if it is somehow possible to change the background of the material preview window in Blender 3.2.
The default setting shows a checkerboard pattern on a grid:

And I found the question here, of course: How to change the background colour in the Material Preview window?
But apart from the fact that this question has not been answered either, this is obviously a different problem.
I would have liked to use a custom scenery there (For example a photo studio wall with a soft edge, and a different base texture and viewed from a different angle).
Here I have found another interesting question/answer about this, in which you can see what I want to achieve, but this does not solve my problem: Material preview background color - Blender Cycles
Is this possible (without modifying the source code)?

The preview scenes are defined by the preview.blend file, which is included in the compiled binary (not as a separate file). As far as I'm aware, Blender's preferences and Python API do not provide an option to modify the scenes. It appears you would have to build Blender yourself with an adapted preview.blend.
The current version of the material preview, at the time of writing, was introduced in the following commit: https://developer.blender.org/rBf5ea1fc4fbafbac6f648ba0d9d9ef16ca8323041

OK, I see, that's what I was afraid of. So I take the answer as "No, it's not possible without changing the source and compiling Blender.". Thanks!


text:
How to create a seamless diagonal wavy pattern with opposing waves?
I'm currently trying to create a wavy pattern with shader nodes, each with two opposing wavy lines running diagonally across a square area.
However, I want the curves to end up with a seamless pattern so that this can be applied to a larger mesh.

Nodes are not new to me, but I am just learning how to use shader nodes.
My first patchy attempt at least got me as far as creating a wavy line, which unfortunately isn't much yet:

I honestly have no idea which direction to go further in here, however I was thinking of mirroring this pattern, then multiplying it, then rotating it $45°$.

I'm pretty sure that's probably the wrong way to go though.
Does anyone have any ideas or tips on how I can create such a pattern?

Maybe this?

I made the $45°$ rotation via the mapping node. The waves are generated by $\sin+\cos$.

Wow, Chris, thank you, that helps tremendously! Once again I learned something from you! Now that I see it, it seems absolutely logical to solve it this way and I was obviously completely wrong with the Wave Texture. However, I'm still struggling to get it 100% seamless. I'm not quite sure what parameters this is based on yet, and I'm still experimenting with it. Any ideas on this?

btw: Using a Greater Than node or setting Linear to Constant in the ColorRamp creates the contrast I was looking for.

@quellenform "still struggling to get it 100% seamless" - if you just want to render a seamless pattern in Blender, the setup should suffice, because you're not (or you shouldn't be) creating a piece of a pattern and then tile the pattern, you're just passing the coordinates to sin/cos which are (seamlessly) periodic functions. However if you want to create a tile to e.g. create a seamless texture, you either need to derive dimensions from sin/cos or derive angle from tangens. Most combinations of angle, width and height just cannot be seamless.

@MarkusvonBroady "If you want to create a tile to e.g. create a seamless texture, you either need to derive dimensions from sin/cos or derive angle from tangens." ...thank you, this hint has been missing!


text:
Why is there a red line when I try to connect one node to another?
I'm trying to connect one node to another here, and I get a red line:

I just can't figure out why and what this is.
What I have tried so far to solve the problem:

I made myself a cup of coffee
I turned off the computer and turned it on again
I have tried a different color theme that displays the lines with a different color

...no solutions have helped me though.
So the question is:
How can I avoid that red line here and what is the deal with these different sockets?

Note: This question (and answer) serves as a target for the recurring question regarding connection problems of nodes, which is asked again and again in various forms, and is intended to show as simply and clearly as possible how it should be done.

A diamond shape does not fit into a round, and a round shape does not fit into a diamond shape.
But why is that?
Short answer: Because one data type is a single value, and the other is "Fields".
The official documentation of Blender states:

"Fundamentally, a field is a function: a set of instructions that can transform an arbitrary number of inputs into a single output. A field’s result can then be calculated many times with different input data. They are used all over geometry nodes to allow calculations that have different results for every element (mesh vertices, faces, etc.)."

This is technically perfectly correct, and should leave no questions unanswered, only apparently it is less easy to understand for many users with less technical background.
Therefore, I will try a simpler explanation...
Simply explained
Let's take a cube as an example:

This cube has exactly one position, exactly one rotation, and exactly one scale.
This cube is handled in Geometry Nodes simply as "Geometry", because the Geometry Nodes don't care if you use a cube, Suzanne, or a Death Star.
These properties can be easily edited in Geometry Nodes with the node Transform:

Translate the geometry with Transform
So a Geometry has transformation properties, which can be described with a value and this single value for a certain property is represented with a round socket:

But what if we don't want to change the position, rotation or scaling of the cube, but the points it consists of?
Suddenly we have for this geometry not only one value for the position, but 8!
And if we want to move the positions of the edges of the cube, we would have to process 12 positions, because a cube has 12 edges!
And that's where "Fields" come into play!
These describe several values of a certain domain (Point, Edge, Face, Face Corner, Spline, Instance) of a geometry and are called Attributes. The domains for points, edges, faces, etc. are therefore called Attribute Domains.
You've probably read this countless times somewhere: An attribute is just such a data package, which describes some property of a certain part of a geometry, and in this example therefore also refers to several elements, because a cube consists of 8 points.
In this case it is therefore the Attribute Domain "Points", and per point there is a value of type "Vector" which describes its position.
So we have 8 vectors in this Attribute Domain, and not just one single vector. And exactly this fact, that we are dealing here with the processing of several values of a certain domain of a geometry, is symbolized with a diamond-shaped socket:

To move the positions of the points of a cube, the node Transform can therefore not help.
Instead, the node Set Position is used, because it can move individual elements of the attribute domain Point:

Reposition individual points with Set Position
Let's increase the level of difficulty
Some nodes, however, can process both types of information! These simply switch automatically the current mode, depending on which kind of information they receive.
So the circle fits into the diamond after all!?
Yes: If the node is able to do this, it is represented by a diamond-shaped socket with a dot in the middle:

To be precise: If a diamond-shaped socket with a dot in the center does not receive a field as input, a single value is always used instead. Here is the exact description: Field Visualization
A simple example of this is the node Set Position, which in the following image takes a single value at the input Offset and applies it equally to all points:

Offset individual points with Set Position and a single value
A frequent application in this context is the use of Set Position in combination with randomly generated values by the Random Value node.
In the default setting, this node always provides a field, in order to be able to assign a different value to each point, for example:

Offset individual points with Set Position and a field as value
Switching the Mode?
However, some nodes can be switched manually by providing them with a certain value at a certain input. This includes, for example, the node Random Value.
Exactly this use case often leads to the following error:

Here the node Random Value returns a field, but the node Transform expects a single value
By inserting a single integer value into the input ID of the node Random Value, the node automatically switches to generating a single value and delivers it to the node Transform:

Manually switch the mode from field to a single value
As you can see, in this use case, the representation of all sockets changes from diamond-shaped to circular, and the red line disappears.

A fantastically worded answer, and one that really helped me. Thanks!

@JohnScolaro You're welcome! Thank you for the praise!

@quellenform thank you for a really great explanation, certainly helped me, is this still the case now 4 is released?

@Neil Yes, this explanation is also valid for version 4+, as this is a basic behavior and fields are an essential part of Geometry Nodes.


text:
GLB model does not render equally in different viewers
I have created cube model in Python with 6 different textures for each face.
While testing with different web viewers I've noticed that model shows properly ONLY with babylon.js whereas three.js and model-viewer are producing undesired opacity effect.
Is there anything I can change/fix in Blender in order to export model compatible with other viewers?
link to model

Best practice is to only use one UV map per object since some viewers only take the first UV map into account. Therefor it might also make sense to pack your textures into one and use it with one UV map.

Any hints how to pack these textures into one and define this one texture for UV map?

If you Smart UV project the cube you will see in your UV map that 6 out of 9 tiles are occupied. Then you can use an image editing software like Photoshop or gimp to place your individual textures in the correct tile. An alternative is to bake the material into a new texture.

Created single texture using PIL by composing face textures accordingly to UV layout and exported glb. Problem still exist and does not relate with number of UV maps. But I found that it appears only if texture has set Alpha <1. Even Alpha=0.99 causes the same glitch

Can you share your blend file?

Sure, here's link

The issue is related with transparency rendering in model-viewer and three.js web viewers. As soon there is Blend mode defined other that Opaque, these viewers are not rendering correctly object. As a workaround I've created cube which consists of 6 separate objects (planes) each with its own texture. Now I can't figure out how to define animation that mimics the whole cube instead of ainimated separate planes.


text:
Script to remove seams from cube
I have cube object with one texture on UV map.

Texture perfectly fits object but it renders abt 1px dark seams. Need help to get rid of these seams preferably by using bpy.

Is it the texture include the seam?

On first image you can see texture. When it's wrapped on the cube there are natural seams. But I can't close them

I've created texture file by perfectly stiching together 6 separate images, there are no gaps or BG defined

are you sure those are seams and not just the edges overlaid?  Have you tried rendering your cube to see if the black lines show up in a render?

Yes these seams are visible in render


text:
Cryptomatte issue
I'm trying to add cryptomattes into my workflow and it is working just fine in blender compositor but I can't make them to work in any other software (Nuke, Davinci, After Effects).

What am I missing ?

Worked for me in Fusion ... for Nuke, does this post solves your issue?

Thanks for the answer, seems like it's an matte ID issue. I'm fairly new to the 3d world and actually don't really understand what they are talking about.

Tried again in Fusion, can't make it to work. Used OpenEXR this time, tried using MediaIn instead of Loader, same.

Found a solution! It seams to work on Eevee but not on Cycles, so I re-rendered in Eevee with only the cryptopass.


text:
Displacement mesh looks shiny, does anyone know how to fix this?
I'm brand new to using Blender and I've run into something that I haven't had any luck finding a solution to so far, so I'm hoping someone may know how to fix this.
Using a displacement map, I created a displacement mesh with the displace and corrective smooth modifiers; there are no materials.  Everything seems to be working great, except the mesh looks shiny/glossy/metallic.  Is there anyone who knows how to get rid of/reduce the shininess?  Or is it normal for displacement meshes to look like this in Blender?  Thank you

Hello, it looks like you are in Solid mode, it displays a default shading, but you have some options in the Viewport Shading panel (top right of your 3D view)

Go to the Material tab, Viewport display panel, and set Metallic to 0 and Roughness to 1.0.   This is not for rendering, it is only for the Solid view in the display.

Probably you are using blender 3.0~3.1, and added the displacement using a modifier. And when you go to "Render", it looks shiny, glossy and metallic, am I not right?
If that's the case, select your object, go to the material tab. After that, reduce the option Clearcoat to 0.
If you're in Solid mode, then it's normal for it to look like this.

Since there wasn't a material applied to it I tried adding one, but upon adding it and adjusting the settings nothing about the appearance of the mesh changed.  I must be doing something wrong obviously, but I should've been more specific about what I'm trying to do with this mesh.  I want to bring it into Unreal Engine 5 and place a material on it there, but the shininess you see in Blender is showing up in Unreal Engine, which is why I believe it's the actual mesh itself that needs to be adjusted, rather than an adjustment to a material.  But that's just a guess.


text:
Rotation axis on different points
I am making a character where the head is connected to the rest of its body using pipe work. I am having trouble with getting the rotations axis correct. I want to have the y,x and z rotational origin points be different according to the correct place of the pipe.
Could anyone provide some tips on how to go about this. I want to be able to rotate the head and get the pipes to rotate accordingly.
Thank you in andvance!

Try using parenting with empties. The good thing about parenting is that the transforms of the parent empty will be inherited by the child, meaning the rotational origins should correct themselves. This also works when rigging

Smart! I used three empties on the different joints. These then copy the rotation of a main controller empty in only one axis. By parenting the empties to each other and parenting the joints to the empties, it now works perfectly. Thank you!


text:
Geonodes: Curl a line with increasing curvature from origin
I'm trying to curl a line via GeoNodes. See here:

As you can see, the line stays fixed at its origin and then curls according to an angle/curvature parameter.
The length along the curve stays constant.
I managed to create a setup that basically creates the right shape (in terms of curvature), but length and offset are off and generally it's not working correctly.
The spiral's center should not be fixed at the origin, but rather be transcendent according to the curvature.

This is my node Tree:

I already tried a vast amount of combinations, but no success. I also read a lot about spirals, but couldn't find any information about how to create a spiral "from the opposite end". And now I'm not even sure if it has to do with spirals at all or if I'd rather call it "circular interpolation". :)
So, is this even the right approach?
Any hints into the right direction are highly welcome!

Your question is more of a math question and I can't answer that (and you might be better off asking it over at math.stackexchange), but if you would be satisfied with only achieving the visual result, that's easy enough (though, not the "curve length stays constant" part):

I marked my additions to your setup with yellow. First Add node is to get rid of that long line you have going from the origin point to the end of the spiral (well, technically, the start). I don't know much about math, but I assume that's happening because Spline Parameter—Factor gives you a linear gradient of floats from $0$ to $1$ and since $\frac{1}{0}$ is undefined, it just puts the first point of the curve to $0,0,0$. Adding a very small number get rids of that. Closer to $0$ that number is, longer the "stem".
Second group of nodes simply uses the Position of that point at the end of the stem (Index0) to offset the whole group in the opposite direction, then rotates it so it stays upwards and looks to right.

Edit 1: Instead of the Transform node for rotation, you could simply switch the X and Y values of your setup and make them negative:

Edit 2: Here's a super hacky way of making the curve retain its length:

Marked the newly added nodes with blue. I'm taking the length of the curve at the animation start when it's just a vertical line and scaling the result down in proportion to it. The magical $49.020$ number happens to be the length of the curve when the rotation angle is at $0.000$ and the first Add node value is at $0.020$. If you wanted to change that number to adjust the length of the "stem", you would need to hook up a Viewer node to the curve before scaling (with rotation at $0$) to see the new curve length in the spreadsheet and put that into the Divide node.

The curve you're trying to produce is called an "Equiangular spiral". Since Blender operates easily in Cartesian coordinates, here's one way to do it with parametric equations:
$$ x(t) = ae^{bt} * cos(t)$$
$$ y(t) = ae^{bt} * sin(t)$$
Where $a$ and $b$ are constants.
The easiest way to generate a curve from parametric equations is start with a mesh line; compute the equations; and then use a Set Position node to adjust the points on the mesh line.  Here's part of a Geometry node tree that does that:

Note that I use several Input nodes, labeled to show the constants $a$ and $b$ as well as a count of line segments.  The more line segments the smoother the curve.
Note also that a Map Range node is used to set the range of t from 0 to some maximum value.  That will give you the number of turns.
The problem with this node group, as you've found out, is that it places the "wrong" end of the spiral at the origin.  Here's a technique for moving the spiral so that the other end is at the origin:

This uses a transfer attribute node to obtain the location of the endpoint of the mesh.  It then multiplies the coordinates by -1, and uses them as the translation input for a Transform node.  This effectively subtracts that value from every point on the line, moving it to the origin.
What is not shown is the technique for rotating the curve to obtain the final alignment you desire.  To do that, simply add a constant to T in the trig functions, resulting in that much extra rotation:
$$ x(t) = ae^{bt} * cos(t+\theta)$$
$$ y(t) = ae^{bt} * sin(t+\theta)$$

Here's a version with the math cleaned up into a node group, showing the full tree:

Although good answers here which work to a degree, I came up with another solution. I thought I was going for a spiral, but actually that wasn't my goal in the end. More on that below.
Regarding the spiral equation, there are multiple solutions possible with GeoNodes. Even for hyperbolic spirals there are at lest two ways build them. But in the end, I guess most spiral node setups have different (dis)-advantages. In addition to that, there are numerous different types of spirals.
So it turned out that I didn't want to build a spiral per se, but rather a line segment which iteratively deforms in a circular manner, driven by a 2D-Curve.
Here's the setup that also allows to "bend" segments. With a linear curve applied, I get the former desired spiral shape:

To additionally answer the initial question:
Kuboa gave the right hint to correctly orient the spiral.
Here's my first solution:


text:
Density of a volume proportional to the proximity to a surface
I apologize if I can't explain it correctly. What I am looking for is the following in Cycles:
Given 2 objects, one rendered as a volume (scatter or absorption) and one as a surface, I want to change the density of the volume based on the proximity to the surface object. Imagine if the volume is a UV sphere and the surface is a cube, when the cube is inside the sphere, the desnity of the sphere should be proportional to the distance of the point in the volume to the cube.
Is this achievable?
All I can do is get proximity to a face with geometry node, but not proximity to a volume

Hi :). Should be easy using this setup with volume Desaturate colors around lightsource. Just can't make it work reliably at the moment :))

thanks for the answer! I tested the method and it seems like proximity is calculated only for 1 point, looks like it's the mesh's origin. Is it possible to get the same exact mechanism, but that it takes into account the entire surface (the mesh I am using is a human)? I am guessing maybe using geometry node proximity value?

Hi :). You're right, it uses the origin point. Not sure how to target the surface directly :)

normally it should be an easy setup with GN and it works with my shader (if you plugin my principled bsdf to surface output you can see the color changes by the distance) but...the density of my volume shader doesn't "react". I have no idea why...[1]: https://i.sstatic.net/nZ0ZG.png [1]: https://i.sstatic.net/hPTbv.jpg  [1]: https://i.sstatic.net/rH4WZ.jpg [1]: https://i.sstatic.net/dzVg6.gif

Hi @Chris :). Had a similar hiccup yesterday, the multiply/add node isn't very intuitive for density. I later simply multiplied a colorramp and it worked fine https://imgur.com/a/moPKZR8

@JachymMichal: Thanks ;) but unfortunately you have input values of 0-1 and my input value can be greater than 1 so the "pure" colorramp won't work, i think. I must made a very stupid mistake...but i have no idea...or it is a bug

@Chris I think the reason the volume is not reacting is the same reason why you can't color a volume using an image texture,  the input is 2D, whereas if you use a noise texture it works cause it's 3D. So I suspect that the proximity value from the geometry node is actually 2D but I don't know how to verify it

where you able to solve this?


text:
Control density of a volume in a more methodical way
I would like to have a volume mesh, let's say a sphere, that gets progressively more "misty"

Imagine the mesh being at very high desnity for the top hemisphere, then density becomes lower in the lower hemisphere to the point that it basically transitions to a gas. I want this to be possible to be added to any mesh and control where the lower density happens.
I have attempted many ways to achieve this, but controlling the density is not really possible in an arbitary way, only with 3D textures (noise or gradient).

Quite interesting ... would you mind to extend your description to be more specific what is your goal visually .... some references (it should be still image or anim) ... why procedural texture doesn't work for you ... Probably any dissolving / disintegration technique like this https://www.youtube.com/watch?v=wm4rDDRcbDQ could work for you? Just instead of spark material you will use something volumetric.

Until you add more details (mentioned in my comment) ...
One way to dissolve solid into a "gas" can be faked simply by Plane used at the same time as factor for

Boolean modifier and
Canvas of Dynamic Paint

Boolean operator will handle "disappearing" solid part. Dynamic Paint (with Sphere as a Brush and Plane as Canvas) will generate Weight (Vertex Group) as Fluid Sim > Gas > Inflow.

Added Solidify modifier to the Plane, to avoid glitches of Boolean modifier (even with Exact solver).

Previously I let emit smoke from Particle system (based on DP weight) , but it was somehow unstable for me (it is still included in the file, just disabled).
There can be more ways using just geometry nodes or Particle system, but in cost of less realistic "gas" dissolving.

Could you share the .blend you used?

very interesting approach!

You can try object coordinates with multiple Empties.
Density/spread is controlled by: scaling empties, ColorRamp, Math node > Multiply
High, medium and low density areas

Combining three areas, each driven by a separate empty (click to enlarge)

I see, that's a great idea, I will try that out. I wish in the next version of blender we get collection input so that we could get texture coordinate from all the empties at once


text:
Get depth/length of refracted ray
If I place a plane in front of the camera (parallel to the view plane) and have it shaded as a refracted BSDF, is there a way to get for each point on the plane the length of the ray between the refraction point and the first hit surface?


text:
Reuse information from previous frame during animation rendering for better performance
Is it possible to improve on the rendering speed of an animation by exploting the fact that the scene doesn't change much between frames? Is blender recalculating everything from scratch for each frame?
In my scenes I usually have a small object moving while the rest of the scene is pretty much static. The character will definitely change the ray paths, so it will affect the scene, however I think most of what was computed for the previous frame should be reusable. Is it achievable?

With Cycles, you can check "Persistent Data".
Render Properties / Performance / Final Render / Persistent Data

thank you that's what i needed!


text:
BLENDER: PNG Images on Surfaces Render Good while Rendering, then turn to Black and White with Black outlines on Final Render
PNG Images on Surfaces Render Good while Rendering, then turn to Black and White with Black outlines on Final Render.
And add a small black outline as well. I've added images with the material nodes and a few closeups...
How can I fix this?

Put Alpha output in Alpha input

That worked like a charm for the sunflower... The only thing that is still there, however, are the black outlines around everything... You can see those in the bottom right image on the one I submitted above. Any idea what is going on there or how to remove them? And thank you very much for the node correction... : )


text:
Adjusting multiple materials at once
just wanna ask is there a way to you can manipulate the multiple materials in one object at once?
For example there are two materials on this sphere, I want apply another shader to the material, but I want the same shader to all other materials that contains it's own texture. Is there a ways
This is just an example sphere, the mesh I will need to apply has contain large amount of materials in one object.
Thank you

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

You can create a node group: Select your 2 nodes (Glossy BSDF and Mix Shader) and press CtrlG. It will automatically display what's inside the group. To exit press Tab (and to enter again press Tab again). To create the same group in another material press ShiftA > NodeGroupName. To ungroup, select the group and AltCtrlG.