Channel

Inheritance diagram of rumba.Channel
class Channel

Node’s plugs and node delegate’s attributes may be modified by animation layers through channels.

A channel is an animated value computed by the animation graph, the graph responsible to blend the animation curve values together along the animation layers.

A channel can be assigned to animation layers. When assigned to a layer, the channel has specific values, constant or animated, on that layer.

Editable layers are the channel’s animation layers which accept modifications. Editable layers are enabled, unlocked (open for edition), with a constant value or an animation curve for that channel.

The target layer is the first channel’s editable layer. This is the layer where the user modifications are stored.

The channel API can be used to assign or remove Plugs or NodeDelegate attributes to the animation layers.

It can also be used to inspect or manipulate the values or animation curves on each layer.

Methods

__eq__

Return self==value.

__init__

__ne__

Return self!=value.

animation_curve(layer)

If available, returns the animation curve of this channel for the specified layer.

animation_curve_node(layer)

If available, returns the animation curve node of this channel for the specified layer.

animation_layer_blend(layer)

If available, returns the animation layer blend node of this channel for the specified layer.

as_bool(frame, layer)

If available, returns the channel value for the specified frame and on the specified layer as a boolean.

as_float(frame, layer)

If available, returns the channel value for the specified frame and on the specified layer as a float.

as_int(frame, layer)

If available, returns the channel value for the specified frame and on the specified layer as an int.

assign_to_layer(layer)

Assign this channel to the layer.

channel_mode()

Return the channel mode.

channel_plug()

Return the actual channel plug (first plug connected to the animation graph)

channel_type()

Return the channel type.

duplicate_animation_curve(layer)

Returns a copy of the current animation curve for that channel on that layer.

is_assigned(layer)

Return true if this channel is assigned to the layer.

is_editable()

Return true if this channel is editable.

is_target(layer)

Return true if layer is the target for this channel.

layers()

Return the layers this channel is assigned to.

new_animation_curve()

Returns a new, empty animation curve of the correct type for that channel.

remove_animation_curve(layer)

Remove the channel's animation curve on this layer if it exists.

remove_from_layer

set_animation_curve(animation_curve, layer)

Set the new animation curve of this channel for the specified layer.

set_key(value, frame, layer)

Set the channel value at the specified frame and on the specified layer.

set_value(value, layer)

Set the channel value on the specified layer.

target_layer()

If available, return the channel's target layer.

value(frame, layer)

If available, returns the channel value for the specified frame and on the specified layer.

__init__()
animation_curve(layer: Node)

If available, returns the animation curve of this channel for the specified layer. Do not modify this value.

animation_curve_node(layer: Node)

If available, returns the animation curve node of this channel for the specified layer.

animation_layer_blend(layer: Node) Optional[Node]

If available, returns the animation layer blend node of this channel for the specified layer.

Return type

Optional[Node]

as_bool(frame: float, layer: Node) bool

If available, returns the channel value for the specified frame and on the specified layer as a boolean.

This is not the final channel value. The final value may be modified by other layers. If no value is available, returns false.

Return type

bool

as_float(frame: float, layer: Node) float

If available, returns the channel value for the specified frame and on the specified layer as a float.

This is not the final channel value. The final value may be modified by other layers. If no value is available, returns 0.0.

Return type

float

as_int(frame: float, layer: Node) int

If available, returns the channel value for the specified frame and on the specified layer as an int.

This is not the final channel value. The final value may be modified by other layers. If no value is available, returns 0.

Return type

int

assign_to_layer(layer: Node) bool

Assign this channel to the layer.

Returns false if this channel can’t be assigned to the layer

Return type

bool

channel_mode() ChannelMode

Return the channel mode.

Return type

ChannelMode

channel_plug() Plug

Return the actual channel plug (first plug connected to the animation graph)

Return type

Plug

channel_type() ChannelType

Return the channel type.

Return type

ChannelType

duplicate_animation_curve(layer: Node)

Returns a copy of the current animation curve for that channel on that layer. If the channel is not animated, return an empty animation curve.

Once modified, set the curve with set_animation_curve. Fails if the channel is not assigned to the layer.

is_assigned(layer: Node) bool

Return true if this channel is assigned to the layer.

Return type

bool

is_editable() bool

Return true if this channel is editable.

Return type

bool

is_editable(layer: Node) -> bool

Return true if layer is editable for this channel.

If layer is not a channel’s layer, also returns false

Return type

bool

is_editable() -> bool

Return true if this channel is editable.

Return type

bool

is_editable(layer: Node) -> bool

Return true if layer is editable for this channel.

If layer is not a channel’s layer, also returns false

Return type

bool

is_target(layer: Node) bool

Return true if layer is the target for this channel.

If layer is not a channel’s layer, also returns false

Return type

bool

layers()

Return the layers this channel is assigned to.

Return type

list(Node)

new_animation_curve()

Returns a new, empty animation curve of the correct type for that channel.

Once modified, set the curve with set_animation_curve. Fails is the channel type is not animatable

remove_animation_curve(layer: Node) None

Remove the channel’s animation curve on this layer if it exists.

The channel stays assigned to that layer and get the channel’s rest value.

Return type

None

set_animation_curve(animation_curve: AnimCurve, layer: Node) bool

Set the new animation curve of this channel for the specified layer.

Returns true if the new curve has been set. The curve is normalized before to be set in the AnimCurveNode.

Return type

bool

set_key(value: Value, frame: float, layer: Node) bool

Set the channel value at the specified frame and on the specified layer.

Create an animation curve if the channel was not animated. Returns true is the value as been set, false otherwise.

Parameters
  • value (Value) – The value to set

  • frame (float) – The frame where to set the value

  • layer (Node) – The layer where to set the value

Return type

bool

set_value(value: Value, layer: Node) bool

Set the channel value on the specified layer. If animated, add or set the keyframe at the current frame.

Returns true is the value as been set, false otherwise.

Parameters
  • value (Value) – The value to set

  • layer (Node) – The layer where to set the value

Return type

bool

target_layer()

If available, return the channel’s target layer.

value(frame: float, layer: Node) Value

If available, returns the channel value for the specified frame and on the specified layer.

This is not the final channel value. The final value may be modified by other layers. If no value is available, returns Value::default_value.

Return type

Value