Aller au contenu

Property animations

The property animation is a VRmaze feature allowing the variation of parameters in the time of the pass. The idea here is to propose a system allowing the creation of function f(t) and apply them to a chosen property, and this, without programming.

Animation of properties

Property animation allows, without programming to control a property as a function of time. An understanding of this system allows you to go quite far without any notion of programming.

Time reference

The set of animations will all have a starting timecode of 0. VRmaze will find the best candidate to provide a timecode during the pass. It is thus possible to use the property animations on an experiment: in this case, the time reference will be the beginning of the experiment. In the case of a property animation in a trial, the time code of the beginning of the trial will be used.

Triggering animation

It is possible to use a certain type of animation that will run only on a trigger. This trigger must be programmed in C#.

Visualization of graphics

Property animation makes extensive use of the VRmaze graphical editor to allow visualization of animation curves. Each system, controller or property animation node, using the integrated graphics system has two parameters that allow you to set the visualized time (starting from 0 anyway) and the calculated point density. These two parameters, not saved in the protocol file, allow to optimize the visualization, but have no effect on the mathematical function controlling the curve.

Display parameters

The display parameters only affect the representation of the graph, not the underlying mathematical functions.

Signal types

Image title 2

A sine wave controller.

VRmaze comes with a set of mathematical functions (controllers) to generate a signal as a function of time. These controllers are parametric and can be configured at will. Each controller has its own parameters.

Saving signals

The parameters of the controllers are saved in the protocol file as they are, without being converted to keyframe animation.

All these signals are contained in an animation list and are applied to the selected property. If multiple controllers are applied at the same time in an animation list, VRmaze will sum at time t all the added controllers to calculate the value to apply to the property.

Exceeding the graphic space

A mathematical function generating a signal will have no time limit. Outside the interval visualized by the graph, the controller will continue to generate a signal.

Case of the Table animation controller

Image title 2

The sub-signal list of the controller `Table Signal control`.

The generic Table Signal controller control is not just another signal controller. The latter has a list of applicable sub-signals allowing the generation of complex signals. These signals are generated from pre-stored tables of values in VRmaze.

Animation by keys

Image title 2

Keyframe animation curve

Mathematical functions allow for a wide range of use cases. However it is often necessary to want to create signals from scratch, with full control over the animation curve. In this sense, VRmaze offers a specific animation controller Key Animation Controller which allows the creation of signals by animation keys.

The animation key is an entity containing only 2 properties, a timecode and a value. VRmaze will create a link between 2 temporally close keys and the per key controller can take into account as many keys as needed.

Modification of animation keys

It is possible to modify the value of an animation key directly in the graphic editor.

Processing loop

When using animation keys, VRmaze cannot deduce how to proceed with the calculation outside the curve defined by the keys. To solve the problem VRmaze proposes a processing loop system that can take 3 forms:

  • Loop output - When the last key is passed, we start over at t=0.
  • Constant output - When the last key is passed, the calculated value is equal to the last key indefinitely.
  • Mirror output - When the last key is exceeded, the calculation is performed in reverse until t=0 and then restarts (Ping-pong).

In the following example, the animation stops at t=50.

Loop output Constant output Mirror output
! ! !

Curve interpolation

The "link" between two temporally close keys is in fact a temporal interpolation between these two keys. Interpolation can take 3 forms:

Linear interpolation takes the two keys and computes a linear value between these two values. At the limits of the keys, the animation curve is discontinuous. Cubic interpolation takes into account several animation keys around a point and calculates a smoothed value. This results in a continuous curve signal. The last interpolation system is not a system because in this case, the calculated value is equal to the previous closest key in time.

Linear Interpolation Cubic Interpolation Constant Interpolation
! ! !

Animation by expression

VRmaze offers the possibility to create its own signal based on a mathematical function that can be complex. This function is of the form f(t) where t is the reference time. In this expression use case it is not possible to use other variables than time [T].

!

Pseudorandom animation curve generated by a mathematical formula in f(t)

VRmaze offers another type of property control that can be based on time, but also and especially on any other property of any other entity. For this, the idea is to add a number of operands by selecting the related entities and the properties of these related entities. By assigning them an operand identifier, it becomes possible to use the identifier in the expression formula.

Operand identifier

Operand identifiers can take any value as a string. However, be careful, a certain number of keywords are already reserved (and usable without having established an operand link beforehand)

Triggering animation

VRmaze offers the possibility to launch animations from triggers. There are 3 possible triggers:

  • Trigger on keyboard input (to trigger on keyboard or joystick input)
  • Triggering by random timecode (to trigger the animation once in a given time interval)
  • Triggering by user action

There are 3 ways to trigger an animation on user action:

  • When the user clicks on the object
  • When the pointer hovers over the object
  • When the pointer stops hovering over the object

Animation on user action

For the animation on user action to work, it is necessary to have a collision on the object (so that the pointer can be captured).

Triggered animations

By default, all animations are launched when they are created at runtime. To use a trigger, you must use a specific animation controller Trigger Float Animation Property.