Nodes/Avatar Graph/Object Set Type
ComfyUI Node

Object Set Type

Set (or mis-set) an object's type

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Set Type
  • BPY_OBJ
  • BPY_OBJ
valueMESH

type is the Blender property that says what an object is - MESH, EMPTY, ARMATURE, CAMERA, LIGHT, and so on. Object Set Type is the auto-generated setter for it, defaulting to "MESH". This is the one setter in the family to treat with real respect, because changing an object's type at runtime is exactly the kind of thing that either does nothing useful or wrecks the object.

How it works

Generated from bpy.types.Object's properties, this node runs setattr(object, "type", value) on the embedded bpy instance and returns the same BPY_OBJ. The value input is a STRING defaulting to "MESH".

Here's the thing Blender doesn't sugarcoat: type is a derived property - an object's data (the mesh, the empty's image, the camera lens) determines its type, and you don't generally reassign it like you'd set a name. Writing EMPTY onto a mesh object doesn't convert the mesh into an empty; it can leave the object in an inconsistent state where the viewport doesn't know how to draw it. The realistic use for this node is essentially zero in a normal avatar graph, where every layer is a mesh and the pack's creation nodes set the type correctly for you. If you find yourself reaching for it, ask whether you actually meant to create a different kind of object upstream instead.

The inputs

  • BPY_OBJ - the object whose type you're (re)setting.
  • value - object type string, default "MESH".

Output: the same BPY_OBJ.

Install & gotchas

Part of the Avatar Graph pack:

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

Or ComfyUI Manager → "Avatar Graph". The pack pins bpy==3.6.0, needing Python 3.10 - bpy has no wheel for 3.11+, so the pack won't import on newer environments (conda python=3.10 per the README). First launch downloads a ~2.5 GB SAM model plus mediapipe landmarker files.

The genuine warning: this is the ObjectSet_* node most likely to break something, and the pack auto-generates it precisely because the property list is exhaustive, not because it's useful. Leave it at the default MESH and don't chain it into your rig. If you actually need a camera, light, or empty, create it with the right Object_ *add node in the first place - that's the supported path. Everything else about the setters still applies: wire downstream of creation, scene resets each run, and --enable-cors-header for the live preview.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
valueoptSTRINGMESH

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ