I created an alembic file and added to the modifier and still could not figure out the purpose or use of this modifier.
You will need to import the file. The importer sets up all that stuff. Alembic importer does that by setting up some relationships including the mesh cache modifier.
You wont get anywhere by just adding the alembic file to the modifier.
Thanks , well that makes perfect sense. Dont know why I didnt think of it. So I imported the alembic file and then selected it in the path for the modifier. So far, so good but still dont see the purpose of this modifier. The Blender docs are really vague on the use of this modifier.
Without it, you cant playback an Alembic mesh cache. That is for animation data.
Thanks again. I really do appreciate your help here. For some reason I am stumped by this modifier. So I have imported the alembic file and it appears in my viewport. I have not added the Mesh Sequence Cache modifier but I can press alt+a and play the file and render the alembic imported file. What am I missing here?
This is what the Blender site says about the modifier:
“Despite its name, this modifier supports meshes and curves. It also handles file sequences, as well as meshes and curves with varying number of vertices/control points.”
Not much explanation at all of what it is used for.
Here is a summary for the Alembic importer and exporter code as it was being developed and also some discussion of the bugs and TODOs(This, of course is from 2016):
Also, here is the dedicated thread for the importer and exporter:
Maybe you’ll find something useful - maybe not. I actually am trying to figure out how to activate and use the “Cache File” mode in the Dope Sheet editor. I can’t even get the darn thing show anything at all.
I hope you find something useful. I am going to be investigating also if I get some time tomorrow.
EDIT: After a quick search on google, it seems that animations can be exported, and therefore, imported as well, using Alembic in two different ways . I’m guessing one way would be an Alembic sequence that would actually be a bunch of instances of variations of a mesh object and the other way would be just a single instance that uses keyframes for it’s animation.
I am looking into these now. It seems a lot are having trouble with this modifier but I am starting to make sense of it. Some have seen that when you import and Alembic sequence the modifier automatically appears in its place but for me it did not happen. Then trying to make sense out of its settings has been a challenge but I am getting there.
I developed the feature so maybe I can answer some questions.
The goal of the modifier was to import into Blender animations of meshes, curves, and particles from other software using the Alembic file format. Nothing prevents exporting a Blender file to alembic, and rereading it in Blender.
I guess that if you don’t know what Alembic is, you would have trouble understanding the modifier and its properties (and yes documentation is lacking…).
Alembic works using a hierarchical tree where transformations are root and branch nodes, and geometry data are leaf nodes. Think of it as transformation matrices being objects in Blender, and meshes being children of the transformation object.
Each node has a path (like “/Cube/CubeData/”), so when adding a Mesh Sequence Cache modifier to an object, you also have to tell the path of the object to read from in the archive. Alembic can store all of the data throughout an animation in a single file, as opposed to having one file per frame like other formats, so you can choose in the modifier the time at which to read the data (say if you want to read data from frame 50 but Blender is at frame 60).
Since Alembic stores a hierarchy of transformations, we also have a Transform Cache Constraint that works in conjunction with the Mesh Sequence Cache Modifier.
There is also an old patch that lets you read curve modifiers based on custom properties in a cache file, so you could import keyframes from an Alembic archive.
The Alembic importer reads an Alembic archive and creates automatically objects, modifiers, and constraints based on the data in the said archive.
I did not work much in this area. Mostly due to lack of time, but also because the main developer in this area of the code base was not really active. I don’t remember much but I think the “Cache File” mode in the Dope Sheet editor should show you the key frames on the various Cache Files, but instead those key frames appear in the general Dope Sheet Summary. I was not familiar with data-blocks in Blender when I added the feature, so I just copied what other data-blocks were doing, maybe this was useless, and no one caught it during code review.
The modifier is only added if the object has animated data (like a character animation changing the positions of the vertices). If the animation is only on the transformation (like scaling or moving the object), then a transform cache constraint is added.
Thanks for the answer buddy…
Do think your patch would be a good resource for learning the Blender codebase ?
Also, you wouldn’t happen to know if there is a branch with separate(unsquashed) commits for your Alembic commit # 61050f75b13 would you ? It would be easier to learn your code through development stages as opposed to one big commit.
WOW thank you thank you KWD for explaining this. Just what I was looking for. This should be with the Blender docs. Now I understand the reason for the controls in the modifier.
The patch is quite big and touches a lot of areas (modifiers, constraints, meshes, NURBS, etc…) so I am not sure if it is the best way to learn the code base. Then some areas may have changed with Blender 2.8. Maybe try looking at smaller, more focused, and more recent patches in the patch tracker.
The alembic branch was deleted after the merge in master, and I don’t know if anyone has a copy of it. Also note that the code in the patch is not the same exactly as the code currently in master as there were a bunch of code fixes and little rewrites to better handle some edge cases.
If you want to do some code archeology, I have quite a few unfinished branches where I tried to improve the Alembic integration. The branches can be found on my github account and start with the prefix “abc_”.
I will say that this is a wonderful start. I know more about this modifier now than I ever did. Most of the info on this modifier on the web is incomplete or at least lacks sufficient information to know its use. This goes a long ways and hope anyone else searching the net runs across this forum thread.
Feels a bit weird that modifier is in that list than or am i crazy?
the importer and modifier work perfectly, so… thank you, much needed feature
i’m working on a project and i’ve received from my client a series of .abc files, with character and cloth animation exported from Clo3D
the file imports fine, i trim the animation lenght, then export a new .abc file for use inside of a VR simulation in Unreal 4.24
everything smooth, except Unreal Geometry Cache, is quite slow, very slow, 5x rendering time slow when the animation is onscreen… (probably because it’s a Beta feature)
finally my question: there are parts of the body that are not visible, same for the inside of clothes, so i’d like to delete a few thousand faces that uselessly add weight to the model
if i delete a few faces in Edit Mode, the faces are back as soon as i go back to Object, i think this is happening because the data in the cache are saved on a per frame base and don’t care if i delete something from the static mesh
surely the system is meant to work like this and it makes sense, but is there a way to delete faces from the cache?
thank you for your time (and the feature)
I’ve been messing around with the object and i discovered this: if i create a Vertex Group in the animated mesh and add a Mask Modifier after the Mesh Sequence Cache, the Group vertices hide correctly, i hope the exporter takes this into account…
Due to the way modifiers work, editing a mesh in object mode will have no effects on the final evaluated mesh data as modifiers will overwrite it; this is where an “Edit Mesh” modifier could be handy (and long desired by the community). However, as you have discovered, you can still add modifiers after the Mesh Sequence Cache one to further modify the object, and yes, the exporter should take all modifiers into account when exporting the data, unless you specify otherwise in the export settings.
Hi KWD. Thank you for your tremendous explanation in this thread.
Your last comment relates to something that I am trying to do in Blender. I am doing some cloth simulation where I’m trying to save the cloth mesh in some Blender script (via Python), and then load it back in a different Python script with the same modifiers applied. I posted a question on Blender StackExchange recently with my attempt at doing this with exporting and importing into .obj files, but this is not working because it does not preserve modifiers:
From your response, do you think the Mesh (Sequence) Cache Modifier could resolve my issue?
If I understand your question correctly, you want to export both the mesh data and the associated modifiers, to then, upon importing, having the mesh data with the result of the modifiers cached with the modifiers list ? That is, to be able to import a mesh, with modifiers on it, but the modifiers are not run because they are cached. If yes then the Mesh Sequence Cache modifier will be useless as it writes only the final mesh data (and some custom attributes like UVs) but it does not write the list of modifiers.
I think the only way to do that would be to save a .blend file and using as a linked library, although I am not too familiar with that side of Blender.
Thank you for your prompt response!
I might not be understanding your explanation. When you say “the result of the modifiers cached with the modifiers list” I am not precisely sure what this means. To put it precisely, in the Blender GUI, if I make a mesh, I can click and add modifiers so that they are on the modifier list. I don’t know if they are cached or not, and I don’t see a “cache” button to click. (Note that in my use case, I don’t really need a full animation; I am just going to take the image from a camera at frame X and that’s all I need.)
In Blender, I am familiar with “caches” when I use a cloth simulator, and I click “bake” to “cache” an animation, so that playing it in the Blender GUI is faster. However, that I use for debugging mostly. I normally use the Python API and step through frames one-by-one (and take the image at frame X), so I don’t know if a cache would be needed.
For reference, this was my original question about trying to do dynamic pinning and un-pinning of vertices of cloth at specific frame intervals:
Then the StackExchange question I linked to in my previous post was my attempt at solving my original question. I have yet to figure out how to do dynamic un-pinning and pinning of vertex groups (and it may be impossible to do in Blender), so my solution was to run a Blender Python script to save the cloth “state” (e.g., vertices), and then in a subsequent Blender Python script, load in that script with the same modifiers and do an action, then save and repeat. So one call to Blender does one “action.”
I skimmed the documentation for linked libraries, and it looks like that might be a way I can pursue my objectives, either in addition to (or in place of) the mesh cache modifier idea.
PS: not sure if you are on the Blender StackExchange, but I’ll upvote you if you wish to write something there.