Skeletons and Rigging: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
m (Nesciuse moved page Skeletons and Rigging/en to Skeletons and Rigging without leaving a redirect: Move en subpage to basepage)
 
(21 intermediate revisions by 18 users not shown)
Line 1: Line 1:
{{LanguageBar}}
[[Category:Modeling]]
[[Category:Modeling]]
=Skeletons=
=Skeletons=
Line 16: Line 18:
When setting up your skeleton, it needs to be robust and easy to animate. The following considerations can hopefully save you some time and trouble on your production.
When setting up your skeleton, it needs to be robust and easy to animate. The following considerations can hopefully save you some time and trouble on your production.


When creating your Skeleton, just about any object can be used as a deformer. You don’t have to use only “Bone�? objects. However, your Skeleton should be only one hierarchy. (all deformers are eventual children of the Hips, for example)
When creating your Skeleton, just about any object can be used as a deformer. You don’t have to use only “Bone�? objects. However, your Skeleton should be only one hierarchy. (all deformers are eventual children of the Hips, for example)


It pays to be organized from the start. This is especially true of your Skeleton bone names – All bone names must be consistent throughout all of your scenes, or else animation on misnamed bones wont be applied when the model is compiled. (all bone names must match the Reference scene/smd)
It pays to be organized from the start. This is especially true of your Skeleton bone names – All bone names must be consistent throughout all of your scenes, or else animation on misnamed bones wont be applied when the model is compiled. (all bone names must match the Reference scene/smd)
Line 27: Line 29:


* In the Render tab, turn on the Bones checkbox. Verify that the Skeleton looks to be in the correct place with respect to the mesh, and that the hierarchy looks correct.
* In the Render tab, turn on the Bones checkbox. Verify that the Skeleton looks to be in the correct place with respect to the mesh, and that the hierarchy looks correct.
* In the Render tab, turn on the Normals checkbox and Verify that the normals are correct, and the character will light correctly. If the normals are incorrect, and your using XSI, be sure to Freeze All Transforms of your mesh before you apply your envelope and re-export the reference SMD.
* In the Render tab, turn on the Normals checkbox and Verify that the normals are correct, and the character will light correctly. If the normals are incorrect, and you're using XSI, be sure to Freeze All Transforms of your mesh before you apply your envelope and re-export the reference SMD.
* View your test animation, and verify that it looks correct with respect to your XSI scene.
* View your test animation, and verify that it looks correct with respect to your XSI scene.
* In the Bones tab, look at the Bone dropdown to see a list of bones in the Skeleton. Verify that there aren’t extra or unused bones in your character.
* In the Bones tab, look at the Bone dropdown to see a list of bones in the Skeleton. Verify that there aren’t extra or unused bones in your character.


==Modifying the Example Skeleton==
=Creating a ValveBiped=


ValveBiped is the name of the standard human rig that was developed in XSI for animating human/biped characters in Half Life 2.
==Introduction==
ValveBiped is the name of the standard human rig that was developed in XSI for animating human/biped characters in Half-Life 2.


It consists of a skeleton hierarchy and a control rig. The skeleton hierarchy is used to deform the character’s mesh, and is what gets exported into the game. The control rig is used solely to animate the skeleton hierarchy in XSI, and does not get exported into the game. The skeleton hierarchy and control rig are two separate hierarchies, but the control rig controls the skeleton hierarchy by the use of constraints.
It consists of a skeleton hierarchy and a control rig. The skeleton hierarchy is used to deform the character’s mesh, and is what gets exported into the game. The control rig is used solely to animate the skeleton hierarchy in XSI, and does not get exported into the game. The skeleton hierarchy and control rig are two separate hierarchies, but the control rig controls the skeleton hierarchy by the use of constraints.
Line 41: Line 44:
A ValveBiped can be created very quickly in XSI, and can be created to any proportions.
A ValveBiped can be created very quickly in XSI, and can be created to any proportions.


=Creating a ValveBiped=
==Creating a ValveBiped using the XSI Mod Tool==
 
==General==
 
The process of creating a ValveBiped in XSI has been largely automated by the use of scripts. The animator basically uses a guide (CharacterStudioGuide.emdl) to specify the desired proportions and then runs the scripts to create a ValveBiped.
 
The basic steps to create a ValveBiped in XSI are as follows:
 
# Import CharacterStudioGuide.emdl into your scene.
# Move the control boxes of the CharacterStudioGuide to the desired joint positions of your character. NOTE: It’s important that you do not scale any part of the CharacterStudioGuide. Only use the translate tool to position the control boxes of the guide.
# From the script editor open and run CreateRigBatchScript.vbs
 
==Specifics and Troubleshooting==
 
When you run the script CreateRigBatchScript.vbs, it actually calls two separate scripts which run in succession; ValveBipedFromGuide.vbs and ValveRigFromIsnerRig.vbs. The first of these scripts imports the skeleton hierarchy and proportions it to the CharacterStudioGuide, and the second script builds the final control rig on top of the skeleton hierarchy and creates the organizational aspects of the ValveBiped model.
 
The following is a list and description of all the component files used to create a ValveBiped as outlined above. Some of these component files must exist in specific paths which are defined in the scripts, so be sure the paths in the scripts point to where the files are on your machine:
 
'''CharacterStudioGuide.emdl'''
 
* An XSI model that you import into your scene and use to set the desired proportions of the ValveBiped. When setting up the proportions do not use the scale tool – the resulting ValveBiped’s proportions will not match the guide. If the character you’re working on is symmetrical, you can use CharacterStudioGuide_Sym.emdl to save a little time – this is a version of the guide with a symmetry constraint so you only have to work on one side of the character. Note: if you use the symmetrical guide you must rename it to “CharacterStudioGuide�? before running the scripts.
 
'''CreateRigBatchScript.vbs'''
 
* The script you run to create the ValveBiped after positioning the CharacterStudioGuide. This is just a short batch script that calls the two component scripts that actually create the ValveBiped (ValveBipedFromGuide.vbs and ValveRigFromIsnerRig.vbs). Each of these component scripts must be located in the respective paths specified by CreateRigBatchScript.vbs. (default: U:\HL2\XSI\Scripts)
 
'''ValveBipedFromGuide.vbs'''
 
* The first component script called by CreateRigBatchScript.vbs -- was largely written by Michael Isner of Softimage. This script imports ValveBiped. emdl (a basic version of the ValveBiped) into the scene and re-proportions it to the match the CharacterStudioGuide. Running this script creates the initial version of ValveBiped that we got from Softimage – this is not the final version of ValveBiped, but was our starting point for building the control rig. ValveBiped.emdl must be located in the path specified by line 33 of ValveBipedFromGuide.vbs. (default: U:\HL2\XSI\models)
 
'''ValveBiped.emdl'''
 
* An XSI model that gets imported into the scene and reproportioned by the script (ValveBipedFromGuide.vbs). Make sure it exists in the path specified by that script. This model is a primitive version of ValveBiped, and we built the final control rig on top of this model. To build the final control rig on top of this model, run the script ValveRigFromIsnerRig.vbs. ValveBiped.emdl must be located in the path specified by line 33 of ValveBipedFromGuide.vbs. (default: U:\HL2\XSI\models)
 
'''ValveRigFromIsnerRig.vbs'''


* The second component script called by CreateRigBatchScript.vbs. This script builds the final control rig on top of the primitive ValveBiped, and also creates the organizational aspects of the ValveBiped (Groups, colors, object names, visibility properties, etc). This script assumes that there’s a model called “ValveBiped�? in your scene for it to work correctly. This script was created entirely by dragging/dropping commands from the script editor’s listener pane – thus it is very easy to make changes/additions to this script to accommodate animator/project preferences.
Dominic Laflamme of Softimage wrote a great tutorial [[Rigging_your_Custom_Character | Rigging your Custom Character]]. Additional information on skeletons and rigging can be found in the '''Rigging A Character - From Scratch''' section of that tutorial.

Latest revision as of 10:39, 12 July 2024

English (en)日本語 (ja)Translate (Translate)

Skeletons

Custom vs Canned

Most of the time, Mod creators will want to start their work with an existing skeleton that has a working animation set, and start their modeling and gameplay prototyping from there. This approach has lots of benefits, and some constraints. Firstly, using an existing skeleton with animation lets you see your model in game faster, which then lets you refine and modify your design in the proper context. Using an existing skeleton also lets you preview your enveloping. But the biggest time saver is having a basic set of animation to start with, so that you can begin to prototype gameplay. Once you have a character up an running in the engine, you can then modify, expand upon, or completely replace any or all of the animations as needed.

Making Your Own

Some designs will demand a custom skeleton here are some guidelines for creating a custom rig. (XSI is mentioned, but these guidelines are applicable to just about any 3D package)

When building/rigging a character for the game it helps to make a distinction in XSI between the Skeleton and the Rig. The Skeleton is a hierarchy of deformers, as simple as possible and with one parent bone (usually the hips) that we use to deform the mesh. This is what gets exported and is the skeleton we see in game. The Rig is a separate hierarchy of controls that we use to animate the Skeleton (as needed) -- often the skeleton is constrained or somehow attached to the rig; but is not in the same hierarchy. One benefit of keeping this distinction is that you will always have a valid Skeleton hierarchy that'll get into the game, plus you are able to change the Rig hierarchy per scene if you wanted, to give you specific controls for specific animations without changing the Skeleton at all.

Rigging Considerations

When setting up your skeleton, it needs to be robust and easy to animate. The following considerations can hopefully save you some time and trouble on your production.

When creating your Skeleton, just about any object can be used as a deformer. You don’t have to use only “Bone�? objects. However, your Skeleton should be only one hierarchy. (all deformers are eventual children of the Hips, for example)

It pays to be organized from the start. This is especially true of your Skeleton bone names – All bone names must be consistent throughout all of your scenes, or else animation on misnamed bones wont be applied when the model is compiled. (all bone names must match the Reference scene/smd)

Testing Your Rig

You’ll need to thoroughly test your skeleton before you start doing animations. Once you’ve created your Reference scene and are happy with the Skeleton and Rig you want to compile the model and view it in HLMV to confirm that it’s working as needed, and is efficient. It also helps to export a quick test animation to verify that the character deforms correctly in HLMV.

When viewing your character in HLMV you want to take note of the following:

  • In the Render tab, turn on the Bones checkbox. Verify that the Skeleton looks to be in the correct place with respect to the mesh, and that the hierarchy looks correct.
  • In the Render tab, turn on the Normals checkbox and Verify that the normals are correct, and the character will light correctly. If the normals are incorrect, and you're using XSI, be sure to Freeze All Transforms of your mesh before you apply your envelope and re-export the reference SMD.
  • View your test animation, and verify that it looks correct with respect to your XSI scene.
  • In the Bones tab, look at the Bone dropdown to see a list of bones in the Skeleton. Verify that there aren’t extra or unused bones in your character.

Creating a ValveBiped

Introduction

ValveBiped is the name of the standard human rig that was developed in XSI for animating human/biped characters in Half-Life 2.

It consists of a skeleton hierarchy and a control rig. The skeleton hierarchy is used to deform the character’s mesh, and is what gets exported into the game. The control rig is used solely to animate the skeleton hierarchy in XSI, and does not get exported into the game. The skeleton hierarchy and control rig are two separate hierarchies, but the control rig controls the skeleton hierarchy by the use of constraints.

The ValveBiped skeleton hierarchy is very similar to that of Character Studio’s Biped, as the ValveBiped was developed initially as a way to port existing animations from 3DSMax into XSI.

A ValveBiped can be created very quickly in XSI, and can be created to any proportions.

Creating a ValveBiped using the XSI Mod Tool

Dominic Laflamme of Softimage wrote a great tutorial Rigging your Custom Character. Additional information on skeletons and rigging can be found in the Rigging A Character - From Scratch section of that tutorial.