gmax to YafRay Exporter
New Features in v1.2
- Get Extents calculates the best scale factor to apply in gmax before exporting (see below).
- All object materials are checked and the export is stopped before it starts if any missing or multi-materials are found.
- Fix for the Win98 bug to eliminate the filename at the end of the data which causes a YafRay error.
- Render Size quick select & Custom select with settings retained when switching between modes.
- Data and image output paths can now be set separately, filename defaults to the scene name and can be edited.
- UI improvements and lots of little bug fixes and things too numerous to list.
Scene Scaling
One of the keys to successfully exporting objects and scenes from gmax to YafRay is proper scene scaling. YafRay seems
to work best within a 10x10x10 box.
The gmax System Unit Scale determines the size of the object that will be exported by gmax. The scene will
likely be many times too large for YafRay to properly render it with the lighting specified. The exporter has built-in
object scaling and light multiplication controls, but the preferred method is to re-scale the scene inside gmax before
exporting. To find out what the System Unit Scale should be set at for a scene, you need to determine the scene extents.
Step 1) The old Hard Way
- Create a box that roughly encloses all the objects in the scene, then apply a scene material to it.
- Hide all the other objects in your scene (Rt. click > hide unselected) to keep them from being exported.
- Set the exporter to Scale All Units 1.0 then export the data and look at the box dimensions listed in
the listener window (F11).
- Select Customize > Preferences, General Tab in the gmax main menu to check the current System Unit Scale and
calculate the new scale for your box (scene). If the box is 100x100x100 at System Unit Scale 1 unit = 1", you could
change it to 1 unit = 1 foot making the scene about 80% smaller, the box would be about 8x8x8. Or you could change it
so that 1 unit = 10.0" for a 10x10x10 box. If the the box was 167x250x120 you would want to set the scale to 1 unit = 25.0, etc.
- Save any changes in your scene before going further, you probably won't want to save it at the new scale settings except
for rendering purposes.
The important thing to remember is that it doesn't really matter if the scene was saved in inches or meters, we just need
to divide the largest dimension by 10 so that when rescaled and exported it roughly fits in a 10x10x10 box.
Step 1) The new Easy Way
- The "Get Extents" function takes all the work out of finding the scene extents.
- Hide any objects that won't be visible to the camera (Rt. click > hide selected), this includes the "plane" that your scene
may be set on or using as a backdrop. "Get Extents" ignores any lights and cameras in your scene, it's only concerned about
finding the objects that will be rendered, and calculates the new scale based on the objects that will be 'seen' by the camera.
- If you want to see the bounding box which represents the extents that are found, check the "Draw Box" checkbox. Next, press
the "Export Scene" button to calculate the extents, the results will be listed in the listener window.
- Save any changes in your scene before going further, you probably won't want to save it at the new scale settings except for
rendering purposes.
- Select Customize > Preferences, General Tab from the gmax main menu and enter the new System Unit Scale value that
is listed in the Listener window.
Step 2) Applying the new System Unit Scale
- After setting the new System Unit Scale you will need to reload your scene to activate the new scale.
- Open the scene (answer NO, when prompted about Saving the changes)
- A dialog box will indicate a Units Mismatch, pick the option to "Rescale the File Objects to match the system Unit Scale"
to load the scene scaled to the new value. Note: You probably won't want to do any modeling at this system scale factor so
when you are done rendering this scene you should either Reset gmax or reload the scene, but this time select the option to
"Adopt the File's Unit Scale".
Step 3) Test Render
- Select a low resolution like 320x240 and set "Scale All Units" to 1.0 and the "Light Multiplier" to about 50.
- Export the Scene, if it passes the materials, lights and camera checks the data will be sent to the listener window.
- Run the grabber utility and press the "Grab" button to write the data to the file.
- Run YafRay yourfilename.xml to generate the render.
- When YafRay finishes open yourfilename.tga to see the results.
From here you'll most likely need to fine tune the lighting multiplier, add more lights, or reposition them to get good overall scene
lighting. Once you're happy with the overall look of the scene, fine tune your materials and apply the various GI, background, filter
and other rendering parameters.
Important Note about Scaling 'boned' objects. Scaling an object doesn't change the scale of skin envelopes in gmax.
Scaling a boned & skinned object will result in something that looks like a horribly deformed pretzel unless you first turn off
the skin modifier.
|