Nodes/Avatar Graph/Object Instance Offset To Cursor
ComfyUI Node

Object Instance Offset To Cursor

The other half of Blender's instance-offset pair

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Instance Offset To Cursor
  • BPY_OBJ
  • BPY_OBJ

Object_InstanceOffsetToCursor is the mirror image of Object_InstanceOffsetFromCursor, and I'll say the same thing I said there: this is a thin node from the Avatar Graph pack's auto-generated sweep of Blender operators, and you'll likely never need it unless you're deliberately doing instancing inside a graph.

It wraps bpy.ops.object.instance_offset_to_cursor() - the "To Cursor" entry in Blender's Object > Set Offset menu. Blender's instancing repeats an object, and the instance offset decides where those repeats sit relative to the object's origin. "To Cursor" anchors that offset at the 3D cursor - effectively re-anchoring where the instances project from, relative to the cursor's location. It's the sibling of "From Cursor," and the two differ in which direction the offset is computed.

How it works

Feed a BPY_OBJ in, it sets that object active in the embedded Blender scene, runs the operator against the current 3D cursor position, and returns the same object untouched. No other inputs - the operator reads everything it needs from scene state. The whole thing is deterministic within a single run, which is the pack's general vibe: the scene resets between executions, so this always operates on the scene your graph just built.

Realistically, where would this show up in an avatar workflow? Somewhere in a template that uses instancing for repeated decorative elements and wants their offset anchored to a cursor positioned earlier in the graph. If you're building a straightforward rigged character from segmented layers - which is the pack's bread and butter - you can safely ignore it.

Inputs and outputs

  • BPY_OBJ - the object whose instance offset you're setting; returned unchanged.
  • BPY_OBJ output - pass-through.

Installing it

Ships in Avatar Graph (avatechai/avatar-graph-comfyui). ComfyUI Manager: search "Avatar Graph". 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

Same pack-level requirements as everything else here: bpy==3.6.0 needs Python 3.10.x, and first launch auto-downloads the SAM ViT-H checkpoint (~2.5 GB) and MediaPipe models. If nodes are missing, check your Python before anything else.

Common issues

The main failure mode is confusion with its twin: Object_InstanceOffsetFromCursor does the opposite anchoring, and they're easy to grab the wrong one from the node list. Beyond that, there's not much to trip on - the operator is simple. If you're seeing errors, it's the environment (Python version or bpy install), not this node's logic. And note the pack is officially a work-in-progress per its README, so esoteric wrappers like this can change or disappear between releases.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ