Nodes/Avatar Graph/Object Shape Key Mirror
ComfyUI Node

Object Shape Key Mirror

Build one side, get the other for free

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Shape Key Mirror
  • BPY_OBJ
  • BPY_OBJ
use_topologyfalse

Symmetric faces are the easy part of rigging - you sculpt a blink on the left eye and you want the same shape mirrored to the right, not sculpted twice. Object Shape Key Mirror wraps bpy.ops.object.shape_key_mirror and copies the active shape key's deformation across the object's local X axis.

In Blender this is the "Mirror Shape Key" button in the shape keys panel, and it's the difference between a face rig that takes you an evening and one that takes a week. Shape keys only exist as full-mesh deformations - there's no "left half only" - so mirroring is how you take your one-sided work and duplicate it symmetrically.

How it works

Auto-generated wrapper, standard for the pack: your incoming BPY_OBJ becomes the active object, the operator runs on the active shape key, and the same object passes back out. In Blender, mirroring works by flipping vertex offsets across X, and it can use the object's vertex groups to control which vertices get affected.

The inputs that matter

  • BPY_OBJ - the mesh with the shape key to mirror.
  • use_topology - boolean, default false. When off, Blender mirrors by vertex coordinates: each vertex's offset is flipped to the matching X position. When on, it mirrors by mesh topology, which matters when your mesh isn't perfectly symmetric in geometry - say a mouth that's not exactly centered. Topology mirror needs a vertex group marking the centerline to work properly; if the mesh is clean and symmetric, leave it off.

Output is one BPY_OBJ, unchanged.

Install

Standard Avatar Graph install. ComfyUI Manager: search Avatar Graph, install, restart. Manual:

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

The pack pins bpy==3.6.0, so Python 3.10 is effectively required (conda env recommended), and the first launch downloads the ~2.5 GB SAM checkpoint plus MediaPipe landmarkers.

Common issues

Mirroring a key that isn't the one you think it is. Like ShapeKeyClear, this node operates on the active shape key, so if a previous node changed which key is active, you'll mirror the wrong deformation. Sequence your graph so the right key is active.

The other classic: mirroring a lopsided key on a lopsided mesh and getting garbage, because coordinate-based mirroring assumes the object's local X axis is the symmetry plane. If the mesh wasn't built centered on X, results look scrambled - that's when use_topology plus a centerline vertex group is your fix. And again: mutations persist in the shared Blender scene, so a mirrored key stays mirrored on subsequent runs.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
use_topologyoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ