Nodes/Avatar Graph/Object Set Lock Rotation W
ComfyUI Node

Object Set Lock Rotation W

ComfyUI Node Guide

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Set Lock Rotation W
  • BPY_OBJ
  • BPY_OBJ
valuefalse

This is a niche one, and it helps to know a bit of Blender's rotation math to see why it's useful. Object Set Lock Rotation W is part of Avatar Graph, Avatech's node pack for rigging static character illustrations into real-time interactive avatars inside ComfyUI. Like the pack's other "ObjectSet" nodes, it doesn't run a Blender operator - it just sets one property directly on an object.

Blender objects can use different rotation representations: Euler angles (the familiar X/Y/Z rotation you're used to), Quaternion, or Axis-Angle. Quaternion and Axis-Angle rotation both have a fourth component beyond the three spatial axes - the "W" (or the angle, in axis-angle's case) - which controls the actual amount of rotation, separate from the axis it's rotating around. This node sets the object's rotation-lock flag specifically for that W component, preventing it from being edited or accidentally driven by whatever's manipulating the object's rotation.

Why would you want that in an avatar rig? Locking specific rotation channels is a common rigging-constraint technique - it stops a control or a driver from accidentally introducing rotation on an axis (or component) it shouldn't touch, which is exactly the kind of accidental artifact that shows up as unwanted pinching, twisting, or scale-like distortion in a deforming rig. If part of your avatar's rig only needs the axis component of a quaternion rotation to move (say, a constrained joint), locking W keeps the magnitude from drifting unexpectedly.

There's one thing to set:

  • value - a boolean. true locks the W/angle component; false (the default) leaves it free.

Output is the same BPY_OBJ, with the lock flag applied.

Practical note: this only does something meaningful if the object's rotation mode is actually Quaternion or Axis-Angle - under the default Euler XYZ rotation mode, there's no W component for this lock to apply to. If you're not sure what rotation mode an upstream object is in, this is worth checking before assuming the lock is doing anything.

Installing it: no standalone install - this ships as part of the full Avatar Graph pack. Easiest route is ComfyUI Manager, searching "Avatar Graph" or avatar-graph-comfyui. Manual install: cd ComfyUI/custom_nodes, then git clone https://github.com/avatechai/avatar-graph-comfyui, cd into it, pip install -r requirements.txt, restart ComfyUI.

The install snag that actually breaks things: Avatar Graph needs Python 3.10.x specifically, because its bpy dependency - Blender's Python API packaged as a standalone library - only ships wheels for that exact version. On a newer Python, which is what most current ComfyUI installs default to, the install just fails. The README's own fix is a dedicated environment: conda create --name comfyui python=3.10, activate it, install ComfyUI's requirements first, then this pack's. If you want the live avatar preview inside Avatech's own web editor, also launch with --enable-cors-header (Mac users add --force-fp16); without it, rig constraints and everything else still work, you just export .glb/.gltf and view results in Blender instead of the live in-browser preview.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
valueoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ