15#ifdef WITH_ANIM_BAKLAVA
41 "The strip values replace the accumulated results by amount specified by influence"},
46 "The strip values are combined with accumulated results by appropriately using addition, "
47 "multiplication, or quaternion math, based on channel type"},
53 "Weighted result of strip is added to the accumulated results"},
58 "Weighted result of strip is removed from the accumulated results"},
63 "Weighted result of strip is multiplied with the accumulated results"},
64 {0,
nullptr, 0,
nullptr,
nullptr},
73 "Hold the first frame if no previous strips in track, and always hold last frame"},
75 {0,
nullptr, 0,
nullptr,
nullptr},
80# include <fmt/format.h>
96static void rna_NlaStrip_name_set(
PointerRNA *
ptr,
const char *value)
110static std::optional<std::string> rna_NlaStrip_path(
const PointerRNA *
ptr)
124 char name_esc_nlt[
sizeof(nlt->
name) * 2];
125 char name_esc_strip[
sizeof(strip->name) * 2];
128 BLI_str_escape(name_esc_strip, strip->name,
sizeof(name_esc_strip));
130 "animation_data.nla_tracks[\"{}\"].strips[\"{}\"]", name_esc_nlt, name_esc_strip);
151 rna_NlaStrip_update(bmain, scene,
ptr);
172 rna_NlaStrip_update(bmain, scene,
ptr);
175static void rna_NlaStrip_start_frame_set(
PointerRNA *
ptr,
float value)
188 CLAMP(value, limit_prev, limit_next);
202 data->end = limit_next;
209 data->prev->end = data->start;
213static void rna_NlaStrip_frame_start_ui_set(
PointerRNA *
ptr,
float value)
229 const float striplen = data->end - data->start;
243 CLAMP(value, limit_prev, limit_next);
247 data->end = data->start + striplen;
252 data->prev->end = data->start;
255 data->next->start = data->end;
259static void rna_NlaStrip_end_frame_set(
PointerRNA *
ptr,
float value)
265 CLAMP(value, limit_prev, limit_next);
279 data->start = limit_prev;
286 data->next->start = data->end;
290static void rna_NlaStrip_frame_end_ui_set(
PointerRNA *
ptr,
float value)
298 const float old_strip_end = data->end;
309 CLAMP(value, limit_prev, limit_next);
314 data->next->start = value;
329 float action_length_delta = (old_strip_end - data->end) / data->scale;
331 if (
IS_EQF(data->repeat, 1.0f)) {
335 if (
IS_EQF(action_length_delta, actlen)) {
336 data->actend = data->actstart + 1.0f;
339 else if (action_length_delta < actlen) {
341 data->actend = data->actend - action_length_delta;
348 data->repeat -= (action_length_delta / actlen);
353static void rna_NlaStrip_scale_set(
PointerRNA *
ptr,
float value)
360 CLAMP(value, 0.0001f, 1000.0f);
367static void rna_NlaStrip_repeat_set(
PointerRNA *
ptr,
float value)
374 CLAMP(value, 0.01f, 1000.0f);
375 data->repeat = value;
381static void rna_NlaStrip_blend_in_set(
PointerRNA *
ptr,
float value)
387 len = (data->end - data->start) - data->blendout;
390 data->blendin = value;
393static void rna_NlaStrip_blend_out_set(
PointerRNA *
ptr,
float value)
399 len = (data->end - data->start);
403 if ((
len - value) < data->blendin) {
404 value =
len - data->blendin;
407 data->blendout = value;
410static void rna_NlaStrip_use_auto_blend_set(
PointerRNA *
ptr,
bool value)
429 data->flag &= ~NLASTRIP_FLAG_AUTO_BLENDS;
433 data->blendin = 0.0f;
434 data->blendout = 0.0f;
438static int rna_NlaStrip_action_editable(
const PointerRNA *
ptr,
const char ** )
463# ifdef WITH_ANIM_BAKLAVA
464static void rna_NlaStrip_action_slot_handle_set(
468 rna_generic_action_slot_handle_set(new_slot_handle,
471 strip->action_slot_handle,
472 strip->action_slot_name);
478 return rna_generic_action_slot_get(strip->act, strip->action_slot_handle);
484 rna_generic_action_slot_set(value,
487 strip->action_slot_handle,
488 strip->action_slot_name,
496 rna_iterator_generic_action_slots_begin(iter, strip->act);
500static void rna_NlaStrip_action_start_frame_set(
PointerRNA *
ptr,
float value)
506 data->actstart = value;
513static void rna_NlaStrip_action_end_frame_set(
PointerRNA *
ptr,
float value)
519 data->actend = value;
525static void rna_NlaStrip_animated_influence_set(
PointerRNA *
ptr,
bool value)
535 data->flag &= ~NLASTRIP_FLAG_USR_INFLUENCE;
539static void rna_NlaStrip_animated_time_set(
PointerRNA *
ptr,
bool value)
549 data->flag &= ~NLASTRIP_FLAG_USR_TIME;
555 const char *data_path,
558 if (data_path[0] ==
'\0') {
579 if (strip ==
nullptr) {
584 strip->
end += (start - strip->
start);
585 strip->
start = start;
591 "Unable to add strip (the track does not have any space to accommodate this new strip)");
608 while ((nlt = nlt->
prev) !=
nullptr) {
616 while ((nlt = nlt->
next) !=
nullptr) {
633static void rna_NlaStrip_remove(
639 reports,
RPT_ERROR,
"NLA strip '%s' not found in track '%s'", strip->
name, track->
name);
655static void rna_NlaTrack_solo_set(
PointerRNA *
ptr,
bool value)
661 if (data ==
nullptr) {
666 for (nt = data; nt; nt = nt->
next) {
667 nt->
flag &= ~NLATRACK_SOLO;
669 for (nt = data; nt; nt = nt->
prev) {
670 nt->
flag &= ~NLATRACK_SOLO;
685 adt->
flag &= ~ADT_NLA_SOLO_TRACK;
707 "Find an F-Curve. Note that this function performs a linear scan "
708 "of all F-Curves in the NLA strip.");
710 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
712 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
715 func,
"fcurve",
"FCurve",
"",
"The found F-Curve, or None if it doesn't exist");
731 "NLA Strip 'transitions' between adjacent strips"},
732 {
NLASTRIP_TYPE_META,
"META", 0,
"Meta",
"NLA Strip acts as a container for adjacent strips"},
737 "NLA Strip representing a sound event for speakers"},
738 {0,
nullptr, 0,
nullptr,
nullptr},
769 prop,
"Extrapolation",
"Action to take for gaps past the strip extents");
776 prop,
"Blending",
"Method used for combining strip's result with accumulated result");
806 "Start Frame (raw value)",
807 "Same as frame_start, except that any value can be set, including ones "
808 "that create an invalid state");
815 "End Frame (raw value)",
816 "Same as frame_end, except that any value can be set, including ones "
817 "that create an invalid state");
827 "Start Frame (manipulated from UI)",
828 "Start frame of the NLA strip. Note: changing this value also updates the value of "
829 "the strip's end frame. If only the start frame should be changed, see the \"frame_start\" "
830 "property instead.");
842 "End Frame (manipulated from UI)",
843 "End frame of the NLA strip. Note: changing this value also updates the value of "
844 "the strip's repeats or its action's end frame. If only the end frame should be "
845 "changed, see the \"frame_end\" property instead.");
857 prop,
"Blend In",
"Number of frames at start of strip to fade in influence");
871 "Number of frames for Blending In/Out is automatically determined from "
872 "overlapping strips");
885# ifdef WITH_ANIM_BAKLAVA
893 "Action Slot Handle",
894 "A number that identifies which sub-set of the Action is considered "
895 "to be for this NLA strip");
904 "The name of the action slot. The slot identifies which sub-set of the Action "
905 "is considered to be for this strip, and its name is used to find the right slot "
906 "when assigning an Action.");
915 "The slot identifies which sub-set of the Action is considered to be for this "
916 "strip, and its name is used to find the right slot when assigning another Action");
918 prop,
"rna_NlaStrip_action_slot_get",
"rna_NlaStrip_action_slot_set",
nullptr,
nullptr);
934 "rna_iterator_nlastrip_action_slots_begin",
935 "rna_iterator_array_next",
936 "rna_iterator_array_end",
937 "rna_iterator_array_dereference_get",
943 prop,
"Action Slots",
"The list of action slots suitable for this NLA strip");
989 prop,
"F-Curves",
"F-Curves for controlling the strip's influence and timing");
996 prop,
"Modifiers",
"Modifiers affecting all the F-Curves in the referenced Action");
1004 "NLA Strips that this strip acts as a container for (if it is of type Meta)");
1010 prop,
"Influence",
"Amount the strip contributes to the current result");
1031 "Animated Influence",
1032 "Influence setting is controlled by an F-Curve rather than automatically determined");
1040 "Animated Strip Time",
1041 "Strip time is controlled by an F-Curve rather than automatically determined");
1047 prop,
"Cyclic Strip Time",
"Cycle the animated time within the action start and end");
1074 "NLA Strip is played back in reverse order (only when timing is "
1075 "automatically determined)");
1081 "Sync Action Length",
1082 "Update range of frames referenced from action "
1083 "after tweaking strip and its keyframes");
1104 parm =
RNA_def_string(func,
"name",
"NlaStrip", 0,
"",
"Name for the NLA Strips");
1112 "Start frame for this strip",
1116 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"Action to assign to this strip");
1119 parm =
RNA_def_pointer(func,
"strip",
"NlaStrip",
"",
"New NLA Strip");
1126 parm =
RNA_def_pointer(func,
"strip",
"NlaStrip",
"",
"NLA Strip to remove");
1138 srna,
"NLA Track",
"An animation layer containing Actions referenced as NLA strips");
1154 "In a local override data, whether this NLA track comes from the linked "
1155 "reference data, or is local to the override");
1181 "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the "
1182 "same AnimData block are disabled)");
Functions and classes to work with Actions.
AnimData * BKE_animdata_from_id(const ID *id)
FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], int array_index)
void BKE_nlastrip_free(NlaStrip *strip, bool do_id_user)
void BKE_nlameta_flush_transforms(NlaStrip *mstrip)
void BKE_nlastrip_remove_and_free(ListBase *strips, NlaStrip *strip, const bool do_id_user)
float BKE_nlastrip_compute_frame_to_next_strip(NlaStrip *strip)
void BKE_nla_validate_state(AnimData *adt)
NlaStrip * BKE_nlastrip_new(bAction *act, ID &animated_id)
void BKE_nlastrip_recalculate_bounds(NlaStrip *strip)
bool BKE_nlastrips_add_strip(ListBase *strips, NlaStrip *strip)
void BKE_nlastrip_recalculate_blend(NlaStrip *strip)
#define NLASTRIP_MIN_LEN_THRESH
float BKE_nla_clip_length_get_nonzero(const NlaStrip *strip)
float BKE_nlastrip_compute_frame_from_previous_strip(NlaStrip *strip)
void BKE_nlastrip_validate_name(AnimData *adt, NlaStrip *strip)
void BKE_nlastrip_validate_fcurves(NlaStrip *strip)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ NLASTRIP_FLAG_USR_INFLUENCE
@ NLASTRIP_FLAG_AUTO_BLENDS
@ NLASTRIP_FLAG_USR_TIME_CYCLIC
@ NLASTRIP_FLAG_TWEAKUSER
@ NLASTRIP_FLAG_SYNC_LENGTH
@ NLASTRIP_EXTEND_HOLD_FORWARD
@ NLASTRIP_EXTEND_NOTHING
@ NLASTRIP_TYPE_TRANSITION
@ NLATRACK_OVERRIDELIBRARY_LOCAL
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
#define RNA_POINTER_INVALIDATE(ptr)
#define RNA_ENUM_ITEM_SEPR
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROPOVERRIDE_NO_COMPARISON
void ANIM_id_update(Main *bmain, ID *id)
decltype(::ActionSlot::handle) slot_handle_t
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_nla(BlenderRNA *brna)
static void rna_def_nlastrip(BlenderRNA *brna)
static void rna_def_nlatrack(BlenderRNA *brna)
const EnumPropertyItem rna_enum_nla_mode_blend_items[]
static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_strip_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_nla_mode_extend_items[]
void WM_event_add_notifier(const bContext *C, uint type, void *reference)