Nodes/Avatar Graph/Object Modifier Set Active
ComfyUI Node

Object Modifier Set Active

Pick which Blender modifier is 'active', without opening Blender

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Modifier Set Active
  • BPY_OBJ
  • BPY_OBJ
modifier

This one is a bit of a head-scratcher until you know what it's for. Object_ModifierSetActive marks a modifier as the active modifier on a Blender object - the one that's highlighted in the modifier stack, the one that "active" modifiers operations act on. In a graph, that's mostly useful right before another operator that targets the active modifier instead of a named one.

What it is

It's a generated wrapper around bpy.ops.object.modifier_set_active(), part of the same auto-generated Object_* family that Avatar Graph uses to expose Blender's object operators. You're unlikely to need it in a typical avatar rig - most of the pack's modifier nodes take an explicit modifier name, so they don't care which one is active. This node exists because the pack generated the whole bpy.ops.object surface, and this operator was on it.

How it works

Like every Object_* node, it takes a BPY_OBJ, sets that object as the active one in the shared headless Blender scene, runs its operator, and returns the same BPY_OBJ. The only other input is modifier - a plain text field holding the exact name of the modifier you want flagged as active (e.g. Multires).

When you'd actually use it

Honestly? Rarely. The scenario that makes sense: you're building a chain of modifier operations where the "active modifier" is the implicit target - for example, some sculpt or apply-style operations in Blender act on whichever modifier is active in the stack. If you're hand-assembling that kind of sequence, you'd place this node just before the operation that reads the active modifier. For the beginner who just wants an eye-blink avatar, skip it.

Output is the same BPY_OBJ, so it drops into a chain without breaking anything. If you wire it wrong (a modifier name that doesn't exist), it just doesn't set anything - no crash, no error, and nothing to see anyway.

Installing it

Same as every node in this pack - it comes with Avatar Graph:

  • ComfyUI Manager: search "Avatar Graph", install, restart.
  • Or:
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 catch: the pack pins bpy==3.6.0, and that only builds for Python 3.10. On a newer Python you'll get "no module named bpy" at startup and the whole pack fails to load. Use the README's bundled Python 3.10 environment on Windows, or a python=3.10 conda env elsewhere.

The honest take

This is one of the pack's filler nodes. It's correct, it works, and you'll almost certainly never miss it. If you find yourself reaching for it, double-check you actually need an "active modifier" operation rather than just naming the modifier directly - the named form is almost always clearer in a graph. When in doubt, leave this one on the shelf.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
modifieroptSTRING

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ