|
Blender
V2.93
|
#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_math.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "DNA_anim_types.h"#include "DNA_armature_types.h"#include "DNA_constraint_types.h"#include "DNA_key_types.h"#include "DNA_material_types.h"#include "DNA_object_types.h"#include "DNA_rigidbody_types.h"#include "DNA_scene_types.h"#include "BKE_action.h"#include "BKE_anim_data.h"#include "BKE_animsys.h"#include "BKE_armature.h"#include "BKE_context.h"#include "BKE_fcurve.h"#include "BKE_fcurve_driver.h"#include "BKE_global.h"#include "BKE_idtype.h"#include "BKE_key.h"#include "BKE_main.h"#include "BKE_material.h"#include "BKE_nla.h"#include "BKE_report.h"#include "DEG_depsgraph.h"#include "DEG_depsgraph_build.h"#include "DEG_depsgraph_query.h"#include "ED_anim_api.h"#include "ED_keyframes_edit.h"#include "ED_keyframing.h"#include "ED_object.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 "anim_intern.h"Go to the source code of this file.
Enumerations | |
| enum | { KEYNEEDED_DONTADD = 0 , KEYNEEDED_JUSTADD , KEYNEEDED_DELPREV , KEYNEEDED_DELNEXT } |
| enum | { VISUALKEY_NONE = 0 , VISUALKEY_LOC , VISUALKEY_ROT , VISUALKEY_SCA } |
| enum | { COMMONKEY_MODE_INSERT = 0 , COMMONKEY_MODE_DELETE } |
| anonymous enum |
| Enumerator | |
|---|---|
| KEYNEEDED_DONTADD | |
| KEYNEEDED_JUSTADD | |
| KEYNEEDED_DELPREV | |
| KEYNEEDED_DELNEXT | |
Definition at line 655 of file keyframing.c.
| anonymous enum |
| Enumerator | |
|---|---|
| VISUALKEY_NONE | |
| VISUALKEY_LOC | |
| VISUALKEY_ROT | |
| VISUALKEY_SCA | |
Definition at line 847 of file keyframing.c.
| anonymous enum |
| Enumerator | |
|---|---|
| COMMONKEY_MODE_INSERT | |
| COMMONKEY_MODE_DELETE | |
Definition at line 1847 of file keyframing.c.
Checks whether an Action has a keyframe for a given frame Since we're only concerned whether a keyframe exists, we can simply loop until a match is found.
Definition at line 2869 of file keyframing.c.
References ACT_MUTED, ANIMFILTER_KEYS_MUTED, FCurve::bezt, bAction::curves, fcurve_frame_has_keyframe(), filter(), ListBase::first, bAction::flag, FCurve::next, NULL, and FCurve::totvert.
Referenced by id_frame_has_keyframe(), and object_frame_has_keyframe().
| eInsertKeyFlags ANIM_get_keyframing_flags | ( | Scene * | scene, |
| const bool | use_autokey_mode | ||
| ) |
Definition at line 92 of file keyframing.c.
References INSERTKEY_CYCLE_AWARE, INSERTKEY_MATRIX, INSERTKEY_NEEDED, INSERTKEY_NOFLAGS, INSERTKEY_REPLACE, INSERTKEY_XYZ2RGB, IS_AUTOKEY_FLAG, IS_AUTOKEY_MODE, and scene.
Referenced by achannel_setting_slider_cb(), achannel_setting_slider_nla_curve_cb(), achannel_setting_slider_shapekey_cb(), add_default_keyingset_exec(), add_keyingset_button_exec(), ANIM_apply_keyingset(), autokeyframe_object(), autokeyframe_pose(), ED_autokeyframe_property(), insert_action_keys(), insert_graph_keys(), and insert_key_button_exec().
| void ANIM_OT_keyframe_clear_button | ( | wmOperatorType * | ot | ) |
Definition at line 2758 of file keyframing.c.
References clear_key_button_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, modify_key_op_poll(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_clear_v3d | ( | wmOperatorType * | ot | ) |
Definition at line 2287 of file keyframing.c.
References clear_anim_v3d_exec(), wmOperatorType::description, ED_operator_areaactive(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and WM_operator_confirm().
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_delete | ( | wmOperatorType * | ot | ) |
Definition at line 2151 of file keyframing.c.
References ANIM_keying_sets_enum_itemf(), delete_key_exec(), wmOperatorType::description, DummyRNA_DEFAULT_items, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, modify_key_op_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, RNA_def_boolean(), RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_delete_button | ( | wmOperatorType * | ot | ) |
Definition at line 2691 of file keyframing.c.
References delete_key_button_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, modify_key_op_poll(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_delete_by_name | ( | wmOperatorType * | ot | ) |
Definition at line 2185 of file keyframing.c.
References delete_key_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, MAX_ID_NAME, modify_key_op_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, RNA_def_boolean(), RNA_def_property_flag(), RNA_def_string_file_path(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_delete_v3d | ( | wmOperatorType * | ot | ) |
Definition at line 2411 of file keyframing.c.
References delete_key_v3d_exec(), wmOperatorType::description, ED_operator_areaactive(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and WM_operator_confirm().
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_insert | ( | wmOperatorType * | ot | ) |
Definition at line 1935 of file keyframing.c.
References ANIM_keying_sets_enum_itemf(), wmOperatorType::description, DummyRNA_DEFAULT_items, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, insert_key_exec(), modify_key_op_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, RNA_def_boolean(), RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_insert_button | ( | wmOperatorType * | ot | ) |
Definition at line 2582 of file keyframing.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, insert_key_button_exec(), modify_key_op_poll(), wmOperatorType::name, OPTYPE_INTERNAL, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_insert_by_name | ( | wmOperatorType * | ot | ) |
Definition at line 1971 of file keyframing.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, insert_key_exec(), MAX_ID_NAME, modify_key_op_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, RNA_def_boolean(), RNA_def_property_flag(), RNA_def_string_file_path(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
| void ANIM_OT_keyframe_insert_menu | ( | wmOperatorType * | ot | ) |
Definition at line 2033 of file keyframing.c.
References ANIM_keying_sets_enum_itemf(), wmOperatorType::description, DummyRNA_DEFAULT_items, ED_operator_areaactive(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, insert_key_exec(), insert_key_menu_invoke(), wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, RNA_def_boolean(), RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
Definition at line 2779 of file keyframing.c.
References ANIMFILTER_KEYS_LOCAL, ToolSettings::autokey_mode, AUTOKEY_MODE_NORMAL, CFRA, float(), id_frame_has_keyframe(), IS_AUTOKEY_MODE, IS_AUTOKEY_ON, scene, and Scene::toolsettings.
Referenced by autokeyframe_object(), autokeyframe_pose(), drawTransformPixel(), ED_autokeyframe_object(), ED_autokeyframe_pchan(), ED_autokeyframe_property(), ED_view3d_camera_autokey(), motionpath_need_update_object(), motionpath_need_update_pose(), pose_clear_transform_generic_exec(), poseAnim_mapping_autoKeyframe(), and poselib_keytag_pose().
|
static |
Definition at line 2221 of file keyframing.c.
References AnimData::action, ANIM_fcurve_delete_from_animdata(), ANIM_remove_empty_action_from_animdata(), BKE_pose_channel_find_name(), BLI_str_quoted_substrN(), bPoseChannel::bone, BONE_SELECTED, C, CTX_DATA_BEGIN, CTX_DATA_END, bAction::curves, DEG_id_tag_update(), ListBase::first, Bone::flag, ID_RECALC_TRANSFORM, MEM_freeN, NC_OBJECT, ND_KEYS, FCurve::next, NULL, OB_MODE_POSE, OPERATOR_CANCELLED, OPERATOR_FINISHED, FCurve::rna_path, and WM_event_add_notifier().
Referenced by ANIM_OT_keyframe_clear_v3d().
|
static |
Definition at line 2711 of file keyframing.c.
References all(), C, clear_keyframe(), CTX_data_main(), PointerRNA::data, G, G_DEBUG, MEM_freeN, NA_REMOVED, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, PointerRNA::owner_id, wmOperator::ptr, ptr, wmOperator::reports, RNA_boolean_get(), RNA_path_from_ID_to_property(), UI_context_active_but_prop_get(), UI_context_update_anim_flag(), and WM_event_add_notifier().
Referenced by ANIM_OT_keyframe_clear_button().
|
static |
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).
The flag argument is used for special settings that alter the behavior of the keyframe deletion. These include the quick refresh options.
Definition at line 1749 of file keyframing.c.
References AnimData::action, ANIM_fcurve_delete_from_animdata(), BKE_animdata_from_id(), BKE_fcurve_is_protected(), BKE_idtype_idcode_to_name(), BKE_report(), BKE_reportf(), deg_tag_after_keyframe_delete(), ED_action_fcurve_find(), ELEM, GS, id, ID::name, NULL, ptr, ret, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RNA_property_array_length(), RPT_ERROR, and RPT_WARNING.
Referenced by clear_key_button_exec().
Definition at line 1625 of file keyframing.c.
References AnimData::action, DEG_id_tag_update_ex(), DEG_relations_tag_update(), bAction::id, ID_RECALC_ANIMATION_NO_FLUSH, and NULL.
Referenced by clear_keyframe(), and delete_keyframe().
|
static |
Definition at line 2602 of file keyframing.c.
References all(), FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_find(), BKE_fcurve_is_protected(), BKE_idtype_idcode_to_name(), BKE_nlastrip_has_curves_for_property(), BKE_reportf(), C, CFRA, CTX_data_main(), CTX_data_scene(), PointerRNA::data, delete_fcurve_key(), delete_keyframe(), NlaStrip::fcurves, float(), G, G_DEBUG, GS, id, MEM_freeN, NA_REMOVED, NlaStrip::name, ID::name, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, PointerRNA::owner_id, wmOperator::ptr, ptr, wmOperator::reports, RNA_boolean_get(), RNA_path_from_ID_to_property(), RNA_property_identifier(), RPT_WARNING, scene, FCurve::totvert, UI_context_active_but_prop_get(), UI_context_update_anim_flag(), and WM_event_add_notifier().
Referenced by ANIM_OT_keyframe_delete_button().
|
static |
Definition at line 2079 of file keyframing.c.
References ANIM_apply_keyingset(), ANIM_keyingset_get_from_enum_type(), ANIM_keyingset_get_from_idname(), BKE_report(), BKE_reportf(), BLI_assert, C, CFRA, CTX_data_scene(), float(), G, G_DEBUG, keyingset_get_from_op_with_error(), MAX_ID_NAME, MODIFYKEY_MODE_DELETE, NA_REMOVED, KeyingSet::name, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperatorType::prop, PROP_ENUM, PROP_STRING, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_property_enum_get(), RNA_property_string_get(), RNA_property_type(), RPT_ERROR, RPT_INFO, RPT_WARNING, scene, type, wmOperator::type, and WM_event_add_notifier().
Referenced by ANIM_OT_keyframe_delete(), and ANIM_OT_keyframe_delete_by_name().
|
static |
Definition at line 2304 of file keyframing.c.
References AnimData::action, BKE_fcurve_is_protected(), BKE_nla_tweakedit_remap(), BKE_pose_channel_find_name(), BKE_reportf(), BLI_str_quoted_substrN(), bPoseChannel::bone, BONE_HIDDEN_P, BONE_SELECTED, C, CFRA, CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_scene(), bAction::curves, DEG_id_tag_update(), delete_keyframe_fcurve(), ListBase::first, Bone::flag, float(), id, ID_RECALC_ANIMATION_NO_FLUSH, ID_RECALC_TRANSFORM, if(), Bone::layer, bArmature::layer, MEM_freeN, ID::name, NC_OBJECT, ND_KEYS, FCurve::next, NLATIME_CONVERT_UNMAP, NULL, OB_MODE_POSE, OPERATOR_FINISHED, wmOperator::reports, FCurve::rna_path, RPT_ERROR, RPT_INFO, RPT_WARNING, scene, and WM_event_add_notifier().
Referenced by ANIM_OT_keyframe_delete_v3d().
| int delete_keyframe | ( | Main * | bmain, |
| ReportList * | reports, | ||
| ID * | id, | ||
| bAction * | act, | ||
| const char | rna_path[], | ||
| int | array_index, | ||
| float | cfra | ||
| ) |
Definition at line 1642 of file keyframing.c.
References AnimData::action, BKE_animdata_from_id(), BKE_fcurve_is_protected(), BKE_idtype_idcode_to_name(), BKE_nla_tweakedit_remap(), BKE_report(), BKE_reportf(), deg_tag_after_keyframe_delete(), delete_keyframe_fcurve(), ED_action_fcurve_find(), ELEM, GS, id, ID::name, NLATIME_CONVERT_UNMAP, NULL, ptr, ret, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RNA_property_array_length(), RPT_ERROR, and RPT_WARNING.
Referenced by ANIM_apply_keyingset(), delete_key_button_exec(), and pyrna_struct_keyframe_delete().
Definition at line 1603 of file keyframing.c.
References ANIM_fcurve_delete_from_animdata(), FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_is_empty(), delete_fcurve_key(), NULL, and FCurve::totvert.
Referenced by delete_key_v3d_exec(), and delete_keyframe().
| FCurve* ED_action_fcurve_ensure | ( | struct Main * | bmain, |
| struct bAction * | act, | ||
| const char | group[], | ||
| struct PointerRNA * | ptr, | ||
| const char | rna_path[], | ||
| const int | array_index | ||
| ) |
Get (or add relevant data to be able to do so) F-Curve from the Active Action, for the given Animation Data block. This assumes that all the destinations are valid.
Definition at line 194 of file keyframing.c.
References action_group_colors_sync(), action_groups_add_channel(), action_groups_add_new(), FCurve::array_index, FCurve::auto_smoothing, BKE_action_group_find_name(), BKE_fcurve_create(), BKE_fcurve_find(), BLI_addtail(), BLI_findlink(), BLI_listbase_is_empty(), BLI_strdup(), bAction::curves, bActionGroup::customCol, PointerRNA::data, DEG_relations_tag_update(), ELEM, FCURVE_ACTIVE, FCURVE_SELECTED, FCURVE_VISIBLE, FCurve::flag, NULL, PointerRNA::owner_id, Object::pose, ptr, FCurve::rna_path, RNA_PoseBone, and PointerRNA::type.
Referenced by achannel_setting_slider_shapekey_cb(), ED_object_parent_set(), followpath_path_animate_exec(), gpencil_stroke_path_animation(), and insert_keyframe_fcurve_value().
| FCurve* ED_action_fcurve_find | ( | struct bAction * | act, |
| const char | rna_path[], | ||
| const int | array_index | ||
| ) |
Find the F-Curve from the Active Action, for the given Animation Data block. This assumes that all the destinations are valid.
Definition at line 181 of file keyframing.c.
References BKE_fcurve_find(), bAction::curves, ELEM, and NULL.
Referenced by clear_keyframe(), delete_keyframe(), and insert_keyframe_fcurve_value().
Definition at line 3003 of file keyframing.c.
References ANIM_apply_keyingset(), ANIM_relative_keyingset_add_source(), autokeyframe_cfra_can_key(), BLI_freelistN(), C, CFRA, Object::id, MODIFYKEY_MODE_INSERT, NULL, and scene.
Referenced by object_clear_transform_generic_exec(), snap_sel_to_grid_exec(), and snap_selected_to_location().
| bool ED_autokeyframe_pchan | ( | bContext * | C, |
| Scene * | scene, | ||
| Object * | ob, | ||
| bPoseChannel * | pchan, | ||
| KeyingSet * | ks | ||
| ) |
Definition at line 3023 of file keyframing.c.
References ANIM_apply_keyingset(), ANIM_relative_keyingset_add_source(), autokeyframe_cfra_can_key(), BLI_freelistN(), C, CFRA, Object::id, MODIFYKEY_MODE_INSERT, NULL, RNA_PoseBone, and scene.
Referenced by pose_flip_quats_exec(), pose_paste_exec(), snap_sel_to_grid_exec(), and snap_selected_to_location().
| bool ED_autokeyframe_property | ( | bContext * | C, |
| Scene * | scene, | ||
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| int | rnaindex, | ||
| float | cfra | ||
| ) |
Use for auto-keyframing from the UI.
Definition at line 3047 of file keyframing.c.
References ANIM_get_keyframing_flags(), FCurve::array_index, autokeyframe_cfra_can_key(), BKE_animsys_eval_context_construct(), BKE_fcurve_find_by_rna_context_ui(), BLI_assert, C, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_wm_reports(), depsgraph, FCurve::grp, id, insert_keyframe(), insert_keyframe_direct(), INSERTKEY_DRIVER, IS_AUTOKEY_ON, ToolSettings::keyframe_type, NA_EDITED, bActionGroup::name, NC_ANIMATION, ND_KEYFRAME, NULL, PointerRNA::owner_id, ptr, FCurve::rna_path, scene, Scene::toolsettings, and WM_event_add_notifier().
Referenced by ui_but_anim_autokey(), and WM_gizmo_target_property_anim_autokey().
Definition at line 136 of file keyframing.c.
References AnimData::action, BKE_action_add(), BKE_animdata_action_ensure_idroot(), BKE_animdata_add_id(), BKE_animdata_from_id(), BLI_snprintf(), DEG_id_tag_update(), DEG_relations_tag_update(), id, bAction::id, ID_RECALC_ANIMATION_NO_FLUSH, ID::name, and NULL.
Referenced by achannel_setting_slider_shapekey_cb(), AnimationImporter::add_bone_animation_sampled(), AnimationImporter::apply_matrix_curves(), ED_object_parent_set(), followpath_path_animate_exec(), get_animation_curves(), gpencil_stroke_path_animation(), insert_keyframe(), AnimationImporter::translate_animation_OLD(), and AnimationImporter::translate_Animations().
Definition at line 2813 of file keyframing.c.
References ANIMFILTER_KEYS_MUTED, FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), ELEM, FCURVE_MUTED, filter(), FCurve::flag, NULL, and FCurve::totvert.
Referenced by achannel_setting_slider_cb(), achannel_setting_slider_nla_curve_cb(), achannel_setting_slider_shapekey_cb(), action_frame_has_keyframe(), and ui_but_anim_flag().
| bool fcurve_is_changed | ( | PointerRNA | ptr, |
| PropertyRNA * | prop, | ||
| FCurve * | fcu, | ||
| const AnimationEvalContext * | anim_eval_context | ||
| ) |
Definition at line 2840 of file keyframing.c.
References FCurve::array_index, buffer, calculate_fcurve(), compare_ff_relative(), count, MEM_freeN, PathResolvedRNA::prop, PathResolvedRNA::prop_index, PathResolvedRNA::ptr, ptr, RNA_MAX_ARRAY_LENGTH, and setting_get_rna_values().
Referenced by ui_but_anim_flag().
|
static |
Retrieve current property values to keyframe, possibly applying NLA correction when necessary.
Definition at line 1117 of file keyframing.c.
References BKE_animsys_nla_remap_keyframe_values(), BKE_report(), buffer, INSERTKEY_MATRIX, MEM_freeN, NULL, ptr, RPT_ERROR, setting_get_rna_values(), visualkey_can_use(), and visualkey_get_values().
Referenced by insert_keyframe(), and insert_keyframe_direct().
Main Keyframe Checking API call: Checks whether a keyframe exists for the given ID-block one the given frame.
Definition at line 2969 of file keyframing.c.
References AnimData::action, action_frame_has_keyframe(), BKE_animdata_from_id(), filter(), GS, id, ID_OB, ID_SCE, ID::name, NULL, and object_frame_has_keyframe().
Referenced by autokeyframe_cfra_can_key(), draw_selected_name(), and object_frame_has_keyframe().
| int insert_bezt_fcurve | ( | FCurve * | fcu, |
| const BezTriple * | bezt, | ||
| eInsertKeyFlags | flag | ||
| ) |
Definition at line 403 of file keyframing.c.
References FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_get_cycle_type(), FCU_CYCLE_PERFECT, FCurve::fpt, INSERTKEY_CYCLE_AWARE, INSERTKEY_OVERWRITE_FULL, INSERTKEY_REPLACE, MEM_callocN, MEM_freeN, NULL, 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 2430 of file keyframing.c.
References AnimData::action, all(), ANIM_get_keyframing_flags(), BKE_animdata_from_id(), BKE_animsys_eval_context_construct(), BKE_fcurve_find(), BKE_fcurve_find_by_rna_context_ui(), BKE_report(), BKE_reportf(), C, CFRA, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_data_scene(), PointerRNA::data, DEG_id_tag_update(), NlaStrip::fcurves, bAction::id, ID_RECALC_ANIMATION_NO_FLUSH, insert_keyframe(), insert_keyframe_direct(), INSERTKEY_DRIVER, INSERTKEY_NOFLAGS, ToolSettings::keyframe_type, MEM_freeN, NA_ADDED, bPoseChannel::name, NC_ANIMATION, ND_KEYFRAME, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, PointerRNA::owner_id, wmOperator::ptr, ptr, wmOperator::reports, RNA_boolean_get(), RNA_NlaStrip, RNA_Object, RNA_path_from_ID_to_property(), RNA_PoseBone, RNA_property_animateable(), RNA_property_identifier(), RPT_ERROR, RPT_WARNING, scene, Scene::toolsettings, PointerRNA::type, UI_BUT_DRIVEN, UI_but_flag_is_set(), UI_context_active_but_prop_get(), UI_context_update_anim_flag(), and WM_event_add_notifier().
Referenced by ANIM_OT_keyframe_insert_button().
|
static |
Definition at line 1872 of file keyframing.c.
References ANIM_apply_keyingset(), ANIM_keyingset_find_id(), BKE_report(), BKE_reportf(), C, CFRA, CTX_data_edit_object(), CTX_data_scene(), Object::data, ED_object_mode_set(), float(), G, G_DEBUG, keyingset_get_from_op_with_error(), MODIFYKEY_MODE_INSERT, NA_ADDED, KeyingSet::name, NC_ANIMATION, ND_KEYFRAME, NULL, OB_MODE_EDIT, OB_MODE_OBJECT, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperatorType::prop, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RPT_ERROR, RPT_INFO, RPT_WARNING, scene, wmOperator::type, and WM_event_add_notifier().
Referenced by ANIM_OT_keyframe_insert(), ANIM_OT_keyframe_insert_by_name(), and ANIM_OT_keyframe_insert_menu().
|
static |
Definition at line 2008 of file keyframing.c.
References Scene::active_keyingset, C, CTX_data_scene(), wmOperatorType::exec, OPERATOR_INTERFACE, wmOperator::ptr, RNA_boolean_get(), RNA_boolean_set(), RNA_enum_set(), scene, wmOperator::type, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), uiItemsEnumO(), and WM_operatortype_name().
Referenced by ANIM_OT_keyframe_insert_menu().
| int insert_keyframe | ( | Main * | bmain, |
| ReportList * | reports, | ||
| ID * | id, | ||
| bAction * | act, | ||
| const char | group[], | ||
| const char | rna_path[], | ||
| int | array_index, | ||
| const AnimationEvalContext * | anim_eval_context, | ||
| eBezTriple_KeyframeType | keytype, | ||
| ListBase * | nla_cache, | ||
| eInsertKeyFlags | flag | ||
| ) |
Main Keyframing API call
Use this when validation of necessary animation data is necessary, since it may not exist yet.
The flag argument is used for special settings that alter the behavior of the keyframe insertion. These include the 'visual' keyframing modes, quick refresh, and extra keyframe filtering.
index of -1 keys all array indices
Definition at line 1413 of file keyframing.c.
References AnimData::action, BKE_animdata_from_id(), BKE_animsys_free_nla_keyframing_context_cache(), BKE_reportf(), DEG_id_tag_update(), ED_id_action_ensure(), get_keyframe_values(), id, bAction::id, ID_RECALC_ANIMATION_NO_FLUSH, insert_keyframe_fcurve_value(), INSERTKEY_AVAILABLE, INSERTKEY_REPLACE, MEM_freeN, ID::name, nla_time_remap(), NULL, ptr, ret, RNA_id_pointer_create(), RNA_MAX_ARRAY_LENGTH, RNA_path_resolve_property(), RPT_ERROR, and TIP_.
Referenced by ANIM_apply_keyingset(), autokeyframe_object(), autokeyframe_pose(), ED_autokeyframe_property(), insert_action_keys(), insert_graph_keys(), insert_key_button_exec(), and pyrna_struct_keyframe_insert().
| bool insert_keyframe_direct | ( | ReportList * | reports, |
| PointerRNA | ptr, | ||
| PropertyRNA * | prop, | ||
| FCurve * | fcu, | ||
| const AnimationEvalContext * | anim_eval_context, | ||
| eBezTriple_KeyframeType | keytype, | ||
| struct NlaKeyframingContext * | nla_context, | ||
| eInsertKeyFlags | flag | ||
| ) |
Definition at line 1249 of file keyframing.c.
References FCurve::array_index, BKE_report(), BKE_reportf(), PointerRNA::data, get_keyframe_values(), insert_keyframe_value(), MEM_freeN, ID::name, NULL, PointerRNA::owner_id, ptr, RNA_MAX_ARRAY_LENGTH, FCurve::rna_path, RNA_path_resolve_property(), RPT_ERROR, TIP_, and update_autoflags_fcurve_direct().
Referenced by achannel_setting_slider_cb(), achannel_setting_slider_nla_curve_cb(), achannel_setting_slider_shapekey_cb(), ED_autokeyframe_property(), gpencil_stroke_path_animation(), gpencil_stroke_path_animation_add_keyframes(), insert_key_button_exec(), and pyrna_struct_keyframe_insert().
|
static |
Definition at line 1329 of file keyframing.c.
References FCurve::color_mode, ED_action_fcurve_ensure(), ED_action_fcurve_find(), ELEM, FCURVE_COLOR_AUTO_RGB, FCURVE_COLOR_AUTO_YRGB, insert_keyframe_value(), INSERTKEY_AVAILABLE, INSERTKEY_REPLACE, INSERTKEY_XYZ2RGB, PROP_COLOR, PROP_COORDS, PROP_EULER, PROP_QUATERNION, PROP_TRANSLATION, PROP_XYZ, ptr, RNA_property_subtype(), FCurve::totvert, and update_autoflags_fcurve_direct().
Referenced by insert_keyframe().
|
static |
Definition at line 1158 of file keyframing.c.
References FCurve::array_index, BKE_fcurve_is_keyframable(), BKE_reportf(), delete_fcurve_key(), FCurve::driver, AnimationEvalContext::eval_time, evaluate_driver(), FCU_CYCLE_PERFECT, insert_vert_fcurve(), INSERTKEY_CYCLE_AWARE, INSERTKEY_DRIVER, INSERTKEY_NEEDED, KEYNEEDED_DELNEXT, KEYNEEDED_DELPREV, KEYNEEDED_DONTADD, new_key_needed(), ptr, remap_cyclic_keyframe_location(), FCurve::rna_path, RNA_path_resolved_create(), RPT_ERROR, and FCurve::totvert.
Referenced by insert_keyframe_direct(), and insert_keyframe_fcurve_value().
| int insert_vert_fcurve | ( | FCurve * | fcu, |
| float | x, | ||
| float | y, | ||
| eBezTriple_KeyframeType | keyframe_type, | ||
| eInsertKeyFlags | flag | ||
| ) |
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. It returns the index at which the keyframe was added.
| 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 547 of file keyframing.c.
References Freestyle::a, BezTriple::amplitude, BezTriple::back, BEZKEYTYPE, FCurve::bezt, BEZT_IPO_BEZ, BEZT_IPO_CONST, BEZT_IPO_LIN, BKE_fcurve_active_keyframe_set(), calchandles_fcurve(), BezTriple::f1, BezTriple::f2, BezTriple::f3, FCURVE_DISCRETE_VALUES, FCURVE_INT_VALUES, FCurve::flag, BezTriple::h1, BezTriple::h2, HD_AUTO_ANIM, insert_bezt_fcurve(), INSERTKEY_FAST, INSERTKEY_NO_USERPREF, INSERTKEY_OVERWRITE_FULL, INSERTKEY_REPLACE, BezTriple::ipo, BezTriple::period, SELECT, subdivide_nonauto_handles(), FCurve::totvert, BezTriple::vec, x, and y.
Referenced by BCAnimationCurve::add_value(), alloc_driver_fcurve(), BCAnimationCurve::clean_handles(), graphkeys_click_insert_exec(), insert_action_keys(), insert_graph_keys(), insert_keyframe_value(), sample_fcurve(), and blender::bke::tests::TEST().
|
static |
Use for insert/delete key-frame.
Definition at line 3131 of file keyframing.c.
References ANIM_keyingset_get_from_enum_type(), ANIM_keyingset_get_from_idname(), BKE_report(), BKE_reportf(), BLI_assert, MAX_ID_NAME, NULL, PROP_ENUM, PROP_STRING, wmOperator::ptr, wmOperator::reports, RNA_property_enum_get(), RNA_property_string_get(), RNA_property_type(), RPT_ERROR, scene, and type.
Referenced by delete_key_exec(), and insert_key_exec().
|
static |
Definition at line 1856 of file keyframing.c.
References blender::compositor::area(), C, CTX_data_scene(), CTX_wm_area(), ELEM, NULL, and scene.
Referenced by ANIM_OT_keyframe_clear_button(), ANIM_OT_keyframe_delete(), ANIM_OT_keyframe_delete_button(), ANIM_OT_keyframe_delete_by_name(), ANIM_OT_keyframe_insert(), ANIM_OT_keyframe_insert_button(), and ANIM_OT_keyframe_insert_by_name().
Definition at line 668 of file keyframing.c.
References FCurve::bezt, evaluate_fcurve(), IS_EQF, KEYNEEDED_DELNEXT, KEYNEEDED_DELPREV, KEYNEEDED_DONTADD, KEYNEEDED_JUSTADD, NULL, FCurve::totvert, and BezTriple::vec.
Referenced by insert_keyframe_value().
|
static |
Definition at line 1378 of file keyframing.c.
References AnimData::action, BKE_animsys_eval_context_construct_at(), BKE_animsys_get_nla_keyframing_context(), BKE_nla_tweakedit_remap(), AnimationEvalContext::eval_time, NLATIME_CONVERT_UNMAP, and NULL.
Referenced by insert_keyframe().
Definition at line 2900 of file keyframing.c.
References Freestyle::a, Object::actcol, AnimData::action, action_frame_has_keyframe(), Object::adt, ANIMFILTER_KEYS_ACTIVE, ANIMFILTER_KEYS_LOCAL, ANIMFILTER_KEYS_NOMAT, ANIMFILTER_KEYS_NOSKEY, BKE_key_from_object(), BKE_nla_tweakedit_remap(), BKE_object_material_get(), filter(), id_frame_has_keyframe(), NLATIME_CONVERT_UNMAP, NULL, and Object::totcol.
Referenced by id_frame_has_keyframe().
|
static |
Definition at line 338 of file keyframing.c.
References FCurve::bezt, BKE_fcurve_get_cycle_type(), data, FCM_EXTRAPOLATE_CYCLIC_OFFSET, FCU_CYCLE_NONE, FCU_CYCLE_OFFSET, ListBase::first, floorf, if(), FCurve::modifiers, FCurve::totvert, type, and BezTriple::vec.
Referenced by insert_keyframe_value().
Definition at line 379 of file keyframing.c.
References BezTriple::f1, BezTriple::f2, BezTriple::f3, and BezTriple::vec.
Referenced by insert_bezt_fcurve().
|
static |
Definition at line 780 of file keyframing.c.
References BLI_assert, buffer, float(), 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().
|
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 496 of file keyframing.c.
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().
| void update_autoflags_fcurve | ( | FCurve * | fcu, |
| bContext * | C, | ||
| ReportList * | reports, | ||
| PointerRNA * | ptr | ||
| ) |
Definition at line 298 of file keyframing.c.
References BKE_report(), BKE_reportf(), C, PointerRNA::data, FCurve::flag, NA_EDITED, ID::name, NC_ANIMATION, ND_KEYFRAME, NULL, PointerRNA::owner_id, ptr, FCurve::rna_path, RNA_path_resolve_property(), RPT_ERROR, TIP_, update_autoflags_fcurve_direct(), and WM_event_add_notifier().
|
static |
Definition at line 273 of file keyframing.c.
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().
|
static |
Definition at line 860 of file keyframing.c.
References 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, NULL, bPoseChannel::parent, Object::parent, ptr, RBO_TYPE_ACTIVE, Object::rigidbody_object, RNA_Object, RNA_PoseBone, RNA_property_identifier(), bConstraint::type, RigidBodyOb::type, PointerRNA::type, VISUALKEY_LOC, VISUALKEY_NONE, VISUALKEY_ROT, and VISUALKEY_SCA.
Referenced by get_keyframe_values().
|
static |
Definition at line 1026 of file keyframing.c.
References BKE_armature_mat_pose_to_bone(), BLI_assert, bPoseChannel::bone, BONE_CONNECTED, buffer, copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), PointerRNA::data, Bone::flag, mat3_to_quat_is_ok(), mat4_to_axis_angle(), mat4_to_eulO(), mat4_to_size(), NULL, Object::obmat, Bone::parent, bPoseChannel::pose_mat, ptr, RNA_Object, RNA_PoseBone, RNA_property_identifier(), bPoseChannel::rotmode, Object::rotmode, setting_get_rna_values(), and PointerRNA::type.
Referenced by get_keyframe_values().