Object Drop Named Material
Assigning an existing material by name
- BPY_OBJ
- BPY_OBJ
Object Drop Named Material does one small, useful thing: it takes a material that already exists somewhere in your Blender data and slaps it onto an object, by name. It's the scripted equivalent of dragging a material swatch from the Shader Editor or Outliner onto something in the viewport.
How it works
This wraps bpy.ops.object.drop_named_material(), the operator behind that exact drag-and-drop interaction in real Blender. Give it a material name that already exists as a data-block in the file - created by an earlier step in your graph, or baked into whatever template .blend Avatar Graph is running against - and it assigns that material into the target object's active material slot, adding it if the object doesn't have one yet.
The key word is existing. This node doesn't create a material or set any of its properties; it only assigns one that's already there. If the name doesn't match anything, there's nothing for it to attach.
The inputs and outputs that matter
name(string) - the material's data-block name to assign. This is the one field a beginner actually sets.BPY_OBJ(optional) - the object to assign the material onto.session_uuid(default0) - drag-session plumbing carried over from the UI operator this wraps; harmless to leave at default when calling this node directly.
Output: a single BPY_OBJ, the same object with its material assigned.
How to install it
ComfyUI Manager: search "Avatar Graph" or avatar-graph-comfyui, 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
Like every node in this pack, it rides on Blender's bpy module, which only ships wheels for Python 3.10.x - that's the actual blocker most people run into, not this node itself. Windows users can sidestep it with Avatech's prebuilt Python-3.10 ComfyUI zip from the README; on macOS/Linux, build a dedicated environment (conda create --name comfyui python=3.10) rather than reusing a newer-Python ComfyUI install. Add --enable-cors-header on restart for the live avatar preview in editor.avatech.ai (--force-fp16 too on Mac); without it you still get full functionality, just via .glb/.gltf export instead of the in-browser preview.
Common issues & troubleshooting
If nothing loads at all, check ComfyUI's startup console for a bpy import error first - that's almost always a Python-version mismatch, not a problem with this specific node.
Material doesn't get assigned, no visible error - the most likely cause is a name mismatch. Material names in Blender are exact-string matches (and Blender silently renames duplicates with a .001 suffix if you create two materials with the same name), so double-check the name you're passing here is the actual current name of the material data-block, not the name you originally gave it before a rename happened upstream in your graph.
Wrong material shows up on export - remember this assigns into the active material slot; if the object already had a different material assigned as active, this replaces that slot's material rather than necessarily adding a brand-new one. If you need multiple materials coexisting on one object, you'll want to manage material slots explicitly (this pack's Object_MaterialSlotAdd/Object_MaterialSlotAssign nodes) rather than relying on this node alone.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| nameopt | STRING | — | |
| session_uuidopt | INT | 0-2147483648–2147483647 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |