Property animation

Composer ships with two animation systems. Most new code should use Project.AddPropertyAnimator — it animates any numeric property on any named model. The older Project.Animator.AddLayerTransformationItem is limited to a fixed set of layer transform fields.

Function Returns Description
Animator.AddLayerTransformationItem(sceneName, layerName, type, durationMs, startValue, stopValue, cData, mode?, options?) Guid Legacy. Animates one of eight fixed LayerTransform fields. New scripts should prefer AddPropertyAnimator.
ClearAllPropertyAnimations() void
IsPropertyBeingAnimated(objectName, propertyName) bool
RemovePropertyAnimation(id) bool
GetNumberOfRunningPropertyAnimations() int
AddPropertyAnimator(objectName, propertyName, startValue, targetValue, durationMs, easing, behavior?) Guid Animates a numeric property (int/byte/uint/long/float/double) on a named model. Pass null for startValue to animate from the property's current value. Returns Guid.Empty on failure (ambiguous name, missing property, read-only, non-numeric).

Notes on AddPropertyAnimator:

  • The target object is looked up by name in NamedModels. If the name is ambiguous, the call fails and returns Guid.Empty.
  • For a Layer, the property is first searched on Layer itself, then on Layer.LayerTransform (so "PositionX" and "Opacity" work directly with the layer name).
  • The property must be writable and numeric — int, byte, uint, long, float, or double. Read-only or non-numeric properties are rejected.
  • Returns the animation's Guid, or Guid.Empty on failure (logged).

Example: fade-in then move

var Enums = importNamespace('VindralEngineBaseTypes.DataTypes.Enums');

function OnConnectorIntro() {
    // Fade opacity 0 → 100 over 500 ms (linear)
    Project.AddPropertyAnimator("Logo", "Opacity", 0, 100, 500, Enums.AnimationEasing.None);

    // Slide to X=400 over 2 s, easing in/out — start from current X
    Project.AddPropertyAnimator("Logo", "PositionX", null, 400, 2000, Enums.AnimationEasing.EaseInOut);
}

RunningAnimationBehavior

Value Meaning
CancelNewAnimation If an animation already exists on the same property, drop the new one.
AbortRunningAnimations (default) Cancel any running animations on the same property and start the new one.
AllowMultipleAnimations Stack the new animation alongside existing ones. Not recommended — the property's final value depends on which animation finishes last.

AnimationEasing

Value Curve
None Linear interpolation.
EaseInOut Smoothstep (3t² − 2t³).

Legacy: AnimatorEngine.AddLayerTransformationItem

Project.Animator.AddLayerTransformationItem is the older animation API. It only animates the eight layer-transform fields below and uses its own enum set. New scripts should prefer AddPropertyAnimator.

Project.Animator.AddLayerTransformationItem(
    sceneName,
    layerName,
    type,               // Animator.AnimateTransform.*
    durationMs,
    startValue,
    stopValue,
    cData,              // free-form string, currently unused
    mode,               // Animator.AnimateEasing.* (default EaseInEaseOut)
    options             // Animator.AnimateOptions.* (default None)
) → Guid
AnimateTransform
PositionX, PositionY, ScaleX, ScaleY, AnchorPointX, AnchorPointY, Rotation, Opacity
AnimateEasing Curve
Linear
EaseInEaseOut (default) Smoothstep
AnimateOptions Meaning
None Use the supplied startValue.
UseCurrentValueAsInitialValue Ignore startValue; capture the property's current value when the animation starts.
var Animator = importNamespace('VindralEngine').Animator;

Project.Animator.AddLayerTransformationItem(
    "Scene", "Tant",
    Animator.AnimateTransform.PositionY,
    1500, 866.805, 381.805, "",
    Animator.AnimateEasing.EaseInEaseOut,
    Animator.AnimateOptions.None);