Search Unity

Baking Camera Animation In Timeline

Discussion in 'Timeline' started by LM-DM3D, Jan 8, 2020.

  1. LM-DM3D

    LM-DM3D

    Joined:
    Aug 14, 2019
    Posts:
    9
    Hey Unity Community,

    I could really use some guidance as this has kinda stunted my progress.

    I will try to explain as simple as possible:

    I have a camera in my unity scene 2019.1.9f1, the camera is animated using the timeline, but there is also a script that runs on play mode that adds some additional camera shake motion..

    My goal would be to parent a game object, new camera, or whatever to the camera that is animated and essentially bake the transform data so that every 'frame' in my case 30 fps or 60 fps would have a key frame

    I have a few reasons for this:

    1) Removes the script that is needed to add camera shake
    2) Export the camera into After Effects

    I need the transform data to be baked to every frame because I want to eliminate any animation interpolation going from unity to after effects.


    I really appreciate the help!

    -Devin
     
  2. LM-DM3D

    LM-DM3D

    Joined:
    Aug 14, 2019
    Posts:
    9
    Also, My method for getting the camera into After effects is

    Unity (Export FBX) > Maya (Export .ma) > After Effects (Import)

    This only works correctly if I can get the animation data baked down.
     
  3. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
  4. LM-DM3D

    LM-DM3D

    Joined:
    Aug 14, 2019
    Posts:
    9
    Hey @seant_unity! Thanks for the fast response

    I have been trying to use the unity recorder. In theory it sounds like exactly what I want to do, but I’m not having much luck getting baked keyframe data from a moving object in play mode.

    I am gonna comb through the documentation once more and verify my steps. If I am still having no luck, I’ll create a quick video to showcase
     
  5. LM-DM3D

    LM-DM3D

    Joined:
    Aug 14, 2019
    Posts:
    9
    Alright I have taken a deep dive into this and still have problems, I have been following this documentation

    A few things to note about the scene:

    1) I have a game object that is acting as a group and I have an animation clip attached to drive the transforms of position and rotation.

    2) Inside the game object, I have placed my camera where I have added a script on the camera to add additional positional changes to simulate hand held camera shake

    3) I have parented an empty game object under the camera which in theory should give me the exact position for the camera + root game object in step 1.

    Following the documentation, does give me an animation file, but when I create a new game object and attach that animation clip to the game object, No animation is present and it doesn't follow the camera from steps 1-2.

    When I look at the animation clip that was baked out, it looks l like it gathered a key frame at the beginning and end, but the values are exactly the same under positional values.

    Essentially what I need is every frame to have 'world space' transform key frame data and that isn't happening.
     
    Last edited: Jan 8, 2020
  6. LM-DM3D

    LM-DM3D

    Joined:
    Aug 14, 2019
    Posts:
    9
    Newly developing idea,

    I removed step 3 from the game object's hierarchy and added a parent constraint. Set the source to be the camera and tried to record the game object.

    IT WORKED, BUT there are some strange things that I can't seem to understand

    I set the recorder parameters to capture constant frame rate of 30

    But in the animator its only showing a key frame every 40 frames???

    02.png

    I imported into Maya to check, and Maya shows a keyframe every frame.

    01.png
     
  7. LM-DM3D

    LM-DM3D

    Joined:
    Aug 14, 2019
    Posts:
    9
    @seant_unity I created a video to explain visually, Hope that helps!

     
  8. vertxxyz

    vertxxyz

    Joined:
    Oct 29, 2014
    Posts:
    109
    I helped out on the Unity Discord and quickly wrote a solution with the recorder api that seems to have solved the issue.

    But that video's a really good description of a problem that might exist with the recorder.
    Not sure if it's the compressor being aggressive, or if it's some incompatibility with the systems in play. It looks like a bug worth looking into.
     
    LM-DM3D likes this.
  9. LM-DM3D

    LM-DM3D

    Joined:
    Aug 14, 2019
    Posts:
    9
  10. LM-DM3D

    LM-DM3D

    Joined:
    Aug 14, 2019
    Posts:
    9
    wow..... they say its been fixed but I have heard no contact from them... and just tried on the latest version. still broken.
     
    Last edited: Apr 25, 2020
  11. Vini_ME

    Vini_ME

    Joined:
    Jul 15, 2021
    Posts:
    1
    upload_2021-11-26_17-0-28.png
    This solves the every frame bake problem.
     

    Attached Files:

  12. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Sigh. I got my hopes up for a moment. I want the same option, but I want it when generating *movie* files (not animation clips).
     

    Attached Files: