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_dynstr.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_action_types.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_lib_id.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 "RNA_path.h"
#include "RNA_prototypes.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 653 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 1928 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 2938 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 | ( | struct Scene * | scene, |
bool | use_autokey_mode | ||
) |
Get the active settings for key-framing settings from context (specifically the given scene)
use_autokey_mode | include settings from key-framing mode in the result (i.e. replace only). |
Definition at line 82 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 2829 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 2339 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 2219 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_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 2762 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 2244 of file keyframing.c.
References ANIM_keyingset_visit_for_search_no_poll(), delete_key_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, MAX_ID_NAME, modify_key_op_poll(), wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, PROP_STRING_SEARCH_SUGGESTION, RNA_def_property_flag(), RNA_def_property_string_search_func_runtime(), RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
void ANIM_OT_keyframe_delete_v3d | ( | wmOperatorType * | ot | ) |
Definition at line 2480 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 2021 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_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 2651 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 2046 of file keyframing.c.
References ANIM_keyingset_visit_for_search_no_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, insert_key_exec(), MAX_ID_NAME, modify_key_op_poll(), wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, PROP_HIDDEN, PROP_STRING_SEARCH_SUGGESTION, RNA_def_property_flag(), RNA_def_property_string_search_func_runtime(), RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_anim().
void ANIM_OT_keyframe_insert_menu | ( | wmOperatorType * | ot | ) |
Definition at line 2133 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 2850 of file keyframing.c.
References ANIMFILTER_KEYS_LOCAL, ToolSettings::autokey_mode, AUTOKEY_MODE_NORMAL, RenderData::cfra, float(), id_frame_has_keyframe(), if(), IS_AUTOKEY_MODE, IS_AUTOKEY_ON, Scene::r, 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 2274 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_substr(), bPoseChannel::bone, BONE_SELECTED, C, CTX_DATA_BEGIN, CTX_DATA_END, bAction::curves, DEG_id_tag_update(), ListBase::first, Bone::flag, ID_RECALC_TRANSFORM, bPoseChannel::name, 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 2782 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 1830 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 1709 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 2671 of file keyframing.c.
References all(), FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_delete_key(), BKE_fcurve_find(), BKE_fcurve_handles_recalc(), BKE_fcurve_is_protected(), BKE_idtype_idcode_to_name(), BKE_nlastrip_has_curves_for_property(), BKE_reportf(), C, RenderData::cfra, CTX_data_main(), CTX_data_scene(), PointerRNA::data, 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, Scene::r, 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 2168 of file keyframing.c.
References C, CTX_data_scene(), delete_key_using_keying_set(), keyingset_get_from_op_with_error(), NULL, OPERATOR_CANCELLED, wmOperatorType::prop, scene, and wmOperator::type.
Referenced by ANIM_OT_keyframe_delete(), and ANIM_OT_keyframe_delete_by_name().
|
static |
Definition at line 2179 of file keyframing.c.
References ANIM_apply_keyingset(), BKE_report(), BKE_reportf(), C, RenderData::cfra, CTX_data_scene(), wmOperator::flag, float(), G, G_DEBUG, MODIFYKEY_MODE_DELETE, NA_REMOVED, KeyingSet::name, NC_ANIMATION, ND_KEYFRAME, NULL, OP_IS_INVOKE, OPERATOR_CANCELLED, OPERATOR_FINISHED, Scene::r, wmOperator::reports, RPT_ERROR, RPT_INFO, RPT_WARNING, scene, and WM_event_add_notifier().
Referenced by delete_key_exec(), and delete_key_v3d_exec().
|
static |
Definition at line 2468 of file keyframing.c.
References ANIM_scene_get_active_keyingset(), C, CTX_data_scene(), delete_key_using_keying_set(), delete_key_v3d_without_keying_set(), NULL, and scene.
Referenced by ANIM_OT_keyframe_delete_v3d().
|
static |
Definition at line 2356 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_substr(), bPoseChannel::bone, BONE_HIDDEN_P, BONE_SELECTED, C, RenderData::cfra, CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_scene(), bAction::curves, DEG_id_tag_update(), delete_keyframe_fcurve(), ListBase::first, Bone::flag, wmOperator::flag, float(), id, ID_RECALC_ANIMATION_NO_FLUSH, ID_RECALC_TRANSFORM, if(), Bone::layer, bArmature::layer, bPoseChannel::name, ID::name, NC_OBJECT, ND_KEYS, FCurve::next, NLATIME_CONVERT_UNMAP, NULL, OB_MODE_POSE, OP_IS_INVOKE, OPERATOR_FINISHED, Scene::r, wmOperator::reports, FCurve::rna_path, RPT_ERROR, RPT_INFO, RPT_WARNING, scene, and WM_event_add_notifier().
Referenced by delete_key_v3d_exec().
int delete_keyframe | ( | struct Main * | bmain, |
struct ReportList * | reports, | ||
struct ID * | id, | ||
struct bAction * | act, | ||
const char | rna_path[], | ||
int | array_index, | ||
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 1723 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 1686 of file keyframing.c.
References ANIM_fcurve_delete_from_animdata(), FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_delete_key(), BKE_fcurve_handles_recalc(), BKE_fcurve_is_empty(), NULL, and FCurve::totvert.
Referenced by delete_key_v3d_without_keying_set(), and delete_keyframe().
FCurve* ED_action_fcurve_ensure | ( | struct Main * | bmain, |
struct bAction * | act, | ||
const char | group[], | ||
struct PointerRNA * | ptr, | ||
const char | rna_path[], | ||
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 173 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, 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().
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 164 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 3070 of file keyframing.c.
References ANIM_apply_keyingset(), ANIM_relative_keyingset_add_source(), autokeyframe_cfra_can_key(), BLI_freelistN(), C, RenderData::cfra, Object::id, MODIFYKEY_MODE_INSERT, NULL, Scene::r, 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 3090 of file keyframing.c.
References ANIM_apply_keyingset(), ANIM_relative_keyingset_add_source(), autokeyframe_cfra_can_key(), BLI_freelistN(), C, RenderData::cfra, Object::id, MODIFYKEY_MODE_INSERT, NULL, Scene::r, 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 | ( | struct bContext * | C, |
struct 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 VSE preview transform, creating new animation/keyframes also on non-keyed properties is desired. |
Definition at line 3111 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, MEM_freeN, NA_EDITED, bActionGroup::name, NC_ANIMATION, ND_KEYFRAME, NULL, PointerRNA::owner_id, ptr, FCurve::rna_path, RNA_path_from_ID_to_property(), scene, Scene::toolsettings, and WM_event_add_notifier().
Referenced by autokeyframe_sequencer_image(), ui_but_anim_autokey(), and WM_gizmo_target_property_anim_autokey().
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 123 of file keyframing.c.
References AnimData::action, BKE_action_add(), BKE_animdata_action_ensure_idroot(), BKE_animdata_ensure_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(), sequencer_paste_animation(), AnimationImporter::translate_animation_OLD(), and AnimationImporter::translate_Animations().
Definition at line 2883 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 2909 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.
r_successful_remaps | Enables bits for indices which are both intended to be remapped and were successfully remapped. Bitmap allocated so it must be freed afterward. |
Definition at line 1172 of file keyframing.c.
References BKE_animsys_nla_remap_keyframe_values(), BLI_BITMAP_NEW, buffer, get_keyframe_values_create_reports(), INSERTKEY_MATRIX, ptr, setting_get_rna_values(), visualkey_can_use(), and visualkey_get_values().
Referenced by insert_keyframe(), and insert_keyframe_direct().
|
static |
Definition at line 1116 of file keyframing.c.
References BKE_reportf(), BLI_BITMAP_TEST_BOOL, 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 get_keyframe_values().
Main Keyframe Checking API call.
Checks whether a keyframe exists for the given ID-block one the given frame. It is recommended to call this method over the other keyframe-checkers directly, in case some detail of the implementation changes...
frame | The value of this is quite often result of BKE_scene_ctime_get() |
Definition at line 3036 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 410 of file keyframing.c.
References FCurve::bezt, BKE_fcurve_bezt_binarysearch_index(), BKE_fcurve_get_cycle_type(), ELEM, 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 2499 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, RenderData::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, Scene::r, wmOperator::reports, RNA_boolean_get(), RNA_path_from_ID_to_property(), 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 1954 of file keyframing.c.
References ANIM_apply_keyingset(), ANIM_keyingset_find_id(), BKE_report(), BKE_reportf(), C, RenderData::cfra, CTX_data_edit_object(), CTX_data_scene(), Object::data, ED_object_mode_set(), wmOperator::flag, float(), G, G_DEBUG, keyingset_get_from_op_with_error(), MODIFYKEY_MODE_INSERT, NA_ADDED, NC_ANIMATION, ND_KEYFRAME, NULL, OB_MODE_EDIT, OB_MODE_OBJECT, OP_IS_INVOKE, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperatorType::prop, Scene::r, wmOperator::reports, 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 2076 of file keyframing.c.
References Scene::active_keyingset, BLI_assert, C, CTX_data_scene(), wmOperatorType::exec, free(), EnumPropertyItem::icon, EnumPropertyItem::identifier, MEM_freeN, EnumPropertyItem::name, NULL, OPERATOR_INTERFACE, wmOperator::ptr, RNA_boolean_get(), RNA_enum_set(), RNA_property_enum_items_gettexted(), RNA_struct_find_property(), scene, wmOperator::type, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), uiItemS(), uiItemStringO(), 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 | ||
) |
Definition at line 1476 of file keyframing.c.
References AnimData::action, BKE_animdata_from_id(), BKE_animsys_free_nla_keyframing_context_cache(), BKE_id_is_editable(), BKE_reportf(), BLI_BITMAP_TEST_BOOL, 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_fcurve_key(), 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 1303 of file keyframing.c.
References FCurve::array_index, BKE_report(), BKE_reportf(), BLI_BITMAP_TEST_BOOL, 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 |
Find or create the FCurve based on the given path, and insert the specified value into it.
Definition at line 1389 of file keyframing.c.
References BKE_action_is_cyclic(), 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_CYCLE_AWARE, INSERTKEY_REPLACE, INSERTKEY_XYZ2RGB, make_new_fcurve_cyclic(), 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 1223 of file keyframing.c.
References FCurve::array_index, BKE_fcurve_delete_key(), BKE_fcurve_handles_recalc(), BKE_fcurve_is_keyframable(), BKE_reportf(), 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 | ( | struct FCurve * | fcu, |
float | x, | ||
float | y, | ||
eBezTriple_KeyframeType | keyframe_type, | ||
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. Returns the index at which a keyframe was added (or -1 if failed).
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 545 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(), BKE_fcurve_handles_recalc(), 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_fcurve_key(), insert_graph_keys(), insert_keyframe_value(), sample_fcurve(), and blender::bke::tests::TEST().
|
static |
Use for insert/delete key-frame.
Definition at line 3207 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().
Used to make curves newly added to a cyclic Action cycle with the correct period.
Definition at line 354 of file keyframing.c.
References add_fmodifier(), FCurve::bezt, ListBase::first, floorf, FMODIFIER_TYPE_CYCLES, bAction::frame_end, bAction::frame_start, MEM_reallocN, FCurve::modifiers, FCurve::totvert, and BezTriple::vec.
Referenced by insert_keyframe_fcurve_value().
Polling callback for use with ANIM_*_keyframe()
operators This is based on the standard ED_operator_areaactive callback, except that it does special checks for a few space-types too.
Definition at line 1938 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().
This helper function determines whether a new keyframe is needed.
Cases where keyframes should not be added:
Definition at line 668 of file keyframing.c.
References FCurve::bezt, evaluate_fcurve(), IS_EQF, KEYNEEDED_DELNEXT, KEYNEEDED_DELPREV, KEYNEEDED_DONTADD, KEYNEEDED_JUSTADD, NULL, blender::meshintersect::prev(), FCurve::totvert, and BezTriple::vec.
Referenced by insert_keyframe_value().
|
static |
Definition at line 1454 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 2969 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 |
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 315 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 393 of file keyframing.c.
References BezTriple::f1, BezTriple::f2, BezTriple::f3, and BezTriple::vec.
Referenced by insert_bezt_fcurve().
|
static |
Try to read value using RNA-properties obtained already.
Definition at line 780 of file keyframing.c.
References BLI_assert, buffer, float(), blender::math::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 503 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, blender::meshintersect::prev(), and BezTriple::vec.
Referenced by insert_vert_fcurve().
void update_autoflags_fcurve | ( | struct FCurve * | fcu, |
struct bContext * | C, | ||
struct ReportList * | reports, | ||
struct PointerRNA * | ptr | ||
) |
Lesser Key-framing API call.
Update integer/discrete flags of the FCurve (used when creating/inserting keyframes, but also through RNA when editing an ID prop, see T37103).
Definition at line 274 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 |
Helper for update_autoflags_fcurve().
Definition at line 252 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 |
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 blocktypes, when using "standard" keying but 'Visual Keying' option in Auto-Keying settings is on.
Definition at line 861 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_property_identifier(), bConstraint::type, RigidBodyOb::type, PointerRNA::type, VISUALKEY_LOC, VISUALKEY_NONE, VISUALKEY_ROT, and VISUALKEY_SCA.
Referenced by get_keyframe_values().
|
static |
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 1028 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_property_identifier(), bPoseChannel::rotmode, Object::rotmode, setting_get_rna_values(), and PointerRNA::type.
Referenced by get_keyframe_values().