Creating animations

  • Here you can see how to create and test animations when creating assets. This article only covers the standard animations and does not cover on animations for wagon bodies and bogies.

    1 Structure

    At the base animations are defined separately from the imported meshes. After this step you can tell each animation what mesh it should move.

    Configurations happens on the left in the section "Animations":

    Animations have a hierarchy, that means they are stored in a tree. In this example you can see that "Panto_main_oben", the upper part of the pantograph arm, is a child of "Panto_main_unten", the lower part of the pantograph arm. This ensure that the upper part moves along with the movements of the lower part.

    2 Configuration

    2.1 Creating new animations, editing and deleting

    To add a new animation first select the parent animation. If the animation does not have a parent (it should be attached to a fixed part of the object) then choose the root, the topmost entry in the tree. This root always exists and cannot be deleted.

    Then click on "Add", enter the name of the animation and choose what type of animation will be created:

    To edit or delete an animation select it and then use the buttons underneath.

    2.2 Changing the hierarchy

    If you accidentally ordered your animations incorrectly in the tree you can easily select them and drag them to the right position in the tree.

    2.3 Adding meshes

    To let your animations actually do something, you of course first need to attach the relevant Mesh to the animation:

    First click on the button "Add/Remove Mesh". The button turns blue. Now you can select (or deselect) one or more meshes in the 3d view or in the mesh list on the right. Selected meshes are shown with an orange border.

    After that you must click the "Add/Remove Mesh" again to get the tool back in normal mesh selection mode.

    2.4 Copying axes and rotation point coordinates from the 3d Program

    When adding a mesh for the first time, if no coordinates were already entered, a notice appears:

    By confirming this window the local coordinate system, that is location of the origin and direction of the axes of the imported mesh, are copied into the Animation configuration. What axis is used is a setting in the Content-Tool options ("Which axis from the 3D program should be imported as rotation axis?"), default setting is the Z axis.

    This function can also be called at a later time. For this select the mesh that should be used as source for the origin and rotation/translation axes in the animation properties. Then click on the button "Copy over coordinate system".

    2.5 Coupling light sources etc. to an animation

    It is often the case (like for articulated rail cars) that effects like sounds, lights and particles have to be attached to an animation, in order for them to move along.

    For this first select then animation in the tree. Then, in the relevant Effect section click on the "Bind to animation" button.

    3 Properties of animations

    3.1 Translation

    The easiest type of animation is translation, moving a mesh. For these you can use the following parameters:

    • Axis of rotation/ translation direction: In what direction should the translation take place? When this direction is at an angle it might be better to use the enty as angles (click on the "Enter as angles..." button) or, if already taken care of in the 3D program, using the import of the information in the mesh.
    • Variable: What variable controls the animation? This has to be a variable declared in the "PUBLIC_VARS" section of the script.
    • "Variable value A/B" and "Shift at var = A/B": These control the animation response to the variable. If the variable is equal to the value entered at "Variable value A" then the translation is the distance entered at "Shift at var = A" (in meters). Same for B.
    • Variable value lower/upper limit: The animation stops when the variable value is outside of the range described here.
    • Maximum speed: If -1 is entered the animation follows changes in the variable value instantaneously. When a value > 0 is entered the variable follows with this value as maximal rate of change.
    • Exponential approach to target position: Similar to "Maximum speed", this however lets the animation end at the goal value in a smooth way.

    3.2 Rotation

    The properties of a rotation are quite similar to the translation properties:

    Added to these is the Pivot point, around which the rotation should happen. If these are not used the previous translation direction is used as axis of rotation. The unit for "Rotation angle at var = A/B" is in degrees.