44 #include "RNA_prototypes.h"
80 if (strip->
act !=
NULL && do_id_user) {
113 for (strip = nlt->
strips.
first; strip; strip = stripn) {
114 stripn = strip->
next;
150 const bool use_same_action,
169 if (use_same_action) {
199 const bool use_same_actions,
239 for (nlt =
src->first; nlt; nlt = nlt->
next) {
256 "Expecting the same number of source and destination strips");
260 if (strip_dest ==
NULL) {
266 if (strip_source == active_strip) {
273 "Expecting topology of source and destination strips to be equal");
274 if (src_is_meta && dst_is_meta) {
276 active_strip, &strip_source->
strips, &strip_dest->
strips);
277 if (found_in_meta !=
NULL) {
278 return found_in_meta;
282 strip_dest = strip_dest->
next;
317 if (track_source == adt_source->
act_track) {
326 track_dest = track_dest->
next;
331 const bool source_has_actstrip = adt_source->
actstrip !=
NULL;
332 const bool dest_has_actstrip = adt_dest->
actstrip !=
NULL;
334 "Active strip did not copy correctly");
374 first_local = first_local->
next) {
388 strcpy(nlt->
name,
"NlaTrack");
484 #ifdef WITH_AUDASPACE
485 if (speaker->
sound) {
536 float actlength, scale;
555 if (
IS_EQF(actlength, 0.0f)) {
563 return strip->
end - scale * (cframe - strip->
actstart);
566 return (strip->
end + (strip->
actstart * scale - cframe)) / scale;
579 return strip->
actend -
fmodf(cframe - strip->
start, actlength * scale) / scale;
630 switch (strip->
type) {
699 puts(
"BKE_nlastrips_has_space() error... start and end arguments swapped");
700 SWAP(
float, start, end);
704 for (strip = strips->
first; strip; strip = strip->
next) {
708 if (strip->
start >= end) {
715 if ((strip->
end > start) || (strip->
end > end)) {
737 for (strip = strips->
first; strip; strip = stripn) {
740 stripn = strip->
next;
747 for (sstrip = tmp.
last; sstrip; sstrip = sstrip->
prev) {
770 bool not_added =
true;
783 for (ns = strips->
first; ns; ns = ns->
next) {
813 for (strip = strips->
first; strip; strip = stripn) {
814 stripn = strip->
next;
818 if (mstrip ==
NULL) {
887 for (strip = strips->
first; strip; strip = stripn) {
888 stripn = strip->
next;
931 if (strip->
end > mstrip->
end) {
953 float oStart, oEnd,
offset;
955 short scaleChanged = 0;
985 oLen = oEnd - oStart;
987 if (
IS_EQF(nLen, oLen) == 0) {
997 p1 = (strip->
start - oStart) / oLen;
998 p2 = (strip->
end - oStart) / oLen;
1003 strip->
end = (p2 * nLen) + mstrip->
start;
1069 printf(
"%s: Active strip (%p, %s) not in NLA track found (%p, %s)\n",
1149 puts(
"BKE_nlatrack_has_space() error... start and end arguments swapped");
1150 SWAP(
float, start, end);
1234 if (inner_active !=
NULL) {
1235 return inner_active;
1252 limit_prev = strip->
prev->
end;
1310 const float stripLen = (strip) ? strip->
end - strip->
start : 0.0f;
1314 if ((strip ==
NULL) ||
IS_EQF(stripLen, 0.0f) ||
IS_EQF(boundsLen, 0.0f)) {
1322 if ((stripLen < boundsLen) &&
1326 if ((stripLen > boundsLen) &&
1353 else if (strip->
end < nls->
end) {
1366 for (; nls; nls = nls->
next) {
1372 else if (strip->
end > nls->
start) {
1379 for (; nls; nls = nls->
next) {
1414 for (; nls; nls = nls->
prev) {
1420 else if (strip->
start < nls->
end) {
1427 for (; nls; nls = nls->
prev) {
1437 float prev_actstart;
1454 float actlen, mapping;
1466 if (
IS_EQF(actlen, 0.0f)) {
1473 if (
IS_EQF(mapping, 0.0f) == 0) {
1474 strip->
end = (actlen * mapping) + strip->
start;
1528 if (strip ==
NULL) {
1594 if (
ptr->
type == &RNA_NlaStrip) {
1598 static bool needs_init =
true;
1609 if (
ELEM(prop, prop_influence, prop_time)) {
1637 if (strip->
name[0] == 0) {
1638 switch (strip->
type) {
1641 (strip->
act) ? (strip->
act->
id.
name + 2) : (
"<No Action>"),
1642 sizeof(strip->
name));
1665 if (tstrip == strip) {
1684 sizeof(strip->
name));
1773 if (((ps && ns) && (*ps > *ns)) || (ps)) {
1786 if (((pe && ne) && (*pe > *ne)) || (pe)) {
1821 #define STASH_TRACK_NAME DATA_("[Action Stash]")
1831 if (strip->
act == act) {
1870 if (prev_track ==
NULL) {
1930 if (strip ==
NULL) {
1965 NlaTrack **r_track_of_active_strip,
1974 for (nlt = nla_tracks->
first; nlt; nlt = nlt->
next) {
1991 if (activeTrack ==
NULL) {
1993 for (nlt = nla_tracks->
last; nlt; nlt = nlt->
prev) {
2004 if ((activeTrack) && (activeStrip ==
NULL)) {
2009 activeStrip = strip;
2015 *r_track_of_active_strip = activeTrack;
2016 *r_active_strip = activeStrip;
2037 if (
ELEM(
NULL, activeTrack, activeStrip, activeStrip->
act)) {
2039 printf(
"NLA tweak-mode enter - neither active requirement found\n");
2040 printf(
"\tactiveTrack = %p, activeStrip = %p\n", (
void *)activeTrack, (
void *)activeStrip);
2050 if (strip->
act == activeStrip->
act) {
2068 for (nlt = activeTrack->
next; nlt; nlt = nlt->
next) {
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
void BKE_action_get_frame_range(const struct bAction *act, float *r_start, float *r_end)
bool action_has_motion(const struct bAction *act)
bool BKE_action_is_cyclic(const struct bAction *act)
void copy_fmodifiers(ListBase *dst, const ListBase *src)
void BKE_fcurve_blend_write(struct BlendWriter *writer, struct ListBase *fcurves)
void BKE_fmodifiers_blend_read_data(struct BlendDataReader *reader, ListBase *fmodifiers, struct FCurve *curve)
void BKE_fcurve_blend_read_data(struct BlendDataReader *reader, struct ListBase *fcurves)
void BKE_fcurve_foreach_id(struct FCurve *fcu, struct LibraryForeachIDData *data)
void BKE_fmodifiers_blend_write(struct BlendWriter *writer, struct ListBase *fmodifiers)
void BKE_fcurve_blend_read_lib(struct BlendLibReader *reader, struct ID *id, struct ListBase *fcurves)
void BKE_fcurve_blend_read_expand(struct BlendExpander *expander, struct ListBase *fcurves)
void BKE_fcurves_free(ListBase *list)
void BKE_fcurves_copy(ListBase *dst, ListBase *src)
struct FCurve * BKE_fcurve_create(void)
void free_fmodifiers(ListBase *modifiers)
void BKE_fmodifiers_blend_read_expand(struct BlendExpander *expander, struct ListBase *fmodifiers)
struct FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], int array_index)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
struct ID * BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, int flag)
void id_us_min(struct ID *id)
void id_us_plus(struct ID *id)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(_data, _id_super, _cb_flag)
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(_data, _func_call)
#define NLASTRIP_MIN_LEN_THRESH
bool BKE_sound_info_get(struct Main *main, struct bSound *sound, SoundInfo *sound_info)
#define BLI_assert_msg(a, msg)
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
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)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
bool BLI_uniquename_cb(UniquenameCheckCallback unique_check, void *arg, const char *defname, char delim, char *name, size_t name_len)
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_len)
#define IN_RANGE(a, b, c)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_list(BlendDataReader *reader, struct ListBase *list)
#define BLO_read_id_address(reader, lib, id_ptr_p)
#define BLO_expand(expander, id)
#define BLO_write_struct_list(writer, struct_name, list_ptr)
#define CLOG_ERROR(clg_ref,...)
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ NLASTRIP_FLAG_USR_INFLUENCE
@ NLASTRIP_FLAG_TEMP_META
@ NLASTRIP_FLAG_AUTO_BLENDS
@ NLASTRIP_FLAG_USR_TIME_CYCLIC
@ NLASTRIP_FLAG_TWEAKUSER
@ NLASTRIP_FLAG_SYNC_LENGTH
@ ADT_NLA_EVAL_UPPER_TRACKS
@ NLASTRIP_EXTEND_NOTHING
@ NLASTRIP_TYPE_TRANSITION
@ NLATRACK_OVERRIDELIBRARY_LOCAL
Read Guarded memory(de)allocation.
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
SyclQueue void void * src
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float3 ceil(const float3 &a)
T length(const vec_base< T, Size > &a)
SymEdge< T > * prev(const SymEdge< T > *se)
float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode)
float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode)
bool BKE_nlatrack_get_bounds(NlaTrack *nlt, float bounds[2])
static NlaStrip * nlastrip_find_active(ListBase *strips)
static void blend_write_nla_strips(BlendWriter *writer, ListBase *strips)
void BKE_nla_action_pushdown(AnimData *adt, const bool is_liboverride)
bool BKE_nla_tweakmode_enter(AnimData *adt)
void BKE_nlameta_flush_transforms(NlaStrip *mstrip)
bool BKE_nlatrack_has_animated_strips(NlaTrack *nlt)
NlaTrack * BKE_nlatrack_find_tweaked(AnimData *adt)
static void blend_lib_read_nla_strips(BlendLibReader *reader, ID *id, ListBase *strips)
void BKE_nlastrips_clear_metastrip(ListBase *strips, NlaStrip *strip)
static void nla_tweakmode_find_active(const ListBase *nla_tracks, NlaTrack **r_track_of_active_strip, NlaStrip **r_active_strip)
void BKE_nla_blend_read_lib(BlendLibReader *reader, ID *id, ListBase *tracks)
NlaStrip * BKE_nlastrip_new(bAction *act)
static void update_active_track(AnimData *adt_dest, const AnimData *adt_source)
void BKE_nla_tracks_copy(Main *bmain, ListBase *dst, const ListBase *src, const int flag)
void BKE_nlastrip_recalculate_bounds_sync_action(NlaStrip *strip)
static float nlastrip_get_frame_actionclip(NlaStrip *strip, float cframe, short mode)
void BKE_nlastrip_free(ListBase *strips, NlaStrip *strip, bool do_id_user)
void BKE_nlastrips_sort_strips(ListBase *strips)
void BKE_nlastrips_clear_metas(ListBase *strips, bool only_sel, bool only_temp)
float BKE_nlastrip_compute_frame_to_next_strip(NlaStrip *strip)
static void nlastrip_get_endpoint_overlaps(NlaStrip *strip, NlaTrack *track, float **start, float **end)
NlaStrip * BKE_nlastack_add_strip(AnimData *adt, bAction *act, const bool is_liboverride)
void BKE_nla_tracks_copy_from_adt(Main *bmain, AnimData *adt_dest, const AnimData *adt_source, const int flag)
void BKE_nla_validate_state(AnimData *adt)
void BKE_nlatrack_solo_toggle(AnimData *adt, NlaTrack *nlt)
static float nlastrip_get_frame_transition(NlaStrip *strip, float cframe, short mode)
void BKE_nlatrack_free(ListBase *tracks, NlaTrack *nlt, bool do_id_user)
static void blend_data_read_nla_strips(BlendDataReader *reader, ListBase *strips)
void BKE_nlastrip_recalculate_bounds(NlaStrip *strip)
bool BKE_nlastrips_has_space(ListBase *strips, float start, float end)
bool BKE_nla_action_stash(AnimData *adt, const bool is_liboverride)
bool BKE_nlastrips_add_strip(ListBase *strips, NlaStrip *strip)
bool BKE_nlastrip_has_curves_for_property(const PointerRNA *ptr, const PropertyRNA *prop)
NlaStrip * BKE_nla_add_soundstrip(Main *bmain, Scene *scene, Speaker *speaker)
static NlaStrip * find_active_strip_from_listbase(const NlaStrip *active_strip, const ListBase *strips_source, const ListBase *strips_dest)
void BKE_nlastrip_set_active(AnimData *adt, NlaStrip *strip)
void BKE_nla_blend_write(BlendWriter *writer, ListBase *tracks)
void BKE_nla_tracks_free(ListBase *tracks, bool do_id_user)
NlaStrip * BKE_nlastrip_copy(Main *bmain, NlaStrip *strip, const bool use_same_action, const int flag)
bool BKE_nlatrack_has_space(NlaTrack *nlt, float start, float end)
void BKE_nlatrack_sort_strips(NlaTrack *nlt)
static void BKE_nlastrip_validate_autoblends(NlaTrack *nlt, NlaStrip *nls)
void BKE_nlatrack_set_active(ListBase *tracks, NlaTrack *nlt_a)
static void nlastrip_fix_resize_overlaps(NlaStrip *strip)
bool BKE_nlatrack_is_nonlocal_in_liboverride(const ID *id, const NlaTrack *nlt)
float BKE_nlastrip_compute_frame_from_previous_strip(NlaStrip *strip)
bool BKE_nlastrip_within_bounds(NlaStrip *strip, float min, float max)
static void update_active_strip(AnimData *adt_dest, NlaTrack *track_dest, const AnimData *adt_source, const NlaTrack *track_source)
bool BKE_nlatrack_add_strip(NlaTrack *nlt, NlaStrip *strip, const bool is_liboverride)
static void blend_read_expand_nla_strips(BlendExpander *expander, ListBase *strips)
void BKE_nlastrip_validate_name(AnimData *adt, NlaStrip *strip)
bool BKE_nlameta_add_strip(NlaStrip *mstrip, NlaStrip *strip)
NlaTrack * BKE_nlatrack_add(AnimData *adt, NlaTrack *prev, const bool is_liboverride)
bool BKE_nlatracks_have_animated_strips(ListBase *tracks)
NlaTrack * BKE_nlatrack_find_active(ListBase *tracks)
static bool nla_editbone_name_check(void *arg, const char *name)
NlaStrip * BKE_nlastrip_find_active(NlaTrack *nlt)
NlaTrack * BKE_nlatrack_copy(Main *bmain, NlaTrack *nlt, const bool use_same_actions, const int flag)
void BKE_nlastrip_validate_fcurves(NlaStrip *strip)
void BKE_nla_tweakmode_exit(AnimData *adt)
bool BKE_nla_action_is_stashed(AnimData *adt, bAction *act)
void BKE_nla_blend_read_expand(struct BlendExpander *expander, struct ListBase *tracks)
void BKE_nla_strip_foreach_id(NlaStrip *strip, LibraryForeachIDData *data)
void BKE_nlastrips_make_metas(ListBase *strips, bool is_temp)
void BKE_nla_blend_read_data(BlendDataReader *reader, ListBase *tracks)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
SymEdge< Arith_t > * next