How to find where a geo node group is being used? I have a lot of geo node groups and of course a bunch have name suffixes of .001 or .002 How can I easily find which objects are using the .001 and the .002 so that I can consolidate all objects to use the same groups?
Is there any way to list out a dependency graph of node groups?
Maybe in the modifiers panel.
your best bet is to write a python script that inspect each objects modifiers,
There isn’t something in the UI that does that yet…
There is nothing built in to do the work. @sozap is right that python can get the dependency graph. Do this to get it written to a file:
- Using Blender open the file. In Blender open the python console.
- Run the python command “import bpy”
- Run the python command “bpy.context.evaluated_depsgraph_get().debug_relations_graphviz(”/SomePath/SomeFile.gv")"
- Using a text editor edit the somefile.qv and realize that the DOT syntax is not human readable.
@Modron is correct in that the Properties panel for modifiers (the wrench) Geo Nodes has at the bottom has a drop down “Internal Dependencies” which can be clicked. So the practical solution is to click on each object one at a time and look at the internal dependencies.
The python is from https://blender.stackexchange.com/questions/220328/visualize-depsgraph I could not get graphviz to install so could not use that to view the graph.
That sounds a bit complicated for what it is…
You need to know which object is using which modifier ?
try this :
import bpy
for ob in bpy.data.objects :
for mod in ob.modifiers :
if mod.type != "NODES" : continue
print(mod.node_group.name,'/' ,ob.name)
This will print in the console a list of geo nodes name and their corresponding objects :
can you explain how this is working ?
how does it make the difference between normal nodes and Geom nodes ?
thanks
happy bl
Perfect. Thank you.
Here is the breakdown of the code :
for ob in bpy.data.objects :
For all the objects in the .blend
for mod in ob.modifiers :
For each modifiers ( of each objects)
if mod.type != "NODES" : continue
If the modifiers isn’t a geometry node modifier then do nothing
print(mod.node_group.name,'/' ,ob.name)
print the modifier’s node group name, and the object name.
It’s probably the “continue” thing that you’re not used to ?
hope that helps and fell free to ask if you have further questions !
how does this = Geom nodes instead of normal nodes ?
and the continue not certain what it does !
also how can we detect EEVEE nodes or cycles nodes?
thanks
happy bl
“Normal” (shading) nodes aren’t modifiers. This is only iterating over modifiers.
Again, this is a different situation. This script only applies to modifiers.
It does this: if the modifier isn’t a geometry nodes modifier, go to the next iteration of the loop (the next modifier, or next object if there are no more modifiers)
ok so Nodes as a modifier’s name is a Geom node !
thanks
happy bl
I’m not sure to get you completely, but it’s not using names to retrieve anything.
But it’s using the .type
Each datablock in blender has a type, for instance an object.type can be “MESH”, “CURVE”, “LATTICE”, “ARMATURE”…
And in our case, the modifiers .type is called “NODES”, that way it’s possible to know that it’s a geometry node modifiers.
In the same fashion you can inspect nodegroups in the .blend and filter those with the “GEOMETRY” type, which is another way to find geometry nodegroups.
But to my knowledge it’s not possible to retreive the users of these groups.
So if you wanted to get all the materials that uses one particular group, you need to inspect all the materials, rather than finding the group and query it’s users.
hope that helps !
i think i get the idea here using the modifier’s type
hope it won’t change too much later on in future
thanks
happy bl