I’m not exactly sure how this bug percolated to the top of my list, but it did. And, I’ve been thinking about ways to do this without a whole bunch of book keeping in extra arrays to preserve the vertex colors (VCs).
This problem actually impacts more than just VCs, it will have an impact on the result where any of the meshes in the input set don’t have a particular component. So if, for instance, you used a mesh that you imported via STL (which has nothing but vertexes, faces and normals) to split a mesh with texture coordinates (TCs) (and/or VCs) you’d lose them in the final result.
Here’s a potential work around for V5 (this also ought to work in V6 but I could automate this in the code there so the workaround would not be necessary). Can someone please try this and see if it would work for you? If it does, let me know and I’ll get it into V6.
In a paint program:
- Make a .jpg file that is some sort of neutral color like a light gray. (This will be the color of the portion of the resulting mesh whose input mesh did not initially have VCs. So, if you use a boolean command, instead of split, you may want to use a color closer to the mesh that already has VCs.)
2) Use List to check out any mesh that you’re not confident already has VCs (any single mesh missing them in the input set will prevent the entire result from having them).
3) Any mesh that is missing vertex colors, assign the .jpg you created in 1) as a texture.
3) If it is also missing TCs, you’ll need to create them first with the texture mapping stuff.
4) Run the command ComputeVertexColors (this uses the combination of the TCs and the .jpg to cook up the VCs).
5) At this point you can remove the texture if you wish, it no longer has a purpose.
6) Now perform the boolean operation. It should preserve the VCs.
Note: This does not help Explode (it must be a different problem since it only takes a single mesh as input) but I’ll look into that in V6 if the boolean steps listed above work for you in V5. Please let me know.