Mesh Shortest Path Select
Connect two selected points with the shortest route
- BPY_OBJ
- BPY_OBJ
Give it two points that are already selected, and it fills in the shortest connected route between them across the mesh's actual surface - not a straight line through 3D space, real topology-aware pathfinding. It wraps Blender's real bpy.ops.mesh.shortest_path_select operator, 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.
How it works, and how it differs from its sibling
This node needs no explicit target index - it works off whichever elements are currently active/selected as its two endpoints and finds the shortest route between them. Its sibling, Mesh Shortest Path Pick, is for the opposite situation: when you know a specific target element by index rather than having both ends already selected. Use this one whenever you've got two points selected and just want the connecting path filled in.
Inputs and output
BPY_OBJ- the mesh coming in, with (at minimum) two distinct elements already selected or active to serve as the path's endpoints.edge_mode-SELECT,SEAM,SHARP,CREASE,BEVEL, orFREESTYLE.SELECTjust selects the path; the others mark it with that property in the same pass - useful if you're, say, tracing a seam for UV unwrapping directly along the shortest route between two points instead of clicking every edge in between.use_face_step(defaultfalse) - lets the path cut across face interiors instead of sticking strictly to existing edges.use_topology_distance(defaultfalse) - weighs the route by connectivity hop count rather than actual physical edge length. Off by default, which means a locally dense patch of geometry can pull the "shortest" path into a longer-looking detour, since it's measuring real distance, not step count.use_fill(defaultfalse) - fills the path with new connecting geometry rather than only selecting what already exists.skip,nth,offset- the same checker-style thinning pattern as Mesh Select Nth, applied along the resulting path.
Output is a single BPY_OBJ, path selected (and optionally marked).
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. This node needs two genuinely distinct elements already selected to have anything to connect - run it on a single-element or empty selection and there's nothing to path between. If the resulting path looks longer or more roundabout than you'd expect for a "shortest" route, check use_topology_distance: without it, Blender is weighing real edge length, which can wind through a dense area rather than take the fewest hops - turning it on switches to a pure hop-count shortest path instead.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| edge_modeopt | COMBO | 6 options: SELECT, SEAM, SHARP, CREASE, BEVEL, FREESTYLE | |
| use_face_stepopt | BOOLEAN | false | — |
| use_topology_distanceopt | BOOLEAN | false | — |
| use_fillopt | BOOLEAN | false | — |
| skipopt | INT | 00–2147483647 | — |
| nthopt | INT | 11–2147483647 | — |
| offsetopt | INT | 0-2147483648–2147483647 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |