Search Unity

Question Transfering fbx animation to cinemachine?

Discussion in 'Cinemachine' started by SecretTomodachi, Aug 16, 2021.

  1. SecretTomodachi

    SecretTomodachi

    Joined:
    Nov 24, 2019
    Posts:
    24
    So I figured out how to transfer my FBX camera animation from blender to Unity, but I don't know how I can transfer it to my cinemachine camera so it'll be easier to work with my system. Can anyone recommend some techniques to do this?
     
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    I'm not exactly sure I'm understanding what you're attempting to do here. Cinemachine's purpose is to control the camera. If you export a camera animation from Blender and bring it into Unity...what is it you want Cinemachine to do?

    If the idea is that you have a canned animation (maybe for a cutscene) and you want to seamlessly tween that to a live game camera, you could simply attach a Virtual Camera with everything set to "Do nothing" to your imported animation. Then you can transition between the exported FBX animation and a second live Virtual Camera.

    Hope that helps!
     
    Gregoryl likes this.
  3. SecretTomodachi

    SecretTomodachi

    Joined:
    Nov 24, 2019
    Posts:
    24
    I want to be able to transition my cutscene camera (which I animated in blender) smoothly to my gameplay camera which uses cinemachine, rather than it being a hard cut. Hope that explains it a bit
     
  4. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    OK, terrific. Then the answer I gave in my second paragraph should be what you want to do: i.e., export your camera from Blender, then in Unity just attach a virtual camera to that animation.

    At the end of the baked animation, you can simply tween to a second, Cinemachine-controlled virtual camera camera.
     
  5. SecretTomodachi

    SecretTomodachi

    Joined:
    Nov 24, 2019
    Posts:
    24
    So attach an animator to my virutal camera? Also I animated the FOV for my camera. How would that transfer over to the virtual camera?
     
  6. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    Ah, ok...I get what you need here. You need the
    CinemachineExternalCamera
    , which is a component you can add to your main Camera (i.e., the actual Camera, not a Cinemachine Virtual Camera). The
    CinemachineExternalCamera
    allows the Camera itself to function as a virtual camera...so you should see the animated FOV, etc. That will permit your baked animation from Blender to drive the Virtual Camera until you're ready for something more dynamic to take control.

    Once you've attached the External Camera, you can simply do a Timeline tween (on a Cinemachine track) between that and the game VCam.

    Hope that makes sense.
     
    tealm and SecretTomodachi like this.