+------------------------------------+
? Mayacrycam Python script 29.09.08  ?
+------------------------------------+

AUTHOR:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Sebastian "Quaternion-Ubergod" H. Schmidt (sebastian.h.schmidt@googlemail.com)

IDEA/TESTING:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Hannes "Ahh the Quaternions are invading!!" Appell (hannes@loneclone.de)



WHAT THIS DOES:
----------------------------------------------------------------------------------------------------------------------------------------------------------------

Ever wanted to get 3d tracked camera animation data from Maya into Cryengine2?
Now you can! This script can write Maya camera data (which is Euler-based and keyframed) to a format compatible with Cryengine2's Quaternion-based timesecond animation system.



INSTRUCTIONS:
----------------------------------------------------------------------------------------------------------------------------------------------------------------

1. You have to have pyXML script installed. Current version is 0.8.4 for Python 2.5
2. The 2 Python files have to be copied into your Maya/Python directory
  Default is: c:\programs\Maya\Python
3. Open the Maya scene with the camera you want to export
4. Open the script editor for Python and type:

import MayaCryCam
Mayacrycam.MayaCryCam(<cameraname>,<filepath>,[fps],[frameStart],[frameEnd])

e.g.:
readCam.WriteCamXml("camera1","c:/project/scenes/01_test.xml",25,1,200)
Translates "camera1" into the XML-file "01_test.xml", based on 25frames per second and starting from frame 1 to 200.


IMPORTANT:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
-Cameraname and filepath have to be specified
-If [frameStart] and [frameEnd] aren't specified, the duration of the scene is used.
-If [fps] isn't specified, the script defaults to 50fps
-Make sure your scene uses the right scale compared to Cryengine2. Set up a proper scene scale for the tracked camera:
1 meter on the real set should be 1 meter in your Mayascene so that it translates to 1 meter in Cryengine2.

VERY important:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
The current version of this script still needs some manual tweaking in order for Cryengine2 to recognize the camera data:
Sandbox2 writes a file called level.pak when you export your leveldata to the engine.
What we need to do is basically inject the XML-file this script generates into this level.pak file so that the engine loads the camera data.

1.  Open up Sandbox2 and create a new level.
1.1 Generate a trackview sequence, use the same name as the name for the XML-file, e.g. "01_test" .
1.2 Generate a simple camera and a trigger for the sequence (so you can see if the camera data import worked).
1.3 Save this level and export it to the engine.

2.1 Go to your Crysis game/levels directory. (default: C:\games\Crysis\Game\Levels)
2.2 Rename "level.pak" to "level.zip", open the file with e.g. WinRAR, extract the file moviedata.xml and open it inside a text/html editor

3.1 Copy and paste the values for the camera's "EntityGUID" and "ID" into the generated XML-file.
3.2 Make sure that the value for "Sequence Name" matches that of the generated XML-file.
3.3 Make sure the camera name matches that inside the generated XML-file.

4.1 Rename your "01_test.xml" to "moviedata.xml" and insert it into the "level.zip" file
4.2 Rename "level.zip" to "level.pak" and load up the level inside the game.
5.  Trigger the sequence and watch your tracked camera inside the game.


WORK IN PROGRESS and STILL TO DO:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
As you probably have guessed, the workflow to get the camera data inside Cryengine2 is far from perfect.
Due to the fact that the editor works with proprietary .cry files and only generates XML-Files when the map is exported to the engine,
the camera data cannot be imported directly into the editor as of yet.
Hopefully a future version of the Crysis SDK will fix this problem or maybe a new version of this script will rectify this by itself.



(c) copyright 2008 Sebastian Schmidt/Hannes Appell
