Blender
V3.3
|
#include <float.h>
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "ED_keyframing.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_path.h"
#include "anim_intern.h"
Go to the source code of this file.
Classes | |
struct | tRKS_DSource |
Macros | |
#define | APPLY_KEYINGFLAG_OVERRIDE(kflag) |
Typedefs | |
typedef struct tRKS_DSource | tRKS_DSource |
Variables | |
static ListBase | keyingset_type_infos = {NULL, NULL} |
ListBase | builtin_keyingsets = {NULL, NULL} |
#define APPLY_KEYINGFLAG_OVERRIDE | ( | kflag | ) |
typedef struct tRKS_DSource tRKS_DSource |
|
static |
Definition at line 93 of file keyingsets.c.
References Scene::active_keyingset, ANIM_get_keyframing_flags(), BKE_keyingset_add(), BLI_listbase_count(), C, CTX_data_scene(), KEYINGSET_ABSOLUTE, Scene::keyingsets, NC_SCENE, ND_KEYINGSET, NULL, OPERATOR_FINISHED, scene, and WM_event_add_notifier().
Referenced by ANIM_OT_keying_set_add().
|
static |
Definition at line 180 of file keyingsets.c.
References Scene::active_keyingset, KeyingSet::active_path, BKE_report(), BLI_addtail(), BLI_findlink(), BLI_listbase_count(), C, CTX_data_scene(), KS_Path::flag, KS_Path::groupmode, ID_OB, KS_Path::idtype, Scene::keyingsets, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_KSNAME, MEM_callocN, OPERATOR_CANCELLED, OPERATOR_FINISHED, KeyingSet::paths, wmOperator::reports, RPT_ERROR, and scene.
Referenced by ANIM_OT_keying_set_path_add().
|
static |
Definition at line 269 of file keyingsets.c.
References Scene::active_keyingset, KeyingSet::active_path, all(), ANIM_get_keyframing_flags(), BKE_keyingset_add(), BKE_keyingset_add_path(), BKE_report(), BKE_reportf(), BLI_findlink(), BLI_listbase_count(), C, CTX_data_scene(), PointerRNA::data, INSERTKEY_XYZ2RGB, IS_AUTOKEY_FLAG, KEYINGSET_ABSOLUTE, Scene::keyingsets, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_KSNAME, MEM_freeN, KeyingSet::name, NC_SCENE, ND_KEYINGSET, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, PointerRNA::owner_id, KeyingSet::paths, wmOperator::ptr, ptr, wmOperator::reports, RNA_boolean_get(), RNA_path_from_ID_to_property(), RNA_property_animateable(), RPT_ERROR, RPT_INFO, scene, UI_context_active_but_prop_get(), and WM_event_add_notifier().
Referenced by ANIM_OT_keyingset_button_add().
int ANIM_apply_keyingset | ( | struct bContext * | C, |
ListBase * | dsources, | ||
struct bAction * | act, | ||
struct KeyingSet * | ks, | ||
short | mode, | ||
float | cfra | ||
) |
Use the specified KeyingSet and context info (if required) to add/remove various Keyframes on the specified frame.
Modify keyframes for the channels specified by the KeyingSet. This takes into account many of the different combinations of using KeyingSets.
Definition at line 1038 of file keyingsets.c.
References ANIM_get_keyframing_flags(), ANIM_validate_keyingset(), KS_Path::array_index, BKE_animsys_eval_context_construct(), BKE_animsys_free_nla_keyframing_context_cache(), BKE_reportf(), BLI_assert, C, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_data_scene(), CTX_wm_reports(), DEG_id_tag_update(), delete_keyframe(), depsgraph, error(), ListBase::first, KS_Path::flag, KS_Path::group, KS_Path::groupmode, GS, KS_Path::id, Object::id, ID_OB, ID_RECALC_ANIMATION_NO_FLUSH, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, insert_keyframe(), ToolSettings::keyframe_type, KS_Path::keyingflag, KeyingSet::keyingflag, KS_Path::keyingoverride, KeyingSet::keyingoverride, keyingset_apply_keying_flags(), KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_KSNAME, KSP_GROUP_NONE, MODIFYKEY_MODE_DELETE, MODIFYKEY_MODE_INSERT, NA_ADDED, KeyingSet::name, ID::name, NC_ANIMATION, ND_KEYFRAME, KS_Path::next, NULL, KeyingSet::paths, ptr, RNA_id_pointer_create(), KS_Path::rna_path, RNA_path_resolve_property(), RNA_property_array_length(), RPT_WARNING, scene, Scene::toolsettings, and WM_main_add_notifier().
Referenced by autokeyframe_object(), autokeyframe_pose(), delete_key_using_keying_set(), ED_autokeyframe_object(), ED_autokeyframe_pchan(), ED_view3d_camera_autokey(), insert_key_exec(), pose_clear_transform_generic_exec(), poseAnim_mapping_autoKeyframe(), poselib_add_exec(), and poselib_keytag_pose().
Find builtin KeyingSet by name.
Definition at line 531 of file keyingsets.c.
References builtin_keyingsets, ListBase::first, KeyingSet::idname, KeyingSet::next, NULL, and STREQ.
Referenced by ANIM_get_keyingset_for_autokeying(), autokeyframe_object(), autokeyframe_pose(), pose_flip_quats_exec(), and poselib_add_exec().
Definition at line 696 of file keyingsets.c.
References Scene::active_keyingset, ANIM_builtin_keyingset_get_named(), ANIM_KS_AVAILABLE_ID, ANIM_scene_get_active_keyingset(), IS_AUTOKEY_FLAG, NULL, and scene.
Referenced by ED_view3d_camera_autokey(), object_clear_transform_generic_exec(), pose_clear_transform_generic_exec(), pose_paste_exec(), poseAnim_mapping_autoKeyframe(), poselib_keytag_pose(), snap_sel_to_grid_exec(), and snap_selected_to_location().
const EnumPropertyItem* ANIM_keying_sets_enum_itemf | ( | bContext * | C, |
PointerRNA * | UNUSEDptr, | ||
PropertyRNA * | UNUSEDprop, | ||
bool * | r_free | ||
) |
Definition at line 779 of file keyingsets.c.
References Scene::active_keyingset, ANIM_keyingset_context_ok_poll(), builtin_keyingsets, C, CTX_data_scene(), KeyingSet::description, DummyRNA_DEFAULT_items, ListBase::first, EnumPropertyItem::identifier, KeyingSet::idname, Scene::keyingsets, KeyingSet::name, KeyingSet::next, NULL, RNA_enum_item_add(), RNA_enum_item_add_separator(), RNA_enum_item_end(), and scene.
Referenced by ANIM_OT_keyframe_delete(), ANIM_OT_keyframe_insert(), ANIM_OT_keyframe_insert_menu(), and ANIM_OT_keying_set_active_set().
Check if KeyingSet can be used in the current context.
Definition at line 878 of file keyingsets.c.
References ANIM_keyingset_info_find_name(), C, KeyingSet::flag, KEYINGSET_ABSOLUTE, NULL, KeyingSetInfo::poll, and KeyingSet::typeinfo.
Referenced by ANIM_keying_sets_enum_itemf(), and anim_keyingset_visit_for_search_impl().
Check if the ID appears in the paths specified by the KeyingSet.
Definition at line 632 of file keyingsets.c.
References BLI_findptr(), ELEM, NULL, and KeyingSet::paths.
Referenced by insert_key_exec().
Get the keying set from enum values generated in ANIM_keying_sets_enum_itemf.
Type is the Keying Set the user specified to use when calling the operator:
type |
|
Definition at line 847 of file keyingsets.c.
References Scene::active_keyingset, BLI_findlink(), builtin_keyingsets, Scene::keyingsets, NULL, scene, and type.
Referenced by keyingset_get_from_op_with_error().
Definition at line 864 of file keyingsets.c.
References BLI_findstring(), builtin_keyingsets, Scene::keyingsets, NULL, and scene.
Referenced by keyingset_get_from_op_with_error().
KeyingSetInfo* ANIM_keyingset_info_find_name | ( | const char | name[] | ) |
Find KeyingSet type info given a name.
Definition at line 520 of file keyingsets.c.
References BLI_findstring(), keyingset_type_infos, and NULL.
Referenced by ANIM_keyingset_context_ok_poll(), and ANIM_validate_keyingset().
void ANIM_keyingset_info_register | ( | KeyingSetInfo * | ksi | ) |
Add the given KeyingSetInfo to the list of type infos, and create an appropriate builtin set too.
Definition at line 566 of file keyingsets.c.
References BKE_keyingset_add(), BLI_addtail(), BLI_strncpy(), builtin_keyingsets, KeyingSetInfo::description, KeyingSet::description, KeyingSetInfo::idname, KeyingSetInfo::keyingflag, keyingset_type_infos, KeyingSetInfo::name, and KeyingSet::typeinfo.
void ANIM_keyingset_info_unregister | ( | struct Main * | bmain, |
KeyingSetInfo * | ksi | ||
) |
Remove the given KeyingSetInfo from the list of type infos, and also remove the builtin set if appropriate.
Definition at line 585 of file keyingsets.c.
References BKE_keyingset_free(), BLI_freelinkN(), BLI_remlink(), BLI_remlink_safe(), builtin_keyingsets, ListBase::first, Scene::id, KeyingSetInfo::idname, keyingset_type_infos, Scene::keyingsets, MEM_freeN, KeyingSet::next, ID::next, scene, Main::scenes, STREQ, and KeyingSet::typeinfo.
Definition at line 613 of file keyingsets.c.
References BKE_keyingsets_free(), BLI_freelinkN(), builtin_keyingsets, ExtensionRNA::data, ListBase::first, ExtensionRNA::free, keyingset_type_infos, KeyingSetInfo::next, next, and KeyingSetInfo::rna_ext.
Referenced by WM_exit_ex().
void ANIM_keyingset_visit_for_search | ( | const bContext * | C, |
PointerRNA * | UNUSEDptr, | ||
PropertyRNA * | UNUSEDprop, | ||
const char * | UNUSEDedit_text, | ||
StringPropertySearchVisitFunc | visit_fn, | ||
void * | visit_user_data | ||
) |
Definition at line 757 of file keyingsets.c.
References anim_keyingset_visit_for_search_impl(), and C.
|
static |
Definition at line 711 of file keyingsets.c.
References Scene::active_keyingset, ANIM_keyingset_context_ok_poll(), builtin_keyingsets, C, CTX_data_scene(), ListBase::first, KeyingSet::idname, StringPropertySearchVisitParams::info, Scene::keyingsets, KeyingSet::name, KeyingSet::next, NULL, scene, and StringPropertySearchVisitParams::text.
Referenced by ANIM_keyingset_visit_for_search(), and ANIM_keyingset_visit_for_search_no_poll().
void ANIM_keyingset_visit_for_search_no_poll | ( | const bContext * | C, |
PointerRNA * | UNUSEDptr, | ||
PropertyRNA * | UNUSEDprop, | ||
const char * | UNUSEDedit_text, | ||
StringPropertySearchVisitFunc | visit_fn, | ||
void * | visit_user_data | ||
) |
Definition at line 767 of file keyingsets.c.
References anim_keyingset_visit_for_search_impl(), and C.
Referenced by ANIM_OT_keyframe_delete_by_name(), and ANIM_OT_keyframe_insert_by_name().
void ANIM_OT_keying_set_active_set | ( | wmOperatorType * | ot | ) |
Definition at line 486 of file keyingsets.c.
References ANIM_keying_sets_enum_itemf(), wmOperatorType::description, DummyRNA_DEFAULT_items, ED_operator_areaactive(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, keyingset_active_menu_exec(), keyingset_active_menu_invoke(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_enum(), RNA_def_enum_funcs(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
void ANIM_OT_keying_set_add | ( | wmOperatorType * | ot | ) |
Definition at line 118 of file keyingsets.c.
References add_default_keyingset_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, keyingset_poll_default_add(), wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_anim().
void ANIM_OT_keying_set_path_add | ( | wmOperatorType * | ot | ) |
Definition at line 209 of file keyingsets.c.
References add_empty_ks_path_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, keyingset_poll_active_edit(), wmOperatorType::name, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_anim().
void ANIM_OT_keying_set_path_remove | ( | wmOperatorType * | ot | ) |
Definition at line 252 of file keyingsets.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, keyingset_poll_activePath_edit(), wmOperatorType::name, ot, wmOperatorType::poll, and remove_active_ks_path_exec().
Referenced by ED_operatortypes_anim().
void ANIM_OT_keying_set_remove | ( | wmOperatorType * | ot | ) |
Definition at line 166 of file keyingsets.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, keyingset_poll_active_edit(), wmOperatorType::name, ot, wmOperatorType::poll, and remove_active_keyingset_exec().
Referenced by ED_operatortypes_anim().
void ANIM_OT_keyingset_button_add | ( | wmOperatorType * | ot | ) |
Definition at line 356 of file keyingsets.c.
References add_keyingset_button_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
void ANIM_OT_keyingset_button_remove | ( | wmOperatorType * | ot | ) |
Definition at line 437 of file keyingsets.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and remove_keyingset_button_exec().
Referenced by ED_operatortypes_anim().
void ANIM_relative_keyingset_add_source | ( | ListBase * | dsources, |
struct ID * | id, | ||
struct StructRNA * | srna, | ||
void * | data | ||
) |
Add another data source for Relative Keying Sets to be evaluated with.
Definition at line 924 of file keyingsets.c.
References BLI_addtail(), data, ELEM, MEM_callocN, NULL, tRKS_DSource::ptr, RNA_id_pointer_create(), and RNA_pointer_create().
Referenced by autokeyframe_object(), autokeyframe_pose(), ED_autokeyframe_object(), ED_autokeyframe_pchan(), ED_view3d_camera_autokey(), pose_clear_transform_generic_exec(), poseAnim_mapping_autoKeyframe(), and poselib_keytag_pose().
Definition at line 647 of file keyingsets.c.
References Scene::active_keyingset, BLI_findlink(), builtin_keyingsets, Scene::keyingsets, NULL, and scene.
Referenced by ANIM_get_keyingset_for_autokeying(), autokeyframe_object(), autokeyframe_pose(), delete_key_v3d_exec(), pose_select_same_keyingset(), and select_grouped_keyingset().
Get the index of the Keying Set provided, for the given Scene.
Definition at line 665 of file keyingsets.c.
References BLI_findindex(), builtin_keyingsets, Scene::keyingsets, NULL, and scene.
eModifyKey_Returns ANIM_validate_keyingset | ( | struct bContext * | C, |
ListBase * | dsources, | ||
struct KeyingSet * | ks | ||
) |
Given a KeyingSet and context info, validate Keying Set's paths. This is only really necessary with relative/built-in KeyingSets where their list of paths is dynamically generated based on the current context info.
Definition at line 954 of file keyingsets.c.
References ANIM_keyingset_info_find_name(), BKE_keyingset_free(), BLI_listbase_is_empty(), C, KeyingSet::flag, KeyingSetInfo::iter, KEYINGSET_ABSOLUTE, MODIFYKEY_INVALID_CONTEXT, MODIFYKEY_MISSING_TYPEINFO, NULL, KeyingSet::paths, KeyingSetInfo::poll, RKS_ITER_overrides_list(), and KeyingSet::typeinfo.
Referenced by ANIM_apply_keyingset(), pose_select_same_keyingset(), and select_grouped_keyingset().
|
static |
Definition at line 472 of file keyingsets.c.
References Scene::active_keyingset, C, CTX_data_scene(), NC_SCENE, ND_KEYINGSET, NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), scene, type, and WM_event_add_notifier().
Referenced by ANIM_OT_keying_set_active_set().
|
static |
Definition at line 458 of file keyingsets.c.
References C, wmOperatorType::name, OPERATOR_INTERFACE, wmOperator::type, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), and uiItemsEnumO().
Referenced by ANIM_OT_keying_set_active_set().
|
static |
Definition at line 1007 of file keyingsets.c.
References APPLY_KEYINGFLAG_OVERRIDE, INSERTKEY_MATRIX, INSERTKEY_NEEDED, INSERTKEY_XYZ2RGB, and result.
Referenced by ANIM_apply_keyingset().
Definition at line 60 of file keyingsets.c.
References Scene::active_keyingset, C, CTX_data_scene(), ListBase::first, Scene::keyingsets, NULL, and scene.
Referenced by ANIM_OT_keying_set_path_add(), and ANIM_OT_keying_set_remove().
Definition at line 73 of file keyingsets.c.
References Scene::active_keyingset, KeyingSet::active_path, BLI_findlink(), C, CTX_data_scene(), ListBase::first, Scene::keyingsets, NULL, KeyingSet::paths, and scene.
Referenced by ANIM_OT_keying_set_path_remove().
Definition at line 53 of file keyingsets.c.
References C, CTX_data_scene(), and NULL.
Referenced by ANIM_OT_keying_set_add().
|
static |
Definition at line 132 of file keyingsets.c.
References Scene::active_keyingset, BKE_keyingset_free(), BKE_report(), BLI_findlink(), BLI_freelinkN(), C, CTX_data_scene(), Scene::keyingsets, NC_SCENE, ND_KEYINGSET, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, scene, and WM_event_add_notifier().
Referenced by ANIM_OT_keying_set_remove().
|
static |
Definition at line 223 of file keyingsets.c.
References Scene::active_keyingset, KeyingSet::active_path, BKE_keyingset_free_path(), BKE_report(), BLI_findlink(), C, CTX_data_scene(), Scene::keyingsets, OPERATOR_CANCELLED, OPERATOR_FINISHED, KeyingSet::paths, wmOperator::reports, RPT_ERROR, and scene.
Referenced by ANIM_OT_keying_set_path_remove().
|
static |
Definition at line 376 of file keyingsets.c.
References Scene::active_keyingset, BKE_keyingset_find_path(), BKE_keyingset_free_path(), BKE_report(), BLI_findlink(), C, CTX_data_scene(), PointerRNA::data, Scene::keyingsets, KSP_GROUP_KSNAME, MEM_freeN, KeyingSet::name, NC_SCENE, ND_KEYINGSET, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, PointerRNA::owner_id, ptr, wmOperator::reports, RNA_path_from_ID_to_property(), RPT_ERROR, RPT_INFO, scene, UI_context_active_but_prop_get(), and WM_event_add_notifier().
Referenced by ANIM_OT_keyingset_button_remove().
|
static |
Definition at line 911 of file keyingsets.c.
References C, ListBase::first, KeyingSetInfo::generate, tRKS_DSource::next, and tRKS_DSource::ptr.
Referenced by ANIM_validate_keyingset().
Definition at line 516 of file keyingsets.c.
Referenced by ANIM_builtin_keyingset_get_named(), ANIM_keying_sets_enum_itemf(), ANIM_keyingset_get_from_enum_type(), ANIM_keyingset_get_from_idname(), ANIM_keyingset_info_register(), ANIM_keyingset_info_unregister(), ANIM_keyingset_infos_exit(), anim_keyingset_visit_for_search_impl(), ANIM_scene_get_active_keyingset(), and ANIM_scene_get_keyingset_index().
Definition at line 514 of file keyingsets.c.
Referenced by ANIM_keyingset_info_find_name(), ANIM_keyingset_info_register(), ANIM_keyingset_info_unregister(), and ANIM_keyingset_infos_exit().