30#include "RNA_prototypes.hh"
68 const float right_bound_a,
69 const float left_bound_b,
70 const float right_bound_b)
72 return (left_bound_a < right_bound_b) && (right_bound_a > left_bound_b);
81 strip_a->
end + offset_a,
82 strip_b->
start + offset_b,
83 strip_b->
end + offset_b);
95 float total_offset = 0;
120 offset = shuffle_left ?
121 fmin(offset, non_xformed_strip->start - (xformed_strip->
end + total_offset)) :
122 fmax(offset, non_xformed_strip->end - (xformed_strip->
start + total_offset));
126 total_offset += offset;
127 }
while (!
IS_EQT(offset, 0.0f, 1
e-4));
148 return -offset_left < offset_right ? offset_left : offset_right;
164 const int shuffle_direction,
188 if (dst_track ==
nullptr) {
199 offset = shuffle_direction;
203 *r_total_offset += offset;
204 }
while (offset != 0);
226 if (down_valid && up_valid) {
227 if (offset_down <
abs(offset_up)) {
228 *r_track_offset = offset_down;
231 *r_track_offset = offset_up;
234 else if (down_valid) {
235 *r_track_offset = offset_down;
238 *r_track_offset = offset_up;
241 return down_valid || up_valid;
251 ListBase anim_data = {
nullptr,
nullptr};
259 ListBase *nla_tracks = &ale->adt->nla_tracks;
266 if (track->strips.first !=
nullptr) {
282 if (track->strips.first !=
nullptr) {
290 track->flag &= ~NLATRACK_TEMPORARILY_ADDED;
351 adj_strip = strip->
next;
373 for (
short iter = 0; iter <= iter_max; iter++) {
374 const bool p_exceeded = (prev !=
nullptr) && (tdn->
h1[0] < prev->end);
375 const bool n_exceeded = (
next !=
nullptr) && (tdn->
h2[0] >
next->start);
377 if ((p_exceeded && n_exceeded) || (iter == iter_max)) {
384 tdn->
h1[0] = prev->end;
389 tdn->
h2[0] = strip->
end;
392 else if (n_exceeded) {
394 float offset = tdn->
h2[0] -
next->start;
396 tdn->
h1[0] -= offset;
397 tdn->
h2[0] -= offset;
399 else if (p_exceeded) {
401 float offset = prev->end - tdn->
h1[0];
403 tdn->
h1[0] += offset;
404 tdn->
h2[0] += offset;
420 const float originalStripScale = tdn->
h1[2];
421 const float newStripScale = originalStripScale * t->
values_final[0];
430 printf(
"recalcData_nla: unsupported NLA transformation mode %d\n", t->
mode);
449 ListBase anim_data = {
nullptr,
nullptr};
554 float center[3], yval;
565 tdn->
h1[0] = strip->start;
567 tdn->
h2[0] = strip->end;
569 tdn->
h1[2] = tdn->
h2[2] = strip->scale;
571 center[0] =
float(scene->r.cfra);
649 for (
int i = 0; i < tc->
data_len; i++, tdn++) {
651 int delta_y1, delta_y2;
657 strip->
flag &= ~NLASTRIP_FLAG_INVALID_LOCATION;
679 strip->
end = tdn->
h2[0];
709 strip->
end = tdn->
h2[0];
725 if (nlatrack_isliboverride) {
737 int delta = (delta_y2) ? delta_y2 : delta_y1;
750 int delta_new_tracks = delta;
755 CLAMP(delta_new_tracks, -1, 1);
756 dst_track = old_track;
758 while (delta_new_tracks < 0) {
759 dst_track = dst_track->
prev;
765 while (delta_new_tracks > 0) {
766 dst_track = dst_track->
next;
770 for (
int j = 0; j < -delta_new_tracks; j++) {
774 nla_tracks, (
NlaTrack *)nla_tracks->
first, new_track, is_liboverride);
775 dst_track = new_track;
778 for (
int j = 0; j < delta_new_tracks; j++) {
783 nla_tracks, (
NlaTrack *)nla_tracks->
last, new_track, is_liboverride);
784 dst_track = new_track;
788 if (dst_track ==
nullptr) {
789 dst_track = old_track;
793 if (dst_track != old_track) {
797 tdn->
nlt = dst_track;
831 ListBase grouped_trans_datas = {
nullptr,
nullptr};
838 for (
int i = 0; i < tc->
data_len; i++, tdn++) {
856 if (group->id == tdn->
id) {
861 if (dst_group ==
nullptr) {
864 dst_group->
id = tdn->
id;
874 ListBase *trans_datas = &group->trans_datas;
877 int minimum_track_offset = 0;
879 if (minimum_track_offset != 0) {
893 trans_data->
nlt = dst_track;
897 printf(
"Cannot moved. Target track '%s' is locked. \n", trans_data->
nlt->
name);
904 trans_data->
nlt = old_track;
915 strip->
start += minimum_time_offset;
916 strip->
end += minimum_time_offset;
951 for (
int i = 0; i < tc->
data_len; i++, tdn++) {
952 if (tdn->
strip ==
nullptr) {
956 tdn->
strip->
flag &= ~NLASTRIP_FLAG_INVALID_LOCATION;
959 ListBase anim_data = {
nullptr,
nullptr};
AnimData * BKE_animdata_from_id(const ID *id)
Main * CTX_data_main(const bContext *C)
void BKE_nlameta_flush_transforms(NlaStrip *mstrip)
bool BKE_nlatrack_add_strip(NlaTrack *nlt, NlaStrip *strip, bool is_liboverride)
void BKE_nlastrips_clear_metas(ListBase *strips, bool only_sel, bool only_temp)
NlaStrip * BKE_nlastrip_prev_in_track(NlaStrip *strip, bool skip_transitions)
void BKE_nlatrack_insert_after(ListBase *nla_tracks, NlaTrack *prev, NlaTrack *new_track, bool is_liboverride)
void BKE_nlatrack_set_active(ListBase *tracks, NlaTrack *nlt)
NlaStrip * BKE_nlastrip_next_in_track(NlaStrip *strip, bool skip_transitions)
void BKE_nlatrack_remove_strip(NlaTrack *track, NlaStrip *strip)
void BKE_nlastrips_add_strip_unsafe(ListBase *strips, NlaStrip *strip)
struct NlaTrack * BKE_nlatrack_new(void)
void BKE_nlatrack_sort_strips(NlaTrack *nlt)
void BKE_nlatrack_insert_before(ListBase *nla_tracks, NlaTrack *next, NlaTrack *new_track, bool is_liboverride)
bool BKE_nlatrack_is_nonlocal_in_liboverride(const ID *id, const NlaTrack *nlt)
void BKE_nlatrack_remove_and_free(ListBase *tracks, NlaTrack *nlt, bool do_id_user)
void BKE_nlastrips_make_metas(ListBase *strips, bool is_temp)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_BACKWARD_MUTABLE(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
struct LinkData * BLI_genericNodeN(void *data)
void BLI_listbase_swaplinks(struct ListBase *listbase, void *vlinka, void *vlinkb) ATTR_NONNULL(1
void unit_m3(float m[3][3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ NLASTRIP_FLAG_INVALID_LOCATION
@ NLASTRIP_TYPE_TRANSITION
@ NLATRACK_TEMPORARILY_ADDED
@ NLATRACK_OVERRIDELIBRARY_LOCAL
void ED_nla_postop_refresh(bAnimContext *ac)
#define NLATRACK_STEP(snla)
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_VISIBLE
Read Guarded memory(de)allocation.
void ANIM_animdata_freelist(ListBase *anim_data)
void ANIM_id_update(Main *bmain, ID *id)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
void *(* MEM_callocN)(size_t len, const char *str)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
IDGroupedTransData * next
IDGroupedTransData * prev
TransCustomDataContainer custom
ccl_device_inline int abs(int x)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)