Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IClipTransition

The IClipTransition graph node interface.

Clip transition nodes must be defined as direct children of a node implementing the Graph::IClipSequencer interface, which is responsible for managing any transitions between those clips. See Graph::IClipSequencer and Graph::IClip.

A clip transition must always reference exactly two Graph::IClip nodes: one representing the "from" state and another one for the "to" state. See GetFromClipNodeTarget() and GetToClipNodeTarget().

When a transition is triggered, the given "from" node is blended out (towards a blend factor of 0.0). and the "to" node is synchronously blended in (towards 1.0), both with their respective duration and offset.

The actual trigger used to start a transition can be any combination of bits from the IEnums::TriggerCondition enumeration, set via SetTriggerConditionEnabled(). The following trigger types are available:

  • IEnums::TRIGGER_CONDITION_CLIP_FINISHED: The transition is started when the timelines defined in the "from" clip are about to expire (see Graph::IClip::GetRemainingClipTime()). This takes into account the given out duration and offset values; the transition is started before the timelines are actually finished so that both transition and timelines expire at the same time. Negative offset values result in the transition being started earlier, positive values add a delay.
  • IEnums::TRIGGER_CONDITION_LOOP_FINISHED: Similar to CLIP_FINISHED, but the transition is started when a timeline in the "from" clip is about to finish its next loop. This is useful for timelines that loop forever, where it is desired to synchronize a transition to a whole loop (e.g. when the feet are on the ground in a walk cycle animation).
  • IEnums::TRIGGER_CONDITION_VARIABLE: When using this trigger, a Graph::IVariable node must be defined via GetTriggerVariableNodeTarget(), of type IEnums::VARIABLE_TYPE_BOOL. The transition is started immediately when the variable's value equals true. This means, that in this case negative offset values cannot have an effect and are clamped to zero.

Note, that if a transition to a certain clip is started, and there is another transition for that new clip whose condition is true at the same moment, that transition gets also started at the same time. This means, that it is possible to chain transitions together without any delay. However, the same clip cannot be processed twice in the same tick, otherwise an infinite loop would occur. In such a case, the transition is delayed until the next tick.


Table members

Methods


GetNodeInterface()

Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.

Murl.Graph.INode GetNodeInterface()

Returns
Murl.Graph.INode The constant Graph::INode interface, or null if not available

SetTriggerConditionEnabled(condition, enabled)

Enable/disable a given trigger condition.

Boolean SetTriggerConditionEnabled(Murl.IEnums.TriggerCondition condition, Boolean enabled)

Parameters
conditionThe condition to enable or disable
enabledIf true, the given condition gets enabled.
Returns
Boolean true if successful.

IsTriggerConditionEnabled(condition)

Check if a given trigger condition is enabled.

Boolean IsTriggerConditionEnabled(Murl.IEnums.TriggerCondition condition)

Parameters
conditionThe condition to check.
Returns
Boolean true if enabled.

GetTriggerVariableNodeTarget()

Get the constant Graph::IVariableNodeTarget container referencing a trigger variable. This method returns a constant pointer to the node's Graph::IVariableNodeTarget container, which allows to query a reference to an optional trigger variable.

Murl.Graph.IGenericNodeTarget.GraphIVariable GetTriggerVariableNodeTarget()

Returns
Murl.Graph.IGenericNodeTarget.GraphIVariable The constant Graph::IVariableNodeTarget container, or null if not available.

GetFromClipNodeTarget()

Get the constant Graph::IClipNodeTarget container referencing the "from" clip. This method returns a constant pointer to the node's Graph::IClipNodeTarget container, which allows to query a reference to the "from" clip node.

Murl.Graph.IGenericNodeTarget.GraphIClip GetFromClipNodeTarget()

Returns
Murl.Graph.IGenericNodeTarget.GraphIClip The constant Graph::IClipNodeTarget container, or null if not available.

GetToClipNodeTarget()

Get the constant Graph::IClipNodeTarget container referencing the "to" clip. This method returns a constant pointer to the node's Graph::IClipNodeTarget container, which allows to query a reference to the "to" clip node.

Murl.Graph.IGenericNodeTarget.GraphIClip GetToClipNodeTarget()

Returns
Murl.Graph.IGenericNodeTarget.GraphIClip The constant Graph::IClipNodeTarget container, or null if not available.

SetOutDuration(duration)

Set the duration of the "from" node's out transition.

Boolean SetOutDuration(Number duration)

Parameters
durationThe duration in seconds.
Returns
Boolean true if successful.

GetOutDuration()

Get the duration of the "from" node's out transition.

Number GetOutDuration()

Returns
Number The duration in seconds.

SetOutOffset(offset)

Set the out transition time offset.

Boolean SetOutOffset(Number offset)

Parameters
offsetThe offset in seconds, with positive values in the future.
Returns
Boolean true if successful.

GetOutOffset()

Get the out transition time offset.

Number GetOutOffset()

Returns
Number The offset in seconds.

SetInDuration(duration)

Set the duration of the "to" node's in transition.

Boolean SetInDuration(Number duration)

Parameters
durationThe duration in seconds.
Returns
Boolean true if successful.

GetInDuration()

Get the duration of the "to" node's in transition.

Number GetInDuration()

Returns
Number The duration in seconds.

SetInOffset(offset)

Set the in transition time offset.

Boolean SetInOffset(Number offset)

Parameters
offsetThe offset in seconds, with positive values in the future.
Returns
Boolean true if successful.

GetInOffset()

Get the in transition time offset.

Number GetInOffset()

Returns
Number The offset in seconds.