Page MenuHome

Export procedual mesh animation with alembic
Closed, ResolvedPublic


System Information
Ubuntu 16.04

Blender Version
Broken: a85f457195

Short description of error
I created a small python script that updates a mesh on every frame. Now I want to export the animation using the alembic exporter. There are no error messages but when I import the file I don't see what I would expect.

Exact steps for others to reproduce the error

Case 1:

  1. Open the file (should be on a frame > 10).
  2. Export using alembic.
  3. Open an empty file.
  4. Import the .abc file -> it only imports an empty mesh (not animated)

Case 2:

  1. Open the file.
  2. Go to frame 1.
  3. Export using alembic.
  4. Open an empty file.
  5. Import the .abc file -> not it does not even import a mesh, but an empty.

I guess the reason for this is that the exporter checks whether the mesh is empty or not. However this check should not be made as the mesh can appear at other frames when it is created using scripts. I understand why this is the default behavior but there should be an option to turn it off, otherwise the exporter is useless in some cases.

Case 3:

  1. Open the file (here the frame does not matter).
  2. Add a wave modifier to the object and set its height to 0 -> the mesh does not change.
  3. Export using alembic.
  4. Open an empty file.
  5. Import the .abc file -> now everything works perfectly.

It's great that it works that way but it feels reallyyy hacky. However it's better then not having this functionality at all.

Event Timeline

To define whether or not a mesh is animated, the exporter only checks for the presence of modifiers and shapekeys. Since your script is using a scene handler and recreating the mesh every frame, it is not possible to know that this particular object is animated (unless there is some hidden black magic I am not aware of).

I can only think of two options at the moment to address this issue :

  • add a flag to the exporter to force exporting objects on every frame (but that would affect every object in the scene)
  • make use of a custom property that needs to be set by the user on the objects needing to be exported for every frame

I see, thanks for the clarification.

Both of these options would work for me.
However, having a global option might work in my case but not in more complicated scenarios.

A third option (which I'm not saying should be implemented) is that the export operator can get a list of objects (or object names) that should be exported on every frame.
This would allow script developers to use this functionality, while it is more complicated to use the functionality from the UI only.

The easiest solution would be to just make the third case I described official. So users/developers who want to export an animated mesh (using scripts) have to create a modifier that does not change the mesh at all. It would give the same flexibility we would have with the custom property approach, just that the code does not need to change at all.

The only thing that is very annoying still, is that if the mesh is empty (on the current frame) it is replaced by an empty object. Beside that fact that I don't quite understand why this happens at all, it definitely should not happen if there is any modifier on the object. The problem also appears when you have an empty mesh with an ocean modifier on top -> the ocean is exported as empty object.

@Jacques Lucke (JacquesLucke) I didn't try this, but you could add a custom property to the mesh, and animate that. That way the mesh has animation data; this might be enough for the exporter to consider it "animated" and export it on every frame. Can you give that a try and let us know if it works?

Just tried the approach with the custom property on the mesh. It did not seem to work.

Animation Nodes creates a disabled modifier for objects with mesh animation now, this solves most of the problems I had. However another solution would still be nice.

The bigger problem is that the exporter creates an empty object if the mesh is empty at the moment when the export starts. As I said this is not only a problem that you can get when using scripts.
Here is a test file in which you can see the problem (it's the same scenario I described in my previous comment). Just try to export the ocean, and then import it in a new file:

Currently this problem is solved by always adding at least one vertex to the mesh. However, this hack is much worse compared to the add-modifier-hack because it actually changes the geometry which is irrelevant in most cases but might be important in other cases (when you really want to have the mesh empty..).

Sergey Sharybin (sergey) lowered the priority of this task from 90 to Normal.May 22 2017, 3:23 PM

@Sybren A. Stüvel (sybren), render pipeline will call the frame change post/pre callbacks (this is likely happening via the depsgraph update). So seems reasonable thing to do for alembic export as well?

Sybren A. Stüvel (sybren) changed the task status from Unknown Status to Resolved.May 24 2017, 12:43 PM

@Sergey Sharybin (sergey) this wasn't necessary -- I just had to remove a check here and add a check there and now it's all fine.

I have encountered an issue similar to this in the FLIP Fluids addon using Blender 2.80 (hash 5e626e766459, June 13th 2019). The FLIP Fluids addon updates fluid mesh geometry in the frame_change_pre handler.

In Blender 2.79, I am able to add a modifier to the procedural mesh and Alembic export would generate an animated mesh. In Blender 2.80, this is no longer working for me and the Alembic export is static.

I am able to reproduce this issue using a modified version of the alembic_test.blend file in the original post. The modification is adding a smooth modifier with zero repeats to the 'Target' object.

To reproduce:

  1. Open the .blend file in Blender 2.80
  2. Run the script
  3. Export Alembic cache
  4. Import Alembic cache into the scene

When the Alembic cache is imported back into Blender, the mesh is not animated.

I had also tried to add a custom property with animation data, but this did not work.

Let me know if I should open a new issue for this, or if I am missing something.

It seems this is still a problem in b2.8

@Karlis Stigis (karlisstigis) Please make it possible for us to verify this, by providing us with an example blend file and clear steps on how to reproduce. Also, 'b2.8' is not really a clear indication of which exact version of Blender you tested with; please test with the latest daily build from

@Sybren A. Stüvel (sybren) Here is a simple example file where multiple meshes get combined in one. Of course in cases where geometry is generated completely from scratch, exporting to Alembic makes more sense, but combining many objects in one is still useful, because then you can reimport those as 1 alembic file and not mess around with hundreds of objects + retime animation.

Blender version and System info is included in archive. I originally tried using official b2.8 release, now I tried using fresh b2.81 build and it's still not possible to export animated mesh, only static geometry gets exported.
Hope this is enough info.