Nodes/Avatar Graph/Object Call User Remap
ComfyUI Node

Object Call User Remap

Swap one Blender datablock for another everywhere

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Call User Remap
  • BPY_OBJ
  • new_id
  • BPY_OBJ

This is the most consequential node in this particular corner of Avatar Graph, and it's worth treating with a bit of caution. It wraps Blender's ID.user_remap(new_id) - a global find-and-replace for datablocks. Every place in the current file that references this object gets repointed to new_id instead. Modifiers, constraints, parenting, collections, drivers - all of it, in one call.

Where it fits in Avatar Graph

Avatar Graph (avatechai/avatar-graph-comfyui) is the pack behind this - it rigs a flat character image into an interactive avatar via segmentation, mesh layers, and a "Shape Flow" runtime graph, exported through Avatar Main Output. The README documents a handful of nodes for that pipeline; this isn't one of them. It's part of the larger, undocumented set the pack generates by exposing most of Blender's own Object/ID API directly as nodes - deep scripting territory, not something the standard rigging tutorial ever points you at.

How it works

Normally, swapping what an object "is" in a Blender file means manually re-pointing every reference one at a time - every modifier, every constraint target, every collection membership. user_remap() does that in bulk: hand it a replacement object, and everything that used to reference the original now references the replacement instead, in a single atomic operation. It's the same mechanism Blender's own UI uses for things like "Make Single User" and library-override resolution under the hood.

Inputs and outputs

  • BPY_OBJ (optional) - the object being replaced. Unwired, it defaults to whatever's currently active.
  • new_id (optional, default null) - the replacement datablock. No widget; wire in whatever reference you want everything repointed to.

Output: BPY_OBJ. Note it's still typed as the object socket, passed through for chaining - worth being deliberate about which object (old or new) you actually expect downstream nodes to keep operating on after a remap, since the semantics of "this object" just changed underneath the rest of your graph.

How to install it

Via ComfyUI Manager: search "avatar-graph-comfyui", install, restart. Manually:

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 needs Python 3.10.x specifically, because bpy is pinned to it. Windows gets a prebuilt Python 3.10 ComfyUI zip from the README; on Mac/Linux, use a dedicated conda env (conda create --name comfyui python=3.10). Restart with --enable-cors-header for the live avatar preview to work with editor.avatech.ai - exports work without it either way.

Common issues & troubleshooting

Install issues almost always trace back to the Python version - a 3.11/3.12 environment (common on newer ComfyUI setups) simply can't load bpy. There's also a documented case of Avatar Graph leaving a ComfyUI Desktop install badly broken after installation (an oversized logo, an unwanted audio-permission popup) that a full reinstall didn't fully fix - worth trialing in a throwaway ComfyUI copy first if you're not already sandboxed on 3.10.

For this node specifically: because a remap touches every reference to the object in the file, not just the ones inside your graph, the failure mode is rarely a crash - it's something elsewhere in the scene (a constraint, a parent relationship, another part of your rig) quietly starting to point at the wrong object after the fact. If your Avatar Graph rig behaves strangely after a run that included a remap, check what else in the file was referencing the original object before you added this node.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
new_idoptnew_id

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ