Nodes/Avatar Graph/Mesh Colors Rotate
ComfyUI Node

Mesh Colors Rotate

A niche fix for twisted per-corner color data

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Colors Rotate
  • BPY_OBJ
  • BPY_OBJ
use_ccwfalse

This is the smallest, most specific tool in Avatar Graph's Blender-operator wraps, and honestly one you'll rarely reach for deliberately - it's bpy.ops.mesh.colors_rotate from Blender's own mesh API, auto-generated into a node like the rest of the Mesh_* family. It has exactly one real option, which tells you something about how narrow its job is.

What it does

Vertex colors in Blender aren't stored per-vertex the way the name suggests - they're stored per face-corner (per "loop"), so each face has its own color value at each of its corners even where corners share a vertex with a neighboring face. Certain mesh operations (a rip, an edge rotate, a re-triangulation) can leave that per-corner color data pointing at the wrong corner relative to the face's actual winding - the colors are all still there, just shifted by one position around the face loop. Colors Rotate fixes exactly that: it shifts the per-corner color assignment around the selected face loop by one step.

The input that matters

  • BPY_OBJ (optional) - the mesh object, with the affected face(s) selected.
  • use_ccw (default false) - which direction to rotate the color assignment. If a rotate in the default direction doesn't fix a twisted color result, this is the one setting to flip.

Output is the same BPY_OBJ, passed through for chaining.

When you'd actually need this

In an Avatar Graph context, you'd mostly hit this after other mesh operations have shuffled geometry around on a piece that also carries vertex-color data (rather than a texture) - for example, if part of your pipeline colors mesh regions directly instead of through UV-mapped textures, and an earlier operation (a rip, a rotate) has visibly scrambled which color sits on which corner.

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 only builds on Python 3.10.x. Windows users get a bundled Python 3.10 ComfyUI zip from 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. Expect a heavier install overall - segment-anything, mediapipe, and OpenCV all come along.

Common issues & troubleshooting

"Operator poll() failed, context is incorrect." If the mesh has no vertex color layer at all, there's nothing for this operator to rotate - check that a color attribute actually exists on the mesh before assuming this node is broken.

Rotating didn't fix the twisted colors. Try flipping use_ccw - there are only two possible rotation directions, and if the default one didn't line things up correctly, the other one usually will.

Not sure this is even the problem you have. If your mesh uses a UV-mapped texture rather than per-vertex color data, this node isn't relevant to what you're seeing - texture-mapping issues live in your UV layout, not in the vertex color loop, and no amount of Colors Rotate will touch that.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
use_ccwoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ