article

Paul Toone avatar image
0 Likes"
Paul Toone posted

Animation Creator Key Concepts   

You can use the animation creator to create and save custom animations for FlexSim objects and Flowitems in your model. Some of the objects in the FlexSim Library come pre-programmed with some basic animations. While those animations are generally enough for most simulations, you can use the animation creator to change the animations or add new ones.

Using the animation creator you can:

  • Import and edit animation files created in other animation software applications. You can import custom objects with bone animation files from third-party software applications such as Blender, Poser, Mixamo, or 3DMax.
  • Export animations created in FlexSim to other FlexSim users. Any animation files you create using the animation creator can be easily shared with other FlexSim users if they want to use that animation in a different simulation model.
  • Create variables and triggers that can dynamically change how an object is animated during a simulation run or get information from an animation-related object. Using the animation creator, you can create variables that change an object's animation under certain conditions during a simulation run. For example, you could create a variable that slows down or speeds up an animation based on certain conditions. You could also use variables to change the position, rotation, or color of an object's animated components under certain conditions.
  • Customize how flowitems are animated. You can use the animation creator to create surrogate objects. surrogate objects are objects that can control the way flowitems will be animated when they are being handled by a task executer or a fixed resource. For example, you could animate a surrogate object so that it will rotate when it is inside a processor.

The following image shows the basic animation creator interface:

See The Animation Creator Interface for an explanation of each element of the interface.

The remainder of this topic will explain key concepts about the animation creator.

Topics

Opening the Animation Creator

To open the animation creator, you first need to add the object you want to animate to the 3D simulation model. Then, right-click the object and select Edit, then Animations from the menu. The animation creator for this object will open in a separate window (tab) in the center pane.

Alternatively, you can access the animation creator by double-clicking the object. Under the General tab, in the Appearance group, click the Edit button next to the Visuals/Animations property.

Key Terms and Definitions

The following are some important terms you'll need to know in order to use the animation creator:

Animations

An animation is a sequence of object movements that are triggered at various points in a simulation run. You can animate any object that is capable of moving throughout the model or interacting with flowitems, such as task executers or fixed resources. In FlexSim, animations are made up of: 1) components and 2) keyframes, which are defined below.

Components

Components are 3D shapes that comprise an object. These shapes can be combined together and be positioned in such a way that looks like movement when an animation is run. The standard FlexSim objects generally come pre-programmed with at least one component, but some might have more. You can also add a custom component to a standard FlexSim object.

The following image shows a custom component that has been added to the Operator's Walk Loaded animation:

surrogates

A surrogate is a special kind of component that will be replaced visually by another object (such as a flowitem) when an animation is running in the simulation model. It acts like a placeholder for another object in an animation. Whereas components are part of an animation visually (meaning it will show up in animation), a surrogate can be visually replaced by another object.

The most common reason for turning a component into a surrogate is to change the animation of a flowitem while it is being handled by one of the fixed resources or task executers during a simulation run. Once a component has been converted to a surrogate in the animation creator, it can be used to change a flowitem's position, size, or rotation in an animation while a fixed resource or task executer is handling it. When the fixed resource or task executer begins handling the flowitem, the flowitem's shape will be replaced by the shape indicated in the Draw surrogate menu in the surrogate's Quick Properties.

For example, in the following image, you'll see that a surrogate (a cube) has been added to a processor's animation:

In this example, the cube will be replaced by the flowitem box shape when it enters the processor because that is what was selected in the Draw surrogate menu. If the Draw surrogate menu instead had been set to None, the flowitem will change to the shape of the surrogate object (a cube) when it enters the processor. The flowitem will then adopt the same position, size, or rotation coordinates that were used in the surrogate's animation.

surrogate shapes
The shape that is being drawn for the surrogate is not important and will not show up in the model. It is purely for your convenience while you are animating the surrogate.

Keyframes

A keyframe is a drawing of an object that defines the starting and ending point of an animation segment. A component keyframe consists of a set of values that define the component's properties such as its position, size, rotation, shape, color, etc. In other words, keyframes are the saved values for different properties of a given set of components.

Usually, you will put two or more keyframes on a timeline to define the beginning and end of an animation segment. Although keyframes typically define the beginning and end of an animation, you should also put keyframes any place that marks a major movement between components. See the example in the next section (Tweening) for more information.

Tweening

Tweening is when FlexSim automatically creates the animation transitions between two keyframes. FlexSim has the capability to tween two components based on many different factors such as an object's position, rotation, size, color, etc. For example, imagine you want to animate a cube component that will change from blue to red in about 5 seconds, as illustrated in the following image:

The timeline for this kind of animation would look approximately like the following image:

Notice that in this timeline, the cube had a keyframe at time 0. On this keyframe, the cube's color component is set to blue. There is a second keyframe at time 5 where the color is set to red. While the animation is running, FlexSim will automatically tween the colors, which means that it will create all the transitional colors between time 0 and 5. In other words, you don't have to manually create a purple color halfway through the animation because FlexSim will do it for you when it tweens the two keyframes.

As a general rule, you should try to put keyframes in places that mark the begining and end of a major movement. For example, let's say you wanted to animate an Operator walking.The first keyframe should be the position the Operator starts from (perhaps a standing position) and the next keyframe might be the right leg extended and so forth. FlexSim will then automatically generate a smooth transition between the keyframes to create the illusion of leg movement during a simulation run.

Timing Animations

The amount of time between the keyframes on the timeline will determine how quick or slow the transition will occur.

Animation Variables

Animation variables can possibly change the way objects are animated based on conditions that might change during a simulation run. For example, a variable on a component keyframe can change a component's position, rotation, size, color, shape, etc. based on dynamic conditions in the simulation model. You could also use a variable to determine how fast a particular animation should run based on certain conditions.

Keep in mind that an animation variable is basically a reference point to an animation-related object, component, or keyframe. Animation variables can point to:

  • Components
  • surrogates
  • Keyframe times
  • Time gaps
  • Component keyframes (such as the component's position, size, rotation, color, or shape frame)

Once you've created an animation variable, you can reference that variable in a Flexscript command. (See Animation Commands for more information.) Flexscript commands can either get information about a variable or it can set the value of a variable (thereby possibly changing the variable). For example, if you want to dynamically change the length of your animation based on parameters in your model at run time, you can create an animation variable that points to a time gap, and then set that animation variable through a keyframe trigger or from a trigger in your model.

Component variables are read-only
Animation variables pointing to a component are static variables. They are merely available as a reference point to a component through the getanimationvar command. Calling setanimationvar to a variable pointing to a component will have no effect. If you want to dynamically set a component's property, use a variable on a component keyframe instead.

Keyframe Triggers

Triggers can be added to animations that will fire when the animation gets to a specific point in the animation's timeline. They are added through the timeline. Triggers allow you to dynamically change or update animation variables, stop the animation, change some parameter in your model, or execute any other Flexscript code.

Creating and Importing Custom Animations

You can create your own custom 3D objects and animations using third-party software applications such as Blender, Poser, Mixamo, or 3DMax. To import a custom object and animation:

  1. First you need to create a custom object to act as your basic template. Drag either the Basic FR object or the Basic TE from the Library into your simulation model. (Use the Basic FR object if you want to create a fixed resource or the Basic TE if you want to create a task executer.)
  2. Click the Basic FR object or the Basic TE object to select it.
  3. In Quick Properties under General Properties, click the arrow next to the Shape box to open a menu.
  4. Select Browse from the menu and navigate to the location of your custom 3D object's file. Select the file that you want to import. The Basic FR object or the Basic TE will be updated to the new shape that you imported.

When you import an object, it will also import any animations that are associated with it. In order to create custom animations, you might need to create animation clips for the object. See the next section about Creating Animation Clips for more information.

Creating Animation Clips

When you create a custom object using third party software, you might typically want to create more than one animation for it. For example, the default Operator object in FlexSim has three different animations: walking, walking while carrying a load, and standing. So, if you wanted to make your own custom Operator object, it should probably have at least these three same animations.

However, some animation software programs only allow you to export all these animations as a single animation file. Consequently, when you import these files into FlexSim, you'll need to cut the animation file into individual clips using the clip editor in the animation creator.

To create animation clips:

  1. With the animation editor open for the object you want to animated, click the Add Clip button on the animation toolbar and select Add Animation Clip from the menu. This will open the clip editor, as shown in the following image:

  1. Click the Add button to add a new clip to the list of clips.
  2. Give the clip an appropriate name by typing a new name in the Name box.
  3. If needed, press the Play button to preview the full animation.
  4. Now you'll need to choose which section of the animation should be included in this clip. Drag the sliders on the timeline to the beginning and end of the section you want to include in this clip. Alternatively, you could manually set the exact frames and times that should be included using the Frame and Time boxes below the timeline.
  5. If needed, you can also change the rate of frames per second using the Rate box.
  6. Click the Apply button to save the changes to the clip.
  7. Make any other necessary changes and then close the window.
  8. Now when you click the Animation menu in the animation control panel, the new clip you created will appear in the list of available animations.

Use the animation creator's timeline if you want to combine one or more clips together.

Animation Commands

The following commands deal with animations:

startanimation(object, animation) - Starts an animation on the object. Animation can be either a string value that is the name of the animation, or it can be a number which is the animation rank.

stopanimation(object, animation) - Stops an animation on the object. Animation can be either a string value that is the name of the animation, or it can be a number which is the animation rank.

resumeanimation(object, animation) - Resumes an animation on the object that was previously stopped. Animation can be either a string value that is the name of the animation, or it can be a number which is the animation rank.

getanimationvar(object, animation, "varname") - Returns the value of an animation variable.

setanimationvar(object, animation, "varname", value) - Sets the value of an animation variable. Value can be a number or object and is based upon what the animation variable is linked to.

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