ComfyUI Node

Mesh Spin

Lathe a profile into a revolved shape

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Spin
  • BPY_OBJ
  • center
  • axis
  • BPY_OBJ
steps12
duplifalse
angle1.57
use_auto_mergetrue
use_normal_flipfalse

Blender's lathe tool, exposed as a node. It wraps bpy.ops.mesh.spin, part of Avatar Graph, the pack that runs actual Blender inside ComfyUI's process (via the bpy Python package) to build interactive 2D-to-3D avatars, auto-generating a node for every mesh operator Blender has. Feed it a simple profile - a single edge, a small curve - and it spins duplicated copies of that profile around an axis, stitching each step to the last, the same way a real lathe turns a flat cross-section into a bowl or a vase.

How it works

Selected geometry gets rotated around a center point and axis, in a set number of steps, over a given angle, with each step's copy connected to the previous one. Spin a straight vertical edge a full 360° around a vertical axis and you get a cylinder. Spin a curved profile instead and you get a vase or a rounded object with real rotational symmetry - something that would take a lot of manual extrude-and-scale steps to build by hand.

Inputs and output

  • BPY_OBJ - the mesh coming in, with the profile geometry already selected.
  • steps (default 12) - how many segments the spin divides into. Higher gives a smoother curve; lower gives a more faceted, low-poly look.
  • angle (default 1.5708 radians, which is 90°) - how far around the spin travels. This is the field to watch: the default is a quarter turn, not a full revolution, so if you expected a closed shape and got a quarter-pipe instead, this is what to change (a full turn is roughly 6.2832 radians, i.e. 2π).
  • dupli (default false) - creates disconnected duplicate copies at each step instead of a stitched, continuous surface.
  • use_auto_merge (default true) - welds the final step back onto the first if the spin closes into a full loop, avoiding duplicate overlapping vertices at the seam.
  • use_normal_flip (default false) - flips the resulting faces' normals if the revolve comes out facing the wrong way.
  • center and axis (both B_VECTOR3) - the pivot point and rotation direction for the spin. These need real, deliberate values - a zero-vector axis has no defined rotation direction to spin around.

Output is a single BPY_OBJ, the revolved geometry.

Installing it

ComfyUI Manager: search "avatar-graph-comfyui", install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/avatechai/avatar-graph-comfyui, then cd avatar-graph-comfyui && python -m pip install -r requirements.txt, then restart.

Python 3.10.x is the requirement to nail down first - the bpy package this pack is built on needs that exact minor version, and the README recommends a dedicated conda environment on macOS/Linux (conda create --name comfyui python=3.10) rather than trusting an existing Python install. Windows users get a prebuilt ComfyUI + Python 3.10 zip linked in the README to unzip over their install before adding the pack via Manager. Restart with --enable-cors-header (macOS also wants --force-fp16) for the live 3D preview.

Common issues

Rule out the Python version first if this pack's nodes aren't loading. Beyond that, the two things that trip people up on this node specifically: angle defaulting to a 90° quarter-turn rather than a closed 360° revolution, and axis needing a real, non-zero direction - a spin without a defined axis simply has nothing to rotate around and won't produce a meaningful result. If a closed shape is coming out with a visible seam or duplicate vertices, check use_auto_merge is actually on.

Categoryblender

Inputs (8)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
stepsoptINT120–1000000
duplioptBOOLEANfalse
angleoptFLOAT1.57-999999995904–999999995904
use_auto_mergeoptBOOLEANtrue
use_normal_flipoptBOOLEANfalse
centeroptB_VECTOR3
axisoptB_VECTOR3

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ