0

I need to vary the vertex colors of a mesh using simulation data (generated using a tool named Paraview).

I imported the mesh and vertex colors in an X3D file, but the vertex colors correspond to one instant in the simulation only.

I'd like to load the vertex colors for the other simulation instants as well (e.g., 3 s, 6 s, 9 s, etc), assign them to the mesh at different keyframes, and animate the result.

I've tried importing an X3D file for each instant (obviously very cumbersome), but even then I struggle to transfer the vertex colors from one imported mesh to another. I did this just to get some results, but ultimately I'd like to have just one object with different vertex color sets that I can assign at different times in the Blender animation.

Does anyone know how I can do this (preferably without loading extra meshes, like I've tried)?

Thanks!

  • Do the different instances of the object share mesh data, like do they keep the vertices in the same local positions and stuff? – Linguini Sep 30 '18 at 22:04
  • Exact same mesh. The only thing that changes is vertex color In the future, maybe vertex coordinates will change also (to capture deformations), but even then the mesh topology should remain the same. –  Oct 01 '18 at 00:42
  • So vertex colors are part of the mesh data, so it might be possible to assign them each to different shape keys? – Linguini Oct 01 '18 at 21:05
  • It would seem! But so far, nothing. Trouble is, I can access vertex colors only by loop index (bpy.data.objects[].data.vertex_colors[].data[].color). Loop indices aren't unique (because vertices of neighboring loops are shared) and they aren't the same as the unique vertex indices (for which I have data). I can access vertices by their unique indices (bpy.data.objects[].vertices, but when I do I can't seem to access the color data... Sorry if this sounds confusing :/ –  Oct 01 '18 at 21:53
  • I see what your saying yeah, that's really weird. I hope someone comes along who knows the answer! – Linguini Oct 02 '18 at 22:15
  • 1
    Got my answer from a related post: https://blender.stackexchange.com/a/119646/61149 –  Oct 02 '18 at 23:51

0 Answers0