Nodes/Avatar Graph/Mesh Merge
ComfyUI Node

Mesh Merge

Welding selected vertices together, on your terms

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Merge
  • BPY_OBJ
  • BPY_OBJ
type
uvsfalse

Boolean cuts, fills, and joins in this pack's mesh pipeline all have a tendency to leave duplicate or near-duplicate vertices lying around - two points sitting in nearly the same spot that should really be one. This node welds selected vertices together, and unlike an automatic "remove doubles by distance" pass, you control exactly which verts get merged and by what rule.

How it works

It wraps Blender's mesh.merge operator. Given a vertex selection, it collapses them into fewer points according to type - not a distance threshold, but an explicit rule about where the merged point ends up. This is the deliberate, rule-based counterpart to a nearby-vertex cleanup pass: you've already selected exactly which vertices should become one, and this decides the resulting position.

The inputs and outputs that matter

  • BPY_OBJ (optional) - the mesh, with the vertices to merge already selected.
  • type - the merge rule: CENTER (average position of all selected verts), CURSOR (snaps to the 3D cursor's location), COLLAPSE (each separately-connected cluster of selected verts collapses to its own point, useful for merging several disconnected pairs at once in a single call), FIRST or LAST (snaps to the first or most-recently-selected/active vertex). CENTER is the common default for a simple weld; COLLAPSE is what you want when merging multiple unrelated clusters in one pass.
  • uvs (default false) - when on, interpolates the UV coordinates of the merged vertices instead of arbitrarily keeping one; worth enabling if the mesh has already been unwrapped and you don't want a visible texture seam appearing at the merge point.

Output is a single BPY_OBJ, with the selected vertices reduced according to type.

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

Merged point ends up somewhere unexpected. That's almost always type - CENTER averages, FIRST/LAST snap to a specific one of the selected verts, and CURSOR ignores the selection's position entirely in favor of wherever the 3D cursor happens to sit. If the result looks arbitrary, double-check which rule is actually set.

Merging several separate duplicate-vertex pairs at once collapses them all into a single point instead of each pair merging independently. Switch type to COLLAPSE - CENTER, FIRST, and LAST treat the whole selection as one group to merge into one point, while COLLAPSE respects connectivity and merges each cluster on its own.

A visible texture seam appears right at the merge point on an already-unwrapped mesh. Turn on uvs so the merge interpolates UV coordinates instead of discarding all but one vertex's UV data.

Categoryblender

Inputs (3)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
typeoptCOMBO5 options: CENTER, CURSOR, COLLAPSE, FIRST, LAST
uvsoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ