35 "The strip values replace the accumulated results by amount specified by influence"},
40 "The strip values are combined with accumulated results by appropriately using addition, "
41 "multiplication, or quaternion math, based on channel type"},
47 "Weighted result of strip is added to the accumulated results"},
52 "Weighted result of strip is removed from the accumulated results"},
57 "Weighted result of strip is multiplied with the accumulated results"},
58 {0,
nullptr, 0,
nullptr,
nullptr},
67 "Hold the first frame if no previous strips in track, and always hold last frame"},
69 {0,
nullptr, 0,
nullptr,
nullptr},
74# include <fmt/format.h>
90static void rna_NlaStrip_name_set(
PointerRNA *
ptr,
const char *value)
104static std::optional<std::string> rna_NlaStrip_path(
const PointerRNA *
ptr)
118 char name_esc_nlt[
sizeof(nlt->
name) * 2];
119 char name_esc_strip[
sizeof(strip->name) * 2];
122 BLI_str_escape(name_esc_strip, strip->name,
sizeof(name_esc_strip));
124 "animation_data.nla_tracks[\"{}\"].strips[\"{}\"]", name_esc_nlt, name_esc_strip);
136 ID *
id =
ptr->owner_id;
145 rna_NlaStrip_update(bmain, scene,
ptr);
166 rna_NlaStrip_update(bmain, scene,
ptr);
169static void rna_NlaStrip_start_frame_set(
PointerRNA *
ptr,
float value)
182 CLAMP(value, limit_prev, limit_next);
196 data->end = limit_next;
207static void rna_NlaStrip_frame_start_ui_set(
PointerRNA *
ptr,
float value)
223 const float striplen =
data->end -
data->start;
237 CLAMP(value, limit_prev, limit_next);
253static void rna_NlaStrip_end_frame_set(
PointerRNA *
ptr,
float value)
259 CLAMP(value, limit_prev, limit_next);
273 data->start = limit_prev;
284static void rna_NlaStrip_frame_end_ui_set(
PointerRNA *
ptr,
float value)
292 const float old_strip_end =
data->end;
303 CLAMP(value, limit_prev, limit_next);
308 data->next->start = value;
323 float action_length_delta = (old_strip_end -
data->end) /
data->scale;
329 if (
IS_EQF(action_length_delta, actlen)) {
330 data->actend =
data->actstart + 1.0f;
333 else if (action_length_delta < actlen) {
335 data->actend =
data->actend - action_length_delta;
342 data->repeat -= (action_length_delta / actlen);
347static void rna_NlaStrip_scale_set(
PointerRNA *
ptr,
float value)
354 CLAMP(value, 0.0001f, 1000.0f);
361static void rna_NlaStrip_repeat_set(
PointerRNA *
ptr,
float value)
368 CLAMP(value, 0.01f, 1000.0f);
369 data->repeat = value;
375static void rna_NlaStrip_blend_in_set(
PointerRNA *
ptr,
float value)
384 data->blendin = value;
387static void rna_NlaStrip_blend_out_set(
PointerRNA *
ptr,
float value)
397 if ((
len - value) <
data->blendin) {
401 data->blendout = value;
404static void rna_NlaStrip_use_auto_blend_set(
PointerRNA *
ptr,
bool value)
427 data->blendin = 0.0f;
428 data->blendout = 0.0f;
438 ID &animated_id = *
ptr->owner_id;
450 "Could not assign action %s to NLA strip %s",
456static int rna_NlaStrip_action_editable(
const PointerRNA *
ptr,
const char ** )
481static void rna_NlaStrip_action_slot_handle_set(
485 rna_generic_action_slot_handle_set(new_slot_handle,
497static void rna_NlaStrip_action_slot_handle_override_diff(
503 rna_generic_action_slot_handle_override_diff(bmain, rnadiff_ctx, strip_a->
act, strip_b->
act);
515 rna_generic_action_slot_set(value,
527 rna_iterator_generic_action_suitable_slots_begin(iter,
ptr, strip->
act);
530static void rna_NlaStrip_action_start_frame_set(
PointerRNA *
ptr,
float value)
536 data->actstart = value;
543static void rna_NlaStrip_action_end_frame_set(
PointerRNA *
ptr,
float value)
549 data->actend = value;
555static void rna_NlaStrip_animated_influence_set(
PointerRNA *
ptr,
bool value)
569static void rna_NlaStrip_animated_time_set(
PointerRNA *
ptr,
bool value)
585 const char *data_path,
588 if (data_path[0] ==
'\0') {
609 if (strip ==
nullptr) {
614 strip->
end += (start - strip->
start);
615 strip->
start = start;
621 "Unable to add strip (the track does not have any space to accommodate this new strip)");
638 while ((nlt = nlt->
prev) !=
nullptr) {
646 while ((nlt = nlt->
next) !=
nullptr) {
663static void rna_NlaStrip_remove(
669 reports,
RPT_ERROR,
"NLA strip '%s' not found in track '%s'", strip->
name, track->
name);
685static void rna_NlaTrack_solo_set(
PointerRNA *
ptr,
bool value)
691 if (
data ==
nullptr) {
696 for (nt =
data; nt; nt = nt->
next) {
699 for (nt =
data; nt; nt = nt->
prev) {
737 "Find an F-Curve. Note that this function performs a linear scan "
738 "of all F-Curves in the NLA strip.");
740 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
742 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
745 func,
"fcurve",
"FCurve",
"",
"The found F-Curve, or None if it doesn't exist");
761 "NLA Strip 'transitions' between adjacent strips"},
762 {
NLASTRIP_TYPE_META,
"META", 0,
"Meta",
"NLA Strip acts as a container for adjacent strips"},
767 "NLA Strip representing a sound event for speakers"},
768 {0,
nullptr, 0,
nullptr,
nullptr},
800 prop,
"Extrapolation",
"Action to take for gaps past the strip extents");
807 prop,
"Blending",
"Method used for combining strip's result with accumulated result");
837 "Start Frame (raw value)",
838 "Same as frame_start, except that any value can be set, including ones "
839 "that create an invalid state");
846 "End Frame (raw value)",
847 "Same as frame_end, except that any value can be set, including ones "
848 "that create an invalid state");
858 "Start Frame (manipulated from UI)",
859 "Start frame of the NLA strip. Note: changing this value also updates the value of "
860 "the strip's end frame. If only the start frame should be changed, see the \"frame_start\" "
861 "property instead.");
873 "End Frame (manipulated from UI)",
874 "End frame of the NLA strip. Note: changing this value also updates the value of "
875 "the strip's repeats or its action's end frame. If only the end frame should be "
876 "changed, see the \"frame_end\" property instead.");
888 prop,
"Blend In",
"Number of frames at start of strip to fade in influence");
902 "Number of frames for Blending In/Out is automatically determined from "
903 "overlapping strips");
910 prop,
nullptr,
"rna_NlaStrip_action_set",
nullptr,
"rna_Action_id_poll");
924 "Action Slot Handle",
925 "A number that identifies which sub-set of the Action is considered "
926 "to be for this NLA strip");
929 prop,
"rna_NlaStrip_action_slot_handle_override_diff",
nullptr,
nullptr);
936 "Last Action Slot Identifier",
937 "The identifier of the most recently assigned action slot. The slot identifies which "
938 "sub-set of the Action is considered to be for this strip, and its identifier is used to "
939 "find the right slot when assigning an Action.");
948 "The slot identifies which sub-set of the Action is considered to be for this "
949 "strip, and its name is used to find the right slot when assigning another Action");
951 prop,
"rna_NlaStrip_action_slot_get",
"rna_NlaStrip_action_slot_set",
nullptr,
nullptr);
967 "rna_iterator_nlastrip_action_suitable_slots_begin",
968 "rna_iterator_array_next",
969 "rna_iterator_array_end",
970 "rna_iterator_array_dereference_get",
976 prop,
"Action Slots",
"The list of action slots suitable for this NLA strip");
1021 prop,
"F-Curves",
"F-Curves for controlling the strip's influence and timing");
1028 prop,
"Modifiers",
"Modifiers affecting all the F-Curves in the referenced Action");
1036 "NLA Strips that this strip acts as a container for (if it is of type Meta)");
1042 prop,
"Influence",
"Amount the strip contributes to the current result");
1063 "Animated Influence",
1064 "Influence setting is controlled by an F-Curve rather than automatically determined");
1072 "Animated Strip Time",
1073 "Strip time is controlled by an F-Curve rather than automatically determined");
1079 prop,
"Cyclic Strip Time",
"Cycle the animated time within the action start and end");
1106 "NLA Strip is played back in reverse order (only when timing is "
1107 "automatically determined)");
1113 "Sync Action Length",
1114 "Update range of frames referenced from action "
1115 "after tweaking strip and its keyframes");
1136 parm =
RNA_def_string(func,
"name",
"NlaStrip", 0,
"",
"Name for the NLA Strips");
1144 "Start frame for this strip",
1148 parm =
RNA_def_pointer(func,
"action",
"Action",
"",
"Action to assign to this strip");
1151 parm =
RNA_def_pointer(func,
"strip",
"NlaStrip",
"",
"New NLA Strip");
1158 parm =
RNA_def_pointer(func,
"strip",
"NlaStrip",
"",
"NLA Strip to remove");
1170 srna,
"NLA Track",
"An animation layer containing Actions referenced as NLA strips");
1186 "In a local override data, whether this NLA track comes from the linked "
1187 "reference data, or is local to the override");
1213 "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the "
1214 "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 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)
#define BLT_I18NCONTEXT_ID_ACTION
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.
#define RNA_ENUM_ITEM_SEPR
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROPOVERRIDE_NO_COMPARISON
void ANIM_id_update(Main *bmain, ID *id)
BMesh const char void * data
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
void unassign_action(NlaStrip &strip, ID &animated_id)
bool assign_action(NlaStrip &strip, Action &action, ID &animated_id)
decltype(::ActionSlot::handle) slot_handle_t
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
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_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_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
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[]
char last_slot_identifier[258]
int32_t action_slot_handle
void WM_event_add_notifier(const bContext *C, uint type, void *reference)