Blender
V3.3
|
#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 "RNA_path.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 |
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 |
Definition at line 730 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 blend_to_default_fcurve | ( | PointerRNA * | id_ptr, |
FCurve * | fcu, | ||
const float | factor | ||
) |
Definition at line 358 of file keyframes_general.c.
References FCurve::bezt, BezTriple::f2, get_default_rna_value(), interpf(), ptr, FCurve::rna_path, RNA_path_resolve_property(), SELECT, FCurve::totvert, and BezTriple::vec.
Referenced by blend_to_default_graph_keys().
void blend_to_neighbor_fcurve_segment | ( | FCurve * | fcu, |
FCurveSegment * | segment, | ||
const float | factor | ||
) |
Definition at line 299 of file keyframes_general.c.
References FCurve::bezt, fabs(), fcurve_segment_end_get(), fcurve_segment_start_get(), interpf(), and BezTriple::vec.
Referenced by blend_to_neighbor_graph_keys().
void breakdown_fcurve_segment | ( | FCurve * | fcu, |
FCurveSegment * | segment, | ||
const float | factor | ||
) |
Definition at line 380 of file keyframes_general.c.
References FCurve::bezt, fcurve_segment_end_get(), fcurve_segment_start_get(), interpf(), and BezTriple::vec.
Referenced by breakdown_graph_keys().
void clean_fcurve | ( | struct bAnimContext * | ac, |
bAnimListElem * | ale, | ||
float | thresh, | ||
bool | cleardefault | ||
) |
Definition at line 89 of file keyframes_general.c.
References bAnimListElem::adt, ANIM_fcurve_delete_from_animdata(), FCurve::array_index, FCurve::bezt, BKE_fcurve_delete_keys_all(), BKE_fcurve_is_empty(), BezTriple::f1, bAnimListElem::id, if(), insert_bezt_fcurve(), IS_EQT, bAnimListElem::key_data, MEM_freeN, next, NULL, blender::meshintersect::prev(), 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().
short copy_animedit_keys | ( | bAnimContext * | ac, |
ListBase * | anim_data | ||
) |
Definition at line 760 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_substr(), RenderData::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, Scene::r, 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 | ||
) |
Definition at line 463 of file keyframes_general.c.
References FCurve::bezt, BEZT_FLAG_IGNORE_TAG, BEZT_FLAG_TEMP_TAG, BLI_freelistN(), decimate_fcurve_segment(), BezTriple::f2, find_fcurve_segments(), if(), insert_bezt_fcurve(), bAnimListElem::key_data, LISTBASE_FOREACH, MEM_freeN, NULL, prepare_for_decimate(), and FCurve::totvert.
Referenced by decimate_graph_keys().
|
static |
Definition at line 429 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().
|
static |
Definition at line 1005 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().
Definition at line 51 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().
Definition at line 291 of file keyframes_general.c.
References FCurve::bezt, and FCurve::totvert.
Referenced by blend_to_neighbor_fcurve_segment(), and breakdown_fcurve_segment().
Definition at line 285 of file keyframes_general.c.
References FCurve::bezt.
Referenced by blend_to_neighbor_fcurve_segment(), and breakdown_fcurve_segment().
|
static |
Find the first segment of consecutive selected curve points, starting from start_index. Keys that have BEZT_FLAG_IGNORE_TAG set are treated as unselected.
r_segment_start_idx | returns the start index of the segment. |
r_segment_len | returns the number of curve points in the segment. |
Definition at line 234 of file keyframes_general.c.
References FCurve::bezt, BEZT_FLAG_IGNORE_TAG, BezTriple::f2, point_is_selected(), SELECT, and FCurve::totvert.
Referenced by find_fcurve_segments().
Return a list of FCurveSegment with a start index and a length. A segment is a continuous selection of keyframes. Keys that have BEZT_FLAG_IGNORE_TAG set are treated as unselected. The caller is responsible for freeing the memory.
Definition at line 267 of file keyframes_general.c.
References BLI_addtail(), find_fcurve_segment(), MEM_callocN, and NULL.
Referenced by blend_to_neighbor_graph_keys(), breakdown_graph_keys(), and decimate_fcurve().
|
static |
Definition at line 860 of file keyframes_general.c.
References BLI_assert, BLI_str_quoted_substr_range(), BLI_string_flip_side_name(), BLI_strncpy(), tAnimCopybufItem::is_bone, blender::math::length(), MAX_VGROUP_NAME, MEM_mallocN, and tAnimCopybufItem::rna_path.
Referenced by pastebuf_match_path_full().
float get_default_rna_value | ( | FCurve * | fcu, |
PropertyRNA * | prop, | ||
PointerRNA * | ptr | ||
) |
Definition at line 318 of file keyframes_general.c.
References FCurve::array_index, len, PROP_BOOLEAN, PROP_FLOAT, PROP_INT, ptr, RNA_property_array_length(), RNA_property_boolean_get_default(), RNA_property_boolean_get_default_index(), RNA_property_float_get_default(), RNA_property_float_get_default_index(), RNA_property_int_get_default(), RNA_property_int_get_default_index(), and RNA_property_type().
Referenced by blend_to_default_fcurve().
eKeyPasteError paste_animedit_keys | ( | bAnimContext * | ac, |
ListBase * | anim_data, | ||
const eKeyPasteOffset | offset_mode, | ||
const eKeyMergeMode | merge_mode, | ||
bool | flip | ||
) |
Definition at line 1150 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, BLI_listbase_is_empty(), BLI_listbase_is_single(), bAnimContext::bmain, RenderData::cfra, bAnimListElem::data, ListBase::first, float(), bAnimListElem::key_data, KEYFRAME_PASTE_NOTHING_TO_PASTE, KEYFRAME_PASTE_NOWHERE_TO_PASTE, KEYFRAME_PASTE_OFFSET_CFRA_END, KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE, KEYFRAME_PASTE_OFFSET_CFRA_START, KEYFRAME_PASTE_OFFSET_NONE, KEYFRAME_PASTE_OK, bAnimListElem::next, NULL, offset, paste_animedit_keys_fcurve(), pastebuf_match_index_only(), pastebuf_match_path_full(), pastebuf_match_path_property(), Scene::r, scene, bAnimContext::scene, and bAnimListElem::update.
Referenced by paste_action_keys(), and paste_graph_keys().
|
static |
Definition at line 1035 of file keyframes_general.c.
References animcopy_firstframe, animcopy_lastframe, tAnimCopybufItem::bezt, FCurve::bezt, BEZT_DESEL_ALL, BKE_fcurve_delete_keys_all(), BKE_fcurve_delete_keys_selected(), BKE_fcurve_handles_recalc(), 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, offset, SELECT, tAnimCopybufItem::totvert, and BezTriple::vec.
Referenced by paste_animedit_keys().
|
static |
Definition at line 987 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 903 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 935 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().
Definition at line 393 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().
Definition at line 622 of file keyframes_general.c.
References FCurve::bezt, BEZT_ISSEL_ANY, BEZT_KEYTYPE_BREAKDOWN, BKE_fcurve_handles_recalc(), ceil(), evaluate_fcurve(), float(), blender::math::floor(), insert_vert_fcurve(), MEM_callocN, MEM_freeN, next, NULL, and BezTriple::vec.
Referenced by sample_action_keys(), and sample_graph_keys().
Use a weighted moving-means method to reduce intensity of fluctuations.
Definition at line 519 of file keyframes_general.c.
References FCurve::bezt, BEZT_ISSEL_ANY, BKE_fcurve_handles_recalc(), 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 712 of file keyframes_general.c.
Referenced by copy_animedit_keys(), and paste_animedit_keys().
|
static |
Definition at line 710 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 711 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 709 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 1134 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 1118 of file keyframes_general.c.
Referenced by ACTION_OT_paste(), and GRAPH_OT_paste().