andyp123 / blender_io_mesh_qmap

Quake .map to Blender importer
GNU General Public License v3.0
36 stars 6 forks source link

Clean up mesh on import #4

Closed andyp123 closed 5 years ago

andyp123 commented 5 years ago

The imported mesh is triangulated and has floating vertices (perhaps a bug in Blender bmesh convex function?) so ideally should be cleaned up during import.

andyp123 commented 5 years ago

convex_hull operator should not leave loose vertices, but does for some reason. Also, using merge vertices does not remove all the loose vertices. The only way to remove them was to do a not is_manifold check on each vertex and then run delete on them.

Comment in script that I removed:

bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=0.01)

# TODO: convex_hull should not leave floating verts, also, bpy.ops.mesh.convex_hull
# has more options, but requires edit mesh context and selection. Maybe report this?
# Perhaps try to fix floating verts using v.is_manifold to check for them

It would be nice to remove triangulated faces, but there is no bmesh operator, and the mesh operator is a usermode operator, so integrating it into the script would require context switches and selection, which would drastically slow down import speed, so I'm going to leave that for now.