|
Rumba C++ SDK
|
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< Node > | layers () 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< Node > | target_layer () const |
| If available, return the channel's target layer. More... | |
| MAQUINA_EXPORT std::optional< Node > | animation_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< Node > | animation_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< AnimCurve > | animation_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< AnimCurve > | new_animation_curve () const |
| Returns a new, empty animation curve of the correct type for that channel. More... | |
| MAQUINA_EXPORT std::unique_ptr< AnimCurve > | 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. 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 |
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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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
| MAQUINA_EXPORT ChannelMode maquina::Channel::channel_mode | ( | ) | const |
Return the channel mode.
|
inline |
Return the actual channel plug (first plug connected to the animation graph)
| MAQUINA_EXPORT ChannelType maquina::Channel::channel_type | ( | ) | const |
Return the channel type.
| 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.
| MAQUINA_EXPORT bool maquina::Channel::is_assigned | ( | const Node & | layer | ) | const |
Return true if this channel is assigned to the layer.
| MAQUINA_EXPORT bool maquina::Channel::is_editable | ( | ) | const |
Return true if this channel is editable.
| 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
| 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
| MAQUINA_EXPORT std::vector<Node> maquina::Channel::layers | ( | ) | const |
Return the layers this channel is assigned to.
| 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
| MAQUINA_EXPORT bool maquina::Channel::operator!= | ( | const Channel & | o | ) | const |
| MAQUINA_EXPORT bool maquina::Channel::operator== | ( | const Channel & | o | ) | const |
| 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.
| MAQUINA_EXPORT void maquina::Channel::remove_from_layer | ( | Node & | layer, |
| bool | undo_stack = true |
||
| ) | const |
Remove this channel from the layer.
| 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.
| 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.
| value | The value to set |
| frame | The frame where to set the value |
| layer | The layer where to set the 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.
| value | The value to set |
| layer | The layer where to set the value |
| MAQUINA_EXPORT std::unique_ptr<Node> maquina::Channel::target_layer | ( | ) | const |
If available, return the channel's target layer.
| 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.