Converting Animation on a Path to Keyframes?

I have an animation that has an object follow a path. When I export the animation as an FBX it won’t work. Is there a way to convert that path animation to individual key frames? In doing so loses the path and makes each frame that much unique and complex?

Thanks in advance! :eyebrowlift2:

Select the object.
In the 3D header, select Object-Animation-Bake Action
After baking, delete the curve constraint.
Now the object should translate according to the plotted keyframes.

or select “clear constraints” from the baking menu.

I tried that with no luck, maybe I am missing something. I select my object and bake it with the default settings and delete the curve and now the object just hops around. When I had the curve modifier on the object it was distorting it as it went down the curve.

Would it help if I posted file, would that help?

May be little outdated… In version 2.63 one had to create any keyframe to make an action, then - bake it (clear constraints, set appropriate time range). It should work.

I have the animation key framed out and it plays nice I am unable to export it to FBX.

Slinky.blend (1.48 MB)

Here, I’ve uploaded the file if you want to give it a look, hopefully that will help.

So I have updated to the newest version of blender and I am getting a new error when I export to the FBX. I now get that I need to (apply Scale to fix) on both my NurbsPath and my Slinky. I do that but it only applies it to the current frame that I am on, I would like to be able to apply it to each frame individually so that it creates a unique slinky shape for each frame essentially making a crude stop motion. Does that make sense, or am I way off base on how to approach this?

Rather than it being a follow path constraint it’s a curve modifier.

You can apply the scale to both the slinky and the curve without it affecting the animation, ie sets the scale of both to (1,1,1)

I’m not sure what you can export to FBX. It does have an apply modifiers flag, suggesting modifiers aren’t supported in FBX.

One method would be to run thru the animation and apply the modifiers as shapes, then export it as a shape key animation.

Cool slinky animation btw.

Thanks!

If I were to apply the scale to both the slinky and curve (done, I figured that one out last night), how would I apply the curve modifier as a shape for each frame, once I do that it applies to the current frame and then it is the same instance throughout the animation?

Here’s a script that works on your slinky.blend file posted
Paste into text block.
Select your slinky
Run the script… all going well an object called “NEW SLINKY” is created, that is animated by shapekey.


import bpy
from bpy import context
scene = context.scene
slinky = context.object


bpy.ops.object.select_all(action='DESELECT')


f = scene.frame_start
scene.frame_set(f)
    


while scene.frame_current <= scene.frame_end:
    ob = slinky.copy()
    ob.animation_data_clear()
    ob.data = ob.data.copy()
    scene.objects.link(ob)
    ob.name = "Frame %.0f" % f
    scene.objects.active = ob
    ob.select = True
    bpy.ops.object.modifier_apply(modifier="Curve")
    #ob.matrix_world = slinky.matrix_world
    f += 1
    scene.frame_set(f)


#make the first frame the active object
new_slinky = scene.objects.active = scene.objects.get("Frame %.0f" % scene.frame_start)
bpy.ops.object.join_shapes()


new_slinky.select = False


scene.objects.active = None
bpy.ops.object.delete()


# put in shapekey animation for new_slinky
new_slinky.name = "NEW SLINKY"
f = scene.frame_start + 1 # start frame is the basis
scene.frame_set(f)
    
key = new_slinky.data.shape_keys


while scene.frame_current <= scene.frame_end:
    for kb in key.key_blocks:
        name = "Frame %.0f" % f


        if kb.name.startswith(name):
            kb.value = 1
            kb.keyframe_insert("value")
            kb.value = 0
            kb.keyframe_insert("value", frame=f-1)
            kb.keyframe_insert("value", frame=f+1)
        else:
            kb.value = 0
        
    f += 1
    scene.frame_set(f)
new_slinky.animation_data_create()    
new_slinky.animation_data.action = slinky.animation_data.action

That was crazy amazing! It did everything that I wanted it to do!!! With just a little bit of cleaning up the file of the things I wasn’t needing, it plays great in Blender.

The only problem I have now is when I export it to an FBX and view it the slinky hops up with the location axis like it does in the animation and the slinky doesn’t go down the stairs :frowning:

I am using this animated FBX in an augmented reality experience and when I play the animation in the creator the position of the spring is off and there is almost a ghost like spring that just hops up, very weird. I will try and post a screen shot and the new file for you to check out. Is there some step that I am missing in the export process?

Thank you soooooo much for your help!!!

could someone update this script for blender 2.8+?