I have a handful of mesh objects and I'd like to display one of them per frame. Thus far, I've been switching out entire mesh objects like this:
myObject.data = meshes[frame_number]
Unfortunately, the object's shader is tied to each mesh, so when I change the mesh, the shader disappears.
I know that I can use
myMesh.from_pydata() to edit the actual mesh, but I'm not quite sure how to get the vertices, edges, and faces out of a mesh and copy them into another. I tried this, but got an error:
#gives an error: myMesh.from_pydata(otherMesh.vertices, otherMesh.edges, otherMesh.polygons)
Any ideas on how I can swap meshes but retain the object's shader?