============================
SANTOS TOOLS 2 SCRIPTS
============================
Version: 1.1.0
Release Date: 06-12-2010
Author: Santos
Email:
santostools@gmail.com
============================
-------------------
General Information
-------------------
'Santos Tools 2' is a collection of 3D Studio MAX scripts for importing and exporting Dawn of War 2 models and animations. All MAX version from MAX 8 upwards are supported.
-------------
Major Changes
-------------
+ added vertex welding on model import
+ script can now import models with smoothing groups
+ added new animation rollout to handle animation import and export
--------------
Required Files
--------------
Script defines it's own material called 'Relic Material'. For this material to work properly you need to extract directory containing shader definition files (shaders\dow2_*.shader) into your mod folder. Additionaly default texture files from 'art\defaults' might be required.
For exporting animations, you need to have 'Havok Content Tools' installed. You can download them for free for non-commercial use via the 'Try Havok' program (
http://software.intel.com/sites/havok). Currently only version 6.6.0 is supported, which works on MAX 9 to MAX 2010.
----------
Known Bugs
----------
- importing smoothing groups may fail for some models (MAX may crash!)
-----
Usage
-----
In MAX go to Utilities panel, click MAXScript button and select 'Santos Tools 2' from the drop down list. A new rollout should appear called 'Santos Tools 2'.
Santos Tools 2
--------------
This rollout displays currently active Dawn of War 2 module. To change current module select different module from the drop down list. Note that script requires a valid module file to operate on. Models must be imported from and exported to selected module's directory. If no modules were found 'Import', 'Export' and 'Animations' rollouts won't be visible.
Import
------
This rollout handles importing Dawn of War 2 model files. It contains three sections:
+ Import - allows to choose which elements of the model file to import
- Meshes - import meshes
- Materials - import all materials
- Bones - import bones as MAX bones
- Markers - import markers as MAX point helpers
- Bounding Volume - import bounding volumes as MAX dummy helpers
- SimBox - import simbox as MAX dummy helper
- CoverBox - import coverbox as MAX dummy helper
Materials will be imported into one multi material placed in slot 1 of MAX Material Editor. Markers cannot be imported without bones. Bounding volumes cannot be imported without meshes. Note that script will create bounding volumes on export so it's not necessery to have them in the scene.
+ Smoothing - allows to select smoothing type to be used on imported model
- None - apply no smoothing
- Smoothing Groups - apply smoothing with smoothing groups
- Normals - apply smoothing with 'Edit Normals' modifier
'Normals' option will give most accurate smoothing since it applies normals loaded from model file. 'Smoothing Groups' option will try to recreate smoothing groups from vertex normals using the least number of groups possible.
+ Options - allows to set import options
- Reset Scene - reset current scene before importing model
- Save Scene - save imported model to MAX scene file
- Merge - merge imported model with contents of the current scene
- Group Meshes - use MAX groups to organize meshes in the scene
- Weld Vertices - weld mesh vertices that share same position
- Import Biped - import skeleton as Character Studio Biped (if possible)
When 'Save Scene' is checked, script will prompt to select output directory. Inside this directory two folders will be created: 'Reference' and 'Animations'. Imported model will be saved to 'Reference\Ref.max'. Animation folder will be empty and can be used as output directory for importing animations.
When 'Reset Scene' is unchecked and 'Merge' is checked, imported models will be merged with models already in the scene, to use the same set of materials, bones and markers. This allows to build full model from various wargear items.
If 'Group Meshes' is checked, script will create MAX groups for mesh groups and lods to organize imported meshes in hierarchical tree structure. If unchecked, imported meshes will have fully qualified names in the following format: [mesh group]:[lod]:[sub mesh].
'Import Biped' will only work with 'Reset Scene' on as bipeds cannot be merged.
Export
------
This rollout handles exporting Dawn of War 2 model files.
- Export Model - exports current scene into MODEL file
- Export Options - displays dialog wich allows to set export options
- Preview Model - opens current model in 'Model Editor'
To export model press 'Export Model' button. Before exporting, export options should be set. These options will be saved with the model's scene file. To show 'Export Dialog' click 'Export Options' button.
The most important setting here is 'Output File' which defines where exported MODEL file will be saved. Note that output path should be relative to current module data path.'Damage States' section allows to select which mesh group will be visible in different model damge states. In 'Data Table' section you can choose if to export 'damage_state' state machine and 'health' variable into MODEL file. 'Bounding Boxes' section allows to control exporting of model's bounding boxes (simbox and coverbox). This section will be disabled if given box is not present in the scene.
'Options' section contains global export options. Currently the only option available is 'Delete File on Error'. If checked uncomplete MODEL files will be deleted when export fails.
Animations
----------
This rollout handles animation import and export. It contains three sections:
+ Import - contains functions for importing animations
- Import Animation - import single animation from ANIM file and save it as MAX scene
- Quick Import - import single animation from ANIM file without saving
- Batch Import - import all animations in selected directory and save them to MAX scenes
'Import Animation' and 'Batch Import' will save two additional files along with MAX scene file. RIG file will contain skeleton extracted from imported animation. TRACKS file will contain names of bones used in imported animation.
'Import Animation' and 'Quick Import' will use currently loaded scene as reference file for imported animation. 'Batch Import' will ask for reference file if no max scene is opened. Reference file might be different from model's main reference file, but needs to contain all bones used in imported animation. To determine which bones are missing from reference file, import animation using 'Quick Import' and look in MAXSCript Listener (F11) for warnings about missing bones.
+ Export - contains functions for exporting animations
- Export Animation - export animation into HKX file, shows 'Havok Content Tools' dialog
- Quick Export - export animation without showing 'Havok Content Tools' dialog
- Batch Export - export all animation in selected directory
When exporting animation for the first time it is advised to use 'Export Animation' button. This will display 'Havok Content Tools' dialog. This dialog allows to modify animation export options and displays export log. To export animation press 'Run configuration' button.
When modifying animation that was previously exported successfully, you can use 'Quick Export' button which will export animation in silent mode without showing 'Havok Content Tools' dialog.
Both 'Export Animation' and 'Quick Export' require MAX scene file with animation scene to be already loaded.
'Batch Export' will export all animations in selected directory and it's sub directories (up to one level deep), preserving directory structure in output folder.
All export functions require RIG and TRACKS files to be present in the same directory as loaded MAX scene. These files will be created on animation import. For animation made from scratch you can create these files by using 'Edit Rig' and 'Edit Tracks' button in 'Utilities' section.
+ Utilities - contains additional animation related utility functions
- Edit Rig - edit animation rig (skeleton)
- Edit Tracks - edit animation tracks (bones used in animation)
Pressing either button will launch custom dialog that allows to create bone list by selecting bones from the scene. Bones can be moved between lists by using '>' and '<' buttons. '>>' button will move all bones from scene to bone list, '<<' button will clear list. Pressing 'Reset' button will reload bone list from file. Pressing 'OK' button will save list to RIG or TRACKS file (depending which button was used) with the same name and to the same directory as currently loaded MAX scene file. To close dialog without saving press 'Cancel' button.