article

Paul Toone avatar image
0 Likes"
Paul Toone posted

Tutorial - Basic Animation Creator Concepts   

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:

  1. Opening the animation creator
  2. Creating a new animation
  3. Editing components
  4. Adding keyframes
  5. Changing the animation speed and repeat settings
  6. 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.

  1. With the 3D model view open, drag an Operator from the Library into the simulation model.
  2. Double-click on the Operator to open its Properties dialog box.
  3. With the Operator tab open, open the Shape menu and select Legacy Operator to use the older version of the Operator.
  4. Click the Apply button to save the changes.
  5. In the General tab, click the Edit button next to the Visuals/Animations property to open the animation creator for this operator.
  6. 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.

  1. On the animation toolbar, find the Animation box and click the Add button next to it to add a new animation.
  2. 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.

  1. Click the Step Left button button to make sure that your cursor at the beginning of the timeline.
  2. 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.
  3. 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.

  1. 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.
  2. 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.
  3. Repeat this step so that there are now three identical keyframes.
  4. 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.
  5. With the LForearm still selected, change the Z-rotation to 35 in Quick Properties.
  6. 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.
  7. 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.

  1. 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.
  2. 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.
  3. Click anywhere on the third keyframe and drag it to 1.00 on the timeline.
  4. 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.
  5. 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.

  1. Return to the 3D model by clicking the Model tab on the center pane.
  2. 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:

  1. Move the Operator so that it is by the control panel on the Processor.
  2. 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:

  1. 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.
  2. Make an 'S' connection between the Processor and the Operator, as shown in the following image:

  1. 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.
  2. In the Triggers tab, click the Add button next to the OnEntry trigger to open a menu.
  3. Select Visual then Start Animation from the menu to open up the Start Animation picklist options, as shown in the following image:

  1. Click the Sampler button next to the Object box to enter sampler mode.
  2. 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.
  3. Click the arrow next to the Animation box to open a menu of the Operator's available animations. Select OperateProcessor animation.
  4. Click somewhere outside of these boxes to save the changes.
  5. Now click the Add button next to the OnExit trigger to open a menu.
  6. Select Visual then Stop Animation from the menu to open up the Stop Animation picklist options, as shown in the following image:

  1. Click the Sampler button next to the Object box to enter sampler mode.
  2. Click the Operator in the simulation model to sample it. The Object box should now read centerobject(current, 1).
  3. Click the arrow next to the Animation box to open a menu of the Operator's available animations. Select OperateProcessor animation.
  4. Click somewhere outside of these boxes to save the changes.
  5. Click the OK button to save the changes and close the Properties dialog box.
  6. 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.

flexsim users manualusers manual
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Article

Contributors

paul.t contributed to this article

Navigation

FlexSim 2016.1