I am trying to Bake animated horse alembic mesh that I exported from Maya in Blender.
There are 6 animations that was imported to blender for Non Linear Animation (Loops). Is there a way to bake them as keyframes to separate the animation from another?
I tried to bake animation as an object but could not sepatare animations from each other. Its not repeating.
Alembic animation is already “baked”, for each frame vertices are at their respective - final - position, there’s no deformers/drivers/whatever control that could be applied to the mesh.
Hence you can’t mix animations in the NLA.
What you could do is:
use frame offset in the alembic cache modifier to start your animation at a certain point
import the alembic into multiple objects, each with different time offsets
use geometry nodes to blend between those objects (didn’t try yet but I reckon it should be fairly simple)
It’s basically shape keys, linearly blending shapes into each other. You might be able to use it to disguise/smooth out small discontinuities from one clip to another, where pose differences are minimal but large enough to cause small jerks in the animation otherwise.
hi, I’ve been looking for the right export settings from Maya for days. Could you tell me how exactly you exported this horse with the animation? Whenever I try this, my alembic comes to Blender and the animation runs, but I don’t have any keyframes. They are not visible. Which export settings do you have? That would be a very big help
There are no keyframes, that’s what this whole discussion was about.
What you get - and have to deal with - is a sequence of deformed meshes (like morphs/shape keys), frame by frame. Think of it as traditional, hand drawn frame-by-frame animation, or even live action footage. There are no rigs, keyframes, animation curves, just … content.
Hence the only option you have is pushing those meshes around on a vertex-by-vertex level (that’s what we were talking about before), like linearly interpolating vertex positions between two frames, or using the velocity attribute to push vertices.
You can’t do any fancy high level stuff like using NLA to combine animations - all of that would have to happen within Maya, in your case, before exporting to alembic.
as I see it in the pictures are there yellow keyframes? and this is exactly what I need.
I very often export Alembic from CLO3D to Blender. There I always have yellow keyframes and can edit them (e.g. create seamless transitions for loops or copy and double the frames to create a longer loop)
But with this horse and Maya, it doesn’t work. I can export a loop of 16-20 frames as alembic but neither edit or extend it in blender.
That’s why I asked for the export settings and import settings in Blender so that I can get exactly those yellow frames like in the photo above.
Hm.
Could you show an example of a working import, the type of keyframes you get, and the kind of blending you achieve?
In the horse’s case I’d say the keyframes represent object level transforms (to move non-deforming objects around), so yes indeed, I need to correct myself, alembic supports some keyframe export after all.
To my knowledge there’s no keyframing for deforming meshes though (that would only make sense if alembic were aware of rigs/skeletons/other deformers), and I reckon the presence of keyframes on object level depends on whether animated, object-level transforms are present in the source file.
So maybe it’s not an export option to check/miss, but the nature of your models&animation?
I’m using alembic to exchange data between Blender & Houdini, and the above pretty much sums up my knowledge regarding Alembic’s capabilites and understanding of its purpose.
I might be wrong though, and there might be more options I’m unaware of …
You can convert your alembic animation into a shapekey for each frame and animate those shapekeys using this script:
import bpy
ob = bpy.context
obAc = ob.active_object
mesh_data = obAc.data
start_frame = bpy.context.scene.frame_start
end_frame = bpy.context.scene.frame_end
if not obAc.data.shape_keys:
obAc.shape_key_add(name="Basis")
# Create shape keys for each frame
for frame in range(start_frame, end_frame + 1):
bpy.context.scene.frame_set(frame)
# Evaluate the mesh with modifiers
depsgraph = bpy.context.evaluated_depsgraph_get()
object_eval = obAc.evaluated_get(depsgraph)
mesh_eval = object_eval.data
# Create a new shape key and set its points based on the current frame
shape_key = obAc.shape_key_add(name=str(frame))
# Collect vertex positions for the current frame
vertices = [vertex.co for vertex in mesh_eval.vertices]
# Set shape key data
shape_key.data.foreach_set('co', [c for v in vertices for c in v])
if obAc.data.shape_keys:
shape_keys = obAc.data.shape_keys.key_blocks
# Iterate through shape keys and set keyframes
for frame in range(start_frame, end_frame + 1):
ob.scene.frame_set(frame)
for shape_key in shape_keys:
if shape_key.name.isdigit():
value = 1.0 if int(shape_key.name) == frame else 0.0
shape_key.value = value
shape_key.keyframe_insert(data_path='value', index=-1)
I am pretty sure this is how the export is looking - one shape key for each frame and animated. I got this file that was exported from CLO3D and also wonder how that came to be because the ABC file I got imports using the Mesh Cache Modifier.