41 "Channels in this layer override the same channels from underlying layers"},
46 "Channels in this layer are added to underlying layers as sequential operations"},
51 "Channels in this layer are added to underlying layers on a per-channel basis"},
56 "Channels in this layer are subtracted to underlying layers on a per-channel basis"},
61 "Channels in this layer are multiplied with underlying layers on a per-channel basis"},
62 {0,
nullptr, 0,
nullptr,
nullptr},
71 "Strip containing keyframes on F-Curves"},
72 {0,
nullptr, 0,
nullptr,
nullptr},
82 "Not yet specified. When this slot is first assigned to a data-block, this will be set to "
83 "the type of that data-block"},
84 {0,
nullptr, 0,
nullptr,
nullptr},
117# include <fmt/format.h>
123 return reinterpret_cast<bAction *
>(ptr->owner_id)->
wrap();
183static void rna_ActionSlots_active_set(
PointerRNA *ptr,
191 action.slot_active_set(slot.handle);
209 action.slot_display_name_set(*bmain, *slot, name);
215void rna_Action_slots_remove(
bAction *dna_action,
222 if (!action.slot_remove(slot)) {
227 slot_ptr->invalidate();
238static int rna_iterator_action_layers_length(
PointerRNA *ptr)
241 return action.layers().size();
251 if (action.layers().size() >= 1) {
264void rna_Action_layers_remove(
bAction *dna_action,
271 if (!action.layer_remove(
layer)) {
276 layer_ptr->invalidate();
287static int rna_iterator_animation_slots_length(
PointerRNA *ptr)
290 return action.slots().size();
293static std::optional<std::string> rna_ActionSlot_path(
const PointerRNA *ptr)
297 char identifier_esc[
sizeof(slot.identifier) * 2];
298 BLI_str_escape(identifier_esc, slot.identifier,
sizeof(identifier_esc));
299 return fmt::format(
"slots[\"{}\"]", identifier_esc);
302int rna_ActionSlot_target_id_type_icon_get(
PointerRNA *ptr)
309void rna_ActionSlot_name_display_get(
PointerRNA *ptr,
char *value)
312 slot.identifier_without_prefix().copy_unsafe(value);
315int rna_ActionSlot_name_display_length(
PointerRNA *ptr)
318 return slot.identifier_without_prefix().size();
321static void rna_ActionSlot_name_display_set(
PointerRNA *ptr,
const char *name)
327 if (name_ref.is_empty()) {
332 action.slot_display_name_define(slot, name);
335static void rna_ActionSlot_identifier_set(
PointerRNA *ptr,
const char *identifier)
339 const StringRef identifier_ref(identifier);
347 BLI_assert(slot.idtype_string() == slot.identifier_prefix());
349 const std::string identifier_with_correct_prefix = slot.idtype_string() +
350 identifier_ref.substr(2);
352 if (identifier_with_correct_prefix != identifier_ref) {
355 "Attempted to set slot identifier to \"%s\", but the type prefix does not match the "
356 "slot's 'target_id_type' \"%s\". Setting to \"%s\" instead.\n",
358 slot.idtype_string().c_str(),
359 identifier_with_correct_prefix.c_str());
362 action.slot_identifier_define(slot, identifier_with_correct_prefix);
369 action.slot_identifier_propagate(*bmain, slot);
375 const Span<ID *> slot_users = slot.users(*bmain);
395static std::optional<std::string> rna_ActionLayer_path(
const PointerRNA *ptr)
399 char name_esc[
sizeof(
layer.name) * 2];
401 return fmt::format(
"layers[\"{}\"]", name_esc);
411static int rna_iterator_ActionLayer_strips_length(
PointerRNA *ptr)
414 return layer.strips().size();
421 switch (strip.type()) {
423 return RNA_ActionKeyframeStrip;
425 return RNA_UnknownType;
435 if (
layer.strips().size() >= 1) {
449void rna_ActionStrips_remove(
455 if (!
layer.strip_remove(action, strip)) {
460 strip_ptr->invalidate();
465static std::optional<std::string> rna_ActionStrip_path(
const PointerRNA *ptr)
471 int strip_index = -1;
473 if (std::optional<AncestorPointerRNA> layer_ancestor_ptr =
477 layer_ptr = {&action.id, layer_ancestor_ptr->type, layer_ancestor_ptr->data};
478 BLI_assert_msg(layer_ptr.has_data(),
"PointerRNA ancestors should not be nullptr");
480 strip_index =
layer->
strips().first_index_try(&strip_to_find);
483 if (strip_index < 0) {
497 if (strip_index < 0) {
502 const std::optional<std::string> layer_path = rna_ActionLayer_path(&layer_ptr);
503 BLI_assert_msg(layer_path,
"Every animation layer should have a valid RNA path.");
504 const std::string strip_path = fmt::format(
"{}.strips[{}]", *layer_path, strip_index);
517static int rna_iterator_keyframestrip_channelbags_length(
PointerRNA *ptr)
535 if (strip_data.channelbag_for_slot(slot) !=
nullptr) {
548static void rna_Channelbags_remove(
ID *dna_action_id,
559 if (!strip_data.channelbag_remove(channelbag)) {
564 channelbag_ptr->invalidate();
569static bool rna_ActionStrip_key_insert(
ID *dna_action_id,
575 const int array_index,
579 if (dna_slot ==
nullptr) {
607 if (std::optional<AncestorPointerRNA> strip_ancestor_ptr =
613 &action.id, strip_ancestor_ptr->type, strip_ancestor_ptr->data, ptr->ancestors};
614 BLI_assert_msg(strip_ptr.has_data(),
"PointerRNA ancestors should not be nullptr");
617 std::optional<std::string> strip_path = rna_ActionStrip_path(&strip_ptr);
618 BLI_assert_msg(strip_path,
"ActionStrip instances should have an RNA path");
622 const int64_t index = strip_data.find_channelbag_index(cbag_to_find);
624 return fmt::format(
"{}.channelbags[{}]", *strip_path,
index);
630 for (
int64_t strip_index :
layer->strips().index_range()) {
638 const int64_t index = strip_data.find_channelbag_index(cbag_to_find);
644 const std::optional<std::string> layer_path = rna_ActionLayer_path(&layer_ptr);
645 BLI_assert_msg(layer_path,
"Every animation layer should have a valid RNA path.");
646 return fmt::format(
"{}.strips[{}].channelbags[{}]", *layer_path, strip_index,
index);
657 animrig::Slot *slot = action.slot_for_handle(channelbag.slot_handle);
670static int rna_iterator_Channelbag_fcurves_length(
PointerRNA *ptr)
673 return bag.fcurves().size();
679 const char *data_path,
681 const char *group_name)
684 if (data_path[0] ==
'\0') {
690 if (group_name && group_name[0]) {
691 descr.channel_group = {group_name};
695 FCurve *fcurve = self.fcurve_create_unique(bmain, descr);
699 "F-Curve '%s[%d]' already exists in this channelbag",
707static FCurve *rna_Channelbag_fcurve_new_from_fcurve(
ID *dna_action_id,
711 const char *data_path)
716 data_path = source->rna_path().c_str();
719 if (self.fcurve_find({data_path, source->array_index})) {
722 "F-Curve '%s[%d]' already exists in this channelbag",
724 source->array_index);
728 copy->rna_path_set(data_path);
729 self.fcurve_append(*copy);
739 const char *data_path,
741 const char *group_name)
744 if (data_path[0] ==
'\0') {
750 if (group_name && group_name[0]) {
751 descr.channel_group = {group_name};
755 FCurve &fcurve = self.fcurve_ensure(bmain, descr);
761 const char *data_path,
764 if (data_path[0] ==
'\0') {
773static void rna_Channelbag_fcurve_remove(
ID *dna_action_id,
780 FCurve *fcurve =
static_cast<FCurve *
>(fcurve_ptr->data);
782 if (!self.fcurve_remove(*fcurve)) {
791static void rna_Channelbag_fcurve_clear(
ID *dna_action_id,
795 dna_channelbag->wrap().fcurves_clear();
806static int rna_iterator_Channelbag_groups_length(
PointerRNA *ptr)
809 return bag.channel_groups().size();
828 if (!self.channel_group_remove(*agrp)) {
831 "Could not remove the F-Curve Group from the collection because it does not exist "
832 "in the collection");
836 agrp_ptr->invalidate();
856 return &strip_data.channelbag_for_slot_ensure(slot);
858 return strip_data.channelbag_for_slot(slot);
861static std::optional<std::string> rna_ActionGroup_path(
const PointerRNA *ptr)
867 if (
GS(ptr->owner_id->name) !=
ID_AC) {
873 if (std::optional<AncestorPointerRNA> channelbag_ancestor_ptr =
878 channelbag_ptr = {ptr->owner_id,
879 channelbag_ancestor_ptr->type,
880 channelbag_ancestor_ptr->data,
882 BLI_assert_msg(channelbag_ptr.has_data(),
"PointerRNA ancestors should not be nullptr");
895 const int group_index = channelbag->channel_groups().first_index_try(group);
896 if (group_index != -1) {
898 action.id, RNA_ActionLayer,
layer);
900 layer_ptr, RNA_ActionStrip, strip);
902 layer_ptr, RNA_ActionChannelbag, channelbag);
910 BLI_assert_msg(channelbag_path,
"ActionChannelbag instances should have an RNA path");
912 char name_esc[
sizeof(group->name) * 2];
915 return fmt::format(
"{}.groups[\"{}\"]", *channelbag_path, name_esc);
928struct ActionGroupChannelsIterator {
937 ListBaseIterator listbase;
947 iter->internal.custom = custom_iter;
952 custom_iter->tag = ActionGroupChannelsIterator::ARRAY;
953 custom_iter->array.ptr =
reinterpret_cast<char *
>(cbag.fcurve_array + group->fcurve_range_start);
954 custom_iter->array.endptr =
reinterpret_cast<char *
>(
955 cbag.fcurve_array + group->fcurve_range_start + group->fcurve_range_length);
956 custom_iter->array.itemsize =
sizeof(
FCurve *);
957 custom_iter->array.length = group->fcurve_range_length;
959 iter->valid = group->fcurve_range_length > 0;
964 MEM_delete(
static_cast<ActionGroupChannelsIterator *
>(iter->internal.custom));
972 ActionGroupChannelsIterator *custom_iter =
static_cast<ActionGroupChannelsIterator *
>(
973 iter->internal.custom);
978 switch (custom_iter->tag) {
979 case ActionGroupChannelsIterator::ARRAY: {
980 custom_iter->array.ptr += custom_iter->array.itemsize;
981 iter->valid = (custom_iter->array.ptr != custom_iter->array.endptr);
984 case ActionGroupChannelsIterator::LISTBASE: {
985 FCurve *fcurve =
reinterpret_cast<FCurve *
>(custom_iter->listbase.link);
989 if ((fcurve->next) && (fcurve->next->grp == grp)) {
990 custom_iter->listbase.link = custom_iter->listbase.link->next;
991 iter->valid = (custom_iter->listbase.link !=
nullptr);
994 custom_iter->listbase.link =
nullptr;
1004 BLI_assert(iter->internal.custom !=
nullptr);
1006 ActionGroupChannelsIterator *custom_iter =
static_cast<ActionGroupChannelsIterator *
>(
1007 iter->internal.custom);
1010 switch (custom_iter->tag) {
1011 case ActionGroupChannelsIterator::ARRAY:
1012 fcurve = *
reinterpret_cast<FCurve **
>(custom_iter->array.ptr);
1014 case ActionGroupChannelsIterator::LISTBASE:
1015 fcurve =
reinterpret_cast<FCurve *
>(custom_iter->listbase.link);
1024 TimeMarker *marker = MEM_new<TimeMarker>(
"TimeMarker");
1032static void rna_Action_pose_markers_remove(
bAction *act,
1040 "Timeline marker '%s' not found in action '%s'",
1047 marker_ptr->invalidate();
1054 *ptr, RNA_TimelineMarker,
BLI_findlink(&act->markers, act->active_marker - 1));
1057static void rna_Action_active_pose_marker_set(
PointerRNA *ptr,
1065static int rna_Action_active_pose_marker_index_get(
PointerRNA *ptr)
1068 return std::max(act->active_marker - 1, 0);
1071static void rna_Action_active_pose_marker_index_set(
PointerRNA *ptr,
int value)
1077static void rna_Action_active_pose_marker_index_range(
1083 *
max =
max_ii(0, act->markers.count() - 1);
1086static bool rna_Action_is_empty_get(
PointerRNA *ptr)
1089 return action.is_empty();
1091static bool rna_Action_is_action_legacy_get(
PointerRNA *ptr)
1095 return rna_action(ptr).is_empty();
1097static bool rna_Action_is_action_layered_get(
PointerRNA * )
1103static void rna_Action_frame_range_get(
PointerRNA *ptr,
float *r_values)
1105 const float2 frame_range = rna_action(ptr).get_frame_range();
1106 r_values[0] = frame_range[0];
1107 r_values[1] = frame_range[1];
1110static void rna_Action_frame_range_set(
PointerRNA *ptr,
const float *values)
1112 bAction *
data = id_cast<bAction *>(ptr->owner_id);
1115 data->frame_start = values[0];
1116 data->frame_end = values[1];
1120static void rna_Action_curve_frame_range_get(
PointerRNA *ptr,
float *values)
1123 const float2 frame_range = rna_action(ptr).get_frame_range_of_keys(
false);
1124 values[0] = frame_range[0];
1125 values[1] = frame_range[1];
1128static void rna_Action_use_frame_range_set(
PointerRNA *ptr,
bool value)
1134 if ((action.frame_start == action.frame_end) && (action.frame_start == 0)) {
1135 const float2 frame_range = action.get_frame_range_of_keys(
false);
1136 action.frame_start = frame_range[0];
1137 action.frame_end = frame_range[1];
1147static void rna_Action_start_frame_set(
PointerRNA *ptr,
float value)
1149 bAction *
data = id_cast<bAction *>(ptr->owner_id);
1151 data->frame_start = value;
1155static void rna_Action_end_frame_set(
PointerRNA *ptr,
float value)
1157 bAction *
data = id_cast<bAction *>(ptr->owner_id);
1159 data->frame_end = value;
1163static void rna_Action_deselect_keys(
bAction *act)
1169static FCurve *rna_Action_fcurve_ensure_for_datablock(
bAction *_self,
1173 const char *data_path,
1174 const int array_index,
1175 const char *group_name)
1182 "Assign action \"%s\" to \"%s\" before calling this function",
1184 datablock->name + 2);
1189 if (data_path[0] ==
'\0') {
1196 if (group_name && group_name[0]) {
1212 bAction *dna_action = id_cast<bAction *>(value.owner_id);
1232 if (filtering_enabled) {
1235 ListBaseT<bAnimListElem> anim_data = {
nullptr,
nullptr};
1253 if (filtering_enabled) {
1272 reevaluate_fcurve_errors(&ac);
1275static std::optional<std::string> rna_DopeSheet_path(
const PointerRNA *ptr)
1277 if (
GS(ptr->owner_id->name) ==
ID_SCR) {
1278 const bScreen *screen =
reinterpret_cast<bScreen *
>(ptr->owner_id);
1281 for (
const auto [area_index, area] : screen->areabase.enumerate()) {
1282 for (
const auto [space_index, sl] : area.spacedata.enumerate()) {
1285 if (sipo->ads == ads) {
1286 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1291 if (snla->ads == ads) {
1292 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1297 if (&saction->ads == ads) {
1298 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1323 if (_rna_ActionSlot_target_id_type_items) {
1324 return _rna_ActionSlot_target_id_type_items;
1355 _rna_ActionSlot_target_id_type_items = items;
1357 auto rna_free_enum_items = [](
void *items) {
1365static void rna_ActionSlot_target_id_type_set(
PointerRNA *ptr,
int value)
1370 if (slot.idtype != 0) {
1373 "WARNING: ignoring assignment to target_id_type of Slot '%s' in Action '%s'. A Slot's "
1374 "target_id_type can only be changed when currently 'UNSPECIFIED'.\n",
1380 action.slot_idtype_define(slot,
ID_Type(value));
1398 srna,
"Dope Sheet",
"Settings for filtering the channels shown in animation editors");
1405 prop,
"Source",
"ID-Block representing source data, usually ID_SCE (i.e. Scene)");
1412 "Show Data-Block Filters",
1413 "Show options for whether channels related to certain types of data are included");
1421 prop,
"Only Show Selected",
"Only include channels relating to selected objects and data");
1429 "Only Show Slot of Active Object",
1430 "Only show the slot of the active Object. Otherwise show all the Action's Slots");
1437 prop,
"Show Hidden",
"Include channels from objects/bone that are not visible");
1445 "Alphabetically sorts data-blocks - mainly objects in the scene "
1446 "(disable to increase viewport speed)");
1461 "Only include F-Curves and drivers that are disabled or have errors");
1472 prop,
"Filtering Collection",
"Collection that included object should be a member of");
1495 "Multi-Word Fuzzy Filter",
1496 "Perform fuzzy/multi-word matching.\n"
1497 "Warning: May be slow");
1505 "Include Missing NLA",
1506 "Include animation data-blocks with no NLA data (NLA editor only)");
1514 prop,
"Display Summary",
"Display an additional 'summary' line (Dope Sheet editors only)");
1523 "Collapse summary when shown, so all other channels get hidden (Dope Sheet editors only)");
1531 "Display Transforms",
1532 "Include visualization of object-level animation data (mostly transforms)");
1539 prop,
"Display Shape Keys",
"Include visualization of shape key related animation data");
1547 "Display Modifier Data",
1548 "Include visualization of animation data related to data-blocks linked to modifiers");
1555 prop,
"Display Meshes",
"Include visualization of mesh related animation data");
1562 prop,
"Display Lattices",
"Include visualization of lattice related animation data");
1569 prop,
"Display Camera",
"Include visualization of camera related animation data");
1576 prop,
"Display Material",
"Include visualization of material related animation data");
1583 prop,
"Display Light",
"Include visualization of light related animation data");
1590 prop,
"Display Line Style",
"Include visualization of Line Style related Animation data");
1597 prop,
"Display Texture",
"Include visualization of texture related animation data");
1604 prop,
"Display Curve",
"Include visualization of curve related animation data");
1611 prop,
"Display World",
"Include visualization of world related animation data");
1618 prop,
"Display Scene",
"Include visualization of scene related animation data");
1625 prop,
"Display Particle",
"Include visualization of particle related animation data");
1632 prop,
"Display Metaball",
"Include visualization of metaball related animation data");
1639 prop,
"Display Armature",
"Include visualization of armature related animation data");
1646 prop,
"Display Node",
"Include visualization of node related animation data");
1653 prop,
"Display Speaker",
"Include visualization of speaker related animation data");
1660 prop,
"Display Cache Files",
"Include visualization of cache file related animation data");
1667 prop,
"Display Hair",
"Include visualization of hair related animation data");
1674 prop,
"Display Point Cloud",
"Include visualization of point cloud related animation data");
1681 prop,
"Display Volume",
"Include visualization of volume related animation data");
1688 prop,
"Display Light Probe",
"Include visualization of light probe related animation data");
1696 "Display Grease Pencil",
1697 "Include visualization of Grease Pencil related animation data and frames");
1704 prop,
"Display Movie Clips",
"Include visualization of movie clip related animation data");
1712 "Variable Fallback As Error",
1713 "Include drivers that relied on any fallback values for their evaluation "
1714 "in the Only Show Errors filter, even if the driver evaluation succeeded");
1738 prop,
"rna_ActionSlots_active_get",
"rna_ActionSlots_active_set",
nullptr,
nullptr);
1753 "The data-block type that the slot is intended for. This is combined with the slot name to "
1754 "create the slot's unique identifier, and is also used to limit (on a best-effort basis) "
1755 "which data-blocks the slot can be assigned to.");
1764 "Name of the slot. This will be made unique within the Action among slots of the same type");
1767 parm =
RNA_def_pointer(func,
"slot",
"ActionSlot",
"",
"Newly created action slot");
1775 "Remove the slot from the Action, including all animation that "
1776 "is associated with that slot");
1777 parm =
RNA_def_pointer(func,
"action_slot",
"ActionSlot",
"Action Slot",
"The slot to remove");
1798 "Add a layer to the Animation. Currently an Animation can only have at most one layer.");
1804 "Name of the layer, will be made unique within the Action");
1806 parm =
RNA_def_pointer(func,
"layer",
"ActionLayer",
"",
"Newly created animation layer");
1815 func,
"anim_layer",
"ActionLayer",
"Animation Layer",
"The layer to remove");
1832 "Identifier for a set of channels in this Action, that can be used by a data-block "
1833 "to specify what it gets animated by");
1845 "Used when connecting an Action to a data-block, to find the correct slot handle. This is "
1846 "the display name, prefixed by two characters determined by the slot's ID type");
1852 prop,
nullptr,
"rna_ActionSlot_target_id_type_set",
"rna_ActionSlot_target_id_type_itemf");
1857 "Type of data-block that this slot is intended to animate; can be set "
1858 "when 'UNSPECIFIED' but is otherwise read-only");
1867 "rna_ActionSlot_name_display_get",
1868 "rna_ActionSlot_name_display_length",
1869 "rna_ActionSlot_name_display_set");
1875 "Slot Display Name",
1876 "Name of the slot, for display in the user interface. This name combined with the slot's "
1877 "data-block type is unique within its Action");
1883 "Number specific to this Slot, unique within the Action.\n"
1884 "This is used, for example, on a ActionKeyframeStrip to look up the "
1885 "ActionChannelbag for this Slot");
1892 "Whether this is the active slot, can be set by assigning to action.slots.active");
1914 func,
"Return the data-blocks that are animated by this slot of this action");
1922 func,
"Duplicate this slot, including all the animation data associated with it");
1947 "Add a new strip to the layer. Currently a layer can only have "
1948 "one strip, with infinite boundaries.");
1955 "The type of strip to create");
1957 parm =
RNA_def_pointer(func,
"strip",
"ActionStrip",
"",
"Newly created animation strip");
1966 func,
"anim_strip",
"ActionStrip",
"Animation Strip",
"The strip to remove");
1991 prop,
"Influence",
"How much of this layer is used when blending into the lower layers");
1999 prop,
"Mix Mode",
"How animation of this layer is blended into the lower layers");
2009 "rna_iterator_ActionLayer_strips_begin",
2010 "rna_iterator_array_next",
2011 "rna_iterator_array_end",
2012 "rna_iterator_array_dereference_get",
2013 "rna_iterator_ActionLayer_strips_length",
2034 "Animation Channels for Slots",
2035 "For each action slot, a list of animation channels that are meant for that slot");
2041 "Add a new channelbag to the strip, to contain animation channels for a specific slot");
2047 "The slot that should be animated by this channelbag");
2051 parm =
RNA_def_pointer(func,
"channelbag",
"ActionChannelbag",
"",
"Newly created channelbag");
2059 parm =
RNA_def_pointer(func,
"channelbag",
"ActionChannelbag",
"",
"The channelbag to remove");
2071 srna =
RNA_def_struct(brna,
"ActionKeyframeStrip",
"ActionStrip");
2073 srna,
"Keyframe Animation Strip",
"Strip with a set of F-Curves for each action slot");
2079 "rna_iterator_keyframestrip_channelbags_begin",
2080 "rna_iterator_array_next",
2081 "rna_iterator_array_end",
2082 "rna_iterator_array_dereference_get",
2083 "rna_iterator_keyframestrip_channelbags_length",
2098 func,
"slot",
"ActionSlot",
"Slot",
"The slot for which to find the channelbag");
2103 "Create if necessary",
2104 "Ensure the channelbag exists for this slot, creating it if necessary");
2105 parm =
RNA_def_pointer(func,
"channels",
"ActionChannelbag",
"Channels",
"");
2116 "The slot that identifies which 'thing' should be keyed");
2119 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2129 "Index of the animated array element, or -1 if the property is not an array",
2140 "Value of the animated property",
2151 "Time, in frames, of the key",
2157 func,
"success",
true,
"Success",
"Whether the key was successfully inserted");
2178 "Strip with a set of F-Curves for each action slot"},
2179 {0,
nullptr, 0,
nullptr,
nullptr},
2202 srna,
"F-Curves",
"Collection of F-Curves for a specific action slot, on a specific strip");
2208 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path to use");
2217 "Name of the Group for this F-Curve, will be created if it does not exist yet");
2218 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"Newly created F-Curve");
2222 func =
RNA_def_function(srna,
"new_from_fcurve",
"rna_Channelbag_fcurve_new_from_fcurve");
2224 func,
"Copy an F-Curve into the channelbag. The original F-Curve is unchanged");
2226 parm =
RNA_def_pointer(func,
"source",
"FCurve",
"Source F-Curve",
"The F-Curve to copy");
2233 "F-Curve data path to use. If not provided, this will use the same data "
2234 "path as the given F-Curve");
2235 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"Newly created F-Curve");
2242 func,
"Returns the F-Curve if it already exists, and creates it if necessary");
2244 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path to use");
2252 "Name of the Group for this F-Curve, will be created if it does not exist "
2253 "yet. This parameter is ignored if the F-Curve already exists");
2254 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"Found or newly created F-Curve");
2262 "Find an F-Curve. Note that this function performs a linear scan "
2263 "of all F-Curves in the channelbag.");
2265 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2269 func,
"fcurve",
"FCurve",
"",
"The found F-Curve, or None if it does not exist");
2276 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"F-Curve to remove");
2301 parm =
RNA_def_string(func,
"name",
"Group", 0,
"",
"New name for the action group");
2303 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Newly created action group");
2310 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Action group to remove");
2323 "Animation Channel Bag",
2324 "Collection of animation channels, typically associated with an action slot");
2339 "rna_iterator_Channelbag_fcurves_begin",
2340 "rna_iterator_array_next",
2341 "rna_iterator_array_end",
2342 "rna_iterator_array_dereference_get",
2343 "rna_iterator_Channelbag_fcurves_length",
2354 "rna_iterator_Channelbag_groups_begin",
2355 "rna_iterator_array_next",
2356 "rna_iterator_array_end",
2357 "rna_iterator_array_dereference_get",
2358 "rna_iterator_Channelbag_groups_length",
2366 "Groupings of F-Curves for display purposes, in e.g. the dopesheet and graph editor");
2400 "rna_ActionGroup_channels_begin",
2401 "rna_ActionGroup_channels_next",
2402 "rna_ActionGroup_channels_end",
2403 "rna_ActionGroup_channels_get",
2435 prop,
"Expanded in Graph Editor",
"Action group is expanded in graph editor");
2466 func,
"name",
"Marker", 0,
nullptr,
"New name for the marker (not unique)");
2468 parm =
RNA_def_pointer(func,
"marker",
"TimelineMarker",
"",
"Newly created marker");
2475 parm =
RNA_def_pointer(func,
"marker",
"TimelineMarker",
"",
"Timeline marker to remove");
2483 "rna_Action_active_pose_marker_get",
2484 "rna_Action_active_pose_marker_set",
2493 "rna_Action_active_pose_marker_index_get",
2494 "rna_Action_active_pose_marker_index_set",
2495 "rna_Action_active_pose_marker_index_range");
2516 prop,
"Is Empty",
"False when there is any Layer, Slot, or legacy F-Curve");
2523 "Return whether this is a legacy Action. Legacy Actions have no layers "
2524 "or slots. Since Blender 4.4 actions are automatically updated to "
2525 "layered actions. This will only return true on empty actions");
2532 "Is Layered Action",
2533 "Return whether this is a layered Action. At this point all actions "
2534 "are layered through versioning and this function will always return true");
2541 "rna_iterator_animation_slots_begin",
2542 "rna_iterator_array_next",
2543 "rna_iterator_array_end",
2544 "rna_iterator_array_dereference_get",
2545 "rna_iterator_animation_slots_length",
2555 "rna_iterator_action_layers_begin",
2556 "rna_iterator_array_next",
2557 "rna_iterator_array_end",
2558 "rna_iterator_array_dereference_get",
2559 "rna_iterator_action_layers_length",
2573 prop,
"Pose Markers",
"Markers specific to this action, for labeling poses");
2583 "Manual Frame Range",
2584 "Manually specify the intended playback frame range for the action "
2585 "(this range is used by some tools, but does not affect animation evaluation)");
2594 "The action is intended to be used as a cycle looping over its manually set "
2595 "playback frame range (enabling this does not automatically make it loop)");
2604 prop,
"Start Frame",
"The start frame of the manually set intended playback range");
2613 prop,
"End Frame",
"The end frame of the manually set intended playback range");
2624 "The intended playback frame range of this action, using the manually set range "
2625 "if available, or the combined frame range of all F-Curves within this action "
2626 "if not (assigning sets the manual frame range)",
2630 prop,
"rna_Action_frame_range_get",
"rna_Action_frame_range_set",
nullptr);
2634 "curve_frame_range",
2639 "Curve Frame Range",
2640 "The combined frame range of all F-Curves within this action",
2646 func =
RNA_def_function(srna,
"deselect_keys",
"rna_Action_deselect_keys");
2648 func,
"Deselects all keys of the Action. The selection status of F-Curves is unchanged.");
2652 srna,
"fcurve_ensure_for_datablock",
"rna_Action_fcurve_ensure_for_datablock");
2655 "Ensure that an F-Curve exists, with the given data path and array index, for the given "
2656 "data-block. This action must already be assigned to the data-block. This function will "
2657 "also create the layer, keyframe strip, and action slot if necessary, and take care of "
2658 "assigning the action slot too");
2665 "The data-block animated by this action, for which to ensure the F-Curve "
2666 "exists. This action must already be assigned to the data-block");
2668 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2676 "Name of the group for this F-Curve, if any. If the F-Curve already exists, this "
2677 "parameter is ignored");
2678 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"The found or created F-Curve");
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
Functions to work with AnimData.
Functions to modify FCurves.
Functions to insert, delete or modify keyframes.
Blender kernel action and pose functionality.
#define STRNCPY_UTF8(dst, src)
#define BLT_I18NCONTEXT_ID_ID
#define BLI_assert_msg(a, msg)
constexpr const T * data() const
constexpr int64_t first_index_try(const T &search_value) const
constexpr int64_t size() const
constexpr IndexRange index_range() const
bActionGroup & channel_group_create(StringRefNull name)
const FCurve * fcurve_find(const FCurveDescriptor &fcurve_descriptor) const
Span< const Strip * > strips() const
static constexpr int identifier_length_min
static constexpr slot_handle_t unassigned
Span< const Channelbag * > channelbags() const
KeyframeSettings get_keyframe_settings(bool from_userprefs)
void action_deselect_keys(Action &action)
Slot & duplicate_slot(Action &action, const Slot &slot)
Action * get_action(ID &animated_id)
FCurve & action_fcurve_ensure(Main *bmain, bAction &action, ID &animated_id, const FCurveDescriptor &fcurve_descriptor)
struct bMotionPath * copy(const struct bMotionPath *mpath_src)
std::string time(const std::tm &date_time, TimeFormat format=TimeFormat::H24)
BLI_INLINE Texture * wrap(MTLTexture *texture)
int icon_from_idcode(int idcode)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void WM_global_reportf(eReportType type, const char *format,...)
@ AGRP_CURVES_ALWAYS_VISIBLE
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
bool rna_Action_id_poll(PointerRNA *ptr, PointerRNA value)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
const EnumPropertyItem rna_enum_id_type_items[]
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
@ RPT_ERROR_INVALID_INPUT
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
static void rna_def_dopesheet(BlenderRNA *brna)
@ ADS_FLAG_SHOW_DBFILTERS
@ ADS_FLAG_SUMMARY_COLLAPSED
static void rna_def_channelbag_groups(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
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_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
static void rna_def_keyframestrip_channelbags(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
std::optional< AncestorPointerRNA > RNA_struct_search_closest_ancestor_by_type(const PointerRNA *ptr, const StructRNA *srna)
void RNA_define_lib_overridable(const bool make_overridable)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
static void rna_def_action_strip(BlenderRNA *brna)
static void rna_def_action_channelbag(BlenderRNA *brna)
@ ADS_FILTER_ONLY_SLOTS_OF_ACTIVE
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
MINLINE int max_ii(int a, int b)
static void rna_def_ActionLayer_strips(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
const EnumPropertyItem rna_enum_strip_type_items[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static void rna_def_action_slots(BlenderRNA *brna, PropertyRNA *cprop)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static void rna_def_action_layer(BlenderRNA *brna)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
VecBase< float, 2 > float2
size_t ANIM_animdata_filter(bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
@ ANIMFILTER_DATA_VISIBLE
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
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_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BMesh const char void * data
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
static void rna_def_action_keyframe_strip(BlenderRNA *brna)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
char char size_t BLI_str_escape(char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
const EnumPropertyItem default_ActionSlot_target_id_type_items[]
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
FCurve * BKE_fcurve_copy(const FCurve *fcu)
static void rna_def_channelbag_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void RNA_def_action(BlenderRNA *brna)
void WM_global_report(eReportType type, const char *message)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void BKE_free_time_marker(TimeMarker &marker, bool do_id_user)
void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
@ ADS_FILTER_NOCACHEFILES
@ ADS_FILTER_NOLIGHTPROBE
@ ADS_FILTER_NOMOVIECLIPS
@ ADS_FILTER_NOPOINTCLOUD
@ ADS_FILTER_DRIVER_FALLBACK_AS_ERROR
static void rna_def_action_layers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
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_api_action(StructRNA *srna)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void rna_def_actionbone_group_common(StructRNA *srna, int update_flag, const char *update_cb)
void ANIM_animdata_freelist(ListBaseT< bAnimListElem > *anim_data)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
@ ID_RECALC_ANIMATION_NO_FLUSH
ID_Type GS(const char *name)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_update_notifier(PropertyRNA *prop, const int noteflag)
std::optional< std::string > rna_Channelbag_path(const PointerRNA *ptr)
PointerRNA RNA_pointer_create_id_subdata(ID &id, StructRNA *type, void *data)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
bool BLI_remlink_safe(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
static void rna_def_action_group(BlenderRNA *brna)
static void rna_def_action(BlenderRNA *brna)
void BKE_blender_atexit_register(void(*func)(void *user_data), void *user_data)
static void rna_def_action_slot(BlenderRNA *brna)
Vector< PointerRNA > items