Rumba C++ SDK
maquina::Channel Class Reference

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

#include <Channel.h>

Public Member Functions

MAQUINA_EXPORT std::vector< Nodelayers () const
 Return the layers this channel is assigned to. More...
 
MAQUINA_EXPORT bool assign_to_layer (Node &layer) const
 Assign this channel to the layer. More...
 
MAQUINA_EXPORT void remove_from_layer (Node &layer, bool undo_stack=true) const
 Remove this channel from the layer. More...
 
MAQUINA_EXPORT bool is_assigned (const Node &layer) const
 Return true if this channel is assigned to the layer. More...
 
MAQUINA_EXPORT bool is_editable () const
 Return true if this channel is editable. More...
 
MAQUINA_EXPORT bool is_editable (const Node &layer) const
 Return true if layer is editable for this channel. More...
 
MAQUINA_EXPORT bool is_target (const Node &layer) const
 Return true if layer is the target for this channel. More...
 
MAQUINA_EXPORT std::unique_ptr< Nodetarget_layer () const
 If available, return the channel's target layer. More...
 
MAQUINA_EXPORT std::optional< Nodeanimation_layer_blend (const Node &layer) const
 If available, returns the animation layer blend node of this channel for the specified layer. More...
 
MAQUINA_EXPORT std::unique_ptr< Nodeanimation_curve_node (const Node &layer) const
 If available, returns the animation curve node of this channel for the specified layer. More...
 
MAQUINA_EXPORT std::unique_ptr< AnimCurveanimation_curve (const Node &layer) const
 If available, returns the animation curve of this channel for the specified layer. Do not modify this value. More...
 
MAQUINA_EXPORT std::unique_ptr< AnimCurvenew_animation_curve () const
 Returns a new, empty animation curve of the correct type for that channel. More...
 
MAQUINA_EXPORT std::unique_ptr< AnimCurveduplicate_animation_curve (const Node &layer) const
 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. More...
 
MAQUINA_EXPORT bool set_animation_curve (AnimCurve &animation_curve, const Node &layer)
 Set the new animation curve of this channel for the specified layer. More...
 
MAQUINA_EXPORT void remove_animation_curve (const Node &layer)
 Remove the channel's animation curve on this layer if it exists. More...
 
MAQUINA_EXPORT Value value (float frame, const Node &layer) const
 If available, returns the channel value for the specified frame and on the specified layer. More...
 
MAQUINA_EXPORT bool as_bool (float frame, const Node &layer) const
 If available, returns the channel value for the specified frame and on the specified layer as a boolean. More...
 
MAQUINA_EXPORT int as_int (float frame, const Node &layer) const
 If available, returns the channel value for the specified frame and on the specified layer as an int. More...
 
MAQUINA_EXPORT float as_float (float frame, const Node &layer) const
 If available, returns the channel value for the specified frame and on the specified layer as a float. More...
 
MAQUINA_EXPORT bool set_value (const Value &value, const Node &layer)
 Set the channel value on the specified layer. If animated, add or set the keyframe at the current frame. More...
 
MAQUINA_EXPORT bool set_key (const Value &value, float frame, const Node &layer)
 Set the channel value at the specified frame and on the specified layer. More...
 
MAQUINA_EXPORT ChannelType channel_type () const
 Return the channel type. More...
 
MAQUINA_EXPORT ChannelMode channel_mode () const
 Return the channel mode. More...
 
Plug channel_plug () const
 Return the actual channel plug (first plug connected to the animation graph) More...
 
MAQUINA_EXPORT bool operator== (const Channel &o) const
 
MAQUINA_EXPORT bool operator!= (const Channel &o) const
 

Detailed Description

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.

Member Function Documentation

◆ animation_curve()

MAQUINA_EXPORT std::unique_ptr<AnimCurve> maquina::Channel::animation_curve ( const Node layer) const

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

◆ animation_curve_node()

MAQUINA_EXPORT std::unique_ptr<Node> maquina::Channel::animation_curve_node ( const Node layer) const

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

◆ animation_layer_blend()

MAQUINA_EXPORT std::optional<Node> maquina::Channel::animation_layer_blend ( const Node layer) const

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

◆ as_bool()

MAQUINA_EXPORT bool maquina::Channel::as_bool ( float  frame,
const Node layer 
) const

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.

◆ as_float()

MAQUINA_EXPORT float maquina::Channel::as_float ( float  frame,
const Node layer 
) const

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.

◆ as_int()

MAQUINA_EXPORT int maquina::Channel::as_int ( float  frame,
const Node layer 
) const

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.

◆ assign_to_layer()

MAQUINA_EXPORT bool maquina::Channel::assign_to_layer ( Node layer) const

Assign this channel to the layer.

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

◆ channel_mode()

MAQUINA_EXPORT ChannelMode maquina::Channel::channel_mode ( ) const

Return the channel mode.

◆ channel_plug()

Plug maquina::Channel::channel_plug ( ) const
inline

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

◆ channel_type()

MAQUINA_EXPORT ChannelType maquina::Channel::channel_type ( ) const

Return the channel type.

◆ duplicate_animation_curve()

MAQUINA_EXPORT std::unique_ptr<AnimCurve> maquina::Channel::duplicate_animation_curve ( const Node layer) const

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()

MAQUINA_EXPORT bool maquina::Channel::is_assigned ( const Node layer) const

Return true if this channel is assigned to the layer.

◆ is_editable() [1/2]

MAQUINA_EXPORT bool maquina::Channel::is_editable ( ) const

Return true if this channel is editable.

◆ is_editable() [2/2]

MAQUINA_EXPORT bool maquina::Channel::is_editable ( const Node layer) const

Return true if layer is editable for this channel.

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

◆ is_target()

MAQUINA_EXPORT bool maquina::Channel::is_target ( const Node layer) const

Return true if layer is the target for this channel.

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

◆ layers()

MAQUINA_EXPORT std::vector<Node> maquina::Channel::layers ( ) const

Return the layers this channel is assigned to.

◆ new_animation_curve()

MAQUINA_EXPORT std::unique_ptr<AnimCurve> maquina::Channel::new_animation_curve ( ) const

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

◆ operator!=()

MAQUINA_EXPORT bool maquina::Channel::operator!= ( const Channel o) const

◆ operator==()

MAQUINA_EXPORT bool maquina::Channel::operator== ( const Channel o) const

◆ remove_animation_curve()

MAQUINA_EXPORT void maquina::Channel::remove_animation_curve ( const Node layer)

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.

◆ remove_from_layer()

MAQUINA_EXPORT void maquina::Channel::remove_from_layer ( Node layer,
bool  undo_stack = true 
) const

Remove this channel from the layer.

◆ set_animation_curve()

MAQUINA_EXPORT bool maquina::Channel::set_animation_curve ( AnimCurve animation_curve,
const Node layer 
)

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.

◆ set_key()

MAQUINA_EXPORT bool maquina::Channel::set_key ( const Value value,
float  frame,
const Node layer 
)

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
valueThe value to set
frameThe frame where to set the value
layerThe layer where to set the value

◆ set_value()

MAQUINA_EXPORT bool maquina::Channel::set_value ( const Value value,
const Node layer 
)

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
valueThe value to set
layerThe layer where to set the value

◆ target_layer()

MAQUINA_EXPORT std::unique_ptr<Node> maquina::Channel::target_layer ( ) const

If available, return the channel's target layer.

◆ value()

MAQUINA_EXPORT Value maquina::Channel::value ( float  frame,
const Node layer 
) const

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.


The documentation for this class was generated from the following file: