Export bezier curve animation as .gltf and/or .fbx

I’ve animated a shape moving along a Bezier curve by using the curve modifier. The approach is very much like this: https://www.youtube.com/watch?v=oBh8N4wWwcM

I need to export the object animation as a .gltf and/or .fbx. I imagine I need to bake the animation but as this is a modifier, I’m not sure if it’s possible.

Does anyone have any ideas?

Thanks

Hi @Sophie_D,

.fbx can’t ( that I know of) record mesh cache data, which is what you require.

I can’t get .gltf to do so either ( but that might be a limitation of Blenders implementation not of the format itself.)

However, if you can use Alembic ( .abc files ) in your work flow, this is perfect and will do exactly what you require. Exporting to the Alembic format seems to be built into Blender as it doesn’t show up in the Add-Ons, but does appear in the Import/Export tab.

Dj.

Thank you Damian,

After some more testing that’s the conclusion I’ve also come to. If anyone does know how to export as .gltf I’d be grateful to hear more. I’d certainly prefer a Blender to .gltf workflow.

This should be possible in glTF, with a little work, but I think you’re hitting a limitation of the exporter… I tried:

  1. Bake animation to a sequence of shape keys by exporting to MDD then importing the MDD back.
  2. Clean up the file (e.g. delete the curve and the old ‘position’ keyframes.
  3. Export to glTF.

The shape key sequence looks fine in Blender:

But after exporting to glTF, the animation is very glitchy. Exporting to FBX currently fails with an error. I’ve added more details in a bug report on the glTF exporter here: https://github.com/KhronosGroup/glTF-Blender-IO/issues/176. The glTF animates correctly if you enable the Always Sample Animations option at export.

Actually here we go – if you select Animation --> Always Sample Animations in the glTF exporter options, after the steps above, you’ll get a working result. Note that this contains one shape key for every frame of the animation, so the file could get big quickly.

1 Like

Thank you for this Don. I’m going to give it a go.

For this project there are a lot of animations so I think this method will result in a huge file. For future projects with less animations it looks like a good workaround.

I would like to have a ‘belt’ move along a bezier curve/circle exported to GLTF in Blender 2.8. I have had success with the strategy @donmccurdy outlines above in the past when using hook modifiers, but am running into issues with it for a simple ‘conveyer belt’ animation where I’m just transforming an object along the Y using a curve modifier.

(For example):

simpleBelt

The .mdd export error is:

Traceback (most recent call last):
  File "/Applications/blender2.8.app/Contents/Resources/2.80/scripts/addons/io_shape_mdd/__init__.py", line 152, in execute
    return export_mdd.save(context, **keywords)
  File "/Applications/blender2.8.app/Contents/Resources/2.80/scripts/addons/io_shape_mdd/export_mdd.py", line 72, in save
    me = obj_eval.to_mesh()
AttributeError: 'bpy_func' object has no attribute 'to_mesh'

location: <unknown location>:-1

As an alternative strategy I tried baking all key frames but that didn’t seem to help.

Since I’m a new user I’m not allowed to upload the blend file itself, so here is a Google Drive link to it: https://drive.google.com/file/d/1AXDInZVX-_VDZPhL-PKztqVoN4Qbox5F/view?usp=sharing

Any help much appreciated!!

I wouldn’t know how to debug a .mdd export unfortunately. :confused:

This particular example could also work with separate objects for each panel and TRS keyframes though. Not sure if there’s a quicker way to set that up than one-by-one.

Ok. Thanks for your help!