|
How to transfer animated geometry, lights and cameras between 3dsmax and Maya.
|
| |
Tutorial Goals
Some of you out there may find yourself in the position of having to work on a larger project where you work in a team that is using 3dsmax and other teams are using Maya. This kind of collaboration is common and can even happen within house with various elements being produced on each package and then integrated either on one side, or on both.
There are two main concerns that you will probably want to tackle when getting your geometry and cameras across to Maya and back again. The first of course are the raw elements of your scene. Usually you will have to be pretty conservative in what you try and take back and forth, and you will often have to do some work on either side of a transfer to ensure that there is a match on both systems. The ultimate goal of a transfer that I outline in this tutorial is to be able to take back and forth simply animated geometry and camera's and lights. When I say cameras and lights, the main thing I am concentrating on is getting the main light shape and its target back and forth. This tutorial should allow you to get enough data across to be able to sync camera and light (position) animations on both sides and to be able to render out the same resolution images on each system and get an exact match.
The firs element to transfer between Max and Maya is the scene file. The best method for this at present is to use the .FBX transfer format by Kaydara. This format was designed as a transfer format for getting data from FilmBox and into 3dsmax and Maya and other packages. To that end and Export and Import plugin has been produced for each system, allowing them to output their data to common format, that can then be imported into any other package, or indeed back into the host if needed. So, lets get our scene and export it to a .FBX file.
First things first, lets have a quick look at our test file and see what it has going on in it, so we can take it into account during our process.
|
|
|
|
|
|
|
Scene Elements
The scene has three meshes in it, a Teapot, a Geosphere and a Torus Knot. There's no real reason for the choice of object, they're just there to give us something to register against in both renderers. There are three lights in the scene, two are omni's and one is a spotlight, they all have varying colours and the spot has raytraced shadows turned on. There is one target camera in the scene. In addition to these elements there are some splines and one point helper that are used for animation.
Animation/ Resolution Settings
The scene is set to a PAL frame rate i.e. 25 fps, and I've used a four second duration i.e. 100 frames. For rendering I've used a PAL D1 resolution i.e. 720x576 with an image aspect of 1.333 and a pixel aspect of 1.06667. The camera is set to a 35mm lens with a FOV of 32.072.
Animation
The torus knot has a simple rotation animation on it, whilst the sphere has a position animation. One omni light is static, the second has its pivot point offset a little and it has a rotation animation around it. The spotlight is position constrained to a point helper, and that in turn is path constrained to a path and also uses a list controller to layer a noise position on top of this, so you have an extra random element to its movement. The spots target is static. The camera has a similar setup to the spotlight, but it is directly path constrained and also has the noise controller applied. The target of the camera is also animated along a path. SO there we go, we have a pretty dynamic scene to test out our transfer.
Exporting to Maya
OK, the first thing to do is export our raw file over to Maya and see what we get there. In the File menu, choose the option "Export...". When you have done so Max will show its current defined "Meshes" directory, this is the place that it will export items too. It might be an idea at this point if you are in a big project to make another directory for exporting too and in it have sub directories for each scene, just to keep things organised. Then just change max's "meshes" path to this folder so it becomes the new default.
You can see that we have a number of
option to choose from in the Save as type: flyout, just find the Kaydara (*.FBX) format and choose that. Next we need to give our file a name. As the file will be a .FBX and file coming back from Maya will be an .FBX as well we need to give our files meaningful names to allow us to know from which package the file was exported, otherwise we could end up importing the file just exported back into max. I've simple used "scene_01_max_to_maya.FBX" as the name, to denote the basic file name scene_01 and then a postfix to show the data flow direction for the file. Press Save and we will be presented with the FBX Exporter option dialogue.
|
|
|
| |
|
|
|
| |
|
|
|
|
3dsmax .FBX Exporter Options
The exporter has a number of options that allow you to define what elements of the scene the exporter plugin will attempt to store in the .FBX file. Its probably a good idea to disable any of the options that are not needed in the transfer as it can take the plugin quite a long time to export some of the items, and this speed hit can be even worse when importing the .FBX file into Maya , In our case you can see the options we are going to use in the image on the right, here's some info on what each should give us.
Geometries
This option will make sure any meshes or other geometry is transferred into the .FBX file. If we just wanted our lights and cameras, we could disable this option.
Support normal per Polygon vertex
Using this option should allow for a better transfer of smoothing information between 3dsmax and Maya.
Cameras
Quite simply this will ensure that our camera is exported.
Lights
The same here for our lights.
Animation
Without this option being active our scene will only export as static data i.e. basically only frame 0 will be exported. So we certainly need this as active for our purposes.
Re-sampling rate
This option defines a sampling interval for when it is needed for interpolation of data. Lower numbers give greater accuracy, of of course will take longer to export. In this case I've settled for 25.000.
Show warnings
This option will give warnings when the .FBX transfer involves some form of compromise, during our transfer this will come in useful.
Ok, that's it for the settings so lets press OK in the dialogue and let it proceed....
As you can see, we have a warning which relates the spotlights exporting. The warning is...
"We export current light animation as TRS, deducted from the animation of both the light and it's target. Current target is exported as a free null node (not constraining it's light anymore).
On merge back, rotation animation of a targeted light is ignored. Animation on the merged back target will constraint the max light normally.On an import in an empty scene, the light created will be free (without target) and it's target will be imported as a dummy."
So from this it is telling us that the Spotlight has been exported as a free spotlight (no target) and the TRS, or Translation, Rotation and Scale animation for it has been derived from that found in 3dsmax and "baked" on to it per frame. It then goes on to warn us about the way the spotlights target has been exported and what will happen if it is re-imported into the scene under different circumstances. This warning is nothing serious, but should give us some idea of what to expect when we import into Maya.
So, lets click on ok and export the file. Once we have done this we now have the file ready to import into Maya, so lets move on to that... |
|
|
| |
|
|
|
|
|
| |
Maya Import of 3dsmax .FBX file
The are actually some elements that we need to set in the Maya file before we import the .FBX elements. The first is to ensure that we are using a PAL fps system.
Time System Setting
You can do this in the Preferences dialogue, open Window / Settings/Preferences / Preferences and go down to the Settings window and change the Time option to PAL (25 fps).
Render Range & Resolution
Open the Render Globals dialogue via Window / Rendering Editors / Render Globals .... In here we can set the period of the animation range that we want to render and also the render resolution.
Range
Set your values to those shown in the Range image on the right hand side. The main think we have to ensure is that we start on frame 0 as in max, and end on frame 100. We also setup the frame extension system to work in our composition package of choice, but basically any option can be used here to suit your needs. Note that the camera is set to perspective, we'll change that once we have our imported camera in.
Resolution
In 3dsmax we have chose PAL D1 (video) as our resolution. This has a res of 720x576, an image aspect of 1.33333 and a pixel aspect of 1.06667. In Maya I've picked the CCIR PAL/Quantel PAL option as this is pretty much a perfect match. You can of course use any resolution in 3dsmax, but you have to ensure that all four settings match in Maya i.e. image width, height, device aspect ratio and Pixel Aspect Ratio.
Ok, so now we have our scene setup to match the settings in our 3dsmax file. Let go ahead and import or .FBX file. |
|
|
|
|
|
|
Maya .FBX Import Options
Ok, lets go to the file menu and import our 3dsmax derived .FBX file. Just navigate your way to the 3dsmax7/meshes directory, or to any other directory you have exported the file to. You should see your file there, just click on it and hit Import.
FBX Importer
As you can see in the dialogue the first option we have is whether to bring in our animation (Take 001) or just bring in the static scene data (No Animation). In our case we want the animation to be brought in, so lets choose Take 001.
The next option is how the data should be brought in. In our case we want to preserver the render globals we have already setup, so we'll choose to Merge in the file.
We again have the option to set the interpolation sampling rate, remember that lower is higher fidelity, but will lead to a slower import of the data. In our case we'll stick with the same value as that used when exporting our file from 3dsmax i.e. 25.000.
Now that we have the import properties set they way we want them, lets go ahead and import the file. When you click on Import the dialogue will show its progress in the space below, giving us an idea as to how the import is progressing. Depending on what is being imported, this can take quite some time.
The imported Scene Scale
The first thing you may note when the file has imported is the large scale difference between 3dsmax and Maya. This can be adjusted somewhat using the system units value in Preferences/ Settings buy changing it to meters before importing. However if you do this, it may have issue down the line, and also the scene comes in at a rather small scale i.e. 100 times smaller than it would have been if the setting was centimeter. The exact scale match lies somewhere between, and so its probably best to leave this setting on its default of centimeters.
However another way of tackling the scale difference is by changing the scale of the Fbx_Root Null in Maya. This null is the parent of all of the objects that have been imported, and so changing its scale can be a quick way of bringing the two systems into a similar scale space. An example of a good value to use here would be 0.1 or in other words ten times smaller than when imported, this should get your two files back into a similar scale.
One thing to consider though when doing this is that if you now export your scene from Maya to .FBX and try to import it into 3dsmax, it will probably be 10 times smaller than it was when it was exported from 3dsmax in the first place. So for our example, we'll leave the Fbx_Root null with a scale of 1.0.
Maya Scene Objects
Ok, as you can see from the Outliner snapshot on the right we now have a number of objects in our Maya scene that match those present in the original 3dsmax scene. Our meshes as present as Teapot01, Geosphere01 and Torus_Knot01.
We can also see that our lights have imported as Omni01, Omni02 and Spot01. The target of Spot01 has imported into the scene as a Null called Spot01_Target .
Our camera has come in as Camera01 and its target has been imported as a Null called Camera01_Target.
Scene modifications to aid working
Due to our large Maya scene scale it may be a good idea to quick change some of our objects settings to make working with our scene a little smoother. The main thing to change is the Far Clip Plane of our perspective camera and our imported camera. By default both will now have values that are simply to small for our scene scale. I would suggest changing your Perspective cameras Far Clip Plane value to 10,000 and Camera01's value to 40,000.
Animation Transfer
Lets check out how Camera01's animation has transferred from 3dsmax. If you look at the Camera01 node you can see that the first issue is that it is looking at 90 degrees to the left of where it should be looking. We can fix this simply with a new aim constrain to the Camera01_Target Null. But first lets check out Camera01_Target .
In our original scene the camera target was animated along a path called line02. You can see in the Maya scene that line02 has been imported as a null, so its not really of much use to us, we can simply delete it plus any other line nulls. Worse than this though is that the export/import has striped away any animation that was on the camera target. So we will need to import that separately from 3dsmax now to get our full camera animation performance back.
Baking Animation of nodes in 3dsmax
In 3dsmax I have produced a small macroscript utility called BakeAnim to help with this process. Download and install the BakeAnim macro script provided here. Once installed, place it on one of your tools bars on 3dsmax and you can then use it from there when needed.
What we're going to do now is create a new null called CamTarget_Baked and transfer/bake the animation from the actual camera target on to it. We can then import this into our Maya file and use it for our cameras target. Lets quickly have a look at the tool, its actually pretty simple, it has four main elements..
Pick the Node
Press this button and then click on the object whose animation you wish to bake.
Pick Bake Target
Click on this button and this time pick the object in your scene that you want the animation baked on to.
Anim Start:
This value defines the start of the animation range to be baked
Anim End
This value defines the end of the animation range to bake.
Bake Animation
When you are happy with your settings, click on this button and the tool will quickly bake the objects and range you have defined.
Close
Just click on this if you wish to close the tool
Ok, so now we know how it works, lets use it. Create a new point helper and call it CamTarget_Baked. Then run the BakeAnim tool and use Pick the Node to define the cameras target. Then use Pick Bake Target to define the point helper we have just created. The Anim Start and Anim end parameters should be correctly set at 0 and 100 automatically, so just click on Bake Animation.
The tool quickly does its thing and we now have Camtarget_Baked with the same animation as the original camera target. We can then export this file as before using .FBX and we should have a new null in Maya called CamTarget_Baked, with the same animation. Another approach is to actually pick the camera target as the node and the target from the script and the tool will the simple bake the animation on the camera target itself, but I've shown you this method so can see that there is some flexibility in how this is handled. Ok, so lets pop back into Maya.
|
|
|
|
|
| |
|
|
|
|
|
| |
|
|
|
|
|
| |
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
Importing the new Null into Maya
If we now import the new .fbx file into Maya, only the new elements will merge in, any elements with matching names are skipped. So we now have our CamTarget_Baked Null to which we can constrain our camera.
For convenience sake lets move Camtarget_Baked into the camera1_group. Then lets put Camera01_Target under our CamTarget_Baked, and then zero its transform values so it inherits the animation of its new parent exactly. But we still have the issue of our camera facing off to the left by 90 degrees, so lets use an aim constrain to put that right.
So , select CamTarget_Baked and then CTRL select Camera01 and use an aim constraint with the values shown in the image on the right hand side. Once you have applied this constraint you should find that your camera matches the one in 3dsmax in most aspects and animates in the same way.
Matching Camera Settings
Now for the relatively difficult part. We now have to setup various parameters of the camera in Maya to match the same elements in 3dsmax. If we get any of these settings setup incorrectly we will not get a match between our renders. The difficulty comes in that Maya and 3dsmax tend to measure the same parameters in different ways by default and even with different measurement systems. Anyway, lets start by setting the focal length for the lens.
Focal Length
When transferring lenses between Max and Maya its usually a good idea to use the values that the Kaydara plugin sets on its imported camera. If you look at the focal length it sets you will see that there is a slight difference between it and the values present in the original camera in Max. If we look at our Lens: value in 3dsmax (visible in the image on the right) we can see a value of 35mm, in Maya the corresponding value is the Focal Length and this has a value of 36.055.
This means that the value in Maya has a ratio of 1.03014 compared to the 3dsmax value, so to transfer any lens from 3dsmax into Maya from scratch, simply multiply the 3dsmax value by 1.03014. For instance a lens: value of 28mm in 3dsmax will become a Focal Length value of 28.8439 in Maya, whilst a lens: value of 85mm becomes 87.5621 in Maya.
Aperture Width / Film Back
In 3dsmax the aperture width is measured in millimeters, however.. in Maya the same measurement is made using inches. Also, to complicate matters further in Maya there are two related parameters, the Camera aperture Width and Height. Of the two parameters, the height is fixed and the width is derived by multiplying the height by the Film Aspect Ratio value below.
In 3dsmax we can see that we have the Aperture Width (mm) value, but we actually need the Height value to enter in Maya and to do that we have to derive the height value in 3dsmax and then convert it to an inch measurement. So, lets do that..
Aperture Width = 20.120 mm
Image Aspect
= 1.33333
Aperture Height = 20.120 / 1.33333 This gives us an Aperture Height of 15.09003 mm. We just need to convert this to an inch value. One imperial inch = 25.4mm. So...
15.09003 / 25.4 = 0.59409
We'll quickly do the same conversion for or 3dsmax width value so we can match it up in Maya..
20.120 / 25.4 = 0.79212
To complete this conversion we now have to multiply both values by the same value we used for the 3dsmax lens: earlier i.e. 1.03014. If we do so we get our final two values which are..
Width: 0.816
Height: 0.612
So, we now have the values we need for Maya. Use the Height value in the Camera Aperture Height field. You can see that when you press enter the Width value stays the same but the Film Aspect Ratio value has changed.
So, we now need to get the aspect ratio back to what it is in 3dsmax. So now enter 1.33333 in the Film Aspect Ratio field and press enter. You'll see that the Camera Aperture Height value has stayed the same (its is the one value of the three that is) and that the Width value has changed to 0.816, which matches the value we calculated earlier.
MayaFilmBack Macroscript Tool
Working out a lot of the values above could be something of a pain if you have to do it frequently. To aid this process I have written a simple Macroscript tool called MayaFilmBack that will automate the process somewhat. To use it simply install it in the usual manner and run it from a button on a tool bar.
Its interface is very simple, it has two values you can enter, Aperture Width(mm) is automatically derived from your current render settings, but you can type in another value here if you wish. Lens: uses a default value of 35mm, however you will need to set this value yourself to the desired value for your camera as I cannot assume that any scene camera is the correct one to use. Once both are set, press the Convert Film Back & Lens Values button and the script will print out the correct values to the MAXScript listener window.
Conclusion
So if you have followed the steps above you should now have a scene in Maya that when rendered matches the output of the original scene in 3dsmax. However, its not always as simple as that as there are a LOT of things that can vary between systems. But lets quickly run through the main points again...
1. in 3dsmax, convert your Cameras lens: and the render dialogues values to Maya compatible ones using the math shown above or the MayaFilmBack script provided.
2. Bake any animation in your 3dsmax scene using the BakeAnim script.
3. Export the scene to a .FBX file
4. In Maya, import the .FBX File
5. Set the Render Resolution values in the Render Globals dialogue.
6. Ensure the Camera has imported correctly, if not, fix it.
7. Set the cameras Focal Length and Film Back values
8. Test render a sequence from both 3dsmax and Maya and do a comparison in any compositing package you have access too.
If you follow those points and all goes to plan you should have a perfect match between the two systems. Of course as I've said there are a lot of issues that can make this fail. If you have any ideas on how this tutorial could be improved or you think there are major issues that need addressing to make it more complete, just let me know and I'll see what I can do about adding those elements.
Chris Thomas
chris@cg-academy.net
|
|
 |
| |
|
|
|
|
|
|
|
| |
|
| |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
|
|
|
| |
|
|
|
| |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
| |
|