Original Article Date: April 23, 2001
In this, the third article in a series on animation in MicroStation /J, we'll look at animating Ergoman's head by using KeyFrames. Note: The contents of this article is based upon MicroStation /J.
A special thanks goes to Sean Forward for this contribution!In this tutorial, we'll take a look at how to set up and run a basic animation using KeyFrames. To make this a little easier, I've prepared a file that already contains the actors we'll be using. Start by downloading and opening Ergoman_Animation. Set up an isometric view, zoom into the head area and leave enough room on your screen to have the required dialog boxes open. If you want - you can just open View 8 which has already been set up.
Next you need to open the required dialog boxes: Tools > Visualization Tools > Animation Tools and Utilities > Render > Animation to open the Animation Producer.Now - to make this guy move we're going to creat a series of KeyFrames that we'll put together using the Animation Producer. KeyFrames are very similar to Saved Views, except they are basically saved positions that can then be recalled to create or simulate movement.To continue, you'll need to open the KeyFrame dialog box by going to the Animation Producer and selecting KeyFrames from the Settings menu. You should get the following dialog:
The first frame we're going to create is the forward position of the head..which is it's current position. Click on the button labeled Create and select Ergoman's head with a datapoint. Accept it with another datapoint and you'll be presented with a dialog where you can enter a name and description for this frame. You can enter Head1 for the name and Head Facing Forward as the description and click OK to finish. Pretty easy eh?!For the next KeyFrame, we want to move Ergomans head 90 degrees to the left. Go to the Animation Tools tool frame and tear off the Animation Actors toolbox. Select Manipulate Actor which is the third tool from the left. Set the Method to Rotate About Z, turn on the Angle option and enter a value of 90. You'll then need to double-click the actor which is to be manipulated and in this case it will be the one called "Head".
If you take a look at View 8, you'll notice that the actors origin is being displayed and that the head has turned to the left. Click on the view to accept this manipulation.
Now that the head is in the correct position, we can create the KeyFrame. Click on the Create button from the Animation KeyFrames dialog and identify Ergoman's head. This time you can call it Head2 and describe it as Head Facing Left. We'll now turn the head -180 degrees to the right....so...using the Manipulate Actor tool, set up the view and accept it. If you're happy with the results in View 8, go ahead and create the KeyFrame for this position. You can call it Head3 and use the description of Head Facing Right. So far so good. All we need to do now is apply the animation!
The end result of our animation is that Ergoman's head is going to rotate from the right to the left and then return to the center position. We do this by scripting the head from the Animation KeyFrames dialog.Since the starting position of the head is going to be facing right, ensure that Head3 is highlighted and then click on the Script button. You can leave all the options as they are and click on the OK button to accept.
Now, to make this easy we'll use 20 frames to move the head from right to left. To do this, select Head2 and click Script, change the Frame Number to 20 and click on OK to finish. Finally we want our head to return to the centre position. Script Head1 and set the Frame Number to 30. That's it!You can now preview your animation and then record it!To preview your creation, go to the Animation Producer and select the correct view ... then just select the >> button. If you're happy with what you see, you can record the script using the methods described in Part 1 and 2. And until the next lesson, fiddle with the other settings to get the feel for what's going on. Don't be scared to try something different 'cause you can always start again from the beginning. (Although, you may want to remember to save the script file!)In the next tutorial we'll look at using a number of actors and their KeyFrames together to create a more complicated animation. Stay tuned!
AskInga Article #68