Skip to end of metadata
Go to start of metadata

Overview

The Track View Editor can export and import camera nodes in the Collada format.

The current state of the exporter/importer is as follows:

  • Only transformation tracks and the fov track have been tested and are supported.
  • Animated FOV's are supported.
  • Only the default Collada import/export plug-ins should be used. Do not use other Collada formats such as OpenCOLLADA.

Exporting Nodes

  • In the TrackView dialog, right-click a camera node in a sequence and select Save to a COLLADA file...
  • Save it to a convenient place:
  • Input the baking (sampling) fps needed:
  • Import the saved .dae file into Maya:

  • After fixing up the axis in the collada file, you can see your camera in Maya:

Axis Issue When Exporting to Maya

  • Maya uses y up-axis (z front, x right) instead of the z up-axis (y front, x left) used in CryENGINE.
  • A Maya camera points to -z axis by default, but an engine camera points to y axis.
  • Unfortunately, Maya Collada importer doesn't handle the 'up_axis' tag in a Collada file properly and always recognizes it as y up.
  • Considering this, in order to represent a camera path in Maya as same as in the engine, you should apply the following patches to the exported Collada file:
original
  ...
  <visual_scene id="RootNode" name="RootNode">
   <node id="Camera2" name="Camera2">
    <translate sid="translate">0 0 0</translate>
    <rotate sid="rotateZ">0 0 1 0</rotate>
    <rotate sid="rotateY">0 1 0 0</rotate>
    <rotate sid="rotateX">1 0 0 0</rotate>
    <instance_camera url="#Camera2-lib"/>
   </node>
  </visual_scene>
  ...
patched
  ...
  <visual_scene id="RootNode" name="RootNode">
   <node id="AdjustUpAxis">
    <translate sid="translate">0 0 0</translate>
    <rotate sid="rotateZ">0 0 1 0</rotate>
    <rotate sid="rotateY">0 1 0 180.0</rotate>
    <rotate sid="rotateX">1 0 0 -90.0</rotate>
    <node id="Flying_Cam_03" name="Flying_Cam_03">
     <translate sid="translate">0 0 0</translate>
     <rotate sid="rotateZ">0 0 1 0</rotate>
     <rotate sid="rotateY">0 1 0 0</rotate>
     <rotate sid="rotateX">1 0 0 0</rotate>
     <node id="AdjustDefaultCameraPose">
      <translate sid="translate">0 0 0</translate>
      <rotate sid="rotateZ">0 0 1 0</rotate>
      <rotate sid="rotateY">0 1 0 0</rotate>
      <rotate sid="rotateX">1 0 0 90.0</rotate>
      <instance_camera url="#Flying_Cam_03-lib"/>
     </node>
    </node>
   </node>
  </visual_scene>
  ...
  • As you can see, two nodes of "AdjustUpAxis", "AdjustDefaultCameraPose" are added and the 'instance_camera' tag is moved from "Flying_Cam_03" node to the "AdjustDefaultCameraPose" node.
  • There is a simple command line tool that fixes this automatically: fix_maya_axis_issue.exe
    Usage: fix_maya_axis_issue.exe Camera.dae
  • This will output a new file called "Camera_fixed.dae".

Importing Nodes

  • If you have imported the camera path to Maya like above, modified it, and now want to bring it back into the engine there are several steps to follow.
  • Before exporting the data to the Collada format, you have to remove two additional nodes added ('AdjustUpAxis' and 'AdjustDefaultCameraPose') when importing due to the axis issue. Then, when exporting, select export options as below: (you have to specify the Y (not Z) up axis, otherwise the exporter will try to transform the data unnecessarily).
  • In the TrackView dialog, right-click a camera node in a sequence and select Load from a COLLADA file...

Animated FOV

  • Maya successfully exports animated fov data to a Collada file (to be more precise it is an animated focal length).
  • Unfortunately it does not support the exporting of animated fov data back. There is a small command-line tool to get the animated fov data from a COLLADA file and append it to a .ma file. Download it here: add_fov_to_ma.exe.
    Usage: add_fov_to_ma.exe Camera.dae Camera.ma
  • First, import a COLLADA file exported from the TrackView, save it as a .ma file in Maya and process that .ma file together with the original COLLADA file by this tool.
  • The final modified .ma file will contain the animated fov data properly.
  • Another caveat: you should use following camera settings in Maya so that the fov value in Maya can be compatible to the one in the engine:

Film Back setting in Maya

Camera Aperture 0.581 0.327
Film Aspect Ratio 1.78

 

 

  • No labels