Nodes/Avatar Graph/Context Set Transform Pivot Point
ComfyUI Node

Context Set Transform Pivot Point

Deciding what a scale or rotate pivots around

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Context Set Transform Pivot Point
  • BPY_OBJ
  • BPY_OBJ
pivot

This node from Avatar Graph - avatech.ai's ComfyUI pack for rigging character art into interactive avatars - doesn't touch geometry at all. It sets a piece of scene context: Blender's transform pivot point, the setting that decides what point a scale or rotation operation pivots around. It's the node-graph equivalent of the pivot-point dropdown you'd normally click in Blender's 3D viewport header.

Why a "context" node matters here

In interactive Blender, you set the pivot point once and every subsequent scale/rotate you do in the viewport respects it, until you change it again. A ComfyUI graph has no persistent viewport state like that - everything has to be explicit, node by node. So this node exists purely to set that piece of context immediately before whatever transform operation you actually care about, ensuring it pivots around the point you intend rather than whatever Blender's default happens to be.

The one field that matters

pivot is an enum with five options, matching Blender's own pivot-point choices directly:

  • BOUNDING_BOX_CENTER - pivots around the center of the selection's bounding box.
  • CURSOR - pivots around the Blender 3D cursor's position, wherever that's currently set.
  • INDIVIDUAL_ORIGINS - each selected object or element transforms around its own origin, independently.
  • MEDIAN_POINT - pivots around the median (average) position of the current selection.
  • ACTIVE_ELEMENT - pivots specifically around whichever element is the active one in the selection, not the whole selection's average.

Get this wrong and a scale or rotate that runs afterward will still execute - it just won't pivot from where you expected, which shows up as a mesh part shifting position when you only meant to resize or rotate it in place. Input and output are both BPY_OBJ, this pack's socket for a live Blender object reference - it passes through unchanged in terms of geometry, only the scene's pivot-point context is affected.

Installing it

Search avatar-graph-comfyui in ComfyUI Manager, or clone it by hand:

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

This runs through bpy, same as the rest of the pack's blender-category nodes, and bpy only works with Python 3.10.x. Set up a dedicated conda environment pinned to 3.10 on Mac/Linux, or use the README's prebuilt Python 3.10 ComfyUI zip on Windows - don't try to install this into a newer Python environment your ComfyUI setup might already be running. Restart afterward with --enable-cors-header if you want the live avatar preview panel to work with editor.avatech.ai.

Troubleshooting

If a mesh part visibly moves or drifts when you only meant to scale or rotate it, that's almost always this setting being wrong (or missing entirely) before the transform node that runs - check pivot is set to what you actually intend, and that this node runs before the transform it's supposed to affect in your graph's execution order, not after. Since this is context that Blender applies at the moment a transform executes, ordering matters here in a way it doesn't for most of this pack's mesh-editing nodes. Beyond that, this is too small and specific a node to have any dedicated community discussion - if the behavior still seems off after checking pivot choice and node order, it's worth confirming with a simpler test transform in isolation before assuming something more complex is broken.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
pivotoptCOMBO5 options: BOUNDING_BOX_CENTER, CURSOR, INDIVIDUAL_ORIGINS, MEDIAN_POINT, ACTIVE_ELEMENT

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ