Nodes/Avatar Graph/Mesh Loopcut
ComfyUI Node

Mesh Loopcut

Adding edge loops by index instead of by mouse drag

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Loopcut
  • BPY_OBJ
  • mesh_select_mode_init
  • BPY_OBJ
number_cuts1
smoothness0.00
falloff
object_index-1
edge_index-1

If you've used Blender at all, you know Ctrl+R - hover over a ring of quads, scroll to pick how many parallel cuts, click to place them. This node is that same operation, minus the mouse: since there's no viewport to hover in during a scripted run, you tell it exactly which edge to cut through by index instead.

How it works

This wraps Blender's mesh.loopcut operator. Given a ring of connected quads, it slices one or more new edge loops running perpendicular across that ring, evenly spaced by default. The interactive version relies entirely on where your mouse is hovering to pick the starting edge; this scripted version needs that supplied explicitly through edge_index instead - which is the detail that trips people up, since it's easy to leave that at its default and get a cut that doesn't land where expected.

The inputs and outputs that matter

  • BPY_OBJ (optional) - the mesh to cut.
  • number_cuts (default 1) - how many parallel loops to add at once across the same ring.
  • edge_index (default -1) - the specific edge that defines which ring gets cut. The default -1 is Blender's "nothing specified" sentinel - normally filled in by wherever your mouse is hovering in the interactive tool. In a headless call, leaving it at -1 doesn't reliably pick a sensible ring on its own; set it to the index of an edge that actually belongs to the ring you want cut.
  • smoothness (default 0) and falloff - let the cut bow away from a perfectly straight line instead of sitting flat, curving along the surface according to the chosen falloff shape (SMOOTH, SPHERE, ROOT, INVERSE_SQUARE, SHARP, LINEAR). Leave smoothness at 0 for a straight, uncurved cut - the common case.
  • object_index (default -1) and mesh_select_mode_init - lower-level context the operator needs internally (which object, and the vertex/edge/face select-mode state to run in). Leave at default unless a cut is silently failing and you've ruled out edge_index as the cause.

Output is a single BPY_OBJ.

How to install it

ComfyUI Manager: search "Avatar Graph" and install. 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 - a 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

No cut appears, or it lands somewhere unexpected. Check edge_index first - left at the default -1, this node has no mouse hover to fall back on the way the interactive tool does, so it needs a real edge index that belongs to the ring you actually want cut.

Cut is straight when you wanted it to follow the surface's curve, or vice versa. That's smoothness and falloff - raise smoothness above 0 and pick a falloff shape to bow the cut instead of keeping it flat.

Multiple cuts bunch up unevenly. number_cuts spaces its cuts evenly across the ring by default; an uneven result usually means the underlying quad ring itself isn't evenly proportioned, not a setting on this node.

Categoryblender

Inputs (7)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
number_cutsoptINT11–1000000
smoothnessoptFLOAT0.00-1000–1000
falloffoptCOMBO6 options: SMOOTH, SPHERE, ROOT, INVERSE_SQUARE, SHARP, LINEAR
object_indexoptINT-1-1–2147483647
edge_indexoptINT-1-1–2147483647
mesh_select_mode_initoptB_BOOLEAN3

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ