I am not much of a scripter, so sorry if this is a simple question... But I would like to create a script that automatically imports and links an alembic file cache to an existing set of meshes in my scene. My blender scene contains a set of a few hundred objects that all have shading, and my alembic file contains these exact same meshes, with the same names, but with animation data. I can do this manually, but with the amount of objects I have, it would take hours to do this by hand!
These would be the manual steps, I need to repeat this over hundreds of objects:
- Import a cache file into my scene simply as a data block, this line seems to work: bpy.ops.cachefile.open(filepath="C:\...\all_meshes.abc")
- pick a shaded objects in my scene
- add a transform cache constraint
- link that constraint to the data block called all_meshes.abc
- link the object path to the correct mesh.
In this case, my alembic file contains the exact same mesh names as those that are shaded in my blender scene, so it might be a case of storing the mesh name into a variable and using that to identify what alembic mesh to link it to?
Any help would be greatly appreciated.