Keying your entire character with a single custom button in XSI
This tutorial assumes the user is animating a character based on a pose
to pose technique explored thoroughly
in the Animation Blocking In Softimage 3D tutorial. Softimage
3D offered an excellent animation workflow
in its ability to create Named Selection Groups of objects which the
user could keyframe in one swift stroke
with user defined hotkeys. The result allowed for superior workflow,
and greater creativity on the part of the animator.
Softimage XSI has taken this process one step further with the ability
to quickly create groupings of objects,
mark the desired parameters of a group to be keyframed, and then keyframe
the group,
creating a function curve for the marked parameters.
Coming from a Softimage 3D background, I was at first dismayed to see
that XSI
no longer supported the many Explicit keying options that were available
in Soft3D.
I finally realized that with a bit of simple copy and paste scripting,
I could replicate my beloved Softimage 3D process
and improve immensely upon my workflow.
This tutorial assumes a competent understanding of XSI. Scripting will be discussed using Vbscript for demonstration purposes.
Getting Started
To begin, download the RASTA database, or drag and drop in a netview browser.
Open up the YAHMON scene. It consists of a simple low resolution
character named Yahmon who hails from the Island of Jamaica.
He is part of a personal project I’ve been working on in my spare time.
His high resolution counterpart awaits in the wings for final renders where I can easily transfer all of the animation over.
Turn viewport A into an Explorer, and make sure that the scope is set
to SCENE. You can do so by pressing S
with your mouse in viewport A.
Expand the Yahmon model node. At the bottom of the hierarchy you’ll
see that I’ve created 6 groupings of scene objects.
For the purposes of this tutorial, we’ll be focussing on the ROTATIONS
group and the TRANSLATIONS group.
Open up the scripting pane by clicking the exclamation button on the Animation toolbar along the bottom of your screen.
Create a custom toolbar by clicking on View >Custom Toolbar>New Toolbar.
Give your toolbar a name and then press OK.
By the end of this tutorial we will have created a single custom button
that will allow us to keyframe our entire character in one click.
In the following section, we’ll need to outline what our script will need to accomplish, we’ll then combine those steps and create our button.
Breaking it all down
By clicking our button, we will:
Since XSI logs most every operation you perform, we’ll be using our history log to copy and paste commands into our script.
Start by clicking on the ROTATIONS group in your explorer. Note the command that appears in your history log
SelectObj "YAHMON.ROTATIONS"
Select the members of the ROTATIONS group by right clicking on
the ROTATIONS group and choosing the select members option.
The scripting command appears as:
SelectMembers "YAHMON.ROTATIONS"
Highlight the two lines of script in your history log pane and drag them down into your scripting window.
Next, you need to let XSI know what type of animation keys you wish
to set on the members of your group. To accomplish this,
click on the marking parameters popup window that appears on the bottom
right of your mouse line.
A list of your selected objects will appear in the popup. Expand
a single object node by clicking on the plus sign to its left.
Expand the Kinematics property node and then expand the local transform
property. Holding down the shift key,
click on the following parameters shown in the image below
Close the popup marking window by clicking outside of the window in
any viewport.
Drag the resulting commands that appeared from the history log into
your script.
Your script should now look like the image below.
Keying the Group using the Marked Parameters as a guideline
Next we need to tell the program to keyframe the marked parameters of
the selected group at the current keyframe on our timeline.
Press the K keyframe button along your mouse line, and then
examine the command it generates in your history log.
I’ve cut out a lot of the middle section of the command below
to save space.
The command keyframes the X,Y,Z rotation of every object in your group
at the current frame.
Since our timeline was at frame 1 when we keyed the ROTATIONS
group,
the last number at the end of the very last line of the script
is the number 1.000
This is not very useful to us if we need to key the character at any
other frame in our timeline with our button
Essentially no matter where on the timeline we are posing Yahmon, a
keyframe will be saved at frame 1 when pressing our button
unless we change this last number. To do so, highlight the number
1.000 after the last comma, and replace it with the letters
FC
FC is a variable that stands for current frame. Using this variable will allow us to use our button to key Yahmon at any frame along the timeline.
Lastly, you’ll want to deselect the objects you have selected. Select any empty area in a 3D viewport to bring up the following command in the history log.
DeselectAll
Putting it all together
Drag it to the bottom of your script, which should now resemble the following:
SelectObj
"YAHMON.ROTATIONS"
SelectMembers
"YAHMON.ROTATIONS"
AddToMarking
"kine.local.ori.euler.rotx"
AddToMarking
"kine.local.ori.euler.roty"
AddToMarking
"kine.local.ori.euler.rotz"
SaveKey"YAHMON.SPINE1.kine.local.rotx,YAHMON.SPINE1.kine.local.roty,YAHMON.SPINE1.kine.local.rotz,YAHMON.SPINE2.kine.local.rotx,
YAHMON.SPINE2.kine.local.roty,YAHMON.SPINE2.kine.local.rotz,YAHMON.SPINE3.kine.local.rotx,YAHMON.SPINE3.kine.local.roty,
YAHMON.SPINE3.kine.local.rotz,YAHMON.L_SHOULDER.kine.local.rotx,YAHMON.L_SHOULDER.kine.local.roty,YAHMON.L_SHOULDER.kine.local.rotz,..
YAHMON.R_FOOT.kine.local.rotx,YAHMON.R_FOOT.kine.local.roty,YAHMON.R_FOOT.kine.local.rotz",
FC
DeselectAll
Repeat the process for the TRANSLATIONS group.
When it comes to marking the parameters for the TRANSLATIONS group,
be sure to mark the local transforms as in the image below.
When you have completed the steps for the TRANSLATIONS group,
drag the script below the Deselect All command from the ROTATIONS
group
Your complete script should resemble the following:
SelectObj
"YAHMON.ROTATIONS"
SelectMembers
"YAHMON.ROTATIONS"
AddToMarking
"kine.local.ori.euler.rotx"
AddToMarking
"kine.local.ori.euler.roty"
AddToMarking
"kine.local.ori.euler.rotz"
SaveKey"YAHMON.SPINE1.kine.local.rotx,YAHMON.SPINE1.kine.local.roty,YAHMON.SPINE1.kine.local.rotz,YAHMON.SPINE2.kine.local.rotx,
YAHMON.SPINE2.kine.local.roty,YAHMON.SPINE2.kine.local.rotz,YAHMON.SPINE3.kine.local.rotx,YAHMON.SPINE3.kine.local.roty,
YAHMON.SPINE3.kine.local.rotz,YAHMON.L_SHOULDER.kine.local.rotx,YAHMON.L_SHOULDER.kine.local.roty,YAHMON.L_SHOULDER.kine.local.rotz,
. . .
YAHMON.R_FOOT.kine.local.rotx,YAHMON.R_FOOT.kine.local.roty,YAHMON.R_FOOT.kine.local.rotz",
FC
DeselectAll
SelectObj
"YAHMON.TRANSLATIONS"
SelectMembers
"YAHMON.TRANSLATIONS"
AddToMarking
"kine.local.pos.posx"
AddToMarking
"kine.local.pos.posy"
AddToMarking
"kine.local.pos.posz"
SaveKey"YAHMON.R_ARM.kine.local.posx,YAHMON.R_ARM.kine.local.posy,YAHMON.R_ARM.kine.local.posz,YAHMON.COG.kine.local.posx,
YAHMON.COG.kine.local.posy,YAHMON.COG.kine.local.posz,YAHMON.L_ARM.kine.local.posx,YAHMON.L_ARM.kine.local.posy,YAHMON.L_ARM.kine.local.posz,
YAHMON.crvlist2.kine.local.posx,YAHMON.crvlist2.kine.local.posy,YAHMON.crvlist2.kine.local.posz,YAHMON.crvlist3.kine.local.posx,
YAHMON.crvlist3.kine.local.posy,YAHMON.crvlist3.kine.local.posz,YAHMON.R_FOOT.kine.local.posx,YAHMON.R_FOOT.kine.local.posy,
YAHMON.R_FOOT.kine.local.posz,YAHMON.L_FOOT.kine.local.posx,YAHMON.L_FOOT.kine.local.posy,YAHMON.L_FOOT.kine.local.posz",
FC
DeselectAll
Creating the Button
Highlight the entire script, or (Ctrl A) to select all. Drag the script from the script pane onto the custom toolbar you created at the beginning of this tutorial.
In the popup window that appears give your button a name that makes
sense to you. I chose KEY_CHAR.
In the Filename section of the popup, click on the three dots to the
right of the black text box to save your script.
Give your script an easily recognizable name, and then click save.
Finally, click OK in the popup window to create the button.
Testing the button
Starting at frame 1, create a pose for Yahmon by manipulating his joints
and control boxes and then click your newly created KEY_CHAR button.
Drag your time slider to another frame and repeat as needed.
Conclusion
You don’t need to be any kind of programmer to create your own tools
in Softimage XSI.
With a little common sense and some planning, you can automate any
task that seems a little long winded.
Additional Information
The preceding tutorial was written by Adam Sale. Adam is a Technical
Director at Bardel Animation and is a fully certified Softimage Instructor
teaching at various institutions throughout Vancouver, BC. He can be reached
at adam@joncrow.com