55 const float mtx[3][3],
56 const float smtx[3][3],
60 float *loc = bezt->
vec[bi];
61 const float *cent = bezt->
vec[1];
72 td2d->
loc[1] = (loc[1] + offset) * unit_scale;
78 td->center[1] = (cent[1] + offset) * unit_scale;
84 td2d->
loc[0] = loc[0];
85 td2d->
loc[1] = (loc[1] + offset) * unit_scale;
91 td->center[1] = (td->center[1] + offset) * unit_scale;
96 td2d->
h1 = bezt->
vec[0];
97 td2d->
h2 = bezt->
vec[2];
172 const bool use_handle,
175 bool *r_right_handle)
178 bool key = (bezt->
f2 &
SELECT) != 0;
179 bool left = use_handle ? ((bezt->
f1 &
SELECT) != 0) : key;
180 bool right = use_handle ? ((bezt->
f3 &
SELECT) != 0) : key;
197 *r_left_handle =
left;
198 *r_right_handle = right;
206 bool sel_key, sel_left, sel_right;
209 for (; j < fcu->
totvert; j++) {
214 if (sel_left || sel_key || sel_right) {
237 View2D *v2d = ®ion->v2d;
244 ListBase anim_data = {
nullptr,
nullptr};
249 float mtx[3][3], smtx[3][3];
254 bool sel_key, sel_left, sel_right;
288 if (!visited_fcurves.
add(fcu)) {
291 unique_fcu_anim_list_elements.
append(ale);
294 bool selected =
false;
297 if (fcu->
bezt ==
nullptr) {
307 cfra =
float(scene->r.cfra);
310 for (i = 0, bezt = fcu->
bezt; i < fcu->
totvert; i++, bezt++) {
318 if (sel_key || sel_left || sel_right) {
332 if (sel_key && !use_local_center) {
377 float xscale, yscale;
387 if (
IS_EQF(xscale, 0.0f) == 0) {
390 if (
IS_EQF(yscale, 0.0f) == 0) {
395 bool at_least_one_key_selected =
false;
402 float unit_scale, offset;
406 if (fcu->
bezt ==
nullptr || (is_prop_edit && ale->tag == 0)) {
416 cfra =
float(scene->r.cfra);
420 ac.
scene, ale->
id,
static_cast<FCurve *
>(ale->key_data), anim_map_flag, &offset);
422 for (i = 0, bezt = fcu->
bezt; i < fcu->
totvert; i++, bezt++) {
424 bezt->
f1 &= ~BEZT_FLAG_TEMP_TAG;
425 bezt->
f2 &= ~BEZT_FLAG_TEMP_TAG;
426 bezt->
f3 &= ~BEZT_FLAG_TEMP_TAG;
434 at_least_one_key_selected |= sel_key;
436 bool is_sel = (sel_key || sel_left || sel_right);
510 if (hdata ==
nullptr) {
530 if (sel_key && !use_local_center) {
542 if (!(sel_left) || !(sel_right)) {
543 if (hdata ==
nullptr) {
573 if (hdata && (sel_left) && (sel_right)) {
597 if (fcu->
bezt ==
nullptr || (ale->tag == 0)) {
607 cfra =
float(scene->r.cfra);
610 for (i = 0, bezt = fcu->
bezt; i < fcu->
totvert; i++, bezt++) {
616 if (sel_left || sel_key) {
632 if (sel_right || sel_key) {
663 if (bezt ==
nullptr) {
667 for (i = 0; i < fcu->
totvert; i++, bezt++) {
696 a++, td++, td2d++, tdg++)
701 float inv_unit_scale = 1.0f / tdg->
unit_scale;
746 if (totvert == 0 || bezts ==
nullptr) {
770 bezm.swap_handles = (bezm.bezt->vec[0][0] > bezm.bezt->vec[1][0] &&
771 bezm.bezt->vec[2][0] < bezm.bezt->vec[1][0]);
775 const int bezms_size = bezms.
size();
776 if (bezms_size < 2) {
785 for (
const int i : bezm_range) {
788 if (bezm->
bezt->
vec[1][0] > (bezm + 1)->bezt->vec[1][0]) {
789 std::swap(*bezm, *(bezm + 1));
799 const bool swap_handles)
822 const BeztMap &bezm = bezms[new_index];
832 if (
const int *trans_data_index = trans_data_map.
lookup_ptr(bezm.
bezt->
vec[0])) {
833 td2d = &tc->
data_2d[*trans_data_index];
840 td = &tc->
data[*trans_data_index];
843 if (
const int *trans_data_index = trans_data_map.
lookup_ptr(bezm.
bezt->
vec[2])) {
844 td2d = &tc->
data_2d[*trans_data_index];
851 td = &tc->
data[*trans_data_index];
854 if (
const int *trans_data_index = trans_data_map.
lookup_ptr(bezm.
bezt->
vec[1])) {
855 td2d = &tc->
data_2d[*trans_data_index];
865 td = &tc->
data[*trans_data_index];
885 for (
int i = 0; i < tc->
data_len; i++) {
893 for (const int i : range) {
894 FCurve *fcu = fcurves[i];
902 blender::Vector<BeztMap> bezms = bezt_to_beztmaps(fcu->bezt, fcu->totvert);
903 sort_time_beztmaps(bezms);
904 update_transdata_bezt_pointers(tc, trans_data_map, fcu, bezms);
908 sort_time_fcurve(fcu);
910 testhandles_fcurve(fcu, BEZT_FLAG_TEMP_TAG, use_handle);
920 ListBase anim_data = {
nullptr,
nullptr};
961 unsorted_fcurves.
append(fcu);
1004 ListBase anim_data = {
nullptr,
nullptr};
Main * CTX_data_main(const bContext *C)
void testhandles_fcurve(FCurve *fcu, eBezTriple_Flag sel_flag, bool use_handle)
bool test_time_fcurve(FCurve *fcu)
void BKE_fcurve_handles_recalc_ex(FCurve *fcu, eBezTriple_Flag handle_sel_flag)
void BKE_fcurve_merge_duplicate_keys(FCurve *fcu, const int sel_flag, const bool use_handle)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode)
#define LISTBASE_FOREACH(type, var, list)
MINLINE float min_ff(float a, float b)
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void unit_m3(float m[3][3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define BEZT_ISSEL_ANY(bezt)
@ SIPO_RUNTIME_FLAG_TWEAK_HANDLES_RIGHT
@ SIPO_RUNTIME_FLAG_TWEAK_HANDLES_LEFT
@ V3D_AROUND_LOCAL_ORIGINS
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_CURVE_VISIBLE
Read Guarded memory(de)allocation.
void UI_view2d_scale_get(const View2D *v2d, float *r_x, float *r_y)
void ANIM_animdata_freelist(ListBase *anim_data)
void ANIM_list_elem_update(Main *bmain, Scene *scene, bAnimListElem *ale)
short ANIM_get_normalization_flags(SpaceLink *space_link)
AnimData * ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
bool ANIM_animdata_context_getdata(bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
constexpr IndexRange drop_back(int64_t n) const
const Value * lookup_ptr(const Key &key) const
bool add(const Key &key, const Value &value)
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr IndexRange index_range() const
void append(const T &value)
IndexRange index_range() const
draw_view in_light_buf[] float
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
void ANIM_editkeyframes_refresh(bAnimContext *ac)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float2 fabs(const float2 a)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
SpaceGraph_Runtime runtime
TransCustomDataContainer custom
TransDataCurveHandleFlags * hdata
bool is_launch_event_drag