Fastest way to collapse faces while preserving vertex colors?

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()
1 Like

Geometry nodes is the solution. It wasn’t working for me because a step in my process has me bake the vertex colors to the quads but with the ‘Use modifier during render’ turned on by default for my ‘Quads to Vertices’ geometry nodes modifier, it wasn’t actually baking any colors. Here’s the tree in case anyone needs this in the future:

2 Likes