Nodes/Avatar Graph/Set Shape Key Value
ComfyUI Node

Set Shape Key Value

Drive an existing shape key by name

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Set Shape Key Value
  • BPY_OBJ
  • BPY_OBJ
shape_key_namemy_shape_key
value0.00

This one sits closer to the actual point of Avatar Graph than most of its Mesh_* neighbors. The pack's whole pitch is rigging shape-key-driven avatars - blink, lip-sync, expressions - and once a shape key exists, you need some way to dial how much of it is applied. This node is that dial.

Why it's different from the rest of this family

Almost every other node in this pack is a direct, auto-generated wrap of a named Blender operator (bpy.ops.mesh.*). This one isn't - there's no set_shape_key_value operator in Blender's own API. It reads as one of Avatar Graph's own hand-written convenience nodes, doing the equivalent of reaching into mesh.shape_keys.key_blocks[name].value directly and setting it, rather than routing through an Edit Mode operator. It's the natural counterpart to Mesh Modify Shape Key: that node sculpts a shape key's actual deformation; this one just sets how much of an already-existing shape key is currently applied.

How it works

A shape key's value ranges from 0 (fully off, base shape) to 1 (fully applied). Set it by name and by number, and the mesh deforms accordingly - this is the static, manual version of what Avatech's runtime "Shape Flow" graph does dynamically, driving that same value in real time off things like blink timers or lip-sync audio. Here, you're setting a fixed snapshot: useful for previews, test renders, or baking a specific expression.

Inputs and output

  • BPY_OBJ - the mesh coming in, which needs to already have the target shape key defined on it (this node sets a value, it doesn't create the shape).
  • shape_key_name (default "my_shape_key") - the exact name of the shape key to drive. It's a plain text field, not a dropdown - there's no validation against what actually exists on the mesh until it hits Blender.
  • value (default 0, range 01, step 0.01) - how much of that shape key to apply.

Output is a single BPY_OBJ, shape key value updated.

Installing it

ComfyUI Manager: search "avatar-graph-comfyui", install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/avatechai/avatar-graph-comfyui, then cd avatar-graph-comfyui && python -m pip install -r requirements.txt, then restart.

Python 3.10.x is the requirement to nail down first - the bpy package this pack is built on needs that exact minor version, and the README recommends a dedicated conda environment on macOS/Linux (conda create --name comfyui python=3.10) rather than trusting an existing Python install. Windows users get a prebuilt ComfyUI + Python 3.10 zip linked in the README to unzip over their install before adding the pack via Manager. Restart with --enable-cors-header (macOS also wants --force-fp16) for the live 3D preview - genuinely worth having while tuning shape keys, since you want to actually see the blink or mouth shape happen rather than just trust the number.

Common issues

Rule out the Python version first if this pack's nodes aren't loading. The most likely trip-up on this node specifically: shape_key_name has to be an exact match, character-for-character, for a shape key that already exists on the mesh - no fuzzy matching, no dropdown to sanity-check against. Double-check the exact name used wherever the shape key was actually created (Mesh Modify Shape Key, or wherever it originated) if this node seems to do nothing. And value is clamped to 01 here - if you need an exaggerated, overshot blend beyond 100%, this isn't the node for that; Mesh Blend From Shape allows values well outside that range.

Categoryblender

Inputs (3)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
shape_key_nameoptSTRINGmy_shape_key
valueoptFLOAT0.000–1

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ