Nodes/Avatar Graph/Object Visual Transform Apply
ComfyUI Node

Object Visual Transform Apply

What You See Is What the Mesh Gets

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Visual Transform Apply
  • BPY_OBJ
  • BPY_OBJ

In Blender there's a gap between where an object is and where its transform data says it is. The transform is stored on the object; the mesh's vertices sit in their own local space. Usually that split is fine, but at export time it can bite - a mesh that looks right in the viewport exports rotated, scaled, or offset because the transform never got baked into the vertices. Object Visual Transform Apply is the bake: it applies the object's current visual transform down into the mesh data.

In the Avatar Graph pipeline, where meshes get layered, joined, and nudged into place, this is the "make the export match the viewport" node. If you've ever exported an avatar that came out sideways, this is the fix you didn't know you needed.

How it works

An auto-generated wrapper around Blender's bpy.ops.object.visual_transform_apply. No parameters - BPY_OBJ in, and the same object out. What it does: takes the object's current location, rotation, and scale as they actually appear, applies them to the mesh's vertices, and resets the object's own transform to identity. Afterward the mesh is genuinely where it appears to be, with no hidden offset left to surprise you at export.

The output is the same BPY_OBJ, so the natural home for this node is near the end of the graph, right before the Avatar Main Output or the GLB/GLTF export step.

One thing to note: it bakes the visual transform - the state the object currently displays, including any constraints or modifiers that contribute to it. That's exactly what you want for a final export, and exactly why this node is called "Visual."

Installing it

It ships with Avatar Graph:

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 ComfyUI, or grab "Avatar Graph" from ComfyUI Manager. Pack-wide notes: bpy==3.6.0 requires Python 3.10 (dedicated conda env per the README), and bpy is a full headless Blender, so the install is a heavyweight step.

Common issues

The classic mistake is running this too early. Bake transforms in the middle of the graph and the downstream nodes that were relying on the object's transform now see an identity transform - their own math changes. Put it last, after all the positioning is done.

Second, "nothing changed" is actually a good outcome when the object's transform was already clean - no-op means nothing to bake. And the standing rule applies: this needs a real BPY_OBJ from an upstream mesh node like Create Mesh Layer or Join Meshes; it does nothing on a bare image.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ