|
Blender
V2.93
|
#include <float.h>#include <math.h>#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_string_utils.h"#include "BLI_utildefines.h"#include "DNA_anim_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BKE_action.h"#include "BKE_curve.h"#include "BKE_fcurve.h"#include "BKE_main.h"#include "BKE_report.h"#include "RNA_access.h"#include "RNA_enum_types.h"#include "ED_anim_api.h"#include "ED_keyframes_edit.h"#include "ED_keyframing.h"Go to the source code of this file.
Classes | |
| struct | tSmooth_Bezt |
| struct | TempFrameValCache |
| struct | tAnimCopybufItem |
Typedefs | |
| typedef struct tSmooth_Bezt | tSmooth_Bezt |
| typedef struct TempFrameValCache | TempFrameValCache |
| typedef struct tAnimCopybufItem | tAnimCopybufItem |
Functions | |
| void | delete_fcurve_key (FCurve *fcu, int index, bool do_recalc) |
| bool | delete_fcurve_keys (FCurve *fcu) |
| void | clear_fcurve_keys (FCurve *fcu) |
| void | duplicate_fcurve_keys (FCurve *fcu) |
| void | clean_fcurve (struct bAnimContext *ac, bAnimListElem *ale, float thresh, bool cleardefault) |
| static bool | prepare_for_decimate (FCurve *fcu, int i) |
| static void | decimate_fcurve_segment (FCurve *fcu, int bezt_segment_start_idx, int bezt_segment_len, float remove_ratio, float error_sq_max) |
| bool | decimate_fcurve (bAnimListElem *ale, float remove_ratio, float error_sq_max) |
| void | smooth_fcurve (FCurve *fcu) |
| void | sample_fcurve (FCurve *fcu) |
| void | ANIM_fcurves_copybuf_free (void) |
| short | copy_animedit_keys (bAnimContext *ac, ListBase *anim_data) |
| static void | flip_names (tAnimCopybufItem *aci, char **name) |
| static tAnimCopybufItem * | pastebuf_match_path_full (FCurve *fcu, const short from_single, const short to_simple, bool flip) |
| static tAnimCopybufItem * | pastebuf_match_path_property (Main *bmain, FCurve *fcu, const short from_single, const short UNUSED(to_simple)) |
| static tAnimCopybufItem * | pastebuf_match_index_only (FCurve *fcu, const short from_single, const short UNUSED(to_simple)) |
| static void | do_curve_mirror_flippping (tAnimCopybufItem *aci, BezTriple *bezt) |
| static void | paste_animedit_keys_fcurve (FCurve *fcu, tAnimCopybufItem *aci, float offset, const eKeyMergeMode merge_mode, bool flip) |
| short | paste_animedit_keys (bAnimContext *ac, ListBase *anim_data, const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode, bool flip) |
Variables | |
| static ListBase | animcopybuf = {NULL, NULL} |
| static float | animcopy_firstframe = 999999999.0f |
| static float | animcopy_lastframe = -999999999.0f |
| static float | animcopy_cfra = 0.0 |
| const EnumPropertyItem | rna_enum_keyframe_paste_offset_items [] |
| const EnumPropertyItem | rna_enum_keyframe_paste_merge_items [] |
| typedef struct tAnimCopybufItem tAnimCopybufItem |
| typedef struct TempFrameValCache TempFrameValCache |
| typedef struct tSmooth_Bezt tSmooth_Bezt |
| void ANIM_fcurves_copybuf_free | ( | void | ) |
Definition at line 701 of file keyframes_general.c.
References animcopy_firstframe, animcopy_lastframe, animcopybuf, tAnimCopybufItem::bezt, BLI_freelinkN(), BLI_listbase_clear(), ListBase::first, MEM_freeN, tAnimCopybufItem::next, and tAnimCopybufItem::rna_path.
Referenced by copy_action_keys(), copy_animedit_keys(), copy_graph_keys(), and WM_exit_ex().
| void clean_fcurve | ( | struct bAnimContext * | ac, |
| bAnimListElem * | ale, | ||
| float | thresh, | ||
| bool | cleardefault | ||
| ) |
Basic F-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only optionally clears up curve if one keyframe with default value remains.
Definition at line 189 of file keyframes_general.c.
References bAnimListElem::adt, ANIM_fcurve_delete_from_animdata(), FCurve::array_index, FCurve::bezt, BKE_fcurve_is_empty(), clear_fcurve_keys(), BezTriple::f1, bAnimListElem::id, if(), insert_bezt_fcurve(), IS_EQT, bAnimListElem::key_data, MEM_freeN, next, NULL, PROP_FLOAT, ptr, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RNA_property_float_get_default_index(), RNA_property_type(), SELECT, FCurve::totvert, and BezTriple::vec.
Referenced by clean_action_keys(), and clean_graph_keys().
| void clear_fcurve_keys | ( | FCurve * | fcu | ) |
Definition at line 137 of file keyframes_general.c.
References FCurve::bezt, MEM_freeN, NULL, and FCurve::totvert.
Referenced by clean_fcurve(), delete_fcurve_keys(), and paste_animedit_keys_fcurve().
| short copy_animedit_keys | ( | bAnimContext * | ac, |
| ListBase * | anim_data | ||
| ) |
Definition at line 732 of file keyframes_general.c.
References ANIM_editkeyframes_ok(), ANIM_fcurve_keyframes_loop(), ANIM_fcurves_copybuf_free(), animcopy_cfra, animcopy_firstframe, animcopy_lastframe, animcopybuf, FCurve::array_index, tAnimCopybufItem::bezt, FCurve::bezt, BEZT_ISSEL_ANY, BEZT_OK_SELECTED, BEZT_SEL_ALL, BKE_pose_channel_find_name(), BLI_addtail(), BLI_str_quoted_substrN(), CFRA, ELEM, ListBase::first, FCurve::grp, GS, bAnimListElem::id, Object::id, ID_OB, if(), bAnimListElem::key_data, ListBase::last, MEM_callocN, MEM_dupallocN, MEM_freeN, ID::name, bAnimListElem::next, NULL, OB_ARMATURE, Object::pose, FCurve::rna_path, scene, bAnimContext::scene, tAnimCopybufItem::totvert, and BezTriple::vec.
Referenced by copy_action_keys(), and copy_graph_keys().
| bool decimate_fcurve | ( | bAnimListElem * | ale, |
| float | remove_ratio, | ||
| float | error_sq_max | ||
| ) |
F-Curve 'decimate' function that removes a certain ratio of curve points that will affect the curves overall shape the least. If you want to remove based on a error margin, set remove_ratio to 1 and simply specify the desired error_sq_max. Otherwise, set the error margin to FLT_MAX.
Definition at line 407 of file keyframes_general.c.
References FCurve::bezt, BEZT_FLAG_TEMP_TAG, decimate_fcurve_segment(), BezTriple::f2, if(), insert_bezt_fcurve(), bAnimListElem::key_data, MEM_freeN, NULL, prepare_for_decimate(), SELECT, and FCurve::totvert.
Referenced by decimate_graph_keys().
|
static |
Definition at line 366 of file keyframes_general.c.
References FCurve::bezt, BEZT_FLAG_TEMP_TAG, BKE_curve_decimate_bezt_array(), ceil(), prepare_for_decimate(), SELECT, and FCurve::totvert.
Referenced by decimate_fcurve().
| void delete_fcurve_key | ( | FCurve * | fcu, |
| int | index, | ||
| bool | do_recalc | ||
| ) |
Only delete the nominated keyframe from provided F-Curve. Not recommended to be used many times successively. For that there is delete_fcurve_keys().
Definition at line 71 of file keyframes_general.c.
References abs(), FCurve::bezt, calchandles_fcurve(), MEM_freeN, NULL, and FCurve::totvert.
Referenced by delete_key_button_exec(), delete_keyframe_fcurve(), insert_keyframe_value(), poselib_remove_exec(), posttrans_fcurve_clean(), and pyrna_struct_keyframe_delete().
| bool delete_fcurve_keys | ( | FCurve * | fcu | ) |
Definition at line 108 of file keyframes_general.c.
References FCurve::active_keyframe_index, FCurve::bezt, BKE_fcurve_active_keyframe_set(), clear_fcurve_keys(), BezTriple::f2, NULL, SELECT, and FCurve::totvert.
Referenced by delete_action_keys(), delete_graph_keys(), and paste_animedit_keys_fcurve().
|
static |
Definition at line 974 of file keyframes_general.c.
References tAnimCopybufItem::array_index, tAnimCopybufItem::bezt, BLI_strn_endswith(), ELEM, tAnimCopybufItem::is_bone, tAnimCopybufItem::rna_path, and BezTriple::vec.
Referenced by paste_animedit_keys_fcurve().
| void duplicate_fcurve_keys | ( | FCurve * | fcu | ) |
Definition at line 150 of file keyframes_general.c.
References FCurve::bezt, BEZT_DESEL_ALL, BEZT_SEL_ALL, ELEM, BezTriple::f2, MEM_callocN, MEM_freeN, NULL, SELECT, and FCurve::totvert.
Referenced by duplicate_action_keys(), and duplicate_graph_keys().
|
static |
Definition at line 833 of file keyframes_general.c.
References BLI_string_flip_side_name(), BLI_strncpy(), tAnimCopybufItem::is_bone, length(), MAX_VGROUP_NAME, MEM_mallocN, and tAnimCopybufItem::rna_path.
Referenced by pastebuf_match_path_full().
| short paste_animedit_keys | ( | bAnimContext * | ac, |
| ListBase * | anim_data, | ||
| const eKeyPasteOffset | offset_mode, | ||
| const eKeyMergeMode | merge_mode, | ||
| bool | flip | ||
| ) |
This function pastes data from the keyframes copy/paste buffer
Definition at line 1126 of file keyframes_general.c.
References ANIM_animdata_update(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIM_UPDATE_DEFAULT, animcopy_cfra, animcopy_firstframe, animcopy_lastframe, animcopybuf, BKE_report(), BLI_listbase_is_empty(), BLI_listbase_is_single(), bAnimContext::bmain, CFRA, bAnimListElem::data, ListBase::first, float(), bAnimListElem::key_data, KEYFRAME_PASTE_OFFSET_CFRA_END, KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE, KEYFRAME_PASTE_OFFSET_CFRA_START, KEYFRAME_PASTE_OFFSET_NONE, bAnimListElem::next, NULL, paste_animedit_keys_fcurve(), pastebuf_match_index_only(), pastebuf_match_path_full(), pastebuf_match_path_property(), bAnimContext::reports, RPT_ERROR, scene, bAnimContext::scene, and bAnimListElem::update.
Referenced by paste_action_keys(), and paste_graph_keys().
|
static |
Definition at line 1004 of file keyframes_general.c.
References animcopy_firstframe, animcopy_lastframe, tAnimCopybufItem::bezt, FCurve::bezt, BEZT_DESEL_ALL, calchandles_fcurve(), clear_fcurve_keys(), delete_fcurve_keys(), do_curve_mirror_flippping(), BezTriple::f2, insert_bezt_fcurve(), INSERTKEY_OVERWRITE_FULL, KEYFRAME_PASTE_MERGE_MIX, KEYFRAME_PASTE_MERGE_OVER, KEYFRAME_PASTE_MERGE_OVER_RANGE, KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL, SELECT, tAnimCopybufItem::totvert, and BezTriple::vec.
Referenced by paste_animedit_keys().
|
static |
Definition at line 956 of file keyframes_general.c.
References animcopybuf, tAnimCopybufItem::array_index, FCurve::array_index, ListBase::first, and tAnimCopybufItem::next.
Referenced by paste_animedit_keys().
|
static |
Definition at line 872 of file keyframes_general.c.
References animcopybuf, tAnimCopybufItem::array_index, FCurve::array_index, ListBase::first, flip_names(), tAnimCopybufItem::is_bone, MEM_freeN, tAnimCopybufItem::next, NULL, tAnimCopybufItem::rna_path, FCurve::rna_path, and STREQ.
Referenced by paste_animedit_keys().
|
static |
Definition at line 904 of file keyframes_general.c.
References animcopybuf, tAnimCopybufItem::array_index, FCurve::array_index, BLI_findindex(), ListBase::first, tAnimCopybufItem::id, tAnimCopybufItem::id_type, ID::name, tAnimCopybufItem::next, RNA_id_pointer_create(), tAnimCopybufItem::rna_path, FCurve::rna_path, RNA_path_resolve_property(), RNA_property_identifier(), STREQ, and which_libbase().
Referenced by paste_animedit_keys().
|
static |
Definition at line 330 of file keyframes_general.c.
References add_v3_v3(), FCurve::bezt, BEZT_IPO_BEZ, BEZT_IPO_LIN, copy_v3_v3(), BezTriple::h1, BezTriple::h2, HD_FREE, BezTriple::ipo, mul_v3_fl(), sub_v3_v3v3(), FCurve::totvert, and BezTriple::vec.
Referenced by decimate_fcurve(), and decimate_fcurve_segment().
| void sample_fcurve | ( | FCurve * | fcu | ) |
Definition at line 592 of file keyframes_general.c.
References FCurve::bezt, BEZT_ISSEL_ANY, BEZT_KEYTYPE_BREAKDOWN, calchandles_fcurve(), ceil(), evaluate_fcurve(), float(), floor(), insert_vert_fcurve(), MEM_callocN, MEM_freeN, next, NULL, and BezTriple::vec.
Referenced by sample_action_keys(), and sample_graph_keys().
| void smooth_fcurve | ( | FCurve * | fcu | ) |
Definition at line 488 of file keyframes_general.c.
References FCurve::bezt, BEZT_ISSEL_ANY, calchandles_fcurve(), ELEM, tSmooth_Bezt::h1, tSmooth_Bezt::h2, tSmooth_Bezt::h3, MEM_callocN, MEM_freeN, NULL, FCurve::totvert, BezTriple::vec, x, tSmooth_Bezt::y1, tSmooth_Bezt::y2, and tSmooth_Bezt::y3.
Referenced by graphkeys_smooth_exec().
|
static |
Definition at line 682 of file keyframes_general.c.
Referenced by copy_animedit_keys(), and paste_animedit_keys().
|
static |
Definition at line 680 of file keyframes_general.c.
Referenced by ANIM_fcurves_copybuf_free(), copy_animedit_keys(), paste_animedit_keys(), and paste_animedit_keys_fcurve().
|
static |
Definition at line 681 of file keyframes_general.c.
Referenced by ANIM_fcurves_copybuf_free(), copy_animedit_keys(), paste_animedit_keys(), and paste_animedit_keys_fcurve().
Definition at line 679 of file keyframes_general.c.
Referenced by ANIM_fcurves_copybuf_free(), copy_animedit_keys(), paste_animedit_keys(), pastebuf_match_index_only(), pastebuf_match_path_full(), and pastebuf_match_path_property().
| const EnumPropertyItem rna_enum_keyframe_paste_merge_items[] |
Definition at line 1105 of file keyframes_general.c.
Referenced by ACTION_OT_paste(), and GRAPH_OT_paste().
| const EnumPropertyItem rna_enum_keyframe_paste_offset_items[] |
Definition at line 1089 of file keyframes_general.c.
Referenced by ACTION_OT_paste(), and GRAPH_OT_paste().