This tutorial is designed to give you examples of how the animation creator will work in context. In this tutorial, you'll learn the basics of the animation creator. After completing this tutorial, you might possibly be interested in Advanced Animation Creator Concepts tutorial.
In this tutorial, you will create a simple animation that will make an Operator appear to operate a Processor when it receives a flowitem.
Tasks Covered
This tutorial will include the following tasks:
- Opening the animation creator
- Creating a new animation
- Editing components
- Adding keyframes
- Changing the animation speed and repeat settings
- Triggering an animation in a simulation model
For More Information
This tutorial will provide hands-on experience with the animation creator. But if you would like more detailed information about this tool, please refer to:
Basic Animation Creator Tutorial
Complete the following steps:
Step 1 - Open the Animation Creator
In this step you will open the animation creator for an Operator object. (See Opening the Animation Creator for more information.) For the purposes of this tutorial, you will use the "Legacy" Operator that was the default Operator in older versions of FlexSim. The Legacy Operator has more customizeable animations and will better illustrate some of the basic animation concepts.
- With the 3D model view open, drag an Operator from the Library into the simulation model.
- Double-click on the Operator to open its Properties dialog box.
- With the Operator tab open, open the Shape menu and select Legacy Operator to use the older version of the Operator.
- Click the Apply button to save the changes.
- In the General tab, click the Edit button next to the Visuals/Animations property to open the animation creator for this operator.
- If needed, press the OK button to close the properties window.
Step 2 - Create a New Animation
In this scenario, you'll to create an animation of an Operator manipulating the controls on a processor. You first need to add an additional animation to the Operator's list of animations.
- On the animation toolbar, find the Animation box and click the Add button next to it to add a new animation.
- The Animation box should now read Animation4. Click inside the box to highlight the text and change it to OperateProcessor for easier reference.
Step 3 - Edit Components
Next, you'll edit some components to create the initial starting position for the animation. When you look at the timeline list, you'll notice in the Animations and Components window that there is already multiple components that make up the Operator (such as the Operator's waist, chest, etc.), as shown in the following image:
Components that are children of other components (indicated by the indentation) are subject to changes made by their parent component. For example, if you changed the position of the Operator's left arm (LArm), it would also change the position of the left forearm (LForearm) and the left hand (LHand). In other words, if you moved the left arm component, all of is child components would move along with it.
In this step, you will change the rotation of the left and right forearms so that they appear to be extended.
- Click the Step Left button button to make sure that your cursor at the beginning of the timeline.
- In the timeline list, click LForearm (the left forearm commponent) to select it. In Quick Properties, under General Properties, change the X-rotation to -90. The left forearm will now appear to be extended.
- Now you'll do the same to the right forearm. In the timeline list, click RForearm to select it. In Quick Properties, change the X-rotation to -90.
The following image shows how the Operator should look in the preview window after completing this step:
Step 4 - Add Keyframes
Now that the starting position is set, you'll add some keyframes to the animation to mark the major movements in the animation. Then you'll change the middle keyframe so that the Operator's arms will be in a different position.
- Click the Add Keyframe button button to add a keyframe to time 0. It should appear as a series of black diamonds in the timeline. You'll notice that the cursor on the timeline jumped ahead one second. This allows you to quickly make adjustments and add keyframes all at once without overwriting any changes. You will adjust the timing of the keyframes later in the tutorial.
- You want to make sure our animation is seamless when it repeats. The easiest way to do this is to create another keyframe, a duplicate of the first. Click the Add Keyframe button again to add another keyframe.
- Repeat this step so that there are now three identical keyframes.
- Now you'll change the second (middle) keyframe so that the left and right forearms are extended. Click the second keyframe for the LForearm (left forearm). The keyframe will turn red to indicate it is selected. In Quick Properties, under General Properties, change the X-rotation to -75.
- With the LForearm still selected, change the Z-rotation to 35 in Quick Properties.
- Now you'll make similar (but not exactly identical) changes to the right forearm. Click on the second keyframe for the RForearm. In Quick Properties, under General Properties and change the X-rotation to -75.
- The Z-rotation of the right forearm will be slightly different. With the RForearm still selected, change the Z-rotation to -35 in Quick Properties.
When you preview the animation by pressing the Play button on the toolbar, the Operator will appear to open and close its arms, as shown in the following image:
Step 5 - Change the Animation Speed and Repeat Settings
In this step, you will make the animation go a little bit faster. Then, you will adjust the animation's repeat settngs so that it will only be repeated twice.
- You'll start by zooming in on the timeline. There are several ways to zoom in and out from the timeline. (See Timeline for more information.) For now, click the Zoom button on the toolbar to zoom in on the three keyframes you have created so far.
- Now that you have zoomed in, you will change the pace of the second and third keyframes. Click anywhere on the second keyframe and drag it to 0.50 on the timeline.
- Click anywhere on the third keyframe and drag it to 1.00 on the timeline.
- Now you'll want to make sure the animation repeats twice when a flowitem enters a processor. In Quick Properties, under the OperateProcessor group, click the Repeat Type menu and select Repeat Set Number.
- Type 2 in the Repeat Value box.
Step 6 - Trigger an Animation in a Simulation Model
In the last step, you'll create a simple simulation model and call the Operator's newly created OperateProcessor animation.
- Return to the 3D model by clicking the Model tab on the center pane.
- From the library, drag out a Source, a Processor, and a Sink. Move them in the model so they are in the approximate positions shown in the following image:
- Move the Operator so that it is by the control panel on the Processor.
- With the Operator still selected, in Quick Properties under General Properties, change the Z-rotation to 90 so that the Operator is facing the Processor, as shown in the following image:
- Next you'll need to connect the objects in the model. Make 'A' connections between the Source and the Processor and between the Processor and the Sink.
- Make an 'S' connection between the Processor and the Operator, as shown in the following image:
- Now you'll set up some triggers on the processor that will start and stop the animation when a flowitem enters the processor. Double-click the Processor to open its Properties dialog box. You might want to move the dialog box so that the Operator is still visible in the simulation model.
- In the Triggers tab, click the Add button next to the OnEntry trigger to open a menu.
- Select Visual then Start Animation from the menu to open up the Start Animation picklist options, as shown in the following image:
- Click the Sampler button next to the Object box to enter sampler mode.
- Click the Operator in the simulation model to sample it. The Object box should now read
centerobject(current, 1)
, which indicates that the object that will be animated is the one connected to the Processor's first center port. - Click the arrow next to the Animation box to open a menu of the Operator's available animations. Select OperateProcessor animation.
- Click somewhere outside of these boxes to save the changes.
- Now click the Add button next to the OnExit trigger to open a menu.
- Select Visual then Stop Animation from the menu to open up the Stop Animation picklist options, as shown in the following image:
- Click the Sampler button next to the Object box to enter sampler mode.
- Click the Operator in the simulation model to sample it. The Object box should now read
centerobject(current, 1)
. - Click the arrow next to the Animation box to open a menu of the Operator's available animations. Select OperateProcessor animation.
- Click somewhere outside of these boxes to save the changes.
- Click the OK button to save the changes and close the Properties dialog box.
- If you haven't already done so, save this model so that you can use it in the next tutorial.
Starting Animations with FlexScript
If you want to create custom codes that start an animation, you can use the following Flexscript code:startanimation(operator, "OperateProcessor");
To stop the animation call:stopanimation(operator, "OperateProcessor");
You can now test your animation by running your simulation model. Click the Reset and Run buttons on the simulation control panel. When your simulation runs, the Operator's OperateProcessor animation should run twice every time a flowitem enters the Processor, as shown in the following image:
This completes this the Basic Animation Creator Concepts tutorial. After completing this tutorial, you might possibly be interested in Advanced Animation Creator Concepts tutorial.