Interacting with a scene object in Softimage
XSI
This
tutorial is an add on to the original Scene object interaction tutorial I wrote
for Softimage 3D some time back. The concept is the same, though the workflow
is now a bit different. If you'd like to read the older version of this tutorial,
which covers more of the theory,
click
here to link. Otherwise, you can follow along with this tutorial by
clicking
here to download the sample scene. The scene has been imported and modified
from Softimage 3D, and is animated up until frame 118.
To
allow for the interaction between the character and the bottle, we will use
a position constraint and an orientation constraint. No constraints have been
added to this scene yet, other than those that control the character rig.
If
you scrub through the animation, notice that at frame 98, the Twiggy character
first makes contact with the bottle of beer.
The
entire character is keyed at this point (see the Automatic keying tutorial for
info on quick character keyframing in XSI) This frame will become the starting
point for the lesson. Multi select the bottle as well as Twiggy's Right hand
constraint box. In your camera view show the centers of both selected objects.
It
is important to note how far apart these two centers reside from one another.
In our case, we need the bottles center to line up exactly over top of the right
hand constraint boxes center. One possible way, would be to move the bottles
center to line up with the center of the latter mentioned hand box, but a quicker
and easier method is available.
Get
a null from the primitives menu cell. In an explorer view rename the null, calling
it BOTTLE_CONSTRAINT_NULL. Click on constraint>position When your mouse cursor
displays the 'pick' option, select the hand box. Close the pop up menu that
appears. Your null should have jumped to the center of the hand box. With the
null still selected, click on constraint>orientation and select the hand box
once again. This time the nulls center flips around so that its X axis aligns
itself to the hand boxes X axis. Make this null, the parent of the bottle of
beer by dragging and dropping the beer bottle on top of the null in an explorer
view.

Now,
whenever you move or rotate the Characters hand constraint box, the beer bottle
will follow along. Unfortunately, the bottle follows the hand box from the very
start of the animation to the very end. What we need to do is disable the constraints
effect from frame 1 to frame 97, and then have the constraint become active
at frame 98 when the characters hand has wrapped itself around the beer bottle.
(pic5)
In
an explorer, make sure the scope is set to All Except Parameters. Select the
BOTTLE_CONSTRAINT_NULL and expand it by clicking on the + sign. Open up the
kinematics node, and finally open up the constraints folder. Within the folder
you should see the nodes for position and orientation constraints that were
set earlier. Click on the gradient image to the left of the position constraint
node. A pop up window containing the position contraints property page appears.


Notice
the check mark beside the position constraint box. The constraint is a boolean
function, a command that returns a true / false value. When the box is checked,
XSI returns a true value for the position constraint meaning that it is active
at the given frame. All we need to do is to keyframe the true / false values
of the function at selected frames to activate and deactivate the constraint.
We will replicate this same process for the orientation constraint. Key the
position constraint on frame 98 by clicking with your left mouse button on the
green chip to the left of the word 'active'. The chip turns red with a spline
curve inside the box. The script log will show you that the constraint is returning
a true value.

Set your time slider to frame 97 and deactivate the constraint by unchecking
the check mark to the right of the word 'active. Set a key for the deactivated
null by clicking the green chip once again. In two frames the bottle null is
transformed into a slave object via the activation of the position constraint.
Set your time slider back to frame 98, and repeat the above steps, but this
time key the true / false values of the orientation constraint. The last step,
I usually take to ensure that my constraints do not pop when transitioning from
a constrained state to an unconstrained state is to key the slave object in
place the frame before it becomes constrained. In this case, I would select
the bottle null as a branch, and key its local position and orientation. This
ensures a smooth transition, because it locks the bottle in 3D space at the
time of constraint activation. In Softimage, keyframe animation is always overidden
by constraint data.
From
this point on, you can keep on posing and keying your character as he picks
up the bottle, takes a long swig and then slams the bottle back down onto the
table. The constraint will remain active until you have the character put the
bottle down. In the sample scene, the character puts the bottle back on the
table at frame 160. To remove the constraint by frame 161, you would simply
do the reverse of the above steps. Drag the time slider to the frame prior to
the slave object being deactivated. Select the slave object (the bottle null
as a branch) and key its local position and orientation to prevent popping when
you deactivate the constraint. Open up the position constraint property editor,
and key the constraint as being active at frame 160, then advance the slider
to frame 161, and key the constraint in a deactive state. Repeat this process
for the orientation constraint. At frame 161, you are now free to animate the
characters arms dropping down by his sides as he feels the effects of his chilled
brew. The bottle will remain on the table. The Softimage 3D version of this
tutorial contains a couple of additional constraint setups involving the activation
and deactivation of constraints, for the interaction between the bottle and
the characters lips.
Scene
object interaction in Softimage XSI was written by Adam Sale. Adam is a Technical
Director and co-founder of Joncrow Entertainment. He can be reached at
adam@joncrow.com