Nodes/Avatar Graph/Object Geometry Node Tree Copy Assign
ComfyUI Node

Object Geometry Node Tree Copy Assign

Making a shared node group unique to one object

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Geometry Node Tree Copy Assign
  • BPY_OBJ
  • BPY_OBJ

Geometry Nodes modifiers often point at a shared node group by default - build one setup, use it on five objects, edit the group once and all five update together. That's convenient right up until you need one of those five to diverge. Object Geometry Node Tree Copy Assign is the "make this one independent" step: it duplicates the currently active geometry node group and assigns that fresh copy to the currently active modifier.

How it works

It wraps bpy.ops.object.geometry_node_tree_copy_assign(). After it runs, the target modifier is no longer pointing at the original, shared node group - it's pointing at a brand-new copy that only it uses, so further edits to this object's setup stop leaking into every other object that still shares the original.

The important caveat, shared with a couple of other nodes in this pack (Object_DropGeometryNodes among them): this operator works off Blender's currently active node group and active modifier context, not an explicit name or reference you pass in. The schema doesn't expose one - there's no parameter for "which tree" or "which modifier" beyond the object itself. In practice that means this node is most reliable run immediately after whatever step in your graph actually made the right modifier active, rather than dropped anywhere convenient.

The inputs and outputs that matter

There's exactly one input:

  • BPY_OBJ - the object whose active modifier's node group gets duplicated and reassigned.

Output is a single BPY_OBJ, passed through, now pointing at its own independent copy of the tree.

How to install it

ComfyUI Manager: search "Avatar Graph", install, restart - or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui && python -m pip install -r requirements.txt

bpy needs Python 3.10.x, exactly. Windows gets a prebuilt Python-3.10 ComfyUI zip from the README; macOS/Linux wants a dedicated conda create --name comfyui python=3.10 environment. Add --enable-cors-header on restart (--force-fp16 too on Mac) for the live avatar preview; without it you still get full functionality via .glb/.gltf export.

Common issues & troubleshooting

Node not loading traces to the Python-version pin - check ComfyUI's startup console for a bpy import error first.

Edited one object's geometry-nodes setup and a different object changed too - that's exactly the shared-tree problem this node exists to solve, run this node first to break the link before making edits you want isolated to one object.

Ran this node and the wrong thing got copied, or nothing did - because it targets Blender's active context rather than something you name, the most likely cause is the wrong modifier or node group being active at the point this node fires in your graph. Trace back through what ran immediately before it, rather than assuming the object input alone determines the target.

Wanted the opposite - combine several one-off setups into one shared, reusable group - that's Object_GeometryNodesMoveToNodes, not this node; this one only handles the make-it-independent direction.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ