Nodes/Avatar Graph/Mesh Attribute Set
ComfyUI Node

Mesh Attribute Set

Writes a value into the mesh's active attribute layer

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Attribute Set
  • BPY_OBJ
  • value_float_vector_2d
  • value_float_vector_3d
  • value_int_vector_2d
  • value_color
  • BPY_OBJ
value_float0.00
value_int0
value_boolfalse

Worth knowing upfront, because it explains everything else about this node and most of its siblings: this isn't hand-written by the Avatech team. Avatar Graph generates a big chunk of its node list directly from Blender's own bpy.ops.mesh.* API - literally a Python list of operator names that gets walked to auto-produce a ComfyUI node per operator. Mesh Attribute Set wraps bpy.ops.mesh.attribute_set, Blender's real operator, unchanged. That's genuinely useful to know: if a field here confuses you, Blender's own documentation and forums are a better resource than anything ComfyUI-specific, because there's no bespoke logic here to look up.

How it works

Blender meshes can carry arbitrary custom "attribute" layers - per-vertex, per-face, or per-corner data of a given type (float, int, boolean, color, or vector). At any time, one of them is the active attribute. This operator writes a value into that active attribute across your current selection. It does not create the attribute layer for you - you need one already active on the mesh before this does anything meaningful.

Because a mesh attribute has exactly one data type, only one of this node's value fields is actually read at runtime - whichever matches the active attribute's type. The rest are ignored, which is why the schema looks like it has so many redundant-seeming inputs.

The inputs and output that matter

  • BPY_OBJ (optional) - the mesh object to operate on.
  • value_float, value_int, value_bool, value_color (a 4-component vector), value_float_vector_2d / _3d, value_int_vector_2d - set whichever one matches your active attribute's type; the others do nothing.

Output is the same BPY_OBJ, passed through so you can chain more Blender operations after it.

How to install it

Via ComfyUI Manager: search "Avatar Graph" (avatar-graph-comfyui), install, restart. Manually:

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

The pack's hard blocker: bpy==3.6.0 is pinned in requirements.txt, and it only builds on Python 3.10.x - nothing newer. Windows users get Avatech's own bundled Python 3.10 ComfyUI zip via the README; Mac/Linux users should build a dedicated conda environment (conda create --name comfyui python=3.10) rather than fighting an existing 3.11/3.12 setup. It's a heavier install overall - segment-anything, mediapipe, and OpenCV come along with it.

Common issues & troubleshooting

"Operator bpy.ops.mesh.attribute_set.poll() failed, context is incorrect." This is Blender itself refusing to run, and the most common cause is exactly the gap noted above: no active attribute layer on the mesh. This node is a setter, not a creator - something upstream needs to have already added and activated the attribute you're trying to write to.

Nothing visibly changes. Since these nodes all run inside Blender's Edit Mode automatically (switch in, run the operator, switch back to Object Mode - you don't manage that yourself), a "successful" run with the wrong active attribute type selected will just silently write to a field you're not looking at. Double check which attribute is actually active before assuming the node failed.

Confused about what "attribute" even means here. This is Blender's general-purpose custom-data system, not something Avatar Graph invented - search Blender's own docs for "mesh attributes" rather than this pack's README, which doesn't document individual mesh operators.

Categoryblender

Inputs (8)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
value_floatoptFLOAT0.00-3.402823466385289e+38–3.402823466385289e+38
value_float_vector_2doptB_VECTOR2
value_float_vector_3doptB_VECTOR3
value_intoptINT0-2147483648–2147483647
value_int_vector_2doptB_VECTOR2
value_coloroptB_VECTOR4
value_booloptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ