Nodes/Avatar Graph/Object Vertex Group Assign
ComfyUI Node

Object Vertex Group Assign

The assign step

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Vertex Group Assign
  • BPY_OBJ
  • BPY_OBJ

Once a vertex group exists, something has to fill it. Object Vertex Group Assign is the filler: it takes whatever vertices are selected in the mesh and assigns them to the active group, with full weight (1.0). It wraps the Blender operator bpy.ops.object.vertex_group_assign(), same pattern as every auto-generated node in this pack - a headless Blender 3.6 runs inside your ComfyUI process and the graph wire becomes a direct operator call.

Here's the thing that makes this node work differently than you might expect in a graph: assignment is driven by vertex selection, and in Blender, entering edit mode on a freshly created mesh leaves every vertex selected by default. The pack's EditOps base deselects all objects, activates your BPY_OBJ, enters edit mode, and runs the op. So on a clean character mesh, this node doesn't assign a subset - it assigns the entire mesh to the active group. That's genuinely useful (it's how a whole-mesh group gets built in the avatar pipeline), but it means the node is coarse. There's no way to feed it "just the mouth region" through the graph, because vertex selection isn't threaded through ComfyUI wires.

What it takes: one input, BPY_OBJ (the mesh whose selected vertices get assigned), and one output, the same object with the group filled. Before running, the active group must already exist - add one first with Object Vertex Group Add, or use the combined Object Vertex Group Assign New if you're assigning a brand-new group anyway.

When would you actually reach for it? In the Avatar Graph flow, mostly as the building block under more meaningful operations: you assign a whole region to a group, then later Object Vertex Group Invert or Object Vertex Group Levels shape that group's weights before a shape key uses it. If you want fine-grained weight control, this isn't the tool - the pack's Mesh Modify Shape Key node is where per-vertex transform control actually happens.

Install is pack-wide: ComfyUI Manager → "Avatar Graph", or git clone https://github.com/avatechai/avatar-graph-comfyui into ComfyUI/custom_nodes and pip install -r requirements.txt on Python 3.10 (bpy==3.6.0). First launch downloads the ~2.4 GB SAM model.

Troubleshooting: the classic "wrong vertices got assigned" complaint is really a selection-expectation mismatch - the node assigns what's selected in the Blender scene, and on a fresh mesh that's everything. If a later node sees an unexpectedly full group, that's why. And remember the pack resets the scene each run, so your assignments are rebuilt fresh every time - which is exactly why the whole pipeline re-runs rather than accumulating.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ