Expressions

Expressions for numeric animations

Expressions allow you to have a more powerful control over animation properties. They can be used with any numeric animation property.

Warning: Disguise software does not support expressions that uses layer names that has spaces between the words, for example "video explosions". In this case you have to rename it to "video_explosions". Expressions can only contain a-z A-Z 0-9 _

 
 

Setting up Expressions

To set up an Expression, right-click the property you want to control. This will open up the min/max/step viewer, which allows you to edit the limit values of the property and the value step used while animating. Below the min/max/step properties is a field called Expression, which initially contains a single word: self. This is the Expression.

The easiest Expression is self. It tells the system to use the value taken from the keyframe sequence. However, self can be built into more complex mathematical Expressions (formulae) to do useful things, such as :

self * 2

255 * self multiplies the animated value by 255.

When you type in an Expression, the property field turns green when the Expression has been correctly understood. If there is a mistake, the property field turns red; moving the mouse over the property field will open up a text message telling you what went wrong.

 

Expressions can refer to any property of any other object in the system. For example, if you want to read the x coordinate of the position of a screen called myscreen and multiply it by 2. The Expression to use would be:

screen:myscreen.pos.x * 2

In general, to access (property) of an object called (objectName) of type (type), we use:

type:objectName.property

 

 

Expanded Functionality - r21

In previous releases, Expressions could only access keyframed values. Module/layer expressions were hard-coded to only support field sequences.

 

As of r21, the functionality of Expressions has been improved, enabling them to be used in all modules in Disguise software.

Support for properties like frameNumberDisplay - the current frame readout at the top of the video layer- have been added for additional functionality.

This new feature allows for an expression to be created that has the ability to get information about a resource, and they can be used with all module properties which have existed previously and any new ones that are to be added.

An example of where this can now be used is in the case of fading the brightness down at the end of a clip; an expression can now be used on the brightness field that reads the frame index to do the fade.

 

Example expression used on Brightness field:

if(module:video.frameNumberDisplay >= 50, 0.5, 1.0)