Nodes/Avatar Graph/Object Collection Link
ComfyUI Node

Object Collection Link

File an object into a Blender Collection

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Collection Link
  • BPY_OBJ
  • collection
  • BPY_OBJ

A direct wrap of bpy.ops.object.collection_link() - Blender's basic operator for adding an object into an existing Collection. Nothing fancy: Collections in Blender are organizational containers (they don't group geometry the way, say, a "join" would), and this node files the object into one.

Where it fits in Avatar Graph

Avatar Graph (avatechai/avatar-graph-comfyui) rigs a flat character image into a real-time interactive avatar - segmentation, mesh layers, a "Shape Flow" runtime graph, exported through Avatar Main Output. The README documents a small set of nodes for that pipeline; this one isn't in it. It's part of the larger family the pack generates by exposing most of Blender's Object operators directly as nodes, and it's the kind of scene-organization plumbing you'd reach for if you're scripting a more elaborate Blender scene around your rig - keeping generated mesh layers tidily grouped, for instance - rather than something the core rigging tutorial calls for.

How it works

Collections are Blender's folder system for the scene outliner: an object can belong to multiple Collections at once, and Collections control per-group visibility, render inclusion, and organization independent of parenting. Linking an object into a Collection is purely additive - it doesn't remove the object from any Collection it's already in, and it doesn't move or transform the object at all.

Inputs and outputs

  • collection - a B_ENUM picking which existing Collection to link the object into.
  • BPY_OBJ (optional) - the object being linked. Unwired, it falls back to Blender's currently active object.

Output: BPY_OBJ - the same object, passed through for chaining, matching every other node in this family.

How to install it

ComfyUI Manager: search "avatar-graph-comfyui", install, restart. Manual clone:

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

The requirement that actually bites: bpy needs Python 3.10.x, nothing later. Windows gets a prebuilt Python 3.10 ComfyUI zip from the README; on Mac/Linux, set up a dedicated conda env (conda create --name comfyui python=3.10) instead of forcing it into an existing one. Restart with --enable-cors-header if you want the live avatar preview panel to work with editor.avatech.ai - file exports don't need it.

Common issues & troubleshooting

The install, not this node, is where things usually go wrong - a 3.11/3.12 environment, the default on most current ComfyUI setups, can't load bpy at all. There's also a real report of Avatar Graph leaving a ComfyUI Desktop install badly broken after installation (an oversized UI logo, a stray audio-permission popup) badly enough that a full reinstall didn't fully clear it - worth testing in a spare, portable ComfyUI instance first if you're not already sandboxed on 3.10.

For the node itself: if collection shows an empty or unexpected list, that's because the Collection has to already exist in the file's data by the time this node runs - either created earlier in the graph or already present in the .blend. And remember linking is additive, not exclusive; if you expected an object to leave its old Collection when it joins a new one, you need Object Collection Unlink on the old one as a separate step.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
collectionoptB_ENUM

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ