Nodes/Avatar Graph/Mesh Knife Tool
ComfyUI Node

Mesh Knife Tool

Blender's interactive cutting tool exposed as a node in Avatar Graph

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Knife Tool
  • BPY_OBJ
  • BPY_OBJ
use_occlude_geometrytrue
only_selectedfalse
xraytrue
visible_measurements
angle_snapping
angle_snapping_increment0.52
wait_for_inputtrue

This is the oddest node in Avatar Graph's Blender set, and worth understanding before you try to use it: Mesh Knife Tool wraps Blender's Knife tool - the one you normally drive live with the mouse, clicking through faces to cut new edges into a mesh interactively. Every parameter exposed here configures how that interactive session behaves, not what it cuts, because the cut path itself is normally something a human traces in the viewport in real time.

How it works

Blender's mesh.knife_tool operator is a modal tool - it takes over input while running, waiting for click-by-click mouse events that define the cut. That's fundamentally different from most of this pack's nodes, which are one-shot operators that run to completion and hand back a result. Exposing this in a headless, node-graph context is genuinely unusual, and how it resolves without a live mouse feeding it points is not something the schema itself makes clear. If you're reaching for this node, know going in that it's exposing settings for an interactive tool the pack's own workflow templates don't demonstrate using - treat it as experimental rather than a reliable step in an automated pipeline.

The inputs and outputs that matter

  • BPY_OBJ - the mesh to cut into.
  • use_occlude_geometry (default true) - whether the knife respects hidden/occluded geometry (won't cut through to the far side of the mesh) or ignores occlusion.
  • only_selected (default false) - restricts cutting to already-selected geometry rather than the whole mesh.
  • xray (default true) - see-through mode, letting the cut register on geometry behind what's facing you.
  • visible_measurements - NONE, BOTH, DISTANCE, or ANGLE; controls the on-screen HUD showing cut length/angle during an interactive session.
  • angle_snapping - NONE, SCREEN, or RELATIVE; snapping behavior for cut angles.
  • angle_snapping_increment (default ~30°, in radians) - the snap increment when angle snapping is active.
  • wait_for_input (default true) - whether the operator waits for interactive input before proceeding, which is the setting most likely to matter for whether this behaves usefully at all in a non-interactive graph.

Output is a single BPY_OBJ.

How to install it

ComfyUI Manager, search "Avatar Graph" and install, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui

then pip install -r requirements.txt and restart. Needs Blender's bpy module, pinned to Python 3.10.x - dedicated conda environment on macOS/Linux, or Avatech's prebuilt Python-3.10 ComfyUI zip on Windows with the pack installed through Manager afterward.

Common issues & troubleshooting

If a run using this node hangs or times out rather than completing, wait_for_input defaulting to true is the first thing to try changing - a modal operator waiting on mouse input that never arrives in a headless execution context is a plausible explanation for a stall, though this pack's README doesn't document scripted, headless use of the knife tool specifically, so treat this as an educated starting point for debugging rather than a confirmed fix. If you need a deterministic cut in an automated pipeline, an operator built for scripted use - Mesh Fill Holes, Mesh Dissolve Faces, or bisecting with a defined plane elsewhere in Blender's toolset - is the more reliable choice than trying to script the interactive knife.

Categoryblender

Inputs (8)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
use_occlude_geometryoptBOOLEANtrue
only_selectedoptBOOLEANfalse
xrayoptBOOLEANtrue
visible_measurementsoptCOMBO4 options: NONE, BOTH, DISTANCE, ANGLE
angle_snappingoptCOMBO3 options: NONE, SCREEN, RELATIVE
angle_snapping_incrementoptFLOAT0.520–3.141592741012573
wait_for_inputoptBOOLEANtrue

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ