Difference between revisions of "Rigging in XSI"

From Valve Developer Community
Jump to: navigation, search
m (Rigging Your Character - From Scratch: second section finished.)
m (Importing a custom character mesh: Fixed a link)
 
(19 intermediate revisions by 10 users not shown)
Line 1: Line 1:
=Rigging Your Character - The Easy Way=
+
== Rigging a character model - the easy way==
 +
=== Anatomy of the Valve character rig ===
 +
[[Image:CreatingaCustomCharacter_1.gif|thumb|300px|[[Media:CreatingaCustomCharacter_1.gif|An image of the urban_reference.scn file]]]]
  
 +
Characters in Half-Life 2 are enveloped (skinned) to a skeletal rig. The skeletal rig is then animated to deform the envelope. These animations are then stored in the XSI Mixer and later exported to individual SMD files.
  
==Anatomy of the Valve Character Rig==
+
The character used as a base in this tutorial is a Counter-Strike character included in the source SDK.
 
 
The first thing you need to know is how a HL2 character is setup in XSI.
 
 
 
Characters in Half-Life 2 are enveloped (skinned) to a skeletal rig. The skeletal rig is then animated to deform the envelope. These animations are then stored in the XSI Mixer and later exported to individual SMD file.
 
 
 
Take a look at the complete HL2 Character in detail. The character we will use as a base is a Counter-Strike character included in the source SDK.
 
[[Image:CreatingaCustomCharacter_1.gif|A image of the urban_reference.scn file]]
 
 
 
  
 
* Start XSI Mod Tool
 
* Start XSI Mod Tool
 
* Select File->Open
 
* Select File->Open
* Select the Source SDK sample scene called urban_reference.scn (\sourcesdk_content\cstrike\modelsrc\urban\xsi\urban_reference.scn)
+
* Select the Source SDK sample scene called urban_reference.scn
 +
<code>\sourcesdk_content\cstrike\modelsrc\urban\xsi\urban_reference.scn</code>
  
 +
{{warning|The export process currently works for XSI 4+ and is reported to work for 5.0, but '''not 5.0.1 or 5.1'''. There is currently no available fix for the Valve addon using the latest version of XSI.}}
  
Once loaded, you should see the character in what we will call the reference pose (neutral pose). The colored spheres and boxes are animation controllers (implicit geometry). They are simple helpers attached to the underlying skeletal rig (which is currently hidden). They make it simple to animate a complex rig without seeing the entire skeleton on screen.
+
Once loaded, the character is seen in what is called the reference pose (neutral pose). The colored spheres and boxes are animation controllers (implicit geometry). They are simple helpers attached to the underlying skeletal rig (which is currently hidden). They make it simple to animate a complex rig without seeing the entire skeleton on screen.
  
 
Next, open up the XSI Scene Explorer by either selecting it from the Application menu (Application->Views->Explorer) or hitting the 8 key.  
 
Next, open up the XSI Scene Explorer by either selecting it from the Application menu (Application->Views->Explorer) or hitting the 8 key.  
  
The explorer is a powerful tool to manage your scene. With the explorer, you can navigate through the hierarchy of the scene, re-parent stuff, call up properties, etc.  
+
{{note|The explorer is a powerful tool to manage your scene. With the explorer, the hierarchy of the scene can be navigated, objects can be re-parented, properties can be viewed, etc.}}
  
  
 
This image shows How the Scene is setup.
 
This image shows How the Scene is setup.
[[image:CreatingaCustomCharacter_2.gif|How the urban_reference.scn file is setup]]
+
[[Image:CreatingaCustomCharacter_2.gif|thumb|400px|none|[[Media:CreatingaCustomCharacter_2.gif|How the urban_reference.scn file is setup]]]]
 
 
The rig is located under the model called urban_mdl. This model is simply a "container" object. The actual IK rig is located under the node called Bip01. At the bottom of the model, you see three groups. Groups are also a container object that points to a bunch of other object in the scene. They are handy for grouping similar object together.
 
 
 
'''Envelope Deformers''' is a group that contains are the objects (bones) that actually deform the mesh. That is, that have influence on at least 1 vertex  in the mesh.
 
  
'''hidden_distractions''' simply contains all objects that are not immediately useful to the animator and that should be hidden (like parent nulls, IK chain roots and effectors. etc.)
+
The rig is located under the model called urban_mdl. This model is simply a "container" object. The actual IK rig is located under the node called Bip01. At the bottom of the model, there are three groups. Groups are also container objects that point to other objects in the scene. They can be used for grouping similar objects together.
  
'''Plotted''' is a group that contains all bones that should be considered when creating an animation clip. You will learn more about this group in chapter 3.
+
'''Envelope Deformers''' is a group that contains the objects (bones) that actually deform the mesh. That is, each deformer  influences at least 1 vertex  in the mesh.
  
 +
'''hidden_distractions''' is simply a group that contains all the objects that are not immediately useful to the animator and should be hidden (e.g., parent nulls, IK chain roots and effectors).
  
==Understanding XSI Envelopes and Weights==
+
'''Plotted''' is a group that contains all bones that should be considered when creating an animation clip. More about this group is discussed below.
  
Now let's look at the other part of the scene, the one we will be replacing with our own mesh. Before replacing it though, we must understand it's different parts.
 
[[image:CreatingaCustomCharacter_urban_mesh.gif|different parts of the original mesh.]]
 
  
When you expand the urban_mesh polygonal mesh object, you can see that it contains a property called "Polygonal Mesh". This is were you will find all operators that affect the mesh in any way. On the image above, you can see that this mesh has an Envelope Operator under it's animation set. A little lower, you can see a list of clusters containing two clusters. One is the WeightMap, the other is the UV coordinates. XSI uses clusters when it needs to store per-vertex attributes. For the weight map cluster, these are the weights for each vertex to the bones that are deforming it. And for the Texture_Coordinate_AUTO, well, it contains UV coordinates for each vertex. 
+
=== Understanding XSI envelopes and weights ===
  
The cluster that is interesting us for now is the WeightMap. Basically, we want to transfer this WeightMap onto our new character instead of re-enveloping the character manually. This automatic assignment of weights will literally save you hours of tedious mesh weighting.
+
[[Image:CreatingaCustomCharacter_urban_mesh.gif|thumb|200px|[[Media:CreatingaCustomCharacter_urban_mesh.gif|Different parts of the original mesh]]]]
 +
Another part of the scene will be examined, the part that will be replaced with a custom mesh. Before replacing it, the different parts should be understood.
  
Included in the Valve Source Addon for XSI is a nifty little export plugin called WeightMap Export. See below:
+
When the urban_mesh polygonal mesh object is expanded in the Explorer window, a property called "Polygonal Mesh" can be seen. This is where all operators that affect the mesh in any way can be found. In the accompanying image, note that this mesh has an Envelope Operator under it's animation set. A little lower in the listing, there a list of clusters containing two clusters. One cluster is the WeightMap; the other is the UV coordinates. XSI uses clusters to store per-vertex attributes. For the weight map cluster, these are the weights or ratios for each bone that are applied to the vertices that the bone deforms. The Texture_Coordinate_AUTO group contains UV coordinates for each vertex.
  
[[image:CreatingaCustomCharacter_3.gif|The Weightmap Export Option]]
+
The cluster that is of interest for now is the WeightMap. This weightmap will be applied to the new character mesh instead of re-enveloping the character mesh manually. This automatic assignment of weights will save hours of tedious mesh weighting.
  
To use it, follow these steps:
+
Included in the Valve Source addon for XSI is an export plugin called WeightMap Export. See below:
* First select the mesh that has the weight map you want to export. In our case, select the urban_mesh object
 
* From the ValveSource menu, select WeightMap Export
 
* Give it a filename and save the map.
 
  
 +
[[Image:CreatingaCustomCharacter_3.gif|thumb|300px|none|[[Media:CreatingaCustomCharacter_3.gif|The Weightmap Export option]]]]
  
==Importing Your Custom Mesh==
+
Export the urban mesh weight map as follows:
 +
* Select the mesh that has the weight map to be exported. I.e., select the urban_mesh object.
 +
* From the ValveSource menu, select WeightMap Export.
 +
* Enter a meaningful filename for the weight map and save the map.
  
 +
=== Importing a custom character mesh ===
 
The XSI Mod Tool comes built in with several importers available under the File->Import menu.
 
The XSI Mod Tool comes built in with several importers available under the File->Import menu.
 
* dotXSI - Softimage Open File Format
 
* dotXSI - Softimage Open File Format
 
* .3ds - Autodesk legacy format
 
* .3ds - Autodesk legacy format
* .obj - Alias Scene(non Functional at this time)
+
* .obj - Alias Scene (non-functional at this time)
 
* .x - Microsoft DirectX file.
 
* .x - Microsoft DirectX file.
  
  
The following is the mesh we will use for our custom character.
+
The following is the mesh that will used for the custom character in this tutorial.
[[image:CreatingaCustomCharacter_5.gif|The new unskined mesh]]
+
 
 +
[[Image:CreatingaCustomCharacter_5.gif|thumb|300px|none|[[Media:CreatingaCustomCharacter_5.gif|The new unskined mesh]]]]
  
 +
Of course, a character meshed can be created from scratch directly in the Mod Tool using it's powerful modeling toolset. Here is a small list of modeling tutorials for XSI.
  
Of course, you can always create your character from scratch directly in Mod Tool using it's powerful modeling toolset. Here is a small list of modeling tutorials for XSI.
+
* http://www.xsibase.com/tutorials/modeling.php
 +
* http://www.mindspring.com/%7Ebblakesley/Tutorial1/main.html
 +
* http://www.chnl1.tv/tutorial_1.htm
 +
* http://www.chnl1.tv/tutorial_2.htm
 +
* http://www.anikoleez.com/tuto/tuto02.htm
 +
* http://www.onionboy.co.uk/tutorials_eye.html
 +
* http://www.joncrow.com/tutorials/xsi_tuts/rotoscope_technique/rotoscoping_technique.htm
 +
* http://www.joncrow.com/tutorials/xsi_tuts/Symmetrical%20Shape%20Anim/sym_shape_anim_compressed.avi
 +
* http://www.thejaco.com/tutorials/3_tire.avi
 +
* http://www.anotherhell.com/tutorials.htm
 +
* http://veazie.org/Tutorials/hl2%20tutorials.html
  
http://www.xsibase.com/tutorials/modeling.php
 
http://www.mindspring.com/%7Ebblakesley/Tutorial1/main.html
 
http://www.chnl1.tv/tutorial_1.htm
 
http://www.chnl1.tv/tutorial_2.htm
 
http://www.anikoleez.com/tuto/tuto02.htm
 
http://www.onionboy.co.uk/tutorials_eye.html
 
http://www.joncrow.com/tutorials/xsi_tuts/rotoscope_technique/rotoscoping_technique.htm
 
http://www.joncrow.com/tutorials/xsi_tuts/Symmetrical%20Shape%20Anim/sym_shape_anim_compressed.avi
 
http://www.thejaco.com/tutorials/3_tire.avi
 
http://www.anotherhell.com/tutorials.htm
 
  
The next step involves moving and scaling the character (and possibly moving some points as well) and try to match the position of the original mesh. Is it not mandatory that the mesh fits perfectly on top on the original mesh, but the better the fit, the better will be the resulting  envelope. However, it is important that the joints (like elbows, knees, ankles, etc.) be at the same position. If they aren't, the arms and legs will bend in the wrong position.
+
The following steps involve moving and scaling the new character mesh (and possibly moving some points as well) to match the position of the original urban model mesh as closely as possible. The new mesh does not have to fit perfectly on top on the original mesh, but the better the fit, the better will be the resulting  envelope. However, it is important that the joints (like elbows, knees, ankles, etc.) be at the same position. If they aren't, the arms and legs will bend in the wrong position.
  
[[image:CreatingaCustomCharacter_6.jpg|The new mesh overlaying the original]]
+
[[Image:CreatingaCustomCharacter_6.jpg|thumb|300px|none|[[Media:CreatingaCustomCharacter_6.jpg|The new mesh overlaying the original]]]]
  
Once you have place your character on top of the other one, you need to delete the old mesh. Do this by branch-selecting the urban_mesh object and hitting the delete key. Branch-selection means that it will select the mesh and everything under it as well. You branch-select something by middle-clicking on it. Or by selecting it and using the Select->Branch from the Select menu.
+
Once the new character mesh has been placed on top of the urban model mesh, the urban model mesh can be deleted as it is used only to provide a guide for positioning. Delete the urban model mesh by <code>branch-selecting</code> the urban_mesh object and hitting the delete key. <code>Branch-selection</code> selects the mesh and everything under it as well. An object can be <code>branch-selected</code> by middle-clicking on the object's name in the Explorer window, or by left-clicking the object's name and using the Select->Branch from the Select menu.
  
  
Next, we will re-import the saved weight map to transfer the weights onto our new mesh. To do this, do the following steps:
+
Next, the saved weight map will be imported to apply the weights to our new mesh.
* Select the mesh on which you want the weights to be applied.
+
* Select the mesh to which the weights are to be applied, i.e., the new character mesh.
 
* Use the ValveSource->WeightMap Import menu.
 
* Use the ValveSource->WeightMap Import menu.
* Select the weightmap file you have saved earlier and click OK.
+
* Select the weightmap file saved earlier and click OK.
  
[[image:CreatingaCustomCharacter_7.gif|WeightMap Import Before]]
+
[[Image:CreatingaCustomCharacter_7.gif|thumb|300px|none|[[Media:CreatingaCustomCharacter_7.gif|WeightMap Import before]]]]
  
The WeightMap Import plugin will transfer the WeightMap by averaging the weights according to vertex positions. The results are not perfect, but again, it will save you hours of envelope tweaking. The following image shows the results after the weights have been imported.
+
The WeightMap Import plugin will transfer the weightmap by averaging the weights according to vertex positions. The results are not perfect, but again, it will save hours of envelope tweaking. The following image shows the results after the weights have been imported.
  
[[image:CreatingaCustomCharacter_8.gif|WeightMap Import After]]
+
[[Image:CreatingaCustomCharacter_8.gif|thumb|200px|none|[[Media:CreatingaCustomCharacter_8.gif|WeightMap Import after]]]]
  
Test your WeightMap by moving the rig around. As you can see from the image below, some weights might need some tweaking. Here's a tutorial on Enveloping in XSI:
+
The weightmap can be tested by moving the rig around. As seen in the image below, some weights might need some tweaking.
http://www.softimage.com/education/Xsi/SelfPacedLearning/Tutorials/webTutorials/XSI_3_0/Char_Setup_env/XSI30_Tutorial07.pdf
 
  
[[image:CreatingaCustomCharacter_11.gif|WeightMap Problems.]]
+
{| class=standard-table
 +
|-
 +
| [[Image:CreatingaCustomCharacter_11.gif|thumb|333px|none|[[Media:CreatingaCustomCharacter_11.gif|WeightMap problems.]]]]
 +
| [[Image:CreatingaCustomCharacter_12.jpg|thumb|300px|none|[[Media:CreatingaCustomCharacter_12.jpg|Fixing WeightMap problems]]]]
 +
|}
  
[[image:CreatingaCustomCharacter_12.jpg|Fixing WeightMap Problems]]
+
== Rigging a character model - from scratch ==
 +
=== The biped guide ===
  
 +
The first part of this tutorial demonstrated how to automatically envelope a custom character mesh using the weightmap of an existing character. While this method saves time, it might not be suitable for every character in the game. If a new character has very different topology (e.g., a child character or an adult male), the previously-described method is less than ideal.
  
=Rigging Your Character - From Scratch=
+
The solution is use the Valve Biped Guide.
 
 
==The Biped Guide==
 
  
In chapter one we saw how to automatically envelope a character using the weightmap of an existing character. While this method saves time, it might not be suitable for every character in your game. If you character have very different topology for instance a child character and a adult male, the method described in chapter one is less than ideal.
+
First import the character mesh to be rigged and weight-mapped. The Ninja mesh used above will also be used for this portion of the tutorial. However, for this demonstration, his arms are not in the neutral pose commonly used in the SDK examples. In this example, the arms are closer to the "Da Vinci pose". This would have been difficult to envelope using the method described above.
  
The solution is use the Valve Biped Guide.
+
After the new mesh has been imported, get a Biped Guide Rig from the Valve Source Menu.
 +
[[Image:CreatingaCustomCharacter_b2.gif|thumb|300px|none|[[Media:CreatingaCustomCharacter_b2.gif|Biped Guide option]]]]
  
First import your character mesh. I will re-use the Ninja mesh used in chapter one, but this time, his arms are not in a neutral pose, they are closer to the the so-called Da Vinci pose. This would have been impossible to envelope with the method describe in chapter one.
+
The Biped Guide is a dummy rig that is used to guide the creation of a functional rig. The Biped guide is used by positioning the cubes at the end of each chain are positioned to match the new character mesh position.  
  
After you have imported your mesh, get a Biped Guide Rig from the Valve Source Menu.
+
This is what the scene looks like before the guide is positioned in the mesh.
[[image:CreatingaCustomCharacter_b2.gif|Biped Guide Option]]
 
  
The Biped Guide, is a dummy rig that is used to guide the creation of a real functional rig. You use this guide by positionning the cube at each end of each chain to the position in which your character is.
+
[[Image:CreatingaCustomCharacter_b3.gif|thumb|300px|none|[[Media:CreatingaCustomCharacter_b3.gif|Biped Guide now imported]]]]
  
This is what the scene looks like before the guide is positioned in the mesh.
+
Use the guide to position the bones in the mesh. Here is the result.  
  
[[image:CreatingaCustomCharacter_b3.gif|Biped Guide now imported]]
+
{{note|Before the cubes are positioned inside the mesh, turn off the "selectability" property of the Ninja mesh. This will prevent the Ninja mesh from being accidentally selected when Guide cubes are being selected. This is done by un-checking the "Selectability" property under the mesh's Visibility Property Page.
  
Use the guide to position your bones in the mesh. Here is the result. Note that before I started positionning cubes inside the mesh, I turned off the "selectability" property of the Ninja mesh so that I don't accidently select it when I want to select a cube. You do this by un-checking the "Selectability" property under the mesh's Visibility Property Page.
+
[[Image:CreatingaCustomCharacter_b1.gif|thumb|300px|none|[[Media:CreatingaCustomCharacter_b1.gif|Mesh set so it cant be selected]]]]
  
[[image:CreatingaCustomCharacter_b1.gif|Mesh set so it cant be selected]]
+
=== Creating the rig from the guide ===
 +
[[Image:CreatingaCustomCharacter_b4.gif|thumb|200px|[[Media:CreatingaCustomCharacter_b4.gif|Create rig from guide option]]]]
 +
Once the guide has been positioned in the proper place, a fully functional Valve Biped rig can be created from it.
  
==Creating Rig From Guide==
+
Select the menu Create Rig From Guide from the ValveSource menu to start the process.
  
Once you have positionned the guide in the proper place, it's time to create a fully functional Valve Biped rig out of it. Select the menu Create Rig From Guide from the ValveSource menu.
+
During the creation of the rig, there may be multiple warning messages stating that a cycle has been created. Click OK and ignore these warnings.
  
During the creation of the rig, you might get a warning message saying that a cycle has been created. You may click OK and ignore these warnings.
+
{{note|Creation of the rig from the Guide may take several minutes (e.g., greater than 3 minutes with a 3.6GHz processor). The XSI window may turn white for extended lengths of time prior to completion of the process.}}
  
[[image:CreatingaCustomCharacter_b4.gif|Create rig from guide option]]
+
Following the creation of the rig, multiple property and expression editor windows may appear. They may be safely closed.
  
==Enveloping==
+
=== Enveloping ===
  
Now that you have your rig, you can safely delete the Biped Guide by branch selecting it from the Explorer and hitting 'delete' since we have no more use for it. This will also un-clutter the scene a bit.  
+
Now that the rig has been created, the Biped Guide can be safely deleted by branch-selecting it in the Explorer window and hitting 'delete.' This will also un-clutter the scene a bit.  
  
Next we want to envelope our mesh to the rig. If you remember from chapter one, the rig was setup with a group called Envelope_Deformers. These are all the objects that deform the mesh, these are the object which we will use to create our envelope.
+
Next, the mesh will be enveloped to the rig. As described earlier in this tutorial, the ValveBiped object contains a group called Envelope_Deformers. These are all the objects that deform the mesh and are used to create the envelope.
  
To create an envelope in XSI, first
+
To create an envelope in XSI:
* Select the mesh  
+
* Select the mesh for which the envelope is to be set.
* Hit '2' to switch to the Animate Toolbar
+
* Press '2' to switch to the Animate Toolbar.
* Select Envelope->Set Envelope from the Animation->Deform toolbar
+
* In the Context menu (normally in the lower left-hand corner of the XSI window), select Animation from the Construction Mode dropdown list.
[[image:CreatingaCustomCharacter_b6.gif|set envlope option]]
+
* In the Animation toolbar, select Deform->Envelope->Set Envelope.
* Hit '8' to open up an explorer (or select one from the Application->Views menu)
+
[[Image:CreatingaCustomCharacter_b6.gif|thumb|300px|none|[[Media:CreatingaCustomCharacter_b6.gif|Set envlope option]]]]
* Expand the ValveBiped model and select the Envelope_Deformer group
+
* Hit '8' to open up an explorer or, in the Applications menu, select Views->XSI Explorer.
* Finally right click anyway to end the pick-session
+
* Expand the ValveBiped object in the Explorer window and select the Envelope_Deformer group.
[[image:CreatingaCustomCharacter_b62.gif]]
+
* Right-click anywhere to end the pick-session.
 +
[[Image:CreatingaCustomCharacter_b62.gif|thumb|150px|none|[[Media:CreatingaCustomCharacter_b62.gif|Click to enlarge]]]]
  
  
Your mesh should now be enveloped to the rig. Note that this automatic assignment of weight that XSI does is not perfect. It does a pretty good job, but you still need to clean up certain areas of the weightmap such as under the arms and legs. You can use all the weightmap tools (like smoothing, etc.) to properly envelope the mesh.
+
The mesh is now enveloped to the rig. If the mesh does not appear to be weight-mapped:
 +
* Ensure the mesh is selected.
 +
* Click on the "eye" icon dropdown menu at the top of the XSI view and ensure Weight Maps is selected.
 +
* Click on the Display Mode dropdown at the top right of the XSI view and select Constant.
  
[[image:CreatingaCustomCharacter_b9.gif|Mostly envloped rig]]
+
The assignment of weights using this technique in XSI is not perfect. It does a pretty good job, but clean-up of certain areas of the weightmap may still be necessary, such as under the arms and legs. The weightmap tools (like smoothing, etc.) can be used to properly weight the mesh to the bones.
  
This tutorial will not teach you how to cleanup weight maps in XSI, but here's a tutorial on XSI envelopes that should be helpful.
+
For editing the weight map, see [[Weight Map Editing]].
  
http://www.softimage.com/education/Xsi/SelfPacedLearning/Tutorials/webTutorials/XSI_3_0/Char_Setup_env/XSI30_Tutorial07.pdf
+
[[Image:CreatingaCustomCharacter_b9.gif|thumb|300px|none|[[Media:CreatingaCustomCharacter_b9.gif|Mostly envloped rig]]]]
  
[[Category:Tutorials]][[Category:Modeling]][[Category:XSI]]
+
[[Category:Tutorials]]
 +
[[Category:Modeling]]
 +
[[Category:XSI]]

Latest revision as of 23:41, 21 June 2016

Rigging a character model - the easy way

Anatomy of the Valve character rig

Characters in Half-Life 2 are enveloped (skinned) to a skeletal rig. The skeletal rig is then animated to deform the envelope. These animations are then stored in the XSI Mixer and later exported to individual SMD files.

The character used as a base in this tutorial is a Counter-Strike character included in the source SDK.

  • Start XSI Mod Tool
  • Select File->Open
  • Select the Source SDK sample scene called urban_reference.scn
\sourcesdk_content\cstrike\modelsrc\urban\xsi\urban_reference.scn
Warning.png Warning: The export process currently works for XSI 4+ and is reported to work for 5.0, but not 5.0.1 or 5.1. There is currently no available fix for the Valve addon using the latest version of XSI.

Once loaded, the character is seen in what is called the reference pose (neutral pose). The colored spheres and boxes are animation controllers (implicit geometry). They are simple helpers attached to the underlying skeletal rig (which is currently hidden). They make it simple to animate a complex rig without seeing the entire skeleton on screen.

Next, open up the XSI Scene Explorer by either selecting it from the Application menu (Application->Views->Explorer) or hitting the 8 key.

Note.png Note: The explorer is a powerful tool to manage your scene. With the explorer, the hierarchy of the scene can be navigated, objects can be re-parented, properties can be viewed, etc.


This image shows How the Scene is setup.

The rig is located under the model called urban_mdl. This model is simply a "container" object. The actual IK rig is located under the node called Bip01. At the bottom of the model, there are three groups. Groups are also container objects that point to other objects in the scene. They can be used for grouping similar objects together.

Envelope Deformers is a group that contains the objects (bones) that actually deform the mesh. That is, each deformer influences at least 1 vertex in the mesh.

hidden_distractions is simply a group that contains all the objects that are not immediately useful to the animator and should be hidden (e.g., parent nulls, IK chain roots and effectors).

Plotted is a group that contains all bones that should be considered when creating an animation clip. More about this group is discussed below.


Understanding XSI envelopes and weights

Another part of the scene will be examined, the part that will be replaced with a custom mesh. Before replacing it, the different parts should be understood.

When the urban_mesh polygonal mesh object is expanded in the Explorer window, a property called "Polygonal Mesh" can be seen. This is where all operators that affect the mesh in any way can be found. In the accompanying image, note that this mesh has an Envelope Operator under it's animation set. A little lower in the listing, there a list of clusters containing two clusters. One cluster is the WeightMap; the other is the UV coordinates. XSI uses clusters to store per-vertex attributes. For the weight map cluster, these are the weights or ratios for each bone that are applied to the vertices that the bone deforms. The Texture_Coordinate_AUTO group contains UV coordinates for each vertex.

The cluster that is of interest for now is the WeightMap. This weightmap will be applied to the new character mesh instead of re-enveloping the character mesh manually. This automatic assignment of weights will save hours of tedious mesh weighting.

Included in the Valve Source addon for XSI is an export plugin called WeightMap Export. See below:

Export the urban mesh weight map as follows:

  • Select the mesh that has the weight map to be exported. I.e., select the urban_mesh object.
  • From the ValveSource menu, select WeightMap Export.
  • Enter a meaningful filename for the weight map and save the map.

Importing a custom character mesh

The XSI Mod Tool comes built in with several importers available under the File->Import menu.

  • dotXSI - Softimage Open File Format
  • .3ds - Autodesk legacy format
  • .obj - Alias Scene (non-functional at this time)
  • .x - Microsoft DirectX file.


The following is the mesh that will used for the custom character in this tutorial.

Of course, a character meshed can be created from scratch directly in the Mod Tool using it's powerful modeling toolset. Here is a small list of modeling tutorials for XSI.


The following steps involve moving and scaling the new character mesh (and possibly moving some points as well) to match the position of the original urban model mesh as closely as possible. The new mesh does not have to fit perfectly on top on the original mesh, but the better the fit, the better will be the resulting envelope. However, it is important that the joints (like elbows, knees, ankles, etc.) be at the same position. If they aren't, the arms and legs will bend in the wrong position.

Once the new character mesh has been placed on top of the urban model mesh, the urban model mesh can be deleted as it is used only to provide a guide for positioning. Delete the urban model mesh by branch-selecting the urban_mesh object and hitting the delete key. Branch-selection selects the mesh and everything under it as well. An object can be branch-selected by middle-clicking on the object's name in the Explorer window, or by left-clicking the object's name and using the Select->Branch from the Select menu.


Next, the saved weight map will be imported to apply the weights to our new mesh.

  • Select the mesh to which the weights are to be applied, i.e., the new character mesh.
  • Use the ValveSource->WeightMap Import menu.
  • Select the weightmap file saved earlier and click OK.

The WeightMap Import plugin will transfer the weightmap by averaging the weights according to vertex positions. The results are not perfect, but again, it will save hours of envelope tweaking. The following image shows the results after the weights have been imported.

The weightmap can be tested by moving the rig around. As seen in the image below, some weights might need some tweaking.

Rigging a character model - from scratch

The biped guide

The first part of this tutorial demonstrated how to automatically envelope a custom character mesh using the weightmap of an existing character. While this method saves time, it might not be suitable for every character in the game. If a new character has very different topology (e.g., a child character or an adult male), the previously-described method is less than ideal.

The solution is use the Valve Biped Guide.

First import the character mesh to be rigged and weight-mapped. The Ninja mesh used above will also be used for this portion of the tutorial. However, for this demonstration, his arms are not in the neutral pose commonly used in the SDK examples. In this example, the arms are closer to the "Da Vinci pose". This would have been difficult to envelope using the method described above.

After the new mesh has been imported, get a Biped Guide Rig from the Valve Source Menu.

The Biped Guide is a dummy rig that is used to guide the creation of a functional rig. The Biped guide is used by positioning the cubes at the end of each chain are positioned to match the new character mesh position.

This is what the scene looks like before the guide is positioned in the mesh.

Use the guide to position the bones in the mesh. Here is the result.

{{note|Before the cubes are positioned inside the mesh, turn off the "selectability" property of the Ninja mesh. This will prevent the Ninja mesh from being accidentally selected when Guide cubes are being selected. This is done by un-checking the "Selectability" property under the mesh's Visibility Property Page.

Creating the rig from the guide

Once the guide has been positioned in the proper place, a fully functional Valve Biped rig can be created from it.

Select the menu Create Rig From Guide from the ValveSource menu to start the process.

During the creation of the rig, there may be multiple warning messages stating that a cycle has been created. Click OK and ignore these warnings.

Note.png Note: Creation of the rig from the Guide may take several minutes (e.g., greater than 3 minutes with a 3.6GHz processor). The XSI window may turn white for extended lengths of time prior to completion of the process.

Following the creation of the rig, multiple property and expression editor windows may appear. They may be safely closed.

Enveloping

Now that the rig has been created, the Biped Guide can be safely deleted by branch-selecting it in the Explorer window and hitting 'delete.' This will also un-clutter the scene a bit.

Next, the mesh will be enveloped to the rig. As described earlier in this tutorial, the ValveBiped object contains a group called Envelope_Deformers. These are all the objects that deform the mesh and are used to create the envelope.

To create an envelope in XSI:

  • Select the mesh for which the envelope is to be set.
  • Press '2' to switch to the Animate Toolbar.
  • In the Context menu (normally in the lower left-hand corner of the XSI window), select Animation from the Construction Mode dropdown list.
  • In the Animation toolbar, select Deform->Envelope->Set Envelope.
  • Hit '8' to open up an explorer or, in the Applications menu, select Views->XSI Explorer.
  • Expand the ValveBiped object in the Explorer window and select the Envelope_Deformer group.
  • Right-click anywhere to end the pick-session.


The mesh is now enveloped to the rig. If the mesh does not appear to be weight-mapped:

  • Ensure the mesh is selected.
  • Click on the "eye" icon dropdown menu at the top of the XSI view and ensure Weight Maps is selected.
  • Click on the Display Mode dropdown at the top right of the XSI view and select Constant.

The assignment of weights using this technique in XSI is not perfect. It does a pretty good job, but clean-up of certain areas of the weightmap may still be necessary, such as under the arms and legs. The weightmap tools (like smoothing, etc.) can be used to properly weight the mesh to the bones.

For editing the weight map, see Weight Map Editing.