|
Blender V4.3
|
Namespaces | |
| namespace | internal |
| namespace | legacy |
| namespace | nla |
| namespace | tests |
Classes | |
| class | Action |
| class | AnimatedProperty |
| class | BoneColor |
| class | ChannelBag |
| class | ChannelGroup |
| class | CombinedKeyingResult |
| class | EvaluationResult |
| struct | FCurveDescriptor |
| struct | KeyframeSettings |
| struct | KeyInsertData |
| class | Layer |
| class | PropIdentifier |
| class | Slot |
| class | SlotRuntime |
| class | Strip |
| class | StripKeyframeData |
| struct | TempFrameValCache |
Typedefs | |
| using | slot_handle_t = decltype(::ActionSlot::handle) |
Enumerations | |
| enum class | ActionSlotAssignmentResult : int8_t { OK = 0 , SlotNotFromAction = 1 , SlotNotSuitable = 2 , MissingAction = 3 } |
| enum class | BakeCurveRemove { NONE = 0 , IN_RANGE = 1 , OUT_RANGE = 2 , ALL = 3 } |
| enum class | SingleKeyingResult { SUCCESS = 0 , UNKNOWN_FAILURE , CANNOT_CREATE_FCURVE , FCURVE_NOT_KEYFRAMEABLE , NO_KEY_NEEDED , UNABLE_TO_INSERT_TO_NLA_STACK , ID_NOT_EDITABLE , ID_NOT_ANIMATABLE , NO_VALID_LAYER , NO_VALID_STRIP , NO_VALID_SLOT , CANNOT_RESOLVE_PATH , _KEYING_RESULT_MAX } |
| enum class | ModifyKeyMode { INSERT = 0 , DELETE } |
| enum class | ModifyKeyReturn { SUCCESS = 0 , INVALID_CONTEXT = -1 , MISSING_TYPEINFO = -2 } |
| enum | { VISUALKEY_NONE = 0 , VISUALKEY_LOC , VISUALKEY_ROT , VISUALKEY_SCA } |
Functions | |
| ENUM_OPERATORS (Layer::Flags, Layer::Flags::Enabled) | |
| ENUM_OPERATORS (Slot::Flags, Slot::Flags::Active) | |
| Action & | action_add (Main &bmain, StringRefNull name) |
| bool | assign_action (bAction *action, ID &animated_id) |
| bool | assign_action (bAction *action, OwnedAnimData owned_adt) |
| bool | assign_tmpaction (bAction *action, OwnedAnimData owned_adt) |
| bool | unassign_action (ID &animated_id) |
| bool | unassign_action (OwnedAnimData owned_adt) |
| Slot * | assign_action_ensure_slot_for_keying (Action &action, ID &animated_id) |
| bool | generic_assign_action (ID &animated_id, bAction *action_to_assign, bAction *&action_ptr_ref, slot_handle_t &slot_handle_ref, char *slot_name) |
| ActionSlotAssignmentResult | generic_assign_action_slot (Slot *slot_to_assign, ID &animated_id, bAction *&action_ptr_ref, slot_handle_t &slot_handle_ref, char *slot_name) ATTR_WARN_UNUSED_RESULT |
| ActionSlotAssignmentResult | generic_assign_action_slot_handle (slot_handle_t slot_handle_to_assign, ID &animated_id, bAction *&action_ptr_ref, slot_handle_t &slot_handle_ref, char *slot_name) ATTR_WARN_UNUSED_RESULT |
| bool | is_action_assignable_to (const bAction *dna_action, ID_Type id_code) ATTR_WARN_UNUSED_RESULT |
| ActionSlotAssignmentResult | assign_action_slot (Slot *slot_to_assign, ID &animated_id) |
| ActionSlotAssignmentResult | assign_action_and_slot (Action *action, Slot *slot_to_assign, ID &animated_id) |
| Action * | get_action (ID &animated_id) |
| std::optional< std::pair< Action *, Slot * > > | get_action_slot_pair (ID &animated_id) |
| const animrig::ChannelBag * | channelbag_for_action_slot (const Action &action, slot_handle_t slot_handle) |
| animrig::ChannelBag * | channelbag_for_action_slot (Action &action, slot_handle_t slot_handle) |
| Span< FCurve * > | fcurves_for_action_slot (Action &action, slot_handle_t slot_handle) |
| Span< const FCurve * > | fcurves_for_action_slot (const Action &action, slot_handle_t slot_handle) |
| FCurve * | action_fcurve_ensure (Main *bmain, bAction *act, const char group[], PointerRNA *ptr, FCurveDescriptor fcurve_descriptor) |
| FCurve * | fcurve_find_in_action (bAction *act, FCurveDescriptor fcurve_descriptor) |
| FCurve * | fcurve_find_in_action_slot (bAction *act, slot_handle_t slot_handle, FCurveDescriptor fcurve_descriptor) |
| FCurve * | fcurve_find_in_assigned_slot (AnimData &adt, FCurveDescriptor fcurve_descriptor) |
| bool | fcurve_matches_collection_path (const FCurve &fcurve, StringRefNull collection_rna_path, StringRefNull data_name) |
| Vector< FCurve * > | fcurves_in_action_slot_filtered (bAction *act, slot_handle_t slot_handle, FunctionRef< bool(const FCurve &fcurve)> predicate) |
| bool | action_fcurve_remove (Action &action, FCurve &fcu) |
| bool | action_fcurve_detach (Action &action, FCurve &fcurve_to_detach) |
| void | action_fcurve_attach (Action &action, slot_handle_t action_slot, FCurve &fcurve_to_attach, std::optional< StringRefNull > group_name) |
| void | action_fcurve_move (Action &action_dst, slot_handle_t action_slot_dst, Action &action_src, FCurve &fcurve) |
| ID * | action_slot_get_id_for_keying (Main &bmain, Action &action, slot_handle_t slot_handle, ID *primary_id) |
| ID * | action_slot_get_id_best_guess (Main &bmain, Slot &slot, ID *primary_id) |
| slot_handle_t | first_slot_handle (const ::bAction &dna_action) |
| void | assert_baklava_phase_1_invariants (const Action &action) |
| void | assert_baklava_phase_1_invariants (const Layer &layer) |
| void | assert_baklava_phase_1_invariants (const Strip &strip) |
| Action * | convert_to_layered_action (Main &bmain, const Action &legacy_action) |
| void | move_slot (Main &bmain, Slot &slot, Action &from_action, Action &to_action) |
| void | deselect_keys_actions (blender::Span< bAction * > actions) |
| void | action_deselect_keys (Action &action) |
| void | foreach_fcurve_in_action (Action &action, FunctionRef< void(FCurve &fcurve)> callback) |
| void | foreach_fcurve_in_action_slot (Action &action, slot_handle_t handle, FunctionRef< void(FCurve &fcurve)> callback) |
| bool | foreach_action_slot_use (const ID &animated_id, FunctionRef< bool(const Action &action, slot_handle_t slot_handle)> callback) |
| bool | foreach_action_slot_use_with_references (ID &animated_id, FunctionRef< bool(bAction *&action_ptr_ref, slot_handle_t &slot_handle_ref, char *slot_name)> callback) |
| void | reevaluate_fcurve_errors (bAnimContext *ac) |
| const FCurve * | fcurve_find_by_rna_path (const AnimData &adt, StringRefNull rna_path, int array_index) |
| template<typename CB > | |
| static void | ANIM_armature_foreach_bone (ListBase *bones, CB callback) |
| template<typename CB > | |
| static void | ANIM_armature_foreach_bone (const ListBase *bones, CB callback) |
| int | armature_bonecoll_find_index (const bArmature *armature, const ::BoneCollection *bcoll) |
| int | armature_bonecoll_find_parent_index (const bArmature *armature, int bcoll_index) |
| int | armature_bonecoll_child_number_find (const bArmature *armature, const ::BoneCollection *bcoll) |
| int | armature_bonecoll_child_number_set (bArmature *armature, ::BoneCollection *bcoll, int new_child_number) |
| bool | armature_bonecoll_is_root (const bArmature *armature, int bcoll_index) |
| bool | armature_bonecoll_is_child_of (const bArmature *armature, int potential_parent_index, int potential_child_index) |
| bool | armature_bonecoll_is_descendant_of (const bArmature *armature, int potential_parent_index, int potential_descendant_index) |
| bool | bonecoll_has_children (const BoneCollection *bcoll) |
| void | bonecolls_copy_expanded_flag (Span< BoneCollection * > bcolls_dest, Span< const BoneCollection * > bcolls_source) |
| int | armature_bonecoll_move_to_parent (bArmature *armature, int from_bcoll_index, int to_child_num, int from_parent_index, int to_parent_index) |
| blender::Map< BoneCollection *, BoneCollection * > | ANIM_bonecoll_array_copy_no_membership (BoneCollection ***bcoll_array_dst, int *bcoll_array_dst_num, BoneCollection **bcoll_array_src, int bcoll_array_src_num, bool do_id_user) |
| void | ANIM_bonecoll_array_free (BoneCollection ***bcoll_array, int *bcoll_array_num, bool do_id_user) |
| const BoneColor & | ANIM_bonecolor_posebone_get (const bPoseChannel *pose_bone) |
| float | evaluate_driver_from_rna_pointer (const AnimationEvalContext *anim_eval_context, PointerRNA *ptr, PropertyRNA *prop, const FCurve *fcu) |
| EvaluationResult | evaluate_action (PointerRNA &animated_id_ptr, Action &action, slot_handle_t slot_handle, const AnimationEvalContext &anim_eval_context) |
| void | evaluate_and_apply_action (PointerRNA &animated_id_ptr, Action &action, slot_handle_t slot_handle, const AnimationEvalContext &anim_eval_context, bool flush_to_original) |
| KeyframeSettings | get_keyframe_settings (bool from_userprefs) |
| const FCurve * | fcurve_find (Span< const FCurve * > fcurves, FCurveDescriptor fcurve_descriptor) |
| FCurve * | fcurve_find (Span< FCurve * > fcurves, FCurveDescriptor fcurve_descriptor) |
| FCurve * | create_fcurve_for_channel (FCurveDescriptor fcurve_descriptor) |
| void | initialize_bezt (BezTriple *beztr, float2 position, const KeyframeSettings &settings, eFCurve_Flags fcu_flags) |
| bool | fcurve_delete_keyframe_at_time (FCurve *fcurve, float time) |
| bool | delete_keyframe_fcurve_legacy (AnimData *adt, FCurve *fcu, float cfra) |
| int | insert_bezt_fcurve (FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag) |
| Lesser Key-framing API call. | |
| SingleKeyingResult | insert_vert_fcurve (FCurve *fcu, const float2 position, const KeyframeSettings &settings, eInsertKeyFlags flag) |
| Main Key-framing API call. | |
| void | sample_fcurve_segment (const FCurve *fcu, float start_frame, float sample_rate, float *samples, int sample_count) |
| void | bake_fcurve (FCurve *fcu, blender::int2 range, float step, BakeCurveRemove remove_existing) |
| void | bake_fcurve_segments (FCurve *fcu) |
| const std::optional< StringRefNull > | default_channel_group_for_path (const PointerRNA *animated_struct, const StringRef prop_rna_path) |
| bool | key_insertion_may_create_fcurve (eInsertKeyFlags insert_key_flags) |
| void | pose_apply_action_selected_bones (Object *ob, bAction *action, slot_handle_t slot_handle, const AnimationEvalContext *anim_eval_context) |
| void | pose_apply_action_all_bones (Object *ob, bAction *action, slot_handle_t slot_handle, const AnimationEvalContext *anim_eval_context) |
| void | pose_apply_action_blend (Object *ob, bAction *action, slot_handle_t slot_handle, const AnimationEvalContext *anim_eval_context, float blend_factor) |
| Vector< float > | get_rna_values (PointerRNA *ptr, PropertyRNA *prop) |
| StringRef | get_rotation_mode_path (eRotationModes rotation_mode) |
| bool | visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop) |
| Vector< float > | visualkey_get_values (PointerRNA *ptr, PropertyRNA *prop) |
| static animrig::Layer & | ActionLayer_alloc () |
| template<typename T > | |
| static void | grow_array (T **array, int *num, const int add_num) |
| template<typename T > | |
| static void | grow_array_and_append (T **array, int *num, T item) |
| template<typename T > | |
| static void | grow_array_and_insert (T **array, int *num, const int index, T item) |
| template<typename T > | |
| static void | shrink_array (T **array, int *num, const int shrink_num) |
| template<typename T > | |
| static void | shrink_array_and_remove (T **array, int *num, const int index) |
| template<typename T > | |
| static void | shrink_array_and_swap_remove (T **array, int *num, const int index) |
| template<typename T > | |
| static void | array_shift_range (T *array, const int num, const int range_start, const int range_end, const int to) |
| static void | layer_ptr_destructor (ActionLayer **dna_layer_ptr) |
| static void | slot_name_ensure_unique (Action &action, Slot &slot) |
| static void | slot_ptr_destructor (ActionSlot **dna_slot_ptr) |
| static float2 | get_frame_range_of_fcurves (Span< const FCurve * > fcurves, bool include_modifiers) |
| static void | strip_ptr_destructor (ActionStrip **dna_strip_ptr) |
| static bool | is_id_using_action_slot (const ID &animated_id, const Action &action, const slot_handle_t slot_handle) |
| static void | channelbag_ptr_destructor (ActionChannelBag **dna_channelbag_ptr) |
| static void | fcurve_ptr_destructor (FCurve **fcurve_ptr) |
| static void | fcurve_ptr_noop_destructor (FCurve **) |
| static void | clone_slot (Slot &from, Slot &to) |
| int | armature_bonecoll_find_index (const bArmature *armature, const BoneCollection *bcoll) |
| EvaluationResult | blend_layer_results (const EvaluationResult &last_result, const EvaluationResult ¤t_result, const Layer ¤t_layer) |
| void | apply_evaluation_result (const EvaluationResult &evaluation_result, PointerRNA &animated_id_ptr, bool flush_to_original) |
| static bool | is_fcurve_evaluatable (const FCurve *fcu) |
| static void | animsys_construct_orig_pointer_rna (const PointerRNA *ptr, PointerRNA *ptr_orig) |
| static void | animsys_write_orig_anim_rna (PointerRNA *ptr, const char *rna_path, const int array_index, const float value) |
| static EvaluationResult | evaluate_keyframe_data (PointerRNA &animated_id_ptr, StripKeyframeData &strip_data, const slot_handle_t slot_handle, const AnimationEvalContext &offset_eval_context) |
| static EvaluationResult | evaluate_strip (PointerRNA &animated_id_ptr, Action &owning_action, Strip &strip, const slot_handle_t slot_handle, const AnimationEvalContext &anim_eval_context) |
| static void | replace_bezt_keyframe_ypos (BezTriple *dst, const BezTriple *bezt) |
| static void | subdivide_nonauto_handles (const FCurve *fcu, BezTriple *bezt, BezTriple *prev, BezTriple *next) |
| static bool | new_key_needed (const FCurve &fcu, const float frame, const float value) |
| static float2 | remap_cyclic_keyframe_location (const FCurve &fcu, const eFCU_Cycle_Type type, float2 position) |
| static void | remove_fcurve_key_range (FCurve *fcu, const int2 range, const BakeCurveRemove removal_mode) |
| static void | make_new_fcurve_cyclic (FCurve *fcu, const blender::float2 &action_range) |
| static void | get_keyframe_values_create_reports (ReportList *reports, PointerRNA ptr, PropertyRNA *prop, const int index, const int count, const bool force_all, const BitSpan successful_remaps) |
| static Vector< float > | get_keyframe_values (PointerRNA *ptr, PropertyRNA *prop, const bool visual_key) |
| static BitVector | nla_map_keyframe_values_and_generate_reports (const MutableSpan< float > values, const int index, PointerRNA &ptr, PropertyRNA &prop, NlaKeyframingContext *nla_context, const AnimationEvalContext *anim_eval_context, ReportList *reports, bool *force_all) |
| static float | nla_time_remap (float time, const AnimationEvalContext *anim_eval_context, PointerRNA *id_ptr, AnimData *adt, bAction *act, ListBase *nla_cache, NlaKeyframingContext **r_nla_context) |
| static SingleKeyingResult | insert_keyframe_value (FCurve *fcu, float cfra, float curval, eBezTriple_KeyframeType keytype, eInsertKeyFlags flag) |
| static SingleKeyingResult | insert_keyframe_fcurve_value (Main *bmain, PointerRNA *ptr, PropertyRNA *prop, bAction *act, const char group[], const char rna_path[], int array_index, const float fcurve_frame, float curval, eBezTriple_KeyframeType keytype, eInsertKeyFlags flag) |
| static void | deg_tag_after_keyframe_delete (Main *bmain, ID *id, AnimData *adt) |
| static CombinedKeyingResult | insert_key_legacy_action (Main *bmain, bAction *action, PointerRNA *ptr, PropertyRNA *prop, const std::optional< StringRefNull > channel_group, const std::string &rna_path, const float frame, const Span< float > values, eInsertKeyFlags insert_key_flag, eBezTriple_KeyframeType key_type, const BitSpan keying_mask) |
| static SingleKeyingResult | insert_key_layer (Main *bmain, Action &action, Layer &layer, const Slot &slot, const std::string &rna_path, const std::optional< PropertySubType > prop_subtype, const std::optional< blender::StringRefNull > channel_group, const KeyInsertData &key_data, const KeyframeSettings &key_settings, const eInsertKeyFlags insert_key_flags) |
| static CombinedKeyingResult | insert_key_layered_action (Main *bmain, Action &action, PointerRNA *rna_pointer, const std::optional< StringRefNull > channel_group, const blender::Span< RNAPath > rna_paths, const float scene_frame, const KeyframeSettings &key_settings, const eInsertKeyFlags insert_key_flags) |
| static eInsertKeyFlags | get_autokey_flags (Scene *scene) |
| void | pose_apply_action_selected_bones (Object *ob, bAction *action, const int32_t slot_handle, const AnimationEvalContext *anim_eval_context) |
| void | pose_apply_action_all_bones (Object *ob, bAction *action, const int32_t slot_handle, const AnimationEvalContext *anim_eval_context) |
| void | pose_apply_action_blend (Object *ob, bAction *action, const int32_t slot_handle, const AnimationEvalContext *anim_eval_context, const float blend_factor) |
Public F-Curves API | |
| bAction * | id_action_ensure (Main *bmain, ID *id) |
| void | animdata_fcurve_delete (bAnimContext *ac, AnimData *adt, FCurve *fcu) |
| bool | animdata_remove_empty_action (AnimData *adt) |
| Vector< ID * > | find_related_ids (Main &bmain, ID &id) |
| static void | add_object_data_users (const Main &bmain, const ID &id, Vector< ID * > &related_ids) |
| static bAction * | find_related_action (Main &bmain, ID &id) |
Key-Framing Management | |
| void | update_autoflags_fcurve_direct (FCurve *fcu, PropertyRNA *prop) |
| CombinedKeyingResult | insert_keyframes (Main *bmain, PointerRNA *struct_pointer, std::optional< StringRefNull > channel_group, const blender::Span< RNAPath > rna_paths, std::optional< float > scene_frame, const AnimationEvalContext &anim_eval_context, eBezTriple_KeyframeType key_type, eInsertKeyFlags insert_key_flags) |
| Main key-frame insertion API. | |
| bool | insert_keyframe_direct (ReportList *reports, PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, const AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, NlaKeyframingContext *nla_context, eInsertKeyFlags flag) |
| Secondary Insert Key-framing API call. | |
| int | delete_keyframe (Main *bmain, ReportList *reports, ID *id, const RNAPath &rna_path, float cfra) |
| Main Delete Key-Framing API call. | |
| int | clear_keyframe (Main *bmain, ReportList *reports, ID *id, const RNAPath &rna_path) |
| bool | is_keying_flag (const Scene *scene, eKeying_Flag flag) |
| eInsertKeyFlags | get_keyframing_flags (Scene *scene) |
Auto keyframing | |
Notes:
| |
| bool | is_autokey_on (const Scene *scene) |
| bool | is_autokey_mode (const Scene *scene, eAutokey_Mode mode) |
| bool | autokeyframe_cfra_can_key (const Scene *scene, ID *id) |
| void | autokeyframe_object (bContext *C, Scene *scene, Object *ob, Span< RNAPath > rna_paths) |
| bool | autokeyframe_object (bContext *C, Scene *scene, Object *ob, KeyingSet *ks) |
| bool | autokeyframe_pchan (bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks) |
| void | autokeyframe_pose_channel (bContext *C, Scene *scene, Object *ob, bPoseChannel *pose_channel, Span< RNAPath > rna_paths, short targetless_ik) |
| bool | autokeyframe_property (bContext *C, Scene *scene, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, float cfra, bool only_if_property_keyed) |
| decltype(::ActionSlot::handle) typedef blender::animrig::slot_handle_t = decltype(::ActionSlot::handle) |
Definition at line 44 of file ANIM_action.hh.
| anonymous enum |
| Enumerator | |
|---|---|
| VISUALKEY_NONE | |
| VISUALKEY_LOC | |
| VISUALKEY_ROT | |
| VISUALKEY_SCA | |
Definition at line 30 of file visualkey.cc.
|
strong |
| Enumerator | |
|---|---|
| OK | |
| SlotNotFromAction | |
| SlotNotSuitable | |
| MissingAction | |
Definition at line 1231 of file ANIM_action.hh.
|
strong |
| Enumerator | |
|---|---|
| NONE | |
| IN_RANGE | |
| OUT_RANGE | |
| ALL | |
Definition at line 140 of file ANIM_fcurve.hh.
|
strong |
Mode for modify_keyframes.
| Enumerator | |
|---|---|
| INSERT | |
| DELETE | |
Definition at line 14 of file ANIM_keyingsets.hh.
|
strong |
Return codes for errors (with Relative KeyingSets).
| Enumerator | |
|---|---|
| SUCCESS | |
| INVALID_CONTEXT | Context info was invalid for using the Keying Set. |
| MISSING_TYPEINFO | There isn't any type-info for generating paths from context. |
Definition at line 20 of file ANIM_keyingsets.hh.
|
strong |
Represents a single success/failure in the keyframing process.
What is considered "single" depends on the level at which the failure happens. For example, it can be at the level of a single key on a single fcurve, all the way up to the level of an entire ID not being animatable. Both are considered "single" events.
Definition at line 44 of file ANIM_keyframing.hh.
| Action & blender::animrig::action_add | ( | Main & | bmain, |
| StringRefNull | name ) |
Create a new Action with zero users.
This is basically the same as BKE_action_add, except that the Action has zero users and it's already wrapped with its C++ wrapper.
Definition at line 1151 of file animrig/intern/action.cc.
References BKE_action_add(), bAction::id, and id_us_clear_real().
Referenced by BKE_animdata_transfer_by_basepath(), blender::bke::greasepencil::convert::AnimDataConvertor::fcurves_convert_finalize(), and blender::animrig::tests::TEST_F().
| void blender::animrig::action_deselect_keys | ( | Action & | action | ) |
Deselect all keys within the action.
Definition at line 24 of file action_selection.cc.
References BKE_fcurve_deselect_all_keys(), and blender::animrig::legacy::fcurves_all().
Referenced by deselect_keys_actions(), and poselib_keytag_pose().
| void blender::animrig::action_fcurve_attach | ( | Action & | action, |
| slot_handle_t | action_slot, | ||
| FCurve & | fcurve_to_attach, | ||
| std::optional< StringRefNull > | group_name ) |
Attach the F-Curve to the Action Slot.
Compatible with both legacy and layered Actions. The slot handle is ignored for legacy Actions.
On layered Actions, this assumes the 'Baklava Phase 1' invariants (one layer, one keyframe strip).
Definition at line 2499 of file animrig/intern/action.cc.
References action_fcurve_attach(), blender::animrig::legacy::action_treat_as_legacy(), FCurve::array_index, BLI_addtail(), BLI_assert, blender::animrig::StripKeyframeData::channelbag_for_slot_ensure(), bAction::curves, blender::animrig::ChannelBag::fcurve_append(), bAction::id, blender::animrig::Action::layer(), blender::animrig::Action::layer_keystrip_ensure(), ID::name, printf, FCurve::rna_path, and blender::animrig::Action::slot_for_handle().
Referenced by action_fcurve_attach(), and action_fcurve_move().
Detach the F-Curve from the Action, searching for it in all channelbags.
Compatible with both legacy and layered Actions. The slot handles are ignored for legacy Actions.
The F-Curve is not freed, and ownership is transferred to the caller.
Definition at line 2476 of file animrig/intern/action.cc.
References action_fcurve_detach(), BLI_remlink_safe(), blender::animrig::StripKeyframeData::channelbags(), bAction::curves, blender::animrig::Action::is_action_legacy(), and blender::animrig::Action::layers().
Referenced by action_fcurve_detach(), and action_fcurve_move().
| FCurve * blender::animrig::action_fcurve_ensure | ( | Main * | bmain, |
| bAction * | act, | ||
| const char | group[], | ||
| PointerRNA * | ptr, | ||
| FCurveDescriptor | fcurve_descriptor ) |
Find or create an F-Curve on the given action that matches the given fcurve descriptor.
This function is primarily intended for use with legacy actions, but for reasons of expedience it now also works with layered actions under the following limited circumstances: ptr must be non-null and must have an owner_id that already uses act. See the comments in the implementation for more details.
| ptr | RNA pointer for the struct the fcurve is being looked up/created for. For legacy actions this is optional and may be null, but if provided is used to do things like set the fcurve color properly. For layered actions this parameter is required, and is used to create and assign an appropriate slot if needed when creating the fcurve. |
| fcurve_descriptor | description of the fcurve to lookup/create. Note that this is not relative to ptr (e.g. if ptr is not an ID). It should contain the exact data path of the fcurve to be looked up/created. |
Definition at line 2341 of file animrig/intern/action.cc.
References action_fcurve_ensure(), action_group_colors_set_from_posebone(), action_groups_add_channel(), action_groups_add_new(), blender::animrig::legacy::action_treat_as_legacy(), blender::animrig::FCurveDescriptor::array_index, assert_baklava_phase_1_invariants(), assign_action_ensure_slot_for_keying(), BKE_action_group_find_name(), BLI_addtail(), BLI_assert, BLI_assert_msg, BLI_listbase_is_empty(), blender::StringRefNull::c_str(), blender::animrig::StripKeyframeData::channelbag_for_slot_ensure(), create_fcurve_for_channel(), bAction::curves, PointerRNA::data, DEG_relations_tag_update(), FCURVE_ACTIVE, blender::animrig::ChannelBag::fcurve_ensure(), fcurve_find_in_action(), FCurve::flag, get_action(), blender::animrig::Action::layer(), blender::animrig::Action::layer_keystrip_ensure(), PointerRNA::owner_id, blender::animrig::FCurveDescriptor::prop_subtype, ptr, RNA_id_pointer_create(), blender::animrig::FCurveDescriptor::rna_path, RNA_path_resolve_property(), RNA_property_subtype(), and PointerRNA::type.
Referenced by action_fcurve_ensure(), blender::ed::object::followpath_path_animate_exec(), insert_keyframe_fcurve_value(), blender::ed::object::parent_set(), blender::interface::tests::CopyDriversToSelected::SetUp(), 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().
| void blender::animrig::action_fcurve_move | ( | Action & | action_dst, |
| slot_handle_t | action_slot_dst, | ||
| Action & | action_src, | ||
| FCurve & | fcurve ) |
Move an F-Curve from one Action to the other.
If the F-Curve was part of a channel group, the group membership also carries over to the destination Action. If no group with the same name exists, it is created. This only happens for layered Actions, though.
Compatible with both legacy and layered Actions. The slot handle and group membership are ignored for legacy Actions.
The F-Curve must exist on the source Action. All channelbags for all slots are searched for the F-Curve.
| action_slot_dst | may not be Slot::unassigned on layered Actions. |
Definition at line 2531 of file animrig/intern/action.cc.
References action_fcurve_attach(), action_fcurve_detach(), action_fcurve_move(), BLI_assert, FCurve::grp, bActionGroup::name, and UNUSED_VARS_NDEBUG.
Referenced by action_fcurve_move(), action_move_fcurves_by_basepath(), blender::bke::greasepencil::convert::AnimDataConvertor::fcurves_convert_finalize(), and blender::animrig::tests::TEST_F().
Remove the given FCurve from the action by searching for it in all channelbags. This assumes that an FCurve can only exist in an action once.
Definition at line 2455 of file animrig/intern/action.cc.
References action_fcurve_remove(), BLI_assert, blender::animrig::StripKeyframeData::channelbags(), blender::animrig::Action::is_action_layered(), and blender::animrig::Action::layers().
Referenced by action_fcurve_remove(), animdata_fcurve_delete(), clear_keyframe(), and ED_curve_updateAnimPaths().
Make a best-effort guess as to which ID* is animated by the given slot.
This is only used in rare cases; usually the ID* for which operations are performed is known.
Definition at line 2651 of file animrig/intern/action.cc.
References action_slot_get_id_best_guess(), blender::animrig::Slot::users(), and users.
Referenced by action_slot_get_id_best_guess(), and animfilter_action_slots().
| ID * blender::animrig::action_slot_get_id_for_keying | ( | Main & | bmain, |
| Action & | action, | ||
| slot_handle_t | slot_handle, | ||
| ID * | primary_id ) |
Find an appropriate user of the given Action + Slot for keyframing purposes.
(NOTE: although this function exists for handling situations caused by the expanded capabilities of layered actions, for convenience it also works with legacy actions. For legacy actions this simply returns primary_id as long as it's a user of action.)
Usually this function shouldn't be necessary, because you'll already have an obvious ID that you're keying. But in some cases (such as the action editor where multiple slots are accessible) the active ID that would normally get keyed might have nothing to do with the slot that's actually getting keyed.
This function handles such cases by attempting to find an actual user of the slot that's appropriate for keying. More specifically:
primary_id is a user of the slot, primary_id is always returned.In other words, the cases where a user of the slot is not returned are:
primary_id, and therefore there is no single, clear user that can be appropriately used for keying.| primary_id | whenever this is among the users of the action + slot, it is given priority and is returned. May be null. |
Definition at line 2617 of file animrig/intern/action.cc.
References action_slot_get_id_for_keying(), blender::animrig::legacy::action_treat_as_legacy(), get_action(), blender::animrig::Action::slot_for_handle(), blender::animrig::Slot::users(), and users.
Referenced by action_slot_get_id_for_keying(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
|
static |
Definition at line 77 of file animrig/intern/action.cc.
References DNA_struct_default_alloc.
Referenced by blender::animrig::Action::layer_add().
|
static |
Definition at line 47 of file animdata.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append_non_duplicates(), Object::data, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, Object::id, ID_REAL_USERS, and Main::objects.
Referenced by find_related_ids().
|
static |
Call callback(bone) for each bone in the list of bones.
Bones are visited in depth-first order.
TODO: extend the callback with a bool return value to indicate whether the loop should continue or stop.
Definition at line 47 of file ANIM_armature_iter.hh.
References ANIM_armature_foreach_bone(), and callback.
|
static |
Call callback(bone) for each bone in the list of bones.
Bones are visited in depth-first order.
TODO: extend the callback with a bool return value to indicate whether the loop should continue or stop.
Definition at line 30 of file ANIM_armature_iter.hh.
References ANIM_armature_foreach_bone(), and callback.
Referenced by ANIM_armature_bonecoll_reconstruct(), ANIM_armature_foreach_bone(), ANIM_armature_foreach_bone(), ANIM_armature_runtime_free(), and version_bonelayers_to_bonecollections().
| blender::Map< BoneCollection *, BoneCollection * > blender::animrig::ANIM_bonecoll_array_copy_no_membership | ( | BoneCollection *** | bcoll_array_dst, |
| int * | bcoll_array_dst_num, | ||
| BoneCollection ** | bcoll_array_src, | ||
| int | bcoll_array_src_num, | ||
| bool | do_id_user ) |
Duplicates a list of BoneCollections for edit-mode undo purposes, and returns original-to-duplicate remapping data.
IMPORTANT: this discards membership data in the duplicate collections. This is because this function is only intended to be used with edit-mode Armatures, where the membership information in collections is not definitive, instead being stored in the EditBones. The assumption is that the membership information in the collections will be rebuilt from the EditBones when leaving edit mode.
The source and destination each have two parts: a heap-allocated array of BoneCollection *, and an integer that keeps track of that array's length. The destination parameters are pointers to those components, so they can be modified. The destination array should be empty and unallocated.
| bcoll_array_dst,bcoll_array_dst_num | the destination BoneCollection array and array size. |
| bcoll_array_src,bcoll_array_src_num | the source BoneCollection array and array size. |
| do_id_user | when true, increments the user count of IDs that the BoneCollections' custom properties point to, if any. |
Definition at line 1393 of file animrig/intern/bone_collections.cc.
References BLI_assert, BLI_listbase_clear(), BoneCollection::bones, IDP_CopyProperty_ex(), LIB_ID_CREATE_NO_USER_REFCOUNT, MEM_dupallocN, MEM_malloc_arrayN, and BoneCollection::prop.
Referenced by undoarm_from_editarm(), and undoarm_to_editarm().
| void blender::animrig::ANIM_bonecoll_array_free | ( | BoneCollection *** | bcoll_array, |
| int * | bcoll_array_num, | ||
| bool | do_id_user ) |
Frees a list of BoneCollections.
IMPORTANT: although there is nothing about this function that fundamentally prevents it from being used generally, other data structures like Armature runtime data and EditBones often store direct pointers to BoneCollections, which this function does NOT handle. Prefer using higher-level functions to remove BoneCollections from Armatures.
| bcoll_array | pointer to the heap-allocated array of BoneCollection * to be freed. |
| bcoll_array_num | pointer to the integer that tracks the length of bcoll_array. |
| do_id_user | when true, decrements the user count of IDs that the BoneCollections' custom properties point to, if any. |
Definition at line 1428 of file animrig/intern/bone_collections.cc.
References BLI_freelistN(), BoneCollection::bones, IDP_FreeProperty_ex(), MEM_freeN(), MEM_SAFE_FREE, and BoneCollection::prop.
Referenced by undoarm_free_data(), and undoarm_to_editarm().
| const BoneColor & blender::animrig::ANIM_bonecolor_posebone_get | ( | const bPoseChannel * | pose_bone | ) |
Return the effective BoneColor of this pose bone.
This returns the pose bone's own color, unless it's set to "default", then it defaults to the armature bone color.
Definition at line 88 of file bonecolor.cc.
References bPoseChannel::bone, Bone::color, bPoseChannel::color, and BoneColor::palette_index.
Referenced by action_group_colors_set_from_posebone(), and pose_select_same_color().
| void blender::animrig::animdata_fcurve_delete | ( | bAnimContext * | ac, |
| AnimData * | adt, | ||
| FCurve * | fcu ) |
Delete the F-Curve from the given AnimData block (if possible), as appropriate according to animation context.
Definition at line 253 of file animdata.cc.
References AnimData::action, action_fcurve_remove(), action_groups_remove_channel(), ANIMCONT_DRIVERS, animdata_remove_empty_action(), BKE_fcurve_free(), BLI_assert_unreachable, BLI_freelinkN(), BLI_listbase_is_empty(), BLI_remlink(), bActionGroup::channels, bAction::curves, bAnimContext::datatype, AnimData::drivers, ELEM, bAction::groups, FCurve::grp, and blender::animrig::Action::is_action_legacy().
Referenced by animchannels_delete_exec(), clean_fcurve(), clear_anim_v3d_exec(), delete_action_keys(), delete_graph_keys(), delete_keyframe(), and delete_keyframe_fcurve_legacy().
| bool blender::animrig::animdata_remove_empty_action | ( | AnimData * | adt | ) |
Unlink the action from animdata if it's empty.
If the action has no F-Curves, unlink it from AnimData if it did not come from a NLA Strip being tweaked.
Definition at line 317 of file animdata.cc.
References AnimData::action, ADT_NLA_EDIT_ON, BLI_listbase_is_empty(), bAction::curves, DEG_id_tag_update(), AnimData::flag, bAction::id, ID_RECALC_ANIMATION_NO_FLUSH, and id_us_min().
Referenced by animdata_fcurve_delete(), and clear_anim_v3d_exec().
|
static |
Definition at line 102 of file evaluation.cc.
References BLI_assert_msg, PointerRNA::data, ID::orig_id, PointerRNA::owner_id, and ptr.
Referenced by animsys_write_orig_anim_rna().
|
static |
Definition at line 119 of file evaluation.cc.
References animsys_construct_orig_pointer_rna(), BKE_animsys_rna_path_resolve(), BKE_animsys_write_to_rna_path(), and ptr.
Referenced by apply_evaluation_result().
| void blender::animrig::apply_evaluation_result | ( | const EvaluationResult & | evaluation_result, |
| PointerRNA & | animated_id_ptr, | ||
| bool | flush_to_original ) |
Apply the result of the animation evaluation to the given data-block.
| flush_to_original | when true, look up the original data-block (assuming the given one is an evaluated copy) and update that too. |
Definition at line 170 of file evaluation.cc.
References animsys_write_orig_anim_rna(), blender::animrig::PropIdentifier::array_index, BKE_animsys_write_to_rna_path(), blender::StringRefNull::c_str(), blender::animrig::EvaluationResult::items(), blender::animrig::AnimatedProperty::prop_rna, blender::animrig::PropIdentifier::rna_path, and blender::animrig::AnimatedProperty::value.
Referenced by evaluate_and_apply_action().
| int blender::animrig::armature_bonecoll_child_number_find | ( | const bArmature * | armature, |
| const ::BoneCollection * | bcoll ) |
Find the child number of this bone collection.
This is the offset of this collection relative to the parent's first child. In other words, the first child has number 0, second child has number 1, etc.
This requires a scan of the array, hence the function is called 'find' and not 'get'.
Definition at line 1153 of file animrig/intern/bone_collections.cc.
References armature_bonecoll_find_index(), armature_bonecoll_find_parent_index(), and bonecoll_child_number().
| int blender::animrig::armature_bonecoll_child_number_set | ( | bArmature * | armature, |
| ::BoneCollection * | bcoll, | ||
| int | new_child_number ) |
Move this bone collection to a new child number.
Definition at line 1160 of file animrig/intern/bone_collections.cc.
References bArmature_Runtime::active_collection_index, ANIM_armature_bonecoll_active_index_set(), armature_bonecoll_find_index(), armature_bonecoll_find_parent_index(), blender::animrig::internal::bonecolls_move_to_index(), BoneCollection::child_count, BoneCollection::child_index, bArmature::collection_array, bArmature::collection_root_count, and bArmature::runtime.
Referenced by blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| int blender::animrig::armature_bonecoll_find_index | ( | const bArmature * | armature, |
| const ::BoneCollection * | bcoll ) |
Return the index of the given collection in the armature's collection array, or -1 if not found.
Referenced by ANIM_armature_bonecoll_active_set(), ANIM_armature_bonecoll_insert_copy_after(), ANIM_armature_bonecoll_move(), ANIM_armature_bonecoll_remove(), armature_bonecoll_child_number_find(), armature_bonecoll_child_number_set(), liboverride_recursively_add_children(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| int blender::animrig::armature_bonecoll_find_index | ( | const bArmature * | armature, |
| const BoneCollection * | bcoll ) |
Definition at line 1119 of file animrig/intern/bone_collections.cc.
| int blender::animrig::armature_bonecoll_find_parent_index | ( | const bArmature * | armature, |
| int | bcoll_index ) |
Return the index of the given bone collection's parent, or -1 if it has no parent.
Definition at line 1132 of file animrig/intern/bone_collections.cc.
Referenced by ANIM_armature_bonecoll_move_before_after_index(), ANIM_armature_bonecoll_move_to_index(), ANIM_armature_bonecoll_remove_from_index(), armature_bonecoll_child_number_find(), armature_bonecoll_child_number_set(), blender::ui::bonecollections::BoneCollectionDropTarget::on_drop(), 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(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| bool blender::animrig::armature_bonecoll_is_child_of | ( | const bArmature * | armature, |
| int | potential_parent_index, | ||
| int | potential_child_index ) |
Definition at line 1208 of file animrig/intern/bone_collections.cc.
References armature_bonecoll_is_root(), BoneCollection::child_count, BoneCollection::child_index, and bArmature::collection_array.
Referenced by ANIM_armature_bonecoll_move_to_index(), ANIM_armature_bonecoll_remove_from_index(), armature_bonecoll_is_descendant_of(), and blender::animrig::tests::TEST_F().
| bool blender::animrig::armature_bonecoll_is_descendant_of | ( | const bArmature * | armature, |
| int | potential_parent_index, | ||
| int | potential_descendant_index ) |
Definition at line 1227 of file animrig/intern/bone_collections.cc.
References armature_bonecoll_is_child_of(), armature_bonecoll_is_descendant_of(), BLI_assert_msg, BoneCollection::child_count, BoneCollection::child_index, and bArmature::collection_array.
Referenced by armature_bonecoll_is_descendant_of(), and blender::ui::bonecollections::BoneCollectionDropTarget::can_drop().
Definition at line 1202 of file animrig/intern/bone_collections.cc.
References BLI_assert, and bArmature::collection_root_count.
Referenced by ANIM_armature_bonecoll_insert_copy_after(), armature_bonecoll_is_child_of(), and blender::animrig::tests::TEST_F().
| int blender::animrig::armature_bonecoll_move_to_parent | ( | bArmature * | armature, |
| int | from_bcoll_index, | ||
| int | to_child_num, | ||
| int | from_parent_index, | ||
| int | to_parent_index ) |
Move a bone collection from one parent to another.
| from_bcoll_index | Index of the bone collection to move. |
| to_child_num | Gap index of where to insert the collection; 0 to make it the first child, and parent->child_count to make it the last child. -1 also works as an indicator for the last child, as that makes it possible to call this function without requiring the caller to find the BoneCollection* of the parent. |
| from_parent_index | Index of its current parent (-1 if it is a root collection). |
| to_parent_index | Index of the new parent (-1 if it is to become a root collection). |
Definition at line 1296 of file animrig/intern/bone_collections.cc.
References ancestors_visible_update(), BLI_assert, BLI_assert_msg, blender::animrig::internal::bonecolls_move_to_index(), BoneCollection::child_count, BoneCollection::child_index, bArmature::collection_array, bArmature::collection_array_num, bArmature::collection_root_count, and BoneCollection::flags.
Referenced by ANIM_armature_bonecoll_move_before_after_index(), ANIM_armature_bonecoll_remove_from_index(), blender::ui::bonecollections::BoneCollectionDropTarget::on_drop(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
|
static |
Moves the given (end exclusive) range to index to, shifting other items before/after to make room.
The range is moved such that the start ends up at to.
to must be far away enough from the end of the array for the entire range to be moved there without spilling over the end of the array.
Definition at line 180 of file animrig/intern/action.cc.
References BLI_assert, ELEM, and UNUSED_VARS_NDEBUG.
Referenced by blender::animrig::ChannelBag::channel_group_move(), blender::animrig::ChannelBag::channel_group_remove(), blender::animrig::ChannelBag::fcurve_assign_to_channel_group(), blender::animrig::ChannelBag::fcurve_move(), and blender::animrig::ChannelBag::fcurve_ungroup().
| void blender::animrig::assert_baklava_phase_1_invariants | ( | const Action & | action | ) |
Assert the invariants of Project Baklava phase 1.
For an action the invariants are that it:
For a layer the invariants are that it:
For a strip the invariants are that it:
This simultaneously serves as a todo marker for later phases of Project Baklava and ensures that the phase-1 invariants hold at runtime.
TODO: these functions should be changed to assert fewer and fewer assumptions as we progress through the phases of Project Baklava and more and more of the new animation system is implemented. Finally, they should be removed entirely when the full system is completely implemented.
Definition at line 2672 of file animrig/intern/action.cc.
References assert_baklava_phase_1_invariants(), BLI_assert, blender::animrig::Action::is_action_legacy(), blender::animrig::Action::layer(), and blender::animrig::Action::layers().
Referenced by blender::bke::action_blend_write(), action_fcurve_ensure(), assert_baklava_phase_1_invariants(), assert_baklava_phase_1_invariants(), assert_baklava_phase_1_invariants(), blender::animrig::legacy::channelbag_ensure(), channelbag_for_action_slot(), fcurve_find_in_action(), fcurves_for_action_slot(), fcurves_for_action_slot(), blender::animrig::Action::get_layer_for_keyframing(), insert_key_layer(), blender::animrig::Action::layer_keystrip_ensure(), and move_slot().
| void blender::animrig::assert_baklava_phase_1_invariants | ( | const Layer & | layer | ) |
Assert the invariants of Project Baklava phase 1.
For an action the invariants are that it:
For a layer the invariants are that it:
For a strip the invariants are that it:
This simultaneously serves as a todo marker for later phases of Project Baklava and ensures that the phase-1 invariants hold at runtime.
TODO: these functions should be changed to assert fewer and fewer assumptions as we progress through the phases of Project Baklava and more and more of the new animation system is implemented. Finally, they should be removed entirely when the full system is completely implemented.
Definition at line 2685 of file animrig/intern/action.cc.
References assert_baklava_phase_1_invariants(), and BLI_assert.
| void blender::animrig::assert_baklava_phase_1_invariants | ( | const Strip & | strip | ) |
Assert the invariants of Project Baklava phase 1.
For an action the invariants are that it:
For a layer the invariants are that it:
For a strip the invariants are that it:
This simultaneously serves as a todo marker for later phases of Project Baklava and ensures that the phase-1 invariants hold at runtime.
TODO: these functions should be changed to assert fewer and fewer assumptions as we progress through the phases of Project Baklava and more and more of the new animation system is implemented. Finally, they should be removed entirely when the full system is completely implemented.
Definition at line 2695 of file animrig/intern/action.cc.
References assert_baklava_phase_1_invariants(), BLI_assert, ActionStrip::frame_offset, blender::animrig::Strip::is_infinite(), blender::animrig::Strip::type(), and UNUSED_VARS_NDEBUG.
This will make a best-effort guess as to which slot to use, in this order;
false if the assignment was not possible (for example the ID is of a type that cannot be animated). If the above fall-through case of "no slot found" is reached, this function will still return true as the Action was successfully assigned. Definition at line 1158 of file animrig/intern/action.cc.
References assign_action(), and BKE_animdata_ensure_id().
Referenced by action_to_animdata(), assign_action(), assign_action_and_slot(), assign_action_ensure_slot_for_keying(), BKE_animdata_set_action(), BKE_animdata_transfer_by_basepath(), blender::bke::greasepencil::convert::AnimDataConvertor::fcurves_convert_finalize(), id_action_ensure(), ipo_to_animdata(), blender::ed::space_node::node_group_ungroup(), 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(), unassign_action(), and unassign_action().
|
nodiscard |
Same as assign_action(action, id) above.
Use this function when you already have the AnimData struct of this ID.
Definition at line 1167 of file animrig/intern/action.cc.
References AnimData::action, OwnedAnimData::adt, BKE_animdata_action_editable(), BKE_report(), generic_assign_action(), OwnedAnimData::owner_id, RPT_ERROR, AnimData::slot_handle, and AnimData::slot_name.
| ActionSlotAssignmentResult blender::animrig::assign_action_and_slot | ( | Action * | action, |
| Slot * | slot_to_assign, | ||
| ID & | animated_id ) |
Utility function that assigns both an Action and a slot of that Action.
Returns the result of the underlying assign_action_slot() call.
Definition at line 1435 of file animrig/intern/action.cc.
References assign_action(), assign_action_slot(), and MissingAction.
Referenced by BKE_nla_tweakmode_enter(), blender::animrig::tests::AnimationEvaluationTest::SetUp(), 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().
|
nodiscard |
Assign the Action, ensuring that a Slot is also assigned.
If this Action happens to already be assigned, and a Slot is assigned too, that Slot is returned. Otherwise a new Slot is created + assigned.
nullptr otherwise. Reasons the assignment can fail is when the given ID is of an animatable type, when the ID is in NLA Tweak mode (in which case no Action assignments can happen), or when the legacy Action ID type doesn't match the animated ID.assign_action() this skips the search by slot name when the Action is already assigned. It should be possible for an animator to un-assign a slot, then create a new slot by inserting a new key. This shouldn't auto-assign the old slot (by name) and then insert the key.Definition at line 1201 of file animrig/intern/action.cc.
References AnimData::action, assign_action(), assign_action_slot(), BKE_animdata_from_id(), BLI_assert_unreachable, blender::animrig::Slot::is_suitable_for(), ID::name, OK, blender::animrig::Action::slot_add_for_id(), blender::animrig::Action::slot_find_by_name(), blender::animrig::Action::slot_for_handle(), AnimData::slot_handle, and AnimData::slot_name.
Referenced by action_fcurve_ensure(), insert_key_layered_action(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| ActionSlotAssignmentResult blender::animrig::assign_action_slot | ( | Slot * | slot_to_assign, |
| ID & | animated_id ) |
Definition at line 1424 of file animrig/intern/action.cc.
References AnimData::action, BKE_animdata_from_id(), generic_assign_action_slot(), MissingAction, AnimData::slot_handle, and AnimData::slot_name.
Referenced by assign_action_and_slot(), assign_action_ensure_slot_for_keying(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
|
nodiscard |
Same as assign_action, except it assigns to AnimData::tmpact and AnimData::tmp_slot_handle.
Definition at line 1182 of file animrig/intern/action.cc.
References OwnedAnimData::adt, generic_assign_action(), OwnedAnimData::owner_id, AnimData::tmp_slot_handle, AnimData::tmp_slot_name, and AnimData::tmpact.
Referenced by BKE_animdata_free(), and blender::bke::greasepencil::convert::AnimDataConvertor::fcurves_convert_finalize().
Auto-keyframing feature - checks for whether anything should be done for the current frame.
Definition at line 81 of file keyframing_auto.cc.
References AUTOKEY_MODE_EDITKEYS, AUTOKEY_MODE_NORMAL, BKE_scene_frame_get(), id_frame_has_keyframe(), is_autokey_mode(), and is_autokey_on().
Referenced by autokeyframe_object(), autokeyframe_object(), autokeyframe_pchan(), autokeyframe_pose_channel(), autokeyframe_property(), drawTransformPixel(), motionpath_need_update_object(), motionpath_need_update_pose(), pose_clear_transform_generic_exec(), poseAnim_mapping_autoKeyframe(), and poselib_keytag_pose().
| bool blender::animrig::autokeyframe_object | ( | bContext * | C, |
| Scene * | scene, | ||
| Object * | ob, | ||
| KeyingSet * | ks ) |
Auto-keyframing feature - for objects
Definition at line 163 of file keyframing_auto.cc.
References ANIM_apply_keyingset(), ANIM_relative_keyingset_add_source(), autokeyframe_cfra_can_key(), BKE_scene_frame_get(), Object::id, and INSERT.
| void blender::animrig::autokeyframe_object | ( | bContext * | C, |
| Scene * | scene, | ||
| Object * | ob, | ||
| Span< RNAPath > | rna_paths ) |
Insert keyframes on the given object ob based on the auto-keying settings.
| rna_paths | Only inserts keys on those RNA paths. |
Definition at line 107 of file keyframing_auto.cc.
References ANIM_apply_keyingset(), ANIM_relative_keyingset_add_source(), ANIM_scene_get_active_keyingset(), AUTOKEY_FLAG_ONLYKEYINGSET, autokeyframe_cfra_can_key(), BKE_animsys_eval_context_construct(), BKE_scene_frame_get(), BLI_assert, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_wm_reports(), depsgraph, AnimationEvalContext::eval_time, flag, blender::animrig::CombinedKeyingResult::generate_reports(), get_autokey_flags(), blender::animrig::CombinedKeyingResult::get_count(), Object::id, INSERT, insert_keyframes(), is_keying_flag(), blender::animrig::CombinedKeyingResult::merge(), ptr, and SUCCESS.
Referenced by autokeyframe_object(), blender::ed::object::object_clear_transform_generic_exec(), snap_sel_to_grid_exec(), and snap_selected_to_location().
| bool blender::animrig::autokeyframe_pchan | ( | bContext * | C, |
| Scene * | scene, | ||
| Object * | ob, | ||
| bPoseChannel * | pchan, | ||
| KeyingSet * | ks ) |
Definition at line 181 of file keyframing_auto.cc.
References ANIM_apply_keyingset(), ANIM_relative_keyingset_add_source(), autokeyframe_cfra_can_key(), BKE_scene_frame_get(), Object::id, and INSERT.
Referenced by pose_paste_exec(), snap_sel_to_grid_exec(), and snap_selected_to_location().
| void blender::animrig::autokeyframe_pose_channel | ( | bContext * | C, |
| Scene * | scene, | ||
| Object * | ob, | ||
| bPoseChannel * | pose_channel, | ||
| Span< RNAPath > | rna_paths, | ||
| short | targetless_ik ) |
Auto-keyframing feature - for poses/pose-channels
| targetless_ik | Has targetless ik been done on any channels? |
| rna_paths | Only inserts keys on those RNA paths. |
Definition at line 199 of file keyframing_auto.cc.
References ANIM_apply_keyingset(), ANIM_relative_keyingset_add_source(), ANIM_scene_get_active_keyingset(), AUTOKEY_FLAG_ONLYKEYINGSET, autokeyframe_cfra_can_key(), BKE_animsys_eval_context_construct(), BKE_scene_frame_get(), BLI_assert, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_wm_reports(), depsgraph, AnimationEvalContext::eval_time, flag, blender::animrig::CombinedKeyingResult::generate_reports(), get_autokey_flags(), blender::animrig::CombinedKeyingResult::get_count(), Object::id, INSERT, insert_keyframes(), INSERTKEY_MATRIX, is_keying_flag(), blender::animrig::CombinedKeyingResult::merge(), ptr, and SUCCESS.
Referenced by autokeyframe_pose(), and pose_flip_quats_exec().
| bool blender::animrig::autokeyframe_property | ( | bContext * | C, |
| Scene * | scene, | ||
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| int | rnaindex, | ||
| float | cfra, | ||
| bool | only_if_property_keyed ) |
Use for auto-key-framing.
| only_if_property_keyed | if true, auto-key-framing only creates keyframes on already keyed properties. This is by design when using buttons. For other callers such as gizmos or sequencer preview transform, creating new animation/keyframes also on non-keyed properties is desired. |
Definition at line 267 of file keyframing_auto.cc.
References FCurve::array_index, autokeyframe_cfra_can_key(), BKE_animsys_eval_context_construct(), BKE_fcurve_find_by_rna_context_ui(), BLI_assert, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_wm_reports(), depsgraph, flag, get_autokey_flags(), blender::animrig::CombinedKeyingResult::get_count(), FCurve::grp, insert_keyframe_direct(), insert_keyframes(), is_autokey_on(), ToolSettings::keyframe_type, NA_EDITED, bActionGroup::name, NC_ANIMATION, ND_KEYFRAME, PointerRNA::owner_id, ptr, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_from_ID_to_property(), SUCCESS, and WM_event_add_notifier().
Referenced by autokeyframe_sequencer_image(), blender::nodes::inverse_eval::set_rna_property(), ui_but_anim_autokey(), and WM_gizmo_target_property_anim_autokey().
| void blender::animrig::bake_fcurve | ( | FCurve * | fcu, |
| blender::int2 | range, | ||
| float | step, | ||
| BakeCurveRemove | remove_existing ) |
Creates keyframes in the given range at the given step interval.
| range | start and end frame to bake. Is inclusive on both ends. |
| remove_existing | choice which keys to remove in relation to the given range. |
Definition at line 551 of file animrig/intern/fcurve.cc.
References FCurve::bezt, BKE_bezier_array_merge(), BKE_fcurve_handles_recalc(), BLI_assert, FCurve::flag, get_keyframe_settings(), initialize_bezt(), MEM_callocN, MEM_freeN(), NONE, remove_fcurve_key_range(), sample_fcurve_segment(), and FCurve::totvert.
| void blender::animrig::bake_fcurve_segments | ( | FCurve * | fcu | ) |
Fill the space between selected keyframes with keyframes on full frames. E.g. With a key selected on frame 1 and 3 it will insert a key on frame 2.
Definition at line 598 of file animrig/intern/fcurve.cc.
References FCurve::bezt, BEZT_ISSEL_ANY, BEZT_KEYTYPE_BREAKDOWN, BKE_fcurve_handles_recalc(), ceil(), evaluate_fcurve(), float, floor(), blender::animrig::TempFrameValCache::frame, get_keyframe_settings(), insert_vert_fcurve(), INSERTKEY_NOFLAGS, int, MEM_callocN, MEM_freeN(), next, range, and FCurve::totvert.
Referenced by bake_action_keys(), and bake_graph_keys().
| EvaluationResult blender::animrig::blend_layer_results | ( | const EvaluationResult & | last_result, |
| const EvaluationResult & | current_result, | ||
| const Layer & | current_layer ) |
Blend the 'current layer' with the 'last evaluation result', returning the blended result.
Definition at line 214 of file evaluation.cc.
References blender::animrig::Layer::Add, blender::animrig::PropIdentifier::array_index, blend, ActionLayer::influence, blender::math::interpolate(), blender::animrig::EvaluationResult::items(), blender::animrig::Layer::mix_mode(), blender::animrig::Layer::Multiply, blender::animrig::Layer::Offset, blender::animrig::AnimatedProperty::prop_rna, blender::animrig::Layer::Replace, blender::animrig::PropIdentifier::rna_path, blender::animrig::Layer::Subtract, and blender::animrig::AnimatedProperty::value.
Referenced by evaluate_action().
| bool blender::animrig::bonecoll_has_children | ( | const BoneCollection * | bcoll | ) |
Definition at line 1252 of file animrig/intern/bone_collections.cc.
References BoneCollection::child_count.
Referenced by move_to_collection_menu_create().
| void blender::animrig::bonecolls_copy_expanded_flag | ( | Span< BoneCollection * > | bcolls_dest, |
| Span< const BoneCollection * > | bcolls_source ) |
For each bone collection in the destination armature, copy its BONE_COLLECTION_EXPANDED flag from the corresponding bone collection in the source armature.
This is used in the handling of undo steps, to ensure that undo'ing does not modify this flag.
Definition at line 1257 of file animrig/intern/bone_collections.cc.
References ANIM_armature_bonecoll_is_expanded_set(), bonecolls_get_by_name(), BoneCollection::name, blender::Span< T >::size(), and STREQ.
Referenced by armature_undo_preserve(), and undoarm_to_editarm().
| animrig::ChannelBag * blender::animrig::channelbag_for_action_slot | ( | Action & | action, |
| slot_handle_t | slot_handle ) |
Definition at line 2210 of file animrig/intern/action.cc.
References channelbag_for_action_slot().
| const animrig::ChannelBag * blender::animrig::channelbag_for_action_slot | ( | const Action & | action, |
| slot_handle_t | slot_handle ) |
Definition at line 2183 of file animrig/intern/action.cc.
References assert_baklava_phase_1_invariants(), blender::animrig::StripKeyframeData::channelbag_for_slot(), blender::animrig::Action::layers(), and blender::animrig::Slot::unassigned.
Referenced by blender::animrig::legacy::action_fcurves_remove(), animfilter_action_slot(), blender::animrig::legacy::channel_groups_for_assigned_slot(), channelbag_for_action_slot(), fcurve_find_in_action_slot(), fcurves_for_action_slot(), fcurves_for_action_slot(), and updateDuplicateActionConstraintSettings().
|
static |
Definition at line 1651 of file animrig/intern/action.cc.
Referenced by blender::animrig::StripKeyframeData::channelbag_remove().
| int blender::animrig::clear_keyframe | ( | Main * | bmain, |
| ReportList * | reports, | ||
| ID * | id, | ||
| const RNAPath & | rna_path ) |
Main Keyframing API call: Use this when validation of necessary animation data isn't necessary as it already exists. It will clear the current buttons fcurve(s).
Definition at line 686 of file animrig/intern/keyframing.cc.
References AnimData::action, action_fcurve_remove(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_animdata_from_id(), BKE_report(), BKE_reportf(), ELEM, foreach_fcurve_in_action_slot(), blender::animrig::Action::is_action_layered(), RNAPath::path, ptr, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RPT_ERROR, and AnimData::slot_handle.
Referenced by clear_key_button_exec().
Clone information from the given slot into this slot while retaining important info like the slot handle and runtime data. This copies the name which might clash with other names on the action. Call slot_name_ensure_unique after.
Definition at line 2760 of file animrig/intern/action.cc.
References clone_slot(), and ActionSlot::runtime.
Referenced by clone_slot(), and move_slot().
Creates a new Action that matches the old action but is converted to have layers. Returns a nullptr if the action is empty or already layered.
Definition at line 2703 of file animrig/intern/action.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BKE_action_add(), BKE_fcurve_copy(), BLI_assert, BLI_listbase_count(), blender::animrig::ChannelBag::channel_group_create(), ActionStripKeyframeData::channelbag_array_num, convert_to_layered_action(), bAction::curves, blender::animrig::Strip::data(), ActionChannelBag::fcurve_array, ActionChannelBag::fcurve_array_num, blender::animrig::ChannelBag::fcurve_assign_to_channel_group(), bAction::groups, FCurve::grp, bAction::id, blender::animrig::Action::is_action_legacy(), blender::animrig::Action::layer_add(), LISTBASE_FOREACH, LISTBASE_FOREACH_INDEX, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), MAX_ID_NAME, ID::name, blender::animrig::Action::slot_add(), and STRNCPY_UTF8.
Referenced by convert_to_layered_action(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| FCurve * blender::animrig::create_fcurve_for_channel | ( | FCurveDescriptor | fcurve_descriptor | ) |
Create an fcurve for a specific channel, pre-set-up with default flags and interpolation mode.
If the channel's property subtype is provided, the fcurve will also be set to the correct color mode based on user preferences.
Definition at line 56 of file animrig/intern/fcurve.cc.
References blender::animrig::FCurveDescriptor::array_index, FCurve::array_index, FCurve::auto_smoothing, BKE_fcurve_create(), BLI_strdupn(), FCurve::color_mode, blender::StringRefBase::data(), FCURVE_COLOR_AUTO_RGB, FCURVE_COLOR_AUTO_YRGB, FCURVE_SELECTED, FCURVE_VISIBLE, FCurve::flag, KEYING_FLAG_XYZ2RGB, PROP_COLOR, PROP_COORDS, PROP_EULER, PROP_QUATERNION, blender::animrig::FCurveDescriptor::prop_subtype, PROP_TRANSLATION, PROP_XYZ, blender::animrig::FCurveDescriptor::rna_path, FCurve::rna_path, and blender::StringRefBase::size().
Referenced by action_fcurve_ensure(), and blender::animrig::ChannelBag::fcurve_create().
| const std::optional< StringRefNull > blender::animrig::default_channel_group_for_path | ( | const PointerRNA * | animated_struct, |
| const StringRef | prop_rna_path ) |
Return the default channel group name for the given RNA pointer and property path, or none if it has no default.
For example, for object location/rotation/scale this returns the standard "Object Transforms" channel group name.
Definition at line 189 of file animrig/intern/keyframing.cc.
References BLI_assert, PointerRNA::data, blender::StringRefBase::find(), bPoseChannel::name, blender::StringRefBase::not_found, and PointerRNA::type.
Referenced by insert_key_layered_action(), and insert_key_legacy_action().
|
static |
Definition at line 568 of file animrig/intern/keyframing.cc.
References AnimData::action, DEG_id_tag_update_ex(), DEG_relations_tag_update(), bAction::id, and ID_RECALC_ANIMATION_NO_FLUSH.
Referenced by delete_keyframe().
| int blender::animrig::delete_keyframe | ( | Main * | bmain, |
| ReportList * | reports, | ||
| ID * | id, | ||
| const RNAPath & | rna_path, | ||
| float | cfra ) |
Main Delete Key-Framing API call.
Use this to delete keyframe on current frame for relevant channel. Will perform checks just in case.
Definition at line 582 of file animrig/intern/keyframing.cc.
References AnimData::action, animdata_fcurve_delete(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_animdata_from_id(), BKE_fcurve_is_empty(), BKE_fcurve_is_protected(), BKE_idtype_idcode_to_name(), BKE_nla_tweakedit_remap(), BKE_report(), BKE_reportf(), BLI_assert, deg_tag_after_keyframe_delete(), ELEM, fcurve_delete_keyframe_at_time(), fcurve_find(), fcurve_find_in_action(), fcurves_for_action_slot(), GS, RNAPath::index, blender::animrig::Action::is_action_layered(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), NLATIME_CONVERT_UNMAP, RNAPath::path, ptr, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RNA_property_array_length(), RPT_ERROR, RPT_WARNING, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::animrig::Action::slot_for_handle(), and AnimData::slot_handle.
Referenced by delete_key_button_exec(), and pyrna_struct_keyframe_delete().
Deletes the keyframe at cfra on fcu if a key exists there, and deletes the fcurve if it was the only keyframe.
adt->action and that adt->action is a legacy action.Definition at line 108 of file animrig/intern/fcurve.cc.
References animdata_fcurve_delete(), BKE_fcurve_is_empty(), and fcurve_delete_keyframe_at_time().
| void blender::animrig::deselect_keys_actions | ( | blender::Span< bAction * > | actions | ) |
Deselect the keys of all actions in the Span. Duplicate entries are only visited once.
Definition at line 31 of file action_selection.cc.
References action_deselect_keys(), and blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add().
| blender::animrig::ENUM_OPERATORS | ( | Layer::Flags | , |
| Layer::Flags::Enabled | ) |
| blender::animrig::ENUM_OPERATORS | ( | Slot::Flags | , |
| Slot::Flags::Active | ) |
| EvaluationResult blender::animrig::evaluate_action | ( | PointerRNA & | animated_id_ptr, |
| Action & | action, | ||
| slot_handle_t | slot_handle, | ||
| const AnimationEvalContext & | anim_eval_context ) |
Evaluate the given action for the given slot and animated ID.
This does not apply the resulting values to the ID. Instead, it returns the resulting values in an EvaluationResult.
Definition at line 38 of file evaluation.cc.
References blend_layer_results(), blender::animrig::internal::evaluate_layer(), and blender::animrig::Action::layers().
Referenced by evaluate_and_apply_action().
| void blender::animrig::evaluate_and_apply_action | ( | PointerRNA & | animated_id_ptr, |
| Action & | action, | ||
| slot_handle_t | slot_handle, | ||
| const AnimationEvalContext & | anim_eval_context, | ||
| bool | flush_to_original ) |
Top level animation evaluation function.
Animate the given ID, using the layered Action and the given slot.
| flush_to_original | when true, look up the original data-block (assuming the given one is an evaluated copy) and update that too. |
Definition at line 73 of file evaluation.cc.
References apply_evaluation_result(), and evaluate_action().
Referenced by BKE_animsys_evaluate_animdata().
| float blender::animrig::evaluate_driver_from_rna_pointer | ( | const AnimationEvalContext * | anim_eval_context, |
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| const FCurve * | fcu ) |
Evaluates the driver on the frame given in anim_eval_context and returns the value. Returns 0 if the RNA path can't be resolved.
Definition at line 16 of file driver.cc.
References FCurve::array_index, FCurve::driver, evaluate_driver(), ptr, and RNA_path_resolved_create().
|
static |
Definition at line 134 of file evaluation.cc.
References BKE_animsys_rna_path_resolve(), calculate_fcurve(), blender::animrig::StripKeyframeData::channelbag_for_slot(), blender::animrig::ChannelBag::fcurves(), is_fcurve_evaluatable(), ID::name, PointerRNA::owner_id, printf, and blender::animrig::EvaluationResult::store().
Referenced by evaluate_strip().
|
static |
Definition at line 193 of file evaluation.cc.
References blender::animrig::Strip::data(), AnimationEvalContext::eval_time, evaluate_keyframe_data(), ActionStrip::frame_offset, and blender::animrig::Strip::type().
Referenced by blender::animrig::internal::evaluate_layer().
Delete the keyframe at time on fcurve if a key exists there.
This does NOT delete the FCurve if it ends up empty. That is for the caller to do.
time is in fcurve time, not scene time. Any time remapping must be done prior to calling this function.time and deleted, false otherwise. Definition at line 89 of file animrig/intern/fcurve.cc.
References FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_delete_key(), BKE_fcurve_handles_recalc(), BKE_fcurve_is_protected(), and FCurve::totvert.
Referenced by delete_key_v3d_without_keying_set(), delete_keyframe(), and delete_keyframe_fcurve_legacy().
| const FCurve * blender::animrig::fcurve_find | ( | Span< const FCurve * > | fcurves, |
| FCurveDescriptor | fcurve_descriptor ) |
Return the first fcurve in fcurves that matches fcurve_descriptor.
If no matching fcurve is found, returns nullptr.
Definition at line 38 of file animrig/intern/fcurve.cc.
References blender::animrig::FCurveDescriptor::array_index, and blender::animrig::FCurveDescriptor::rna_path.
Referenced by blender::animrig::ChannelBag::ChannelBag(), delete_keyframe(), blender::animrig::ChannelBag::fcurve_find(), blender::animrig::ChannelBag::fcurve_find(), and fcurve_find().
| FCurve * blender::animrig::fcurve_find | ( | Span< FCurve * > | fcurves, |
| FCurveDescriptor | fcurve_descriptor ) |
Definition at line 50 of file animrig/intern/fcurve.cc.
References blender::Span< T >::cast(), and fcurve_find().
| const FCurve * blender::animrig::fcurve_find_by_rna_path | ( | const AnimData & | adt, |
| StringRefNull | rna_path, | ||
| int | array_index ) |
Compatibility helper function for BKE_animadata_fcurve_find_by_rna_path().
Searches each layer (top to bottom) to find an FCurve that matches the given RNA path & index.
adt->action actually points to a layered Action. It is a bug to call this with a legacy Action, or without one.This function should probably be limited to the active layer (for the given property, once pinning to layers is there), so that the "this is keyed" color is more accurate.
Again, this is just to hook up the layered Action to the old Blender UI code.
Definition at line 365 of file animdata.cc.
References AnimData::action, BLI_assert, blender::animrig::StripKeyframeData::channelbag_for_slot(), blender::animrig::Action::is_action_layered(), blender::animrig::Action::layer(), bAction::layer_array_num, blender::animrig::Action::slot_for_handle(), and AnimData::slot_handle.
| FCurve * blender::animrig::fcurve_find_in_action | ( | bAction * | act, |
| FCurveDescriptor | fcurve_descriptor ) |
Find the F-Curve in the given Action.
All the Action slots are searched for this F-Curve. To limit to a single slot, use fcurve_find_in_action_slot().
Definition at line 2239 of file animrig/intern/action.cc.
References blender::animrig::FCurveDescriptor::array_index, assert_baklava_phase_1_invariants(), BKE_fcurve_find(), blender::StringRefNull::c_str(), blender::animrig::StripKeyframeData::channelbags(), bAction::curves, blender::animrig::Strip::data(), blender::animrig::Action::is_action_legacy(), blender::animrig::Action::layer(), and blender::animrig::FCurveDescriptor::rna_path.
Referenced by action_fcurve_ensure(), delete_keyframe(), insert_keyframe_fcurve_value(), and insert_keyframes().
| FCurve * blender::animrig::fcurve_find_in_action_slot | ( | bAction * | act, |
| slot_handle_t | slot_handle, | ||
| FCurveDescriptor | fcurve_descriptor ) |
Find the F-Curve in the given Action Slot.
Definition at line 2278 of file animrig/intern/action.cc.
References blender::animrig::FCurveDescriptor::array_index, BKE_fcurve_find(), blender::StringRefNull::c_str(), channelbag_for_action_slot(), bAction::curves, blender::animrig::ChannelBag::fcurve_find(), blender::animrig::Action::is_action_legacy(), and blender::animrig::FCurveDescriptor::rna_path.
Referenced by BKE_animadata_fcurve_find_by_rna_path(), and fcurve_find_in_assigned_slot().
| FCurve * blender::animrig::fcurve_find_in_assigned_slot | ( | AnimData & | adt, |
| FCurveDescriptor | fcurve_descriptor ) |
Find the F-Curve in the Action Slot assigned to this ADT.
Definition at line 2273 of file animrig/intern/action.cc.
References AnimData::action, fcurve_find_in_action_slot(), and AnimData::slot_handle.
Referenced by blender::ed::object::followpath_path_animate_exec(), and make_new_animlistelem().
| bool blender::animrig::fcurve_matches_collection_path | ( | const FCurve & | fcurve, |
| StringRefNull | collection_rna_path, | ||
| StringRefNull | data_name ) |
Return whether fcurve targets the given collection path + data name.
For example, to match F-Curves for the pose bone named "botje", you'd pass collection_rna_path = "pose.bones[" and data_name="botje".
fcurve matches, false if it doesn't. Definition at line 2299 of file animrig/intern/action.cc.
References BLI_assert, BLI_str_quoted_substr(), blender::StringRefNull::c_str(), blender::StringRefBase::is_empty(), FCurve::rna_path, and blender::StringRefBase::size().
Referenced by updateDuplicateActionConstraintSettings().
|
static |
Definition at line 1747 of file animrig/intern/action.cc.
References BKE_fcurve_free().
Referenced by blender::animrig::ChannelBag::fcurves_clear().
|
static |
Definition at line 1771 of file animrig/intern/action.cc.
Referenced by blender::animrig::ChannelBag::fcurve_detach_by_index().
| Span< FCurve * > blender::animrig::fcurves_for_action_slot | ( | Action & | action, |
| slot_handle_t | slot_handle ) |
Return the F-Curves for this specific slot handle.
This is just a utility function, that's intended to become obsolete when multi-layer Actions are introduced. However, since Blender currently only supports a single layer with a single strip, of a single type, this function can be used.
The use of this function is also an indicator for code that will have to be altered when multi-layered Actions are getting implemented.
animrig::legacy namespace.Definition at line 2217 of file animrig/intern/action.cc.
References assert_baklava_phase_1_invariants(), BLI_assert, channelbag_for_action_slot(), blender::animrig::ChannelBag::fcurves(), and blender::animrig::Action::is_action_layered().
Referenced by animsys_evaluate_action(), delete_keyframe(), blender::animrig::legacy::fcurves_for_action_slot_templated(), blender::animrig::Action::get_frame_range_of_slot(), blender::animrig::Action::has_keyframes(), and blender::animrig::Action::is_slot_animated().
| Span< const FCurve * > blender::animrig::fcurves_for_action_slot | ( | const Action & | action, |
| slot_handle_t | slot_handle ) |
Definition at line 2228 of file animrig/intern/action.cc.
References assert_baklava_phase_1_invariants(), BLI_assert, channelbag_for_action_slot(), blender::animrig::ChannelBag::fcurves(), and blender::animrig::Action::is_action_layered().
| Vector< FCurve * > blender::animrig::fcurves_in_action_slot_filtered | ( | bAction * | act, |
| slot_handle_t | slot_handle, | ||
| FunctionRef< bool(const FCurve &fcurve)> | predicate ) |
Return the F-Curves in the given action+slot for which predicate returns true.
This works for both layered and legacy actions. For legacy actions the slot handle is ignored.
Definition at line 2324 of file animrig/intern/action.cc.
References BLI_assert, and foreach_fcurve_in_action_slot().
Referenced by updateDuplicateActionConstraintSettings().
Definition at line 179 of file animdata.cc.
References find_related_ids(), get_action(), and blender::animrig::Action::is_action_layered().
Referenced by id_action_ensure().
Build a Vector of IDs that are related to the given ID. Related things are e.g. Object<->Data, Mesh<->Material and so on. The exact relationships are defined per ID type. Only relationships of 1:1 are traced. The case of multiple users for 1 ID is treated as not related. The returned Vector always contains the passed ID as the first index as such will never be empty.
Definition at line 66 of file animdata.cc.
References add_object_data_users(), BKE_id_owner_get(), BKE_key_from_id(), BLI_assert, Object::data, ID::flag, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, Key::from, GS, bNodeTree::id, Key::id, Object::id, ID_FLAG_EMBEDDED_DATA, ID_KE, ID_MA, ID_OB, ID_PA, ID_REAL_USERS, LISTBASE_FOREACH, ID::name, node_tree, blender::bke::node_tree_from_id(), Material::nodetree, Main::objects, and Object::particlesystem.
Referenced by find_related_action().
| slot_handle_t blender::animrig::first_slot_handle | ( | const ::bAction & | dna_action | ) |
Return the handle of the first slot of this Action.
This is for code that needs to treat Actions as somewhat-legacy Actions, i.e. as holders of F-Curves for which the specific slot is not interesting.
TODO: Maybe at some point this function should get extended with an ID type parameter, to return the first slot that is suitable for that ID type.
Definition at line 2663 of file animrig/intern/action.cc.
References first_slot_handle(), ActionSlot::handle, bAction::slot_array, and bAction::slot_array_num.
Referenced by action_preview_render_prepare(), first_slot_handle(), and poselib_blend_apply().
| bool blender::animrig::foreach_action_slot_use | ( | const ID & | animated_id, |
| FunctionRef< bool(const Action &action, slot_handle_t slot_handle)> | callback ) |
Call the given callback for each Action + Slot that this ID uses.
The following cases are visited:
| callback | The function to call for each Action+Slot used. Even when there is no slot assigned, this function will be called (but then with slot_handle = Slot::unassigned). The callback should return true to continue the foreach loop, or return false to stop it. |
false when the callback returned false, and true otherwise. Definition at line 73 of file action_iterators.cc.
References callback, and foreach_action_slot_use_with_references().
Referenced by is_id_using_action_slot(), and blender::animrig::internal::rebuild_slot_user_cache().
| bool blender::animrig::foreach_action_slot_use_with_references | ( | ID & | animated_id, |
| FunctionRef< bool(bAction *&action_ptr_ref, slot_handle_t &slot_handle_ref, char *slot_name)> | callback ) |
Same as foreach_action_slot_use(), except that it reports some pointers so the callback can modify which Action/slot is assigned.
Visit a constraint, and call the callback if it's an Action constraint.
Visit a constraint, and call the callback if it's an Action constraint.
Definition at line 91 of file action_iterators.cc.
References NlaStrip::act, AnimData::action, BKE_animdata_from_id(), callback, blender::bke::nla::foreach_strip_adt(), AnimData::slot_handle, and AnimData::slot_name.
Referenced by foreach_action_slot_use(), move_slot(), and blender::animrig::tests::TEST_F().
| void blender::animrig::foreach_fcurve_in_action | ( | Action & | action, |
| FunctionRef< void(FCurve &fcurve)> | callback ) |
Iterates over all FCurves of the Action and executes the callback on it. Works on layered and legacy actions.
Definition at line 21 of file action_iterators.cc.
References callback, bAction::curves, blender::animrig::Action::is_action_legacy(), blender::animrig::Action::layers(), and LISTBASE_FOREACH.
| void blender::animrig::foreach_fcurve_in_action_slot | ( | Action & | action, |
| slot_handle_t | handle, | ||
| FunctionRef< void(FCurve &fcurve)> | callback ) |
Iterates over all FCurves of the given slot handle in the Action and executes the callback on it. Works on layered and legacy actions. When the action is legacy, the slot handle will be ignored.
Definition at line 44 of file action_iterators.cc.
References BLI_assert, callback, bAction::curves, blender::animrig::Action::is_action_layered(), blender::animrig::Action::is_action_legacy(), blender::animrig::Action::layers(), and LISTBASE_FOREACH.
Referenced by action_move_fcurves_by_basepath(), clear_keyframe(), fcurves_in_action_slot_filtered(), get_item_transform_flags_and_fcurves(), and blender::animrig::tests::TEST_F().
|
nodiscard |
Generic function to build Action-assignment logic.
This is a low-level function, intended as a building block for higher-level Action assignment functions.
Definition at line 1261 of file animrig/intern/action.cc.
References blender::animrig::legacy::action_treat_as_legacy(), BKE_animdata_action_ensure_idroot(), BKE_reportf(), BLI_assert, generic_assign_action_slot(), bAction::id, id_us_min(), id_us_plus(), ID::name, OK, RPT_ERROR, blender::animrig::Slot::unassigned, and UNUSED_VARS_NDEBUG.
Referenced by assign_action(), assign_tmpaction(), BKE_nla_tweakmode_exit(), move_slot(), and blender::animrig::tests::TEST_F().
| ActionSlotAssignmentResult blender::animrig::generic_assign_action_slot | ( | Slot * | slot_to_assign, |
| ID & | animated_id, | ||
| bAction *& | action_ptr_ref, | ||
| slot_handle_t & | slot_handle_ref, | ||
| char * | slot_name ) |
Generic function to build Slot-assignment logic.
This is a low-level function, intended as a building block for higher-level slot assignment functions.
Definition at line 1319 of file animrig/intern/action.cc.
References BLI_assert, BLI_strncpy_utf8(), ActionSlot::handle, is_id_using_action_slot(), blender::animrig::Slot::is_suitable_for(), MissingAction, ActionSlot::name, blender::animrig::Slot::name_length_max, OK, blender::animrig::Action::slot_for_handle(), blender::animrig::Action::slot_setup_for_id(), SlotNotFromAction, SlotNotSuitable, blender::animrig::Action::slots(), blender::animrig::Slot::unassigned, blender::animrig::Slot::users_add(), and blender::animrig::Slot::users_remove().
Referenced by assign_action_slot(), blender::animrig::nla::assign_action_slot(), generic_assign_action(), generic_assign_action_slot_handle(), move_slot(), and blender::animrig::tests::TEST_F().
| ActionSlotAssignmentResult blender::animrig::generic_assign_action_slot_handle | ( | slot_handle_t | slot_handle_to_assign, |
| ID & | animated_id, | ||
| bAction *& | action_ptr_ref, | ||
| slot_handle_t & | slot_handle_ref, | ||
| char * | slot_name ) |
Generic function to build Slot Handle-assignment logic.
This is a low-level function, intended as a building block for higher-level slot handle assignment functions.
Definition at line 1376 of file animrig/intern/action.cc.
References generic_assign_action_slot(), MissingAction, OK, and blender::animrig::Slot::unassigned.
Return the Action of this ID, or nullptr if it has none.
Definition at line 1445 of file animrig/intern/action.cc.
References AnimData::action, and BKE_animdata_from_id().
Referenced by action_fcurve_ensure(), action_slot_get_id_for_keying(), find_related_action(), insert_key_layered_action(), and merge_actions_selection_poll().
| std::optional< std::pair< Action *, Slot * > > blender::animrig::get_action_slot_pair | ( | ID & | animated_id | ) |
Get the Action and the Slot that animate this ID.
Definition at line 1459 of file animrig/intern/action.cc.
References AnimData::action, BKE_animdata_from_id(), blender::animrig::Action::slot_for_handle(), and AnimData::slot_handle.
Referenced by blender::animrig::tests::TEST_F().
|
static |
Definition at line 33 of file keyframing_auto.cc.
References AUTOKEY_FLAG_INSERTAVAILABLE, AUTOKEY_FLAG_INSERTNEEDED, AUTOKEY_MODE_EDITKEYS, flag, INSERTKEY_AVAILABLE, INSERTKEY_CYCLE_AWARE, INSERTKEY_MATRIX, INSERTKEY_NEEDED, INSERTKEY_NOFLAGS, INSERTKEY_REPLACE, is_autokey_mode(), is_keying_flag(), KEYING_FLAG_CYCLEAWARE, and KEYING_FLAG_VISUALKEY.
Referenced by autokeyframe_object(), autokeyframe_pose_channel(), and autokeyframe_property().
|
static |
Return the frame range of the span of keys.
Definition at line 793 of file animrig/intern/action.cc.
References FMod_Cycles::after_mode, FMod_Cycles::before_mode, BKE_fcurve_calc_range(), FModifier::data, FCM_EXTRAPOLATE_NONE, FCM_LIMIT_XMAX, FCM_LIMIT_XMIN, FMod_Limits::flag, FMODIFIER_TYPE_CYCLES, FMODIFIER_TYPE_LIMITS, max_ff(), MAXFRAMEF, min, min_ff(), MINAFRAMEF, FMod_Limits::rect, FModifier::type, rctf::xmax, and rctf::xmin.
Referenced by blender::animrig::Action::get_frame_range(), blender::animrig::Action::get_frame_range_of_keys(), and blender::animrig::Action::get_frame_range_of_slot().
| KeyframeSettings blender::animrig::get_keyframe_settings | ( | bool | from_userprefs | ) |
Helper function to generate the KeyframeSettings struct.
| from_userprefs | if true read the user preferences for the settings, else return static defaults. |
Definition at line 24 of file animrig/intern/fcurve.cc.
References BEZT_IPO_BEZ, BEZT_KEYTYPE_KEYFRAME, HD_AUTO_ANIM, and blender::animrig::KeyframeSettings::keyframe_type.
Referenced by bake_fcurve(), bake_fcurve_segments(), insert_keyframe_value(), insert_keyframes(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), 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().
|
static |
Definition at line 355 of file animrig/intern/keyframing.cc.
References get_rna_values(), ptr, visualkey_can_use(), and visualkey_get_values().
Referenced by insert_key_layered_action(), insert_keyframe_direct(), and insert_keyframes().
|
static |
Definition at line 306 of file animrig/intern/keyframing.cc.
References BKE_reportf(), BLI_dynstr_appendf(), BLI_dynstr_free(), BLI_dynstr_get_cstring(), BLI_dynstr_new(), count, ELEM, MEM_freeN(), ID::name, PointerRNA::owner_id, ptr, RNA_property_ui_name(), and RPT_WARNING.
Referenced by nla_map_keyframe_values_and_generate_reports().
| eInsertKeyFlags blender::animrig::get_keyframing_flags | ( | Scene * | scene | ) |
Get the settings for key-framing from the given scene.
Definition at line 243 of file animrig/intern/keyframing.cc.
References flag, INSERTKEY_CYCLE_AWARE, INSERTKEY_MATRIX, INSERTKEY_NEEDED, INSERTKEY_NOFLAGS, is_keying_flag(), KEYING_FLAG_CYCLEAWARE, KEYING_FLAG_VISUALKEY, and MANUALKEY_FLAG_INSERTNEEDED.
Referenced by achannel_setting_slider_cb(), achannel_setting_slider_nla_curve_cb(), add_default_keyingset_exec(), add_keyingset_button_exec(), insert_action_keys(), and insert_graph_keys().
| Vector< float > blender::animrig::get_rna_values | ( | PointerRNA * | ptr, |
| PropertyRNA * | prop ) |
Get the values of the given property. Casts non-float properties to float.
Definition at line 16 of file anim_rna.cc.
References length(), MEM_freeN(), MEM_malloc_arrayN, PROP_BOOLEAN, PROP_ENUM, PROP_FLOAT, PROP_INT, ptr, RNA_property_array_check(), RNA_property_array_length(), RNA_property_boolean_get(), RNA_property_boolean_get_array(), RNA_property_enum_get(), RNA_property_float_get(), RNA_property_float_get_array(), RNA_property_int_get(), RNA_property_int_get_array(), and RNA_property_type().
Referenced by fcurve_is_changed(), get_keyframe_values(), and visualkey_get_values().
| StringRef blender::animrig::get_rotation_mode_path | ( | eRotationModes | rotation_mode | ) |
Get the rna path for the given rotation mode.
Definition at line 73 of file anim_rna.cc.
References ROT_MODE_AXISANGLE, and ROT_MODE_QUAT.
Referenced by autokeyframe_object(), and autokeyframe_pose().
|
static |
Definition at line 85 of file animrig/intern/action.cc.
References BLI_assert, MEM_SAFE_FREE, and blender::uninitialized_relocate_n().
Referenced by grow_array_and_append().
|
static |
Definition at line 98 of file animrig/intern/action.cc.
References grow_array().
Referenced by blender::animrig::ChannelBag::channel_group_create(), blender::animrig::StripKeyframeData::channelbag_for_slot_add(), blender::animrig::ChannelBag::fcurve_append(), blender::animrig::Action::layer_add(), blender::animrig::Action::slot_add(), blender::animrig::Layer::strip_add(), and blender::animrig::Action::strip_keyframe_data_append().
|
static |
Definition at line 105 of file animrig/intern/action.cc.
References BLI_assert, MEM_SAFE_FREE, and blender::uninitialized_relocate_n().
Referenced by blender::animrig::ChannelBag::fcurve_create().
Get (or add relevant data to be able to do so) the Active Action for the given Animation Data block, given an ID block where the Animation Data should reside.
Definition at line 195 of file animdata.cc.
References AnimData::action, assign_action(), BKE_action_add(), BKE_animdata_ensure_id(), BKE_id_owner_get(), BLI_assert, BLI_assert_msg, DATA_, DEG_id_tag_update(), DEG_relations_tag_update(), find_related_action(), Key::from, GS, bAction::id, ID_FLAG_EMBEDDED_DATA, ID_KE, ID_RECALC_ANIMATION_NO_FLUSH, id_us_min(), ID::name, printf, SNPRINTF, UNUSED_VARS_NDEBUG, ID::us, and USER_EXPERIMENTAL_TEST.
Referenced by AnimationImporter::apply_matrix_curves(), blender::ed::object::followpath_path_animate_exec(), get_animation_curves(), blender::io::usd::import_blendshapes(), insert_keyframes(), blender::ed::object::parent_set(), sequencer_paste_animation(), blender::interface::tests::CopyDriversToSelected::SetUp(), and AnimationImporter::translate_Animations().
| void blender::animrig::initialize_bezt | ( | BezTriple * | beztr, |
| float2 | position, | ||
| const KeyframeSettings & | settings, | ||
| eFCurve_Flags | fcu_flags ) |
Initialize the given BezTriple with default values.
Definition at line 281 of file animrig/intern/fcurve.cc.
References BezTriple::amplitude, BezTriple::back, BEZKEYTYPE_LVALUE, BEZT_IPO_BEZ, BEZT_IPO_CONST, BEZT_IPO_LIN, BezTriple::f1, BezTriple::f2, BezTriple::f3, FCURVE_DISCRETE_VALUES, FCURVE_INT_VALUES, BezTriple::h1, BezTriple::h2, BezTriple::ipo, BezTriple::period, SELECT, and BezTriple::vec.
Referenced by bake_fcurve(), and insert_vert_fcurve().
| int blender::animrig::insert_bezt_fcurve | ( | FCurve * | fcu, |
| const BezTriple * | bezt, | ||
| eInsertKeyFlags | flag ) |
Lesser Key-framing API call.
Use this when validation of necessary animation data isn't necessary as it already exists, and there is a BezTriple that can be directly copied into the array.
This function adds a given BezTriple to an F-Curve. It will allocate memory for the array if needed, and will insert the BezTriple into a suitable place in chronological order.
Definition at line 145 of file animrig/intern/fcurve.cc.
References FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_get_cycle_type(), ELEM, FCU_CYCLE_PERFECT, flag, FCurve::fpt, INSERTKEY_CYCLE_AWARE, INSERTKEY_OVERWRITE_FULL, INSERTKEY_REPLACE, MEM_callocN, MEM_freeN(), replace_bezt_keyframe_ypos(), FCurve::totvert, and BezTriple::vec.
Referenced by clean_fcurve(), decimate_fcurve(), insert_vert_fcurve(), and paste_animedit_keys_fcurve().
|
static |
Definition at line 839 of file animrig/intern/keyframing.cc.
References blender::animrig::KeyInsertData::array_index, assert_baklava_phase_1_invariants(), BLI_assert, blender::animrig::Strip::data(), insert_key_layer(), and blender::animrig::KeyInsertData::position.
Referenced by insert_key_layer(), and insert_key_layered_action().
|
static |
Definition at line 864 of file animrig/intern/keyframing.cc.
References blender::animrig::CombinedKeyingResult::add(), assign_action_ensure_slot_for_keying(), BLI_assert, BLI_assert_msg, default_channel_group_for_path(), DEG_id_tag_update(), ELEM, get_action(), get_keyframe_values(), blender::animrig::Action::get_layer_for_keyframing(), bAction::id, ID_RECALC_ANIMATION_NO_FLUSH, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), insert_key_layer(), insert_key_layered_action(), INSERTKEY_MATRIX, blender::animrig::Action::is_action_layered(), blender::animrig::Action::layer_keystrip_ensure(), ActionSlot::name, PointerRNA::owner_id, ptr, RNA_path_from_ID_to_property(), RNA_path_resolve_property(), and RNA_property_subtype().
Referenced by insert_key_layered_action(), and insert_keyframes().
|
static |
Definition at line 782 of file animrig/intern/keyframing.cc.
References blender::animrig::CombinedKeyingResult::add(), BLI_assert, default_channel_group_for_path(), insert_key_legacy_action(), insert_keyframe_fcurve_value(), and ptr.
Referenced by insert_key_legacy_action(), and insert_keyframes().
| bool blender::animrig::insert_keyframe_direct | ( | ReportList * | reports, |
| PointerRNA | ptr, | ||
| PropertyRNA * | prop, | ||
| FCurve * | fcu, | ||
| const AnimationEvalContext * | anim_eval_context, | ||
| eBezTriple_KeyframeType | keytype, | ||
| NlaKeyframingContext * | nla_context, | ||
| eInsertKeyFlags | flag ) |
Secondary Insert Key-framing API call.
Use this when validation of necessary animation data is not necessary, since an RNA-pointer to the necessary data being keyframed, and a pointer to the F-Curve to use have both been provided.
This function can't keyframe quaternion channels on some NLA strip types.
| keytype | The "keyframe type" (eBezTriple_KeyframeType), as shown in the Dope Sheet. |
| flag | Used for special settings that alter the behavior of the keyframe insertion. These include the 'visual' key-framing modes, quick refresh, and extra keyframe filtering. |
Definition at line 424 of file animrig/intern/keyframing.cc.
References FCurve::array_index, BKE_report(), BKE_reportf(), PointerRNA::data, AnimationEvalContext::eval_time, flag, get_keyframe_values(), insert_keyframe_value(), INSERTKEY_MATRIX, ID::name, nla_map_keyframe_values_and_generate_reports(), PointerRNA::owner_id, ptr, FCurve::rna_path, RNA_path_resolve_property(), RPT_, RPT_ERROR, SUCCESS, and update_autoflags_fcurve_direct().
Referenced by achannel_setting_slider_cb(), achannel_setting_slider_nla_curve_cb(), and autokeyframe_property().
|
static |
Find or create the FCurve based on the given path, and insert the specified value into it.
Definition at line 506 of file animrig/intern/keyframing.cc.
References action_fcurve_ensure(), BLI_assert, CANNOT_CREATE_FCURVE, fcurve_find_in_action(), flag, bAction::frame_end, bAction::frame_start, insert_keyframe_value(), INSERTKEY_CYCLE_AWARE, key_insertion_may_create_fcurve(), make_new_fcurve_cyclic(), ptr, result, FCurve::totvert, and update_autoflags_fcurve_direct().
Referenced by insert_key_legacy_action().
|
static |
Definition at line 411 of file animrig/intern/keyframing.cc.
References BKE_fcurve_is_keyframable(), FCURVE_NOT_KEYFRAMEABLE, flag, get_keyframe_settings(), insert_vert_fcurve(), and INSERTKEY_NO_USERPREF.
Referenced by insert_keyframe_direct(), and insert_keyframe_fcurve_value().
| CombinedKeyingResult blender::animrig::insert_keyframes | ( | Main * | bmain, |
| PointerRNA * | struct_pointer, | ||
| std::optional< StringRefNull > | channel_group, | ||
| const blender::Span< RNAPath > | rna_paths, | ||
| std::optional< float > | scene_frame, | ||
| const AnimationEvalContext & | anim_eval_context, | ||
| eBezTriple_KeyframeType | key_type, | ||
| eInsertKeyFlags | insert_key_flags ) |
Main key-frame insertion API.
Insert keys for struct_pointer, for all paths in rna_paths. Any necessary animation data (AnimData, Action, ...) is created if it doesn't already exist.
Note that this function was created as part of an ongoing refactor by merging two other functions that were almost identical to each other. There are still things left over from that which can and should be improved (such as the partially redundant scene_frame and anim_eval_contextparameters). Additionally, it's a bit of a mega-function now, and can probably be stripped down to a clearer core functionality.
| struct_pointer | RNA pointer to the struct to be keyed. This is often an ID, but not necessarily. For example, pose bones are also common. Note that if you have an ID and want to pass it here for keying, you can create the PointerRNA for it with RNA_id_pointer_create(). |
| channel_group | the channel group to put any newly created fcurves under. If not given, the standard groups are used. |
| rna_paths | the RNA paths to key. These paths are relative to struct_pointer. Note that for paths to array properties, if the array index is specified then only that element is keyed, but if the index is not specified then all array elements are keyed. |
| scene_frame | the frame to insert the keys at. This is in scene time, not NLA mapped (NLA mapping is already handled internally by this function). If not given, the evaluation time from anim_eval_context is used instead. |
Definition at line 952 of file animrig/intern/keyframing.cc.
References AnimData::action, blender::animrig::legacy::action_treat_as_legacy(), blender::animrig::CombinedKeyingResult::add(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), FCurve::bezt, BKE_animdata_ensure_id(), BKE_animsys_free_nla_keyframing_context_cache(), BKE_animsys_nla_remap_keyframe_values(), BKE_fcurve_bezt_binarysearch_index(), BLI_assert, DEG_id_tag_update(), ELEM, AnimationEvalContext::eval_time, fcurve_find_in_action(), blender::animrig::CombinedKeyingResult::get_count(), get_keyframe_settings(), get_keyframe_values(), bAction::id, id_action_ensure(), ID_RECALC_ANIMATION_NO_FLUSH, insert_key_layered_action(), insert_key_legacy_action(), insert_keyframes(), INSERTKEY_AVAILABLE, INSERTKEY_MATRIX, INSERTKEY_NO_USERPREF, INSERTKEY_REPLACE, blender::animrig::KeyframeSettings::keyframe_type, blender::animrig::CombinedKeyingResult::merge(), nla_time_remap(), PointerRNA::owner_id, ptr, RNA_id_pointer_create(), RNA_path_from_ID_to_property(), RNA_path_resolve_property(), blender::Span< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and FCurve::totvert.
Referenced by achannel_setting_slider_shapekey_cb(), autokeyframe_object(), autokeyframe_pose_channel(), autokeyframe_property(), insert_keyframes(), 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(), 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(), 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(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
| SingleKeyingResult blender::animrig::insert_vert_fcurve | ( | FCurve * | fcu, |
| const float2 | position, | ||
| const KeyframeSettings & | settings, | ||
| eInsertKeyFlags | flag ) |
Main Key-framing API call.
Use this when validation of necessary animation data isn't necessary as it already exists. It will insert a keyframe using the current value being keyframed.
This function is a wrapper for insert_bezt_fcurve(), and should be used when adding a new keyframe to a curve, when the keyframe doesn't exist anywhere else yet.
| keyframe_type | The type of keyframe (eBezTriple_KeyframeType). |
| flag | Optional flags (eInsertKeyFlags) for controlling how keys get added and/or whether updates get done. |
Definition at line 410 of file animrig/intern/fcurve.cc.
References FCurve::bezt, BKE_fcurve_active_keyframe_set(), BKE_fcurve_get_cycle_type(), BKE_fcurve_handles_recalc(), BLI_assert, FCU_CYCLE_PERFECT, FCurve::flag, flag, initialize_bezt(), insert_bezt_fcurve(), INSERTKEY_CYCLE_AWARE, INSERTKEY_FAST, INSERTKEY_NEEDED, INSERTKEY_OVERWRITE_FULL, INSERTKEY_REPLACE, BezTriple::ipo, new_key_needed(), NO_KEY_NEEDED, remap_cyclic_keyframe_location(), subdivide_nonauto_handles(), SUCCESS, FCurve::totvert, and UNKNOWN_FAILURE.
Referenced by bake_fcurve_segments(), insert_keyframe_value(), blender::animrig::StripKeyframeData::keyframe_insert(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::animrig::tests::TEST_F(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
Return whether the given Action can be assigned to the ID.
This always returns true for layered Actions. For legacy Actions it returns true if the Action's idroot matches the ID.
Definition at line 1400 of file animrig/intern/action.cc.
References blender::animrig::legacy::action_treat_as_legacy(), and bAction::idroot.
Referenced by blender::animrig::tests::TEST_F().
| bool blender::animrig::is_autokey_mode | ( | const Scene * | scene, |
| eAutokey_Mode | mode ) |
Check the mode for auto-keyframing (per scene takes precedence).
Definition at line 73 of file keyframing_auto.cc.
Referenced by autokeyframe_cfra_can_key(), and get_autokey_flags().
| bool blender::animrig::is_autokey_on | ( | const Scene * | scene | ) |
Check if auto-key-framing is enabled (per scene takes precedence).
Definition at line 65 of file keyframing_auto.cc.
References AUTOKEY_ON.
Referenced by autokeyframe_cfra_can_key(), autokeyframe_property(), createTransGPencil_curves(), createTransGPencil_strokes(), blender::ed::transform::greasepencil::createTransGreasePencilVerts(), blender::ed::greasepencil::ensure_active_keyframe(), blender::ed::sculpt_paint::ensure_editable_drawings(), mask_normals_make_consistent_exec(), mask_switch_direction_exec(), blender::ed::object::object_clear_transform_generic_exec(), recalcData_objects(), recalcData_pose(), recalcData_sequencer_image(), slide_point_modal(), slide_spline_curvature_modal(), snap_sel_to_grid_exec(), snap_selected_to_location(), special_aftertrans_update__mask(), special_aftertrans_update__object(), special_aftertrans_update__pose(), special_aftertrans_update__sequencer_image(), viewRedrawForce(), and viewRedrawPost().
|
static |
Definition at line 89 of file evaluation.cc.
References BKE_fcurve_is_empty(), FCURVE_DISABLED, FCURVE_MUTED, and FCurve::flag.
Referenced by evaluate_keyframe_data().
|
static |
Definition at line 1248 of file animrig/intern/action.cc.
References foreach_action_slot_use().
Referenced by generic_assign_action_slot().
| bool blender::animrig::is_keying_flag | ( | const Scene * | scene, |
| eKeying_Flag | flag ) |
Check if a flag is set for keyframing (per scene takes precedence).
Definition at line 235 of file animrig/intern/keyframing.cc.
References flag.
Referenced by ANIM_get_keyingset_for_autokeying(), animrecord_check_state(), autokeyframe_object(), autokeyframe_object(), autokeyframe_pose(), autokeyframe_pose_channel(), autokeyframe_sequencer_image(), get_autokey_flags(), get_keyframing_flags(), and blender::nodes::inverse_eval::set_rna_property().
| bool blender::animrig::key_insertion_may_create_fcurve | ( | eInsertKeyFlags | insert_key_flags | ) |
Return whether key insertion functions are allowed to create new fcurves, according to the given flags.
Specifically, both INSERTKEY_REPLACE and INSERTKEY_AVAILABLE prohibit the creation of new F-Curves.
Definition at line 264 of file animrig/intern/keyframing.cc.
References INSERTKEY_AVAILABLE, and INSERTKEY_REPLACE.
Referenced by insert_keyframe_fcurve_value(), and blender::animrig::StripKeyframeData::keyframe_insert().
|
static |
Definition at line 273 of file animrig/intern/action.cc.
Referenced by blender::animrig::Action::layer_remove().
|
static |
Used to make curves newly added to a cyclic Action cycle with the correct period.
Definition at line 270 of file animrig/intern/keyframing.cc.
References add_fmodifier(), FCurve::bezt, ListBase::first, floorf, FMODIFIER_TYPE_CYCLES, MEM_reallocN, FCurve::modifiers, FCurve::totvert, and BezTriple::vec.
Referenced by insert_keyframe_fcurve_value().
| void blender::animrig::move_slot | ( | Main & | bmain, |
| Slot & | slot, | ||
| Action & | from_action, | ||
| Action & | to_action ) |
Move the given slot from from_action to to_action. The slot name might not be exactly the same if the name already exists in the slots of to_action. Also the slot handle is likely going to be different on to_action. All users of the slot will be reassigned to the moved slot on to_action.
from_action will not be deleted by this function. But it might leave it without users which means it will not be saved (unless it has a fake user). Definition at line 2769 of file animrig/intern/action.cc.
References assert_baklava_phase_1_invariants(), BLI_assert, BLI_assert_msg, ActionStripKeyframeData::channelbag_array, ActionStripKeyframeData::channelbag_array_num, blender::animrig::StripKeyframeData::channelbag_for_slot(), clone_slot(), blender::animrig::StripKeyframeData::find_channelbag_index(), foreach_action_slot_use_with_references(), generic_assign_action(), generic_assign_action_slot(), ActionSlot::handle, blender::animrig::Action::layer(), move_slot(), blender::animrig::Action::slot_add(), ActionChannelBag::slot_handle, slot_name_ensure_unique(), blender::animrig::Action::slot_remove(), blender::animrig::Action::slots(), UNUSED_VARS_NDEBUG, and blender::animrig::Slot::users().
Referenced by merge_actions_selection_exec(), move_slot(), and blender::animrig::tests::TEST_F().
|
static |
Return whether the given fcurve already evaluates to the same value as the proposed keyframe at the keyframe's time.
This is a helper function for determining whether to insert a keyframe or not when "only insert needed" is enabled.
NOTE: this does not determine whether inserting the keyframe would change the fcurve at points other than the keyframe itself. For example, even if inserting the key wouldn't change the fcurve's value at the time of the keyframe, the resulting changes to bezier interpolation could change the fcurve on either side of it. This function intentionally does not account for that, since that's not how the "only insert needed" feature is supposed to work.
Definition at line 343 of file animrig/intern/fcurve.cc.
References FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), compare_ff_relative(), evaluate_fcurve(), FCurve::totvert, and BezTriple::vec.
Referenced by insert_vert_fcurve().
|
static |
Definition at line 372 of file animrig/intern/keyframing.cc.
References BKE_animsys_nla_remap_keyframe_values(), get_keyframe_values_create_reports(), and ptr.
Referenced by insert_keyframe_direct().
|
static |
Definition at line 390 of file animrig/intern/keyframing.cc.
References AnimData::action, BKE_animsys_get_nla_keyframing_context(), BKE_nla_tweakedit_remap(), NLATIME_CONVERT_UNMAP, and time.
Referenced by insert_keyframes().
| void blender::animrig::pose_apply_action_all_bones | ( | Object * | ob, |
| bAction * | action, | ||
| const int32_t | slot_handle, | ||
| const AnimationEvalContext * | anim_eval_context ) |
Definition at line 96 of file pose.cc.
References animsys_evaluate_action(), Object::id, and RNA_id_pointer_create().
| void blender::animrig::pose_apply_action_all_bones | ( | Object * | ob, |
| bAction * | action, | ||
| slot_handle_t | slot_handle, | ||
| const AnimationEvalContext * | anim_eval_context ) |
Evaluate the action and apply it to the pose. Ignore selection state of the bones.
Referenced by action_preview_render_prepare().
| void blender::animrig::pose_apply_action_blend | ( | Object * | ob, |
| bAction * | action, | ||
| const int32_t | slot_handle, | ||
| const AnimationEvalContext * | anim_eval_context, | ||
| const float | blend_factor ) |
Definition at line 105 of file pose.cc.
References animsys_blend_in_action(), and ptr.
| void blender::animrig::pose_apply_action_blend | ( | Object * | ob, |
| bAction * | action, | ||
| slot_handle_t | slot_handle, | ||
| const AnimationEvalContext * | anim_eval_context, | ||
| float | blend_factor ) |
Referenced by poselib_blend_apply().
| void blender::animrig::pose_apply_action_selected_bones | ( | Object * | ob, |
| bAction * | action, | ||
| const int32_t | slot_handle, | ||
| const AnimationEvalContext * | anim_eval_context ) |
Definition at line 81 of file pose.cc.
References animsys_evaluate_action(), and ptr.
| void blender::animrig::pose_apply_action_selected_bones | ( | Object * | ob, |
| bAction * | action, | ||
| slot_handle_t | slot_handle, | ||
| const AnimationEvalContext * | anim_eval_context ) |
Evaluate the action and apply it to the pose. If any pose bones are selected, only FCurves that relate to those bones are evaluated.
| void blender::animrig::reevaluate_fcurve_errors | ( | bAnimContext * | ac | ) |
Iterate the FCurves of the given bAnimContext and validate the RNA path. Sets the flag FCURVE_DISABLED if the path can't be resolved.
Definition at line 334 of file animdata.cc.
References bAnimContext::ads, ADS_FILTER_ONLY_ERRORS, ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FCURVESONLY, bAnimContext::data, bAnimContext::datatype, FCURVE_DISABLED, bDopeSheet::filterflag, FCurve::flag, LISTBASE_FOREACH, ptr, RNA_id_pointer_create(), FCurve::rna_path, and RNA_path_resolve_property().
|
static |
Move the point where a key is about to be inserted to be inside the main cycle range. Returns the type of the cycle if it is enabled and valid.
Definition at line 372 of file animrig/intern/fcurve.cc.
References FMod_Cycles::after_mode, FCurve::bezt, FCM_EXTRAPOLATE_CYCLIC_OFFSET, FCU_CYCLE_NONE, FCU_CYCLE_OFFSET, ListBase::first, floorf, FCurve::modifiers, FCurve::totvert, and BezTriple::vec.
Referenced by insert_vert_fcurve().
|
static |
Definition at line 497 of file animrig/intern/fcurve.cc.
References ALL, FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_delete_keys(), BKE_fcurve_delete_keys_all(), IN_RANGE, OUT_RANGE, and FCurve::totvert.
Referenced by bake_fcurve().
|
static |
Definition at line 128 of file animrig/intern/fcurve.cc.
References BezTriple::f1, BezTriple::f2, BezTriple::f3, and BezTriple::vec.
Referenced by insert_bezt_fcurve().
| void blender::animrig::sample_fcurve_segment | ( | const FCurve * | fcu, |
| float | start_frame, | ||
| float | sample_rate, | ||
| float * | samples, | ||
| int | sample_count ) |
| sample_rate | indicates how many samples per frame should be generated. |
| r_samples | Is expected to be an array large enough to hold sample_count. |
Definition at line 485 of file animrig/intern/fcurve.cc.
References evaluate_fcurve(), and float.
Referenced by bake_fcurve(), btw_smooth_allocate_operator_data(), btw_smooth_graph_keys(), gaussian_smooth_allocate_operator_data(), and gaussian_smooth_graph_keys().
|
static |
Definition at line 121 of file animrig/intern/action.cc.
References BLI_assert, MEM_freeN(), and blender::uninitialized_move_n().
|
static |
Definition at line 134 of file animrig/intern/action.cc.
References BLI_assert, MEM_freeN(), and blender::uninitialized_move_n().
|
static |
Same as shrink_array_and_remove() above, except instead of shifting all the elements after the removed item over to fill the gap, it just swaps in the last element to where the removed element was.
Definition at line 153 of file animrig/intern/action.cc.
References BLI_assert, MEM_freeN(), and blender::uninitialized_move_n().
Referenced by blender::animrig::Action::strip_keyframe_data_remove_if_unused().
Definition at line 376 of file animrig/intern/action.cc.
References BLI_uniquename_cb(), ActionSlot::name, and STREQ.
Referenced by move_slot(), blender::animrig::Action::slot_add(), and blender::animrig::Action::slot_name_define().
|
static |
Definition at line 514 of file animrig/intern/action.cc.
Referenced by blender::animrig::Action::slot_remove().
|
static |
Definition at line 930 of file animrig/intern/action.cc.
Referenced by blender::animrig::Layer::strip_remove().
|
static |
Update the FCurve to allow insertion of bezt without modifying the curve shape.
Checks whether it is necessary to apply Bezier subdivision due to involvement of non-auto handles. If necessary, changes bezt handles from Auto to Aligned.
| bezt | key being inserted |
| prev | keyframe before that key |
| next | keyframe after that key |
Definition at line 239 of file animrig/intern/fcurve.cc.
References FCurve::auto_smoothing, BEZT_IPO_BEZ, BEZT_IS_AUTOH, BKE_fcurve_bezt_subdivide_handles(), fabsf, FCURVE_SMOOTH_CONT_ACCEL, BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_VECT, BezTriple::ipo, next, and BezTriple::vec.
Referenced by insert_vert_fcurve().
|
nodiscard |
Un-assign the Action assigned to this ID.
Same as calling assign_action(nullptr, animated_id).
Definition at line 1191 of file animrig/intern/action.cc.
References assign_action().
Referenced by animrecord_check_state(), BKE_animdata_free(), BKE_animdata_transfer_by_basepath(), BKE_nla_action_pushdown(), blender::ed::space_node::node_group_ungroup(), blender::animrig::tests::TEST_F(), and blender::animrig::tests::TEST_F().
|
nodiscard |
Un-assign the Action assigned to this ID.
Same as calling assign_action(nullptr, owned_adt).
Definition at line 1196 of file animrig/intern/action.cc.
References assign_action().
| void blender::animrig::update_autoflags_fcurve_direct | ( | FCurve * | fcu, |
| PropertyRNA * | prop ) |
Definition at line 213 of file animrig/intern/keyframing.cc.
References FCURVE_DISCRETE_VALUES, FCURVE_INT_VALUES, FCurve::flag, PROP_FLOAT, PROP_INT, and RNA_property_type().
Referenced by insert_keyframe_direct(), insert_keyframe_fcurve_value(), and update_autoflags_fcurve().
| bool blender::animrig::visualkey_can_use | ( | PointerRNA * | ptr, |
| PropertyRNA * | prop ) |
This helper function determines if visual-keyframing should be used when inserting keyframes for the given channel. As visual-keyframing only works on Object and Pose-Channel blocks, this should only get called for those block-types, when using "standard" keying but 'Visual Keying' option in Auto-Keying settings is on.
Definition at line 37 of file visualkey.cc.
References BLI_assert_msg, bPoseChannel::constflag, CONSTRAINT_DISABLE, CONSTRAINT_TYPE_ARMATURE, CONSTRAINT_TYPE_CHILDOF, CONSTRAINT_TYPE_DAMPTRACK, CONSTRAINT_TYPE_DISTLIMIT, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_LOCKTRACK, CONSTRAINT_TYPE_LOCLIKE, CONSTRAINT_TYPE_LOCLIMIT, CONSTRAINT_TYPE_MINMAX, CONSTRAINT_TYPE_ROTLIKE, CONSTRAINT_TYPE_ROTLIMIT, CONSTRAINT_TYPE_SIZELIKE, CONSTRAINT_TYPE_SIZELIMIT, CONSTRAINT_TYPE_TRACKTO, CONSTRAINT_TYPE_TRANSFORM, CONSTRAINT_TYPE_TRANSLIKE, bPoseChannel::constraints, Object::constraints, PointerRNA::data, ELEM, bConstraint::enforce, ListBase::first, bConstraint::flag, bConstraint::next, bPoseChannel::parent, Object::parent, PCHAN_HAS_IK, PCHAN_INFLUENCED_BY_IK, printf, ptr, RBO_TYPE_ACTIVE, Object::rigidbody_object, RNA_property_identifier(), bConstraint::type, PointerRNA::type, RigidBodyOb::type, VISUALKEY_LOC, VISUALKEY_NONE, VISUALKEY_ROT, and VISUALKEY_SCA.
Referenced by get_keyframe_values().
| Vector< float > blender::animrig::visualkey_get_values | ( | PointerRNA * | ptr, |
| PropertyRNA * | prop ) |
This helper function extracts the value to use for visual-keyframing In the event that it is not possible to perform visual keying, try to fall-back to using the default method. Assumes that all data it has been passed is valid.
Definition at line 197 of file visualkey.cc.
References BKE_armature_mat_pose_to_bone(), bPoseChannel::bone, BONE_CONNECTED, copy_m4_m4(), PointerRNA::data, Bone::flag, get_rna_values(), mat4_to_axis_angle(), mat4_to_eulO(), mat4_to_quat(), mat4_to_size(), Bone::parent, bPoseChannel::pose_mat, ptr, RNA_property_identifier(), bPoseChannel::rotmode, Object::rotmode, and PointerRNA::type.
Referenced by get_keyframe_values().