98 if ((ok = key_ok(ked, bezt))) {
106 if (key_cb(ked, bezt)) {
121 if (key_cb(ked, bezt)) {
154 if (agrp ==
nullptr) {
159 if (agrp->wrap().is_legacy()) {
161 if (fcu->grp == agrp) {
174 for (
FCurve *fcurve : fcurves) {
197 for (
FCurve *fcurve : fcurves) {
213 if (act ==
nullptr) {
236 ListBase anim_data = {
nullptr,
nullptr};
241 Base dummy_base = {
nullptr};
251 dummy_chan.
data = &dummy_base;
252 dummy_chan.
id = &ob->
id;
256 ac.
data = &dummy_chan;
291 ListBase anim_data = {
nullptr,
nullptr};
297 if (sce ==
nullptr) {
303 dummy_chan.
data = sce;
304 dummy_chan.
id = &sce->
id;
305 dummy_chan.
adt = sce->
adt;
308 ac.
data = &dummy_chan;
341 ListBase anim_data = {
nullptr,
nullptr};
356 switch (ale->datatype) {
380 ked,
static_cast<FCurve *
>(ale->data), key_ok, key_cb, fcu_cb);
389 ked,
static_cast<FCurve *
>(ale->data), key_ok, key_cb, fcu_cb);
415 if (ale ==
nullptr) {
424 ked,
static_cast<FCurve *
>(ale->
key_data), key_ok, key_cb, fcu_cb);
452 ked, ads,
static_cast<Object *
>(ale->
key_data), key_ok, key_cb, fcu_cb);
455 ked, ads,
static_cast<Scene *
>(ale->
data), key_ok, key_cb, fcu_cb);
477 ListBase anim_data = {
nullptr,
nullptr};
484 static_cast<FCurve *
>(ale->key_data),
500 ListBase anim_data = {
nullptr,
nullptr};
527 if (!handles_shown) {
530 const bool handles_shown_only_selected = ked->
iterflags &
542 if (check(ked, bezt, 1)) {
548 if (check(ked, bezt, 0)) {
551 if (check(ked, bezt, 2)) {
576 return (bezt->
vec[index][0] > ked->
f1) && (bezt->
vec[index][0] < ked->
f2);
622 return (bezt->
vec[index][1] > ked->
f1) && (bezt->
vec[index][1] < ked->
f2);
687 data->rectf_scaled->xmin = ked->
f1;
688 data->rectf_scaled->xmax = ked->
f2;
692 pt[0] = bezt->
vec[1][0];
709 xy_view[0] = xy_view[0] - data_circle->
mval[0];
710 xy_view[1] = xy_view[1] - data_circle->
mval[1];
746 data->rectf_scaled->xmin = ked->
f1;
747 data->rectf_scaled->xmax = ked->
f2;
751 pt[0] = bezt->
vec[1][0];
811 ked->
f1 += bezt->
vec[1][0];
816 ked->
f2 += bezt->
vec[1][1];
837 if (ale !=
nullptr) {
876 const float secf =
float(scene->frames_per_second());
908 bezt->
vec[0][1] = bezt->
vec[2][1] = bezt->
vec[1][1];
965 for (
int i = 0;
i < 3;
i++) {
966 float diff = (center - bezt->
vec[
i][0]);
971 std::swap(bezt->
h1, bezt->
h2);
972 std::swap(bezt->
f1, bezt->
f3);
977 for (
int i = 0;
i < 3;
i++) {
978 float diff = (center - bezt->
vec[
i][1]);
1072#define ENSURE_HANDLES_MATCH(bezt) \
1073 if (bezt->h1 != bezt->h2) { \
1074 if (ELEM(bezt->h1, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) { \
1075 bezt->h1 = HD_FREE; \
1077 if (ELEM(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) { \
1078 bezt->h2 = HD_FREE; \
1329 BLI_assert_msg(idx == 0 || idx == 2,
"handle_flatten() expects a handle index");
1336 BLI_assert_msg(idx == 0 || idx == 2,
"handle_set_length() expects a handle index");
1338 float handle_direction[2];
1346 const float handle_length,
1351 const float flat_direction_left[2] = {-handle_length, 0.0f};
1352 const float flat_direction_right[2] = {handle_length, 0.0f};
1485 switch (keyframe_type) {
1624 switch (selectmode) {
1650 char *map =
static_cast<char *
>(ked->
data);
1685 char *map =
static_cast<char *
>(ked->
data);
1713 else if (
i == (fcu->
totvert - 1)) {
1741 const char *map =
static_cast<char *
>(ked->
data);
Functions and classes to work with Actions.
void BKE_fcurve_keyframe_move_time_with_handles(BezTriple *keyframe, const float new_time)
void BKE_fcurve_handles_recalc(FCurve *fcu)
void BKE_fcurve_keyframe_move_value_with_handles(BezTriple *keyframe, float new_value)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
bool BLI_lasso_is_point_inside(blender::Span< blender::int2 > mcoords, int sx, int sy, int error_value)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v2_length(float n[2], float unit_length)
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void swap_v3_v3(float a[3], float b[3])
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
void BLI_rctf_transform_pt_v(const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2])
#define BEZT_ISSEL_IDX(bezt, i)
#define BEZT_SEL_ALL(bezt)
#define BEZT_ISSEL_ANY(bezt)
#define BEZT_DESEL_ALL(bezt)
#define BEZKEYTYPE_LVALUE(bezt)
Object is a sort of wrapper for general info.
#define ANIM_UPDATE_DEFAULT
@ ALE_GREASE_PENCIL_GROUP
@ ANIMFILTER_DATA_VISIBLE
@ KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE
@ KEYFRAME_ITER_INCL_HANDLES
@ KEYFRAME_ITER_HANDLES_INVISIBLE
short(*)(KeyframeEditData *ked, BezTriple *bezt) KeyframeEditFunc
void(*)(FCurve *fcu) FcuEditFunc
Read Guarded memory(de)allocation.
void ANIM_animdata_freelist(ListBase *anim_data)
void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
float ANIM_nla_tweakedit_remap(bAnimListElem *ale, const float cframe, const eNlaTime_ConvertModes mode)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
int ED_markers_find_nearest_marker_time(ListBase *markers, float x)
BMesh const char void * data
Slot * slot_for_handle(slot_handle_t handle)
blender::Span< const FCurve * > fcurves() const
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt)
static short mirror_bezier_xaxis(KeyframeEditData *, BezTriple *bezt)
static short ok_bezier_channel_circle(KeyframeEditData *ked, BezTriple *bezt)
static short summary_keyframes_loop(KeyframeEditData *ked, bAnimContext *ac, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
static short ok_bezier_selected(KeyframeEditData *, BezTriple *bezt)
static short set_bezier_auto_clamped(KeyframeEditData *, BezTriple *bezt)
static void mirror_bezier_xaxis_ex(BezTriple *bezt, const float center)
static short ok_bezier_framerange(KeyframeEditData *ked, BezTriple *bezt)
static short set_bezt_circle(KeyframeEditData *, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_mirror(short mode)
static short keyframe_ok_checks(KeyframeEditData *ked, BezTriple *bezt, blender::FunctionRef< bool(KeyframeEditData *ked, BezTriple *bezt, const int index)> check)
short bezt_selmap_flush(KeyframeEditData *ked, BezTriple *bezt)
#define ENSURE_HANDLES_MATCH(bezt)
static short set_easingtype_easeout(KeyframeEditData *, BezTriple *bezt)
void ANIM_editkeyframes_refresh(bAnimContext *ac)
static short set_bezt_quart(KeyframeEditData *, BezTriple *bezt)
static short set_bezt_expo(KeyframeEditData *, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_easing(short mode)
static short set_bezier_vector(KeyframeEditData *, BezTriple *bezt)
static short set_easingtype_easeauto(KeyframeEditData *, BezTriple *bezt)
static short set_bezt_bounce(KeyframeEditData *, BezTriple *bezt)
static short snap_bezier_nearest(KeyframeEditData *, BezTriple *bezt)
static short select_bezier_subtract(KeyframeEditData *ked, BezTriple *bezt)
static short snap_bezier_value(KeyframeEditData *ked, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_ipo(short mode)
static short mirror_bezier_value(KeyframeEditData *ked, BezTriple *bezt)
static short set_keytype_generated(KeyframeEditData *, BezTriple *bezt)
static short selmap_build_bezier_more(KeyframeEditData *ked, BezTriple *bezt)
bool keyframe_region_lasso_test(const KeyframeEdit_LassoData *data_lasso, const float xy[2])
static short set_keytype_extreme(KeyframeEditData *, BezTriple *bezt)
static short ok_bezier_region_circle(KeyframeEditData *ked, BezTriple *bezt)
static short set_bezt_elastic(KeyframeEditData *, BezTriple *bezt)
static short select_bezier_add(KeyframeEditData *ked, BezTriple *bezt)
static short snap_bezier_nearmarker(KeyframeEditData *ked, BezTriple *bezt)
static short scene_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, Scene *sce, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
static short set_keytype_breakdown(KeyframeEditData *, BezTriple *bezt)
static void handle_set_length(float vec[3][3], const int idx, const float handle_length)
void ANIM_fcurve_equalize_keyframes_loop(FCurve *fcu, const eEditKeyframes_Equalize mode, const float handle_length, const bool flatten)
static short set_keytype_moving_hold(KeyframeEditData *, BezTriple *bezt)
static short snap_bezier_time(KeyframeEditData *ked, BezTriple *bezt)
static short action_legacy_keyframes_loop(KeyframeEditData *ked, bAction *act, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
static short ok_bezier_selected_key(KeyframeEditData *, BezTriple *bezt)
static short select_bezier_invert(KeyframeEditData *, BezTriple *bezt)
static void handle_flatten(float vec[3][3], const int idx, const float direction[2])
static short set_bezier_auto(KeyframeEditData *, BezTriple *bezt)
static short set_bezt_quint(KeyframeEditData *, BezTriple *bezt)
static short set_bezt_quad(KeyframeEditData *, BezTriple *bezt)
static short set_bezt_bezier(KeyframeEditData *, BezTriple *bezt)
static short snap_bezier_horizontal(KeyframeEditData *, BezTriple *bezt)
static short ok_bezier_frame(KeyframeEditData *ked, BezTriple *bezt)
static short set_bezt_back(KeyframeEditData *, BezTriple *bezt)
static short set_bezier_free(KeyframeEditData *, BezTriple *bezt)
static short set_bezt_sine(KeyframeEditData *, BezTriple *bezt)
static short set_keytype_jitter(KeyframeEditData *, BezTriple *bezt)
static short set_easingtype_easein(KeyframeEditData *, BezTriple *bezt)
short bezt_to_cfraelem(KeyframeEditData *ked, BezTriple *bezt)
static short snap_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_buildselmap(short mode)
static short set_bezier_align(KeyframeEditData *, BezTriple *bezt)
static short agrp_keyframes_loop(KeyframeEditData *ked, bActionGroup *agrp, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
static short mirror_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt)
short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, bAnimListElem *ale, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
static void mirror_bezier_yaxis_ex(BezTriple *bezt, const float center)
bool keyframe_region_circle_test(const KeyframeEdit_CircleData *data_circle, const float xy[2])
void bezt_remap_times(KeyframeEditData *ked, BezTriple *bezt)
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
static bool handles_visible(KeyframeEditData *ked, BezTriple *bezt)
static short bezier_isfree(KeyframeEditData *, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_keytype(const eBezTriple_KeyframeType keyframe_type)
static short set_bezt_cubic(KeyframeEditData *, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_ok(short mode)
static short set_bezt_constant(KeyframeEditData *, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_snap(short mode)
static short ob_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, Object *ob, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
static short snap_bezier_nearestsec(KeyframeEditData *ked, BezTriple *bezt)
static short set_easingtype_easeinout(KeyframeEditData *, BezTriple *bezt)
static short mirror_bezier_marker(KeyframeEditData *ked, BezTriple *bezt)
static short action_layered_keyframes_loop(KeyframeEditData *ked, animrig::Action &action, animrig::Slot *slot, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
static short selmap_build_bezier_less(KeyframeEditData *ked, BezTriple *bezt)
static short ok_bezier_region(KeyframeEditData *ked, BezTriple *bezt)
void ANIM_animdata_keyframe_callback(bAnimContext *ac, eAnimFilter_Flags filter, KeyframeEditFunc callback_fn)
short bezt_calc_average(KeyframeEditData *ked, BezTriple *bezt)
static short set_bezt_linear(KeyframeEditData *, BezTriple *bezt)
static short mirror_bezier_yaxis(KeyframeEditData *, BezTriple *bezt)
static short ok_bezier_valuerange(KeyframeEditData *ked, BezTriple *bezt)
static short mirror_bezier_time(KeyframeEditData *ked, BezTriple *bezt)
static short ok_bezier_channel_lasso(KeyframeEditData *ked, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_select(const eEditKeyframes_Select selectmode)
static short set_keytype_keyframe(KeyframeEditData *, BezTriple *bezt)
static short ok_bezier_value(KeyframeEditData *ked, BezTriple *bezt)
static short ok_bezier_region_lasso(KeyframeEditData *ked, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_handles(short mode)
void * MEM_callocN(size_t len, const char *str)
Span< FCurve * > fcurves_for_action_slot(Action &action, slot_handle_t slot_handle)
float wrap(float value, float max, float min)
eKeyframeIterFlags iterflags
blender::Array< blender::int2 > mcoords
struct ActionChannelbag * channelbag
eDopeSheet_FilterFlag flag
struct bAnimContext::@242276144047124000362312251357014355232301013033 filters
eDopeSheet_FilterFlag2 flag2