My problem involves pro-gen meshes that I have no part in making and cannot make any changes to, but I need to be able to manipulate each separate piece of the mesh. The meshes do not have any "submeshes" but are made up of multiple parts not connected by any edges.
Using mesh.GetSubmesh(index) and related scripting does not work since the pieces are not explicitly "submeshes" in the way Unity expects them to be.
Is my only hope going to be to iterate over every vert and check if it shares edges with any other verts and group them?
Example, if I had blobs like this (black) that were all one mesh, I want to be able to group them (red):
n
shares any verts with trianglen - 1
, and if so, put them in the same bucket. When you come across a tri that has verts in multiple buckets, union/merge the buckets. (Should technically work for any triangle order, but very inefficient if not in strips). \$\endgroup\$