|
Blender V4.3
|
#include <ANIM_action.hh>
Inherits ActionChannelBag.
Protected Member Functions | |
| FCurve & | fcurve_create (Main *bmain, FCurveDescriptor fcurve_descriptor) |
Additional Inherited Members | |
Public Attributes inherited from ActionChannelBag | |
| int32_t | slot_handle |
| int | group_array_num |
| struct bActionGroup ** | group_array |
| uint8_t | _pad [4] |
| int | fcurve_array_num |
| struct FCurve ** | fcurve_array |
Collection of F-Curves, intended for a specific Slot handle.
Definition at line 806 of file ANIM_action.hh.
|
default |
References blender::animrig::fcurve_find().
|
explicit |
Definition at line 1893 of file animrig/intern/action.cc.
References BKE_fcurve_copy(), bActionGroup::channel_bag, ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, ActionChannelBag::group_array, ActionChannelBag::group_array_num, MEM_dupallocN, and ActionChannelBag::slot_handle.
| blender::animrig::ChannelBag::~ChannelBag | ( | ) |
Definition at line 1917 of file animrig/intern/action.cc.
References BKE_fcurve_free(), channel_groups(), ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, fcurves(), ActionChannelBag::group_array, ActionChannelBag::group_array_num, and MEM_SAFE_FREE.
| bActionGroup * blender::animrig::ChannelBag::channel_group | ( | int64_t | index | ) |
Definition at line 1962 of file animrig/intern/action.cc.
References BLI_assert, ActionChannelBag::group_array, and ActionChannelBag::group_array_num.
| const bActionGroup * blender::animrig::ChannelBag::channel_group | ( | int64_t | index | ) | const |
Definition at line 1957 of file animrig/intern/action.cc.
References BLI_assert, ActionChannelBag::group_array, and ActionChannelBag::group_array_num.
Referenced by channel_group_create(), fcurve_detach_by_index(), rearrange_layered_action_channel_groups(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
Find the channel group that contains the fcurve at fcurve_array_index as a member.
Definition at line 1992 of file animrig/intern/action.cc.
References channel_groups().
Referenced by fcurve_detach_by_index().
| bActionGroup & blender::animrig::ChannelBag::channel_group_create | ( | StringRefNull | name | ) |
Create a new empty channel group with the given name.
The new group is added to the end of the channel group array of the ChannelBag.
This function ensures the group has a unique name, and thus the name of the created group may differ from the name parameter.
Definition at line 2007 of file animrig/intern/action.cc.
References AGRP_SELECTED, BLI_uniquename_cb(), bActionGroup::channel_bag, channel_group(), channel_groups(), DATA_, bActionGroup::fcurve_range_length, bActionGroup::fcurve_range_start, bActionGroup::flag, ActionChannelBag::group_array, ActionChannelBag::group_array_num, blender::animrig::grow_array_and_append(), MEM_callocN, bActionGroup::name, STREQ, STRNCPY_UTF8, and unique_name().
Referenced by animchannels_group_channels(), channel_group_ensure(), and blender::animrig::convert_to_layered_action().
| bActionGroup & blender::animrig::ChannelBag::channel_group_ensure | ( | StringRefNull | name | ) |
Find a channel group with the given name, or if none exists create one.
If a new group is created, it's added to the end of the channel group array of the ChannelBag.
Definition at line 2052 of file animrig/intern/action.cc.
References channel_group_create(), and channel_group_find().
Referenced by fcurve_create(), and updateDuplicateActionConstraintSettings().
| bActionGroup * blender::animrig::ChannelBag::channel_group_find | ( | StringRef | name | ) |
Definition at line 1979 of file animrig/intern/action.cc.
References channel_groups().
| const bActionGroup * blender::animrig::ChannelBag::channel_group_find | ( | StringRef | name | ) | const |
Find the first bActionGroup (channel group) with the given name.
Note that channel groups with the same name are allowed, and this simply returns the first match.
If no matching group is found, nullptr is returned.
Definition at line 1968 of file animrig/intern/action.cc.
References channel_groups().
Referenced by channel_group_ensure(), and what_does_obaction().
| void blender::animrig::ChannelBag::channel_group_move | ( | bActionGroup & | group, |
| int | to_group_index ) |
Move the given channel group's to position to_group_index among the channel groups.
The fcurves in the channel group are moved with it, so that membership doesn't change.
group must belong to this channel bag, and to_group_index must be a valid index in the channel group array.
Definition at line 2087 of file animrig/intern/action.cc.
References blender::animrig::array_shift_range(), BLI_assert, BLI_assert_msg, channel_groups(), ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, bActionGroup::fcurve_range_length, bActionGroup::fcurve_range_start, ActionChannelBag::group_array, ActionChannelBag::group_array_num, and size().
Referenced by rearrange_layered_action_channel_groups().
| bool blender::animrig::ChannelBag::channel_group_remove | ( | bActionGroup & | group | ) |
Remove the given channel group from the channel bag.
Any fcurves that were part of this group will me moved to just after all grouped fcurves.
Definition at line 2062 of file animrig/intern/action.cc.
References blender::animrig::array_shift_range(), BLI_assert, channel_groups(), ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, bActionGroup::fcurve_range_length, and bActionGroup::fcurve_range_start.
| blender::Span< bActionGroup * > blender::animrig::ChannelBag::channel_groups | ( | ) |
Definition at line 1953 of file animrig/intern/action.cc.
References ActionChannelBag::group_array, and ActionChannelBag::group_array_num.
| blender::Span< const bActionGroup * > blender::animrig::ChannelBag::channel_groups | ( | ) | const |
Definition at line 1949 of file animrig/intern/action.cc.
References ActionChannelBag::group_array, and ActionChannelBag::group_array_num.
Referenced by blender::bke::action_blend_write(), animfilter_action_slot(), channel_group_containing_index(), channel_group_create(), channel_group_find(), channel_group_find(), channel_group_move(), channel_group_remove(), blender::animrig::legacy::channel_groups_for_assigned_slot(), fcurve_detach_by_index(), fcurves_clear(), rearrange_layered_action_channel_groups(), rearrange_layered_action_fcurves(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and ~ChannelBag().
Definition at line 1944 of file animrig/intern/action.cc.
References ActionChannelBag::fcurve_array.
Definition at line 1940 of file animrig/intern/action.cc.
References ActionChannelBag::fcurve_array.
Referenced by blender::animrig::legacy::action_fcurves_remove(), animchannels_delete_exec(), fcurve_append(), fcurve_remove_by_index(), and rearrange_layered_action_fcurves().
| void blender::animrig::ChannelBag::fcurve_append | ( | FCurve & | fcurve | ) |
Append an F-Curve to this ChannelBag.
Ownership of the F-Curve is also transferred to the ChannelBag. The F-Curve will not belong to any channel group after appending.
This is considered a low-level function. Things like depsgraph relations tagging is left to the caller.
Definition at line 1738 of file animrig/intern/action.cc.
References fcurve(), ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, blender::animrig::grow_array_and_append(), and FCurve::grp.
Referenced by blender::animrig::action_fcurve_attach(), blender::animrig::tests::add_fcurve_to_action(), and updateDuplicateActionConstraintSettings().
| bool blender::animrig::ChannelBag::fcurve_assign_to_channel_group | ( | FCurve & | fcurve, |
| bActionGroup & | to_group ) |
Assigns the given FCurve to the given channel group.
Fails if either doesn't belong to this channel bag, but otherwise always succeeds.
Definition at line 2550 of file animrig/intern/action.cc.
References blender::animrig::array_shift_range(), bActionGroup::fcurve_range_length, bActionGroup::fcurve_range_start, and FCurve::grp.
Referenced by animchannels_group_channels(), blender::animrig::convert_to_layered_action(), and updateDuplicateActionConstraintSettings().
|
protected |
Create an F-Curve.
Assumes that there is no such F-Curve yet on this ChannelBag. If it is uncertain whether this is the case, use fcurve_create_unique() instead.
| bmain | Used to tag the dependency graph(s) for relationship rebuilding. This is necessary when adding a new F-Curve, as a previously-unanimated depsgraph component may become animated now. Can be nullptr, in which case the tagging is skipped and is left as the responsibility of the caller. |
Definition at line 1710 of file animrig/intern/action.cc.
References BLI_assert, blender::animrig::FCurveDescriptor::channel_group, channel_group_ensure(), blender::animrig::create_fcurve_for_channel(), DEG_relations_tag_update(), FCURVE_ACTIVE, ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, FCurve::flag, and blender::animrig::grow_array_and_insert().
Referenced by fcurve_create_unique(), and fcurve_ensure().
| FCurve * blender::animrig::ChannelBag::fcurve_create_unique | ( | Main * | bmain, |
| FCurveDescriptor | fcurve_descriptor ) |
Create an F-Curve, but only if it doesn't exist yet in this ChannelBag.
| bmain | Used to tag the dependency graph(s) for relationship rebuilding. This is necessary when adding a new F-Curve, as a previously-unanimated depsgraph component may become animated now. Can be nullptr, in which case the tagging is skipped and is left as the responsibility of the caller. |
Definition at line 1702 of file animrig/intern/action.cc.
References fcurve_create(), and fcurve_find().
Referenced by blender::animrig::tests::TEST_F().
| bool blender::animrig::ChannelBag::fcurve_detach | ( | FCurve & | fcurve_to_detach | ) |
Detach an F-Curve from the ChannelBag.
Additionally, if the fcurve was the last fcurve in a channel group, that channel group is deleted.
The F-Curve is not freed. After the call returns true, its ownership has transferred to the caller.
Definition at line 1773 of file animrig/intern/action.cc.
References fcurve_detach_by_index(), and fcurves().
Referenced by fcurve_remove().
| void blender::animrig::ChannelBag::fcurve_detach_by_index | ( | int64_t | fcurve_array_index | ) |
Detach an F-Curve from the ChannelBag, identified by its index in the array.
Acts the same as fcurve_detach() except it's a bit more efficient as it doesn't need to find the F-Curve in the array first.
Definition at line 1783 of file animrig/intern/action.cc.
References BLI_assert, channel_group(), channel_group_containing_index(), channel_groups(), ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, blender::animrig::fcurve_ptr_noop_destructor(), and blender::dna::array::remove_index().
Referenced by fcurve_detach(), and fcurve_remove_by_index().
| FCurve & blender::animrig::ChannelBag::fcurve_ensure | ( | Main * | bmain, |
| FCurveDescriptor | fcurve_descriptor ) |
Find an FCurve matching the fcurve descriptor, or create one if it doesn't exist.
| bmain | Used to tag the dependency graph(s) for relationship rebuilding. This is necessary when adding a new F-Curve, as a previously-unanimated depsgraph component may become animated now. Can be nullptr, in which case the tagging is skipped and is left as the responsibility of the caller. |
Definition at line 1694 of file animrig/intern/action.cc.
References fcurve_create(), and fcurve_find().
Referenced by blender::animrig::action_fcurve_ensure(), and blender::animrig::StripKeyframeData::keyframe_insert().
| FCurve * blender::animrig::ChannelBag::fcurve_find | ( | FCurveDescriptor | fcurve_descriptor | ) |
Definition at line 1687 of file animrig/intern/action.cc.
References blender::animrig::fcurve_find(), and fcurves().
| const FCurve * blender::animrig::ChannelBag::fcurve_find | ( | FCurveDescriptor | fcurve_descriptor | ) | const |
Find an FCurve matching the fcurve descriptor.
If it cannot be found, nullptr is returned.
Definition at line 1682 of file animrig/intern/action.cc.
References blender::animrig::fcurve_find(), and fcurves().
Referenced by fcurve_create_unique(), fcurve_ensure(), blender::animrig::fcurve_find_in_action_slot(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
Move the given fcurve to position to_fcurve_index in the fcurve array.
Note: this can indirectly alter channel group memberships, because the channel groups don't change what ranges in the fcurve array they cover.
fcurve must belong to this channel bag, and to_fcurve_index must be a valid index in the fcurve array.
Definition at line 1812 of file animrig/intern/action.cc.
References blender::animrig::array_shift_range(), BLI_assert, BLI_assert_msg, ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, fcurves(), and size().
Referenced by rearrange_layered_action_fcurves().
| bool blender::animrig::ChannelBag::fcurve_remove | ( | FCurve & | fcurve_to_remove | ) |
Remove an F-Curve from the ChannelBag.
Additionally, if the fcurve was the last fcurve in a channel group, that channel group is also deleted.
After this call, if the F-Curve was found, the reference will no longer be valid, as the curve will have been freed.
Definition at line 1752 of file animrig/intern/action.cc.
References BKE_fcurve_free(), and fcurve_detach().
Referenced by animchannels_delete_exec().
| void blender::animrig::ChannelBag::fcurve_remove_by_index | ( | int64_t | fcurve_array_index | ) |
Remove an F-Curve from the ChannelBag, identified by its index in the array.
Acts the same as fcurve_remove() except it's a bit more efficient as it doesn't need to find the F-Curve in the array first.
Definition at line 1761 of file animrig/intern/action.cc.
References BKE_fcurve_free(), fcurve(), and fcurve_detach_by_index().
Referenced by blender::animrig::legacy::action_fcurves_remove().
| bool blender::animrig::ChannelBag::fcurve_ungroup | ( | FCurve & | fcurve | ) |
Removes the the given FCurve from the channel group it's in, if any.
As part of removing fcurve from its group, fcurve is moved to the end of the fcurve array. However, if fcurve is already ungrouped then this method is a no-op.
Fails if the fcurve doesn't belong to this channel bag, but otherwise always succeeds.
Definition at line 2587 of file animrig/intern/action.cc.
References blender::animrig::array_shift_range(), bActionGroup::fcurve_range_length, and FCurve::grp.
| blender::Span< FCurve * > blender::animrig::ChannelBag::fcurves | ( | ) |
Definition at line 1936 of file animrig/intern/action.cc.
References ActionChannelBag::fcurve_array, and ActionChannelBag::fcurve_array_num.
| blender::Span< const FCurve * > blender::animrig::ChannelBag::fcurves | ( | ) | const |
Definition at line 1932 of file animrig/intern/action.cc.
References ActionChannelBag::fcurve_array, and ActionChannelBag::fcurve_array_num.
Referenced by blender::bke::action_blend_write(), action_group_to_keylist(), agrp_keyframes_loop(), animfilter_action_slot(), blender::animrig::evaluate_keyframe_data(), fcurve_detach(), fcurve_find(), fcurve_find(), fcurve_move(), blender::animrig::fcurves_for_action_slot(), blender::animrig::fcurves_for_action_slot(), rearrange_layered_action_fcurves(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and ~ChannelBag().
| void blender::animrig::ChannelBag::fcurves_clear | ( | ) |
Remove all F-Curves from this ChannelBag.
Definition at line 1825 of file animrig/intern/action.cc.
References channel_groups(), blender::dna::array::clear(), ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, and blender::animrig::fcurve_ptr_destructor().