Incari Studio
2023.1
2023.1
  • Incari HMI Development Platform
  • Getting Started
    • Overview
    • Requirements
    • What's New
    • Installation
    • First Steps
      • Incari Hub
      • Creating a Project
      • Incari Studio
  • Objects and Types
    • Overview
    • Project Objects
      • Scene
      • Scene2D
      • Screen
      • HMD
    • Scene Objects
      • Audio
      • Camera
      • Group
      • Image Sequence Sprite
      • Label
      • Light
      • List
      • Lottie Sprite
      • Mesh
      • On-Screen Keyboard
      • Overlay
      • Primitives
      • Sprite
      • Text
      • Vector
      • Video
      • Web Sprite
    • Scene2D Objects
      • Camera
      • Frame
      • GUI
        • Button
        • Dropdown
        • List
        • Slider
        • Text
        • Text Area
        • Text Input
        • Toggle
      • Image
      • Vector
    • Prefabs
      • Creating and Using Prefabs
        • Prefabs in Scenes
        • Prefabs in Scene2Ds
      • Logic in Prefabs
      • Nested Prefabs
    • Attributes
      • Attribute Types
        • Asset/Object Attribute
        • Boolean Attribute
        • Color Attribute
        • Numerical Attribute
      • Common Attributes
        • Object
        • Sprite
        • Transformation
          • Global Transformations
          • Local Transformations
        • Tag
    • Data Types
      • Bool
      • Byte
      • Float
      • Int
      • String
      • Vector2
      • Vector3
      • Vector4
    • Terminology
  • Modules
    • Overview
    • Animation Editor
    • Asset Database
    • Asset Manager
    • Attribute Editor
    • Code Editor
    • Console
    • Exporter
    • Image Sequence Editor
    • Logic Editor
    • Global Preferences
    • Material Editor
      • Car Paint Model
      • Custom Shading Model
      • Phong Model
      • Glass Model
      • Extended PBR Model
      • PBR Model
      • Shadeless Model
    • Model Editor
    • Plugins
      • Communication
        • MAVLink
        • Serial
        • Socket.IO
        • TCP
        • UDP
    • Profiler View
    • Project Outliner
    • Project Settings
      • CAN
      • Fonts
      • HTTP
      • Keyboard
      • MAVLink
      • MQTT
      • Profiler
      • Scene Separation
      • Serial
      • Socket.IO
      • Styles
      • TCP
      • UDP
    • Scene Outliner
  • Toolbox
    • Overview
    • Actions
      • Delay Action
      • FadeFromTo Action
      • FadeTo Action
      • MoveBy Action
      • MoveTo Action
      • RotateBy Action
      • RotateTo Action
      • RotateFromTo Action
      • ScaleBy Action
      • ScaleTo Action
    • Array
      • Array Value
      • Clear Array
      • Concat Arrays
      • Get Array Element
      • Insert Array Element
      • Length of Array
      • Pop Array Element
      • Push Array Element
      • Remove Array Element
      • Set Array Element
    • Binary
      • Binary (Hex) Value
      • Concat Binaries
    • Communication
      • CAN
        • CAN Send Packet
        • CAN Start
        • CAN Stop
        • Events
          • On CAN Packet Received
          • On CAN Start
          • On CAN Stop
      • HTTP
        • Events
          • On HTTP Route
          • On HTTP Server Start
          • On HTTP Server Stop
        • HTTP Client
        • HTTP Response
        • HTTP Server Start
        • HTTP Server Stop
      • MAVLink
        • Events
          • On MAVLink Packet Received
          • On MAVLink Start
          • On MAVLink Stop
        • MAVLink Decode
        • MAVLink Start
        • MAVLink Stop
      • MQTT
        • Events
          • On MQTT Start
          • On MQTT Stop
          • On MQTT Topic
        • MQTT Publish
        • MQTT Start
        • MQTT Stop
        • MQTT Subscribe
      • Serial
        • Events
          • On Serial Error
          • On Serial Packet Receive
          • On Serial Start
          • On Serial Stop
        • Serial Send Packet
        • Serial Start
        • Serial Stop
      • Socket.IO
        • Events
          • On Socket.IO Error
          • On Socket.IO Receive
          • On Socket.IO Start
          • On Socket.IO Stop
        • Socket.IO Send
        • Socket.IO Start
        • Socket.IO Stop
        • Socket.IO Subscribe
        • Socket.IO Unsubscribe
      • TCP
        • Events
          • On TCP Error
          • On TCP Packet Receive
          • On TCP Start
          • On TCP Stop
        • TCP Send
        • TCP Start
        • TCP Stop
      • UDP
        • Events
          • On UDP Error
          • On UDP Packet Receive
          • On UDP Start
          • On UDP Stop
        • UDP Send
        • UDP Start
        • UDP Stop
    • DateTime
      • Date Time Formatter
      • Now (UTC)
      • System Time
      • Timezone Value
    • Development
      • Assert
      • Benchmark Get
      • Benchmark Start
      • Benchmark Stop
      • Clear Console
      • Console
      • Profiler Start
      • Profiler Stop
    • Dictionary
      • Clear Dictionary
      • Dictionary Value
      • Erase Dictionary Element
      • Get Dictionary Element
      • Get Dictionary Keys
      • Get Dictionary Values
      • Merge Dictionaries
      • Set Dictionary Element
      • Size of Dictionary
    • Events
      • Custom
        • Event Listener
        • Event Trigger
      • Gestures
        • On Swipe
        • On Tap
      • ImageSequence
        • On ImageSequence Frame Changed
        • On ImageSequence Pause
        • On ImageSequence Play
        • On ImageSequence Stop
      • Input
        • On Text Change
      • Keyboard
        • On Key Press
        • On Key Release
      • Leap Motion
        • On Leap Motion Frame Update
        • On Leap Motion Grab End
        • On Leap Motion Grab Start
        • On Leap Motion Grab Update
        • On Leap Motion Pinch End
        • On Leap Motion Pinch Start
        • On Leap Motion Pinch Update
        • On Leap Motion Swipe Left
        • On Leap Motion Swipe Right
        • XR Position
      • List
        • On List Current Index Change
        • On List Entry Select
        • On List Load
      • List 2D
        • On List Active Index Change
      • Lottie
        • On Lottie Finish
        • On Lottie Pause
        • On Lottie Play
        • On Lottie Stop
      • Media
        • On Media Finish
        • On Media Play
      • Mouse
        • Get Mouse Position
        • Get Mouse Position Delta
        • On Hover Enter
        • On Hover Leave
        • On Mouse Button Down
        • On Mouse Button Up
        • On Mouse Click
        • On Mouse Double Click
        • On Mouse Enter
        • On Mouse Leave
        • On Mouse Move
        • On Mouse Scroll
      • Object
        • On Alpha Change
        • On CheckBox Value Change
        • On Dropdown Active Value Change
        • On Opacity Change
        • On Position Change
        • On Rotation Change
        • On Scale Change
        • On Slider Value Change
        • On Visibility Change
      • On-Screen Keyboard
        • On On-Screen Keyboard Arrow Down Pressed
        • On On-Screen Keyboard Arrow Up Pressed
        • On On-Screen Keyboard Enter Pressed
        • On On-Screen Keyboard Input Changed
        • On On-Screen Keyboard Key Pressed
      • Unsubscribe
      • Screen
        • On Screen Scene Change
      • Variables
        • On Variable Change
        • On Variable Set
      • Web
        • On JavaScript Callback
      • WebSprite
        • On WebSprite Load
        • On WebSprite Remote URL Change
    • Flow Control
      • Branch
      • For Each Loop
      • For Loop
      • Index Switch
      • Is Equal
      • Is Greater Equal
      • Is Less Equal
      • Select Data
      • Sequential
      • Switch
      • Toggle
    • Functions
      • Function
        • Function Input
        • Function Output
    • IO
      • Create File
      • Get Current Directory
      • Get File Extension
      • List Directory Content
      • Load File
      • Remove
      • Save File
      • Set Current Directory
    • Incari
      • Animation
        • Pause Animation
        • Play Animation
        • Stop Animation
      • Asset
        • Add to Asset Database
        • Remove from Asset Database
      • Camera
        • Get Active Camera
        • Get All Cameras
        • Set Active Camera
      • ImageSequence
        • Get Current ImageSequence Frame
        • Get ImageSequence Duration
        • Get ImageSequence FPS
        • Get ImageSequence Total Frames
        • Go To Next ImageSequence Frame
        • Go To Previous ImageSequence Frame
        • Pause ImageSequence
        • Play ImageSequence
        • Resume ImageSequence
        • Show ImageSequence Frame
        • Stop ImageSequence
      • List
        • Generate List
        • Get Selected Item
        • Next List Entry
        • Previous List Entry
        • Select List Entry
        • Set Active
        • Set Current Index
      • List 2D
        • Add List Element
        • Get Active Index
        • Get List Data
        • Get List Element
        • Insert List Element
        • Remove List Element
        • Set Active Index
        • Set List Data
        • Set List Element
      • Lottie
        • Pause Lottie
        • Play Lottie
        • Stop Lottie
      • Material
        • Set Custom Uniform
      • Media
        • Get Volume
        • Is Media Playing
        • Pause Media
        • Play Media
        • Seek Media
        • Set Volume
        • Stop Media
      • Object
        • Add Tag
        • Destroy Object
        • Get Active Dropdown Value
        • Get Alpha
        • Get CSS Property
        • Get CheckBox Value
        • Get Children
        • Get Dropdown Options
        • Get Material
        • Get Name
        • Get Objects By Tag
        • Get Opacity
        • Get Parent
        • Get Position
        • Get Root
        • Get Rotation
        • Get Scale
        • Get Size
        • Get Slider Value
        • Get Sort Index
        • Get Tag
        • Get Text
        • Get Text Color
        • Get Tint
        • Get Visibility
        • Has Children
        • Instantiate Object
        • On List Item Clicked
        • Remove Tag
        • Set Active Dropdown Index
        • Set Active Dropdown Value
        • Set Alpha
        • Set CSS Property
        • Set CheckBox Value
        • Set Dropdown Options
        • Set Mask
        • Set Material
        • Set Opacity
        • Set Position
        • Set Rotation
        • Set Scale
        • Set Size
        • Set Slider Value
        • Set Sort Index
        • Set Stylesheet
        • Set Text
        • Set Text Color
        • Set Texture
        • Set Tint
        • Set Visibility
        • Use Mask
      • Object 2D
        • Add CSS Class Name
        • Get CSS Class Names
        • Remove CSS Class Name
        • Set CSS Class Names
      • On-Screen Keyboard
        • Get Screen Keyboard Layout
        • On-Screen Keyboard Clear Input
        • On-Screen Keyboard Get Input
        • On-Screen Keyboard Move Selection
        • On-Screen Keyboard Press Button
        • Set Screen Keyboard Layout
      • Scene 2D
        • Get Stylesheet
        • Merge To Stylesheet
        • Set Stylesheet
      • This Scene
      • Ultrahaptics
        • Ultrahaptics Play
        • Ultrahaptics Stop
      • Scenes
        • Scene
      • Screen
        • Get Scene
        • Set Scene
      • Screens
        • Screen
      • Vector
        • Arc
          • Get ArcEnd
          • Get ArcStart
          • Set ArcEnd
          • Set ArcStart
        • Get BackgroundColor
        • Get FillColor
        • Get StrokeWidth
        • Label
          • Get LabelText
        • Line
          • Get LineWidth
          • Set LineWidth
        • Pie
          • Get PieEnd
          • Get PieStart
          • Set PieEnd
          • Set PieStart
        • Rectangle
          • Get RectangleCorners
          • Set RectangleCorners
        • Set BackgroundColor
        • Set FillColor
        • Set StrokeWidth
      • WebSprite
        • Get Remote URL
        • Set Remote URL
        • Web Sprite Reload
    • Math
      • Absolute
      • Add
      • Average
      • Boolean
        • AND
        • Bool Value
        • Negate
        • OR
      • Ceil
      • Clamp
      • Decrement
      • Divide
      • Floor
      • Increment
      • Interpolate
      • Logarithm
      • Math Constant
      • Maximum
      • Minimum
      • Modulo
      • Multiply
      • Numerical Value
      • Power
      • Random
      • Range Mapper
      • Root
      • Rotation Matrix
      • Round
      • Subtract
      • Trigonometry
        • Arc Cosine
        • Arc Sine
        • Arc Tangent
        • Arc Tangent 2
        • Cosine
        • Radian-Degree Converter
        • Sine
        • Tangent
      • Vector Value
    • Plugins
      • (JSON) Scale Vector
    • Prefab
      • This Prefab
    • String
      • Capitalize
      • CharCodeAt
      • Compare
      • Concat Strings
      • Contains
      • CryptoHash
      • EndsWith
      • Format
      • FormatArray
      • IndexOf
      • IsLower
      • IsUpper
      • JSON Parse
      • JSON Stringify
      • Join
      • LastIndexOf
      • Length
      • Lower
      • MatchRegex
      • PaddingLeft
      • PaddingRight
      • RandomString
      • RemoveCharacters
      • Replace
      • ReplaceRegex
      • Reverse
      • Split
      • StartsWith
      • String Value
      • Substring
      • Trim
      • TrimLeft
      • TrimRight
      • Upper
    • Transition
      • CrossFade
      • Fade
      • MoveInFromBottom
      • MoveInFromLeft
      • MoveInFromRight
      • MoveInFromTop
      • SlideInFromBottom
      • SlideInFromLeft
      • SlideInFromRight
      • SlideInFromTop
    • Utilities
      • Color Value
      • Conversion
      • Create CustomID
      • Create Object
      • Get Command Line Option
      • Group
      • Interval
        • Reset Interval
        • Start Interval
      • Is Data Type
      • Is Object Type
      • System Call
      • Timeout
        • Cancel Timeout
        • Start Timeout
    • Variables
      • Variable Getter
      • Variable Setter
    • Web
      • Call JavaScript Function
  • Demo Projects
    • Overview
    • 4 Methods of Animation
    • Using APIs to Pull Dynamic Data
    • An Analog Clock
    • Image Sequence Button Animation
    • Prefabs
    • Project Initialization
    • On-Screen Keyboard
Powered by GitBook
On this page
  • See For Yourself
  • 1. Animation Editor
  • 2. Interpolation
  • 3. Image Sequence
  • 4. Actions

Was this helpful?

  1. Demo Projects

4 Methods of Animation

PreviousOverviewNextUsing APIs to Pull Dynamic Data

Last updated 1 year ago

Was this helpful?

Animation is a key component of creating engaging UI experiences. Adding flare with motion and color can transform an HMI from something dull and lifeless into something polished and appealing. The term "animation" covers an extremely broad spectrum of disciplines and mediums. Moreover, the way that two animators approach a task may be very different while yielding similar results. In developing Incari, we have been very mindful of this fact and have supplied a variety of different methods for breathing life into static assets.

See For Yourself

Using the new Remote Projects section of Incari Hub, there are now downloadable Projects, which you can play around with to see how certain functionality is implemented in Incari Studio. This Project focuses on the four different approaches to animation, which can all be combined together based on the Project requirements.

To download the Project, open Incari Hub and download the "Animations" Project from the Remote Projects section.

If you go back to the My Projects section, you will see that the Project was added to your local files. If you hover over the project thumbnail and press the â–¶ (play) icon, you can preview the Project.

Now you will see a variety of controls for each of the 4 animation methods.

  1. Animation Editor - Spins the Incari logo 360°. Note that this kind of animation in Incari is relative, meaning that if you hit the X (stop) button while the Sprite is partially rotated, then hit play again, the logo will rotate to the same rotation as it was when you hit the button. These animations are achieved using a Keyframe-based animation.

  2. Interpolation - This fades the opacity of the graphic. Interpolation is without a doubt the most programmatic way of approaching animation. It is an entirely Node-based method which naturally favors a more parametric way of thinking.

  3. Image Sequence - This animates the logo itself using a pre-rendered sequence of .png files. This allows you to use any 3rd-party animation tool to create animations and then bring them into Incari Studio where you can attach functionality.

If you open the project from Incari Hub by double-clicking it, we can begin to break down each animation method one by one.

1. Animation Editor

Within the Asset Manager there is a file called TimelineAnimation.incani. Files with the .incani file type are Keyframe-based timeline animations, created using the Animation Editor, which should open automatically when double-clicking on the Asset.

If you expand the Animation Block called "Logo Animation" and its Transformation Attributes, you will see that both the Z Position and Z Rotation are highlighted in blue. This indicates that these Attributes have some Keyframes saved on this Animation Block.

By selecting these Attributes using Ctrl + LMB and then clicking the "focus" icon highlighted above, we can see the animation, represented as Bezier curves.

A Keyframe consists of two parts:

  1. The Keyframe itself, which holds a value at a specific time.

  2. The curve handles, which control the easing and interpolation between frames.

To add a Keyframe, simply right-click an Attribute and select "Add Keyframe" from the context menu. This will create a Keyframe at whatever time the playhead is currently on. You can then adjust the curve handles to fine-tune the intermediate frames.

If you take a look into the Logic Editor, you will see that controlling animations is fairly simple. When you play an animation using the Play Animation Block Node, an Instance ID is generated. This is a unique id number which Incari uses to identify which animation you want to stop or pause. If this sounds confusing, don't worry, just be aware that in order to use the Stop Animation and Pause Animation Nodes you must tell these Nodes which animation should be affected.

Another last point to note is that the Play Animation Block Node has an Attribute for both the Asset (File) and the Animation Block (Name) which will be played. You can drag the .incani file from the Asset Manager directly to the Node to assign it to the File Attribute and select the desired Animation Block from the dropdown menu.

2. Interpolation

Interpolation is a slightly more complex approach to animation. Unlike some of the other options, it is achieved with the Logic Editor alone, using the Interpolate Node. What this does is calculate the intermediate values between an initial and target value over a set amount of time.

In the example provided in the demo, you will see that each button graphic's On Mouse Click event triggers a sequence of Logic. On all three of the buttons, both of the Interpolate Nodes are reset, to make sure that we don't trigger an interpolation, while one is already in progress.

The play forward and play backward buttons have a third Pulse that calculates the interpolation between the current and target opacity values of the logo. Here is a brief overview of the Attributes of the Interpolation Node:

Data Type - The numerical data type which will be interpolated.

Duration - The length of time between the start and end of the interpolation.

Interval Time - This governs how frequently, in seconds, the interpolated value is calculated and the output Pulse is triggered. In our example, this is set at 0.0167, which is approximately 60 fps: (1 / 60 = ~0.0167).

From - This is the value at the start of interpolation. In our example, we are using the current opacity value of our logo as a starting point.

To - This is the value at the end of the interpolation, which in our example, is either 1 or 0.25, depending on which button was pressed.

Mode - Whether the interpolation will be performed once, repeated, or alternated.

3. Image Sequence

Although Incari's built-in tools are powerful, there are many use cases where the desired effect cannot be achieved using Incari alone. In this case, it often makes more sense to create animations in dedicated animation software. Most tools, such as Adobe After Effects, provide an easy way of exporting an animation as an image sequence, most commonly in the .png file format. By using Incari's Image Sequence Object and Nodes, we can take these frames and combine them with Incari's Logic system.

In the Asset Manager of our demo file, you will see a file called Logo Animation.incseq. Files of the.incseqtype are Image Sequences. To open the file, simply double-click it and the Image Sequence Editor will open. Here you can see all of the images of the sequence arranged in order.

To create this type of file, simply right-click in the Asset Manager and select "Create Asset > Image Sequence". Then double-click it to open the Image Sequence Editor, drag the images into it directly from the Asset Manager, and then click the save icon to save it.

Controlling Image Sequences from the Logic is fairly straightforward. If you take a look in the Logic Editor of the demo scene, you will see that there are three main Nodes for playing, pausing, and stopping the playback of the Image Sequence.

While the Pause ImageSequence and Stop ImageSequence are self-explanatory, the Play ImageSequence Node has quite a few Attributes, which we will go through now:

  • Start Frame / End Frame - This is the frame index that the animation will start and finish on. Setting these to -1 will tell Incari to start at the first frame and end at the last frame.

  • Object - The Image Sequence Sprite Object, which can be dragged from the Scene Outliner onto the Node.

  • Play Mode - Whether the animation will be played based on frames-per-second (FPS) or a duration (Time). The value of this Attribute will determine which of the following Attributes will be visible:

    • FPS - The framerate of the animation. This may be preferable if the animation was exported at a specific framerate that you want to reflect in Incari.

    • Time - The amount of time the animation will take from start to finish. This is useful for tweaking the duration of the animation and can incorporate frame blending using the Interpolation Mode Attribute.

  • Interpolation Mode - This determines whether the animation should fade between one frame and the next. Constant means that frames aren't blended, while Linear means that they are. This Attribute only has an effect when the Play Mode is set to Time.

  • Loop Mode - Whether the Image Sequence plays once (none), plays repeatedly (repeat), or ping-pongs backwards and forwards (alternate).

  • Play Direction - If the animation plays forwards or backwards.

4. Actions

Actions are a set of Nodes designed specifically for animation. In the Toolbox you will see a number of different actions which affect the transformation properties and opacity of Objects.

The names of these Nodes offer insight into what the Node actually does and which Attribute is affected:

Fade = Opacity.

Move = Position.

Rotate = Rotation.

Scale = Scale.

Additionally, you will notice three types of actions:

FromTo = Both the start and end values are set manually.

To = Only the target value is provided.

By = The amount to be animated relative to the Attribute's current value.

Looking at our example Logic, you will see that the logo graphic is moved to a different position depending on which button is pressed. There are also four easing types, defined in the Interpolation Attribute for sine-based and linear interpolation.

Actions - This simply moves the logo from left to right with an easing effect. Actions are Node-based. However, unlike the Interpolation approach, these are specifically for animation and are much more akin to tween libraries like .

Type - This is the method that the Interpolate Node uses to calculate the intermediate values. These are similar to those found in many other software and programming languages. A good reference for interpolation types is .

TweenLite by GreenSock
easings.net
"Animations" Project.
Animation Block Example 1.
Animation Block Example 2.
Bezier Curves.
Animation Nodes.
Play Animation Node Example.
Interpolation Example.
Image Sequence Example.
Image Sequence Nodes Example.
Play ImageSequence Node Example.
Action Nodes.
Animation Using Actions Example.