Original Article Date: July 9, 2001
Just like any good movie, there's got to be a sequel. This time we're going to combine all that we've learned and make Ergoman move. Not like John Travolta; but a little more like George Burns or Charlie Chapman! Note: The contents of this article is based upon MicroStation /J.
A special thanks goes to Sean Forward for this contribution!
Now that we have the basics of using KeyFrames, we'll see how we can combine this with other methods to get movement.To start, download and open 76_ergoman_2.dgn. Note that I've already created the actors of each leg, arm, the body and head. This will make life interesting later on.What we need to do is create the KeyFrames for each actor. The first thing that we're going to do is move Ergoman's right leg and the left arm 20 degrees in the X-plane. To do this use the Manipulate Actor tool and set the Method to Rotate About X. Also check the Angle option and set the angle to 20 degrees.Once we are that stage we can move the first two actors. From the Actor Display List, double click on Leg R and move your cursor near the right leg. What you should see is the original position of the leg highlighted and the final position of the leg. The orientation guide is also present showing us our rotation plane. To accept this position, click on the view. Now do the same thing for the left arm.
Now that we have those two actors in place we can go ahead and place the left leg and the right arm in the opposite direction. The process is the same as above except that the angle is now -20 degrees and what you should end up with can be seen below.
Now that we have moved the actors into the first position, we can create the KeyFrames. From the Animation Producer, open the KeyFrame dialog box from the Settings menu item. Click on the Create button, select and accept Ergoman's right leg. Name this frame Right Leg P1 (Right Leg, Position 1)and also fill in a description if you desire. The keyframe for the right leg is now ready to go and you can now do the same thing for the remaining limbs using "P1" in each of the names.
We can now move the arms and legs to the next position and create the necessary keyframes: Using the Manipulate Actor tool, set the right leg and the left arm to –40 degrees and the left leg and the right arm +40 degrees. Finish up by creating four new keyframes for Position 2.
To finish off this part of the exercise, move the limbs back to the starting position and create the keyframs again using "STRT" in the names.
With the keyframes done, we can set up the script. Our workflow is quite simple: We're going to make this guy's arms and legs swing from start to the first position P1, then to position P2, back to P1 and finally finishing back at start. We'll then repeat this cycle so that he basically stand there looking swinging his arms and legs. This motion will be defined for a total of 110 frames. Once that's done, we'll add some realism by giving him linear motion so that it appears he'll be walking.Double click on Left_Arm_Strt to open the Script KeyFramedialog. Ensure that the frame number is set to 0 and that the Interpolation and Velocity options are at thier default values. Click on OK and repeat this until all of the start postions for each limb has been scripted to Frame 0.
The next thing we want to do is set the frame position for P1 and we'll use 10 frames for the limbs to travel from the start position Strt through to the first postion P1. To do this, double click on each of the P1 keyframes and set the frame number to 10.Since we've used 10 frames to move half a step, we'll need to use 20 frames to swing the limbs from Position 1 to Position 2 - and means that they will be set to frame number 30. How's that you ask? Well, Postion 1 is Frame 10 plus the 20 frames to move to Postion 2 is equal to frame 30. Go ahead and and script the P2's to frame number 30.We have just scripted Ergoman from start to P1 and onto P2 and we can watch this motion by clicking on the Preview button in the dialog.Now that we have the first part of our animation, we need to set the limbs in motion from P1 to P2 and again P1 to P2. We finished off atP2, which is frame 30, and need to move another 20 frames to get back to P1. This means that we repeat the scripting process above with the P1 keyframes using frame number 50. Now script the P2 to frame 70, P1 to frame 90 and finally P2 at 110. Again, check what your work by using the Preview option in the Animation Producer.
Now that we have animated the movement of the limbs, we need to make ergoman look a little less goofy by making him move forward while he's swining his limbs! We have already looked at using the Define Actor Path tool in the previous tutorials...you may remember that this tool allows us to pick the end of a line and have the Actor move along that element over a specific number of frames.Select Define Actor Pathand double click on the first actor, which should be Leg R. MicroStation will now prompt us to "Define Path End" in which case you can snap to the end of the centreline projecting from Ergoman and accept twice.In the resulting dialog, ensure that the Begin Frame is set to 0 and the End Frame is 110. Also be sure to enable the Use Original Actor Orientation! Failing to do this will cause Ergoman to move forward stiff as a board and without any limb movement.The process of defining the path of the actor must be repeated for every actor listed including the Body and Head...unless of course you want to dismember Ergoman as he's walking.
Finally, check that the scripting has been done correctly by using the Preview. If there aren't any problems, record and save the script.
AskInga Article #76