Object Material Slot Deselect
Unselect the faces that share the active material
- BPY_OBJ
- BPY_OBJ
This is the quiet sibling in the material-slot family. Object_MaterialSlotDeselect wraps bpy.ops.object.material_slot_deselect(), which deselects all the vertices or faces assigned to the active material slot of the active object. Its mirror-image, Object_MaterialSlotSelect, does the opposite - selects everything that uses the active material.
Why bother in a ComfyUI graph? These slot selection tools are the Blender-native way to isolate a region by material. In an avatar pipeline you'll often want to grab "everything that's hair" or "everything that's skin" to operate on it - and if the mesh was built from segmented image parts, each part's material is a clean grouping key. Deselect is the cleanup move: you select the parts you care about, then deselect the material region you don't, and the remaining selection is exactly what you wanted.
The mechanism. The node sets BPY_OBJ as the active object and invokes the operator, which reads the active material slot and toggles selection off for every element assigned to it. No arguments beyond the object. It hands BPY_OBJ back unchanged, so it's a zero-impact node on the data flow - it changes selection, not the mesh.
Inputs.
BPY_OBJ- the object whose active slot's vertices get deselected.
That's it. If you want a different slot, you need the active slot to point at the right material first - via material slot management nodes elsewhere in the graph.
Output. BPY_OBJ, passed through.
Installing it. Ships in Avatar Graph (ComfyUI Manager → "Avatar Graph") 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
Restart with --enable-cors-header; the pack needs Python 3.10.x for bpy==3.6.0.
Troubleshooting. The most common confusion is expecting a visible mesh change - there isn't one; this only mutates the vertex/face selection inside the hidden Blender scene. If it seems to do nothing, either the active slot has no assignments or nothing was selected to begin with. It's a utility in the strictest sense: unremarkable on its own, useful as one step in a selection choreography that ends with a modifier, a shape-key edit, or an export.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |