0
$\begingroup$

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!

$\endgroup$
  • $\begingroup$ Do the different instances of the object share mesh data, like do they keep the vertices in the same local positions and stuff? $\endgroup$ – Dr. Farquaad Sep 30 '18 at 22:04
  • $\begingroup$ 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. $\endgroup$ – Alex Oct 1 '18 at 0:42
  • $\begingroup$ So vertex colors are part of the mesh data, so it might be possible to assign them each to different shape keys? $\endgroup$ – Dr. Farquaad Oct 1 '18 at 21:05
  • $\begingroup$ 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 :/ $\endgroup$ – Alex Oct 1 '18 at 21:53
  • 1
    $\begingroup$ Got my answer from a related post: blender.stackexchange.com/a/119646/61149 $\endgroup$ – Alex Oct 2 '18 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.