Nodes/Avatar Graph/Object Set Show In Front
ComfyUI Node

Object Set Show In Front

Make a part draw through everything else in the viewport

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Set Show In Front
  • BPY_OBJ
  • BPY_OBJ
valuefalse

Object Set Show In Front toggles show_in_front, the Blender viewport flag that makes an object render on top of everything else regardless of depth - the same trick Blender uses to keep armatures visible through a mesh. If your avatar's rig is buried inside its own head and you can't see what you're doing, this is the node that puts the important part in front of the geometry.

How it works

Auto-generated setter from bpy.types.Object's properties: setattr(object, "show_in_front", value) on the embedded bpy instance, returning the same BPY_OBJ. The value input is a BOOLEAN with default false; set true and the object's shaded form draws over any geometry in front of it in the viewport.

Use cases, in order of commonness: keeping an armature or empties visible through the mesh while you wire parenting and shape keys; making a specific mesh layer (say, an eyelid you're adjusting) stand out from the rest of the face; and generally fighting the "I can't click what I need because something's in the way" problem. It's Blender's x-ray-ish convenience flag, and it behaves exactly like you'd hope - no z-fighting, just constant on-top drawing.

The inputs

  • BPY_OBJ - the object from Create Mesh Layer, a Mesh_ primitive, or an Object_ op.
  • value - boolean, default false.

Output: the same BPY_OBJ, ready for the next setter.

Install & gotchas

Ships inside 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, which requires Python 3.10 - there's no wheel for 3.11+, so the whole pack fails to import on newer environments. A conda env with python=3.10 is the README's fix. First launch downloads a ~2.5 GB SAM model plus mediapipe landmarker files.

Where people get confused: show_in_front is viewport-only and never affects the render or export - that's a feature (your avatar renders correctly), but it surprises people who expect the flag to carry through. Also, don't confuse it with in_front styling in the editor overlay; this is strictly the Blender viewport flag. Keep the setter downstream of object creation since the bpy scene resets every queue run, and remember the live preview needs --enable-cors-header - without it you still get exports via Save File on Avatar Main Output, just no realtime editor.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
valueoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ