Mesh Shortest Path Pick
Select a path to a specific element by index
- BPY_OBJ
- BPY_OBJ
In Blender's viewport, this is what happens when you Ctrl-click a second element: Blender draws the shortest connected path from your active element to whatever you just clicked. There's no mouse in a headless ComfyUI graph, so this node wraps Blender's real bpy.ops.mesh.shortest_path_pick operator and exposes that "whatever you clicked" as an explicit index parameter instead. It's 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 a specific target: the numeric index of the element you want the path to reach. Its sibling, Mesh Shortest Path Select, works differently - it connects two elements that are already both selected, with no index required. Pick this one when you know exactly which element (by index) you're pathing toward; reach for Select instead when you've already got both endpoints selected and just want the connecting route.
Inputs and output
BPY_OBJ- the mesh coming in, with an active element already established as the path's starting point.edge_mode-SELECT,SEAM,SHARP,CREASE,BEVEL, orFREESTYLE.SELECTjust selects the path; the others mark the resulting path with that property in the same step (tag it as a seam for UV unwrapping, mark it sharp for shading, and so on).use_face_step(defaultfalse) - lets the path cross face interiors instead of sticking strictly to existing edges.use_topology_distance(defaultfalse) - weighs the path by hop count across the mesh's connectivity rather than actual physical edge length.use_fill(defaultfalse) - fills the path with connecting geometry rather than only selecting what's already there.skip,nth,offset- the same checker-style thinning pattern as Mesh Select Nth, applied along the resulting path.index(default-1) - the target element's index. This is the field that replaces the mouse click.
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. On this node specifically, index needs to correspond to a real, currently valid element index on the mesh - there's no picker UI here to catch a mistake before it runs, so an out-of-range or stale index (especially from a mesh that's changed shape between when you determined the index and when this node actually executes) surfaces as a straightforward operator failure. If you don't have a specific index in mind and just want to connect two points you've already selected, Mesh Shortest Path Select is the node you actually want.
Inputs (9)
| 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 | — |
| indexopt | INT | -1-1–2147483647 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |