I have an object that is a “soup” of quads that I need to turn into vertices. It needs to preserve vertex colors like the script below does. Geometry nodes is way faster but it loses the vertex colors and I haven’t figured out a way to keep them(if possible).
This script takes about 3 minutes to collapse 13k faces.
import bpy
import bmesh
bm = bmesh.from_edit_mesh(bpy.context.edit_object.data)
for face in bm.faces:
bmesh.ops.collapse(bm, edges=face.edges, uvs=True)
bmesh.update_edit_mesh(bpy.context.edit_object.data)
bm.free()