Importing
SMD format model files (as exported from SoftImage XSI v4.2 Mod Tool
|
Importing
SMD format skeletal animation files (as exported from XSI)
|
Importing
DirectX X-file format files, both with and without animation sets
|
Combining
loaded animation sets with reference (model) information
|
Exporting
DirectX X-files, both static and with animation sets, compatible for
loading into DirectX-based applications using the D3DX function D3DXLoadMeshHierarchyFromX.
|
When you open SMD2X ( version 4 - SMD2X_4 ), the status of the application is shown. The Primary Reference has not been set and no animation sets have been added to the Primary Animation Sets. Neither an SMD model Reference file or an SMD Animation Set has been loaded. No X File has been loaded. |
|
The SMD Files menu has two choices: - Load an SMD Reference (model) file - Load an SMD Animation file |
|
Click on Load SMD Reference File and, in the resources directory that comes with the SMD2X download, select ss_woman_basic.smd and click OK. | |
As the reference file is loaded, the status of the loading process is displayed. This status may appear only momentarily, depending on the speed of your machine. By far, reading the mesh takes the most time. If the application appears stalled during this phase, be patient. It may take several seconds. |
|
Checking
SMD file header..
|
An SMD file is a plain text file and the header is simply the line "version 1." If you wish, you can open ss_woman_basic.smd in any text editor and examine the sections as described below. |
Loading
nodes..
|
The
"nodes" section of the SMD file is read in and stored. This
is an array of frame names along with node identification numbers and
the identification number of each node's parent node
|
Setting
up relationships..
|
A structure is set up which describes each frame's parent frame, any child frames for which it may be the parent, and sibling frames - other frames which have the same parent. During this phase, a default Scene_Root frame with a transformation identity matrix is created which is the parent frame for all frames in the file. |
Reading
the skeleton structure..
|
The "skeleton" section of the SMD file contains the position and rotation of each bone frame with respect to its parent frame. This is the local transformation matrix DirectX programmers may be familiar with. During this phase of loading, the base skeleton node, the node which is parent to all other bones, is identified and a rotation of -PI/4 about the X axis applied. This provides compatibility between the SMD format (used in the Half-Life® and the Half-Life 2® games) and DirectX axes. |
Fixing
names..
|
As exported from XSI Mod Tool, the names of many bones in the ValveBiped structure contain a period (.), denoting its relationship to the rest of the bone structure. A period (.) in any name is replaced with an underscore (_). An X-file exported with names containing periods may not result in the proper bone structure in DirectX. Instead, in the X-File format, the relationship between a frame and its children is determined by imbedding the children between the parent's open '{' and close '}' brackets. |
Reading
the mesh..
|
The "triangles" section of the SMD file contains vertex positions, normals, texture coordinates and a list of bone identification numbers and the weight on that vertex associated with each bone. These are the "bone weights" or "skin weights" DirectX programmers may be familiar with. |
After the reference file has been loaded, the status is updated, showing that the SMD Reference is available. | |
The Primary menu now has one item enabled - setting the Primary Nodes to the SMD reference. This corresponds to the red arrow in the application structure pictured above this table. Click on Set Primary Nodes to SMD reference. |
|
As shown, the Primary Reference has been copied from the SMD Reference. The Save status reflects that no X-file exports have been made. |
|
As indicated in the Primary menu, now that the Primary Reference has been set, a non-animated (static) X-file can be exported. In the application structure above this table, that is indicated by the purple arrow pointing from Primary Reference to X-File (static model). |
|
Click on Export Non-Animated X File, select a filename (such as woman_basic.x or similar) in the FileSave dialog box and click OK. | |
The status now reflects that you have exported the current Primaries to the filename you chose. | |
Open your favorite mesh viewer and load the x-file you just exported. IF THE MODEL APPEARS SOLID GRAY, instead of textured: - Ensure you set the texture in XSI to a DirectX compatible format. The default in XSI is a GIF texture and will not load properly. - Ensure that the texture file you used in texturing the model in XSI is in the same folder with the X-file you exported. |
updated 24-Apr-2008