37#ifdef WITH_ANIM_BAKLAVA
39 {
int(animrig::Layer::MixMode::Replace),
43 "Channels in this layer override the same channels from underlying layers"},
44 {
int(animrig::Layer::MixMode::Offset),
48 "Channels in this layer are added to underlying layers as sequential operations"},
49 {
int(animrig::Layer::MixMode::Add),
53 "Channels in this layer are added to underlying layers on a per-channel basis"},
54 {
int(animrig::Layer::MixMode::Subtract),
58 "Channels in this layer are subtracted to underlying layers on a per-channel basis"},
59 {
int(animrig::Layer::MixMode::Multiply),
63 "Channels in this layer are multiplied with underlying layers on a per-channel basis"},
64 {0,
nullptr, 0,
nullptr,
nullptr},
68 {
int(animrig::Strip::Type::Keyframe),
72 "Strip containing keyframes on F-Curves"},
73 {0,
nullptr, 0,
nullptr,
nullptr},
84 "Not yet specified. When this slot is first assigned to a data-block, this will be set to "
85 "the type of that data-block"},
86 {0,
nullptr, 0,
nullptr,
nullptr},
112# include <fmt/format.h>
119# ifdef WITH_ANIM_BAKLAVA
197 "Cannot add slots to a legacy Action '%s'. Convert it to a layered Action first.",
213void rna_Action_slots_remove(
bAction *dna_action,
239 return action.
layers().size();
252 "Cannot add layers to a legacy Action '%s'. Convert it to a layered Action first.",
257 if (action.
layers().size() >= 1) {
270void rna_Action_layers_remove(
bAction *dna_action,
293static int rna_iterator_animation_slots_length(
PointerRNA *
ptr)
296 return action.
slots().size();
299static std::optional<std::string> rna_ActionSlot_path(
const PointerRNA *
ptr)
303 char name_esc[
sizeof(slot.
name) * 2];
305 return fmt::format(
"slots[\"{}\"]", name_esc);
315void rna_ActionSlot_name_display_get(
PointerRNA *
ptr,
char *value)
327static void rna_ActionSlot_name_display_set(
PointerRNA *
ptr,
const char *name)
333 if (name_ref.is_empty()) {
343static void rna_ActionSlot_name_set(
PointerRNA *
ptr,
const char *name)
358 if (!name_ref.startswith(expect_prefix)) {
359 const std::string new_prefix = name_ref.substr(0, 2);
361 "Action slot renamed to unexpected prefix \"%s\" (expected \"%s\").\n",
363 expect_prefix.c_str());
378static void rna_ActionSlot_debug_log_users(
const ID *action_id,
ActionSlot *dna_slot,
Main *bmain)
382 Slot &slot = dna_slot->wrap();
384 printf(
"\033[38;5;214mAction Slot users of '%s' on Action '%s':\033[0m\n",
388 printf(
" User map is \033[93mdirty\033[0m, this will trigger a recompute.\n");
391 printf(
" User map is \033[92mclean\033[0m.\n");
394 for (
const ID *user : slot.
users(*bmain)) {
395 printf(
" - %s\n", user->name);
400static std::optional<std::string> rna_ActionLayer_path(
const PointerRNA *
ptr)
404 char name_esc[
sizeof(layer.name) * 2];
406 return fmt::format(
"layers[\"{}\"]", name_esc);
416static int rna_iterator_ActionLayer_strips_length(
PointerRNA *
ptr)
419 return layer.strips().size();
426 switch (strip.
type()) {
427 case animrig::Strip::Type::Keyframe:
428 return &RNA_ActionKeyframeStrip;
430 return &RNA_UnknownType;
436 const animrig::Strip::Type strip_type = animrig::Strip::Type(type);
440 if (layer.strips().size() >= 1) {
454void rna_ActionStrips_remove(
460 if (!layer.strip_remove(action, strip)) {
470static std::optional<std::string> rna_ActionStrip_path(
const PointerRNA *
ptr)
483 const std::optional<std::string> layer_path = rna_ActionLayer_path(&layer_ptr);
484 BLI_assert_msg(layer_path,
"Every animation layer should have a valid RNA path.");
485 const std::string strip_path = fmt::format(
"{}.strips[{}]", *layer_path, index);
500static int rna_iterator_keyframestrip_channelbags_length(
PointerRNA *
ptr)
531static void rna_ChannelBags_remove(
ID *dna_action_id,
552static bool rna_ActionStrip_key_insert(
ID *dna_action_id,
557 const char *rna_path,
558 const int array_index,
562 if (dna_slot ==
nullptr) {
576 const bool ok = result == animrig::SingleKeyingResult::SUCCESS;
584static std::optional<std::string> rna_ChannelBag_path(
const PointerRNA *
ptr)
590 for (
int64_t strip_index : layer->strips().index_range()) {
592 if (strip->
type() != animrig::Strip::Type::Keyframe) {
604 const std::optional<std::string> layer_path = rna_ActionLayer_path(&layer_ptr);
605 BLI_assert_msg(layer_path,
"Every animation layer should have a valid RNA path.");
606 return fmt::format(
"{}.strips[{}].channelbags[{}]", *layer_path, strip_index, index);
620static int rna_iterator_ChannelBag_fcurves_length(
PointerRNA *
ptr)
629 const char *data_path,
633 if (data_path[0] ==
'\0') {
639 FCurve *fcurve =
self.fcurve_create_unique(bmain, {data_path, index});
643 "F-Curve '%s[%d]' already exists in this channelbag",
653 const char *data_path,
656 if (data_path[0] ==
'\0') {
662 return self.fcurve_find({data_path, index});
665static void rna_ChannelBag_fcurve_remove(
ID *dna_action_id,
674 if (!
self.fcurve_remove(*fcurve)) {
683static void rna_ChannelBag_fcurve_clear(
ID *dna_action_id,
687 dna_channelbag->wrap().fcurves_clear();
698static int rna_iterator_ChannelBag_groups_length(
PointerRNA *
ptr)
709 return &
self.channel_group_create(name);
720 if (!
self.channel_group_remove(*agrp)) {
723 "Could not remove the F-Curve Group from the collection because it doesn't exist "
724 "in the collection");
753struct ActionGroupChannelsIterator {
770 ActionGroupChannelsIterator *custom_iter = MEM_cnew<ActionGroupChannelsIterator>(__func__);
780 if (group->wrap().is_legacy()) {
781 custom_iter->tag = ActionGroupChannelsIterator::LISTBASE;
782 custom_iter->listbase.link =
static_cast<Link *
>(group->channels.first);
784 iter->
valid = custom_iter->listbase.link !=
nullptr;
791 custom_iter->tag = ActionGroupChannelsIterator::ARRAY;
792 custom_iter->array.ptr =
reinterpret_cast<char *
>(cbag.
fcurve_array + group->fcurve_range_start);
793 custom_iter->array.endptr =
reinterpret_cast<char *
>(
794 cbag.
fcurve_array + group->fcurve_range_start + group->fcurve_range_length);
795 custom_iter->array.itemsize =
sizeof(
FCurve *);
796 custom_iter->array.length = group->fcurve_range_length;
798 iter->
valid = group->fcurve_range_length > 0;
811 ActionGroupChannelsIterator *custom_iter =
static_cast<ActionGroupChannelsIterator *
>(
817 switch (custom_iter->tag) {
818 case ActionGroupChannelsIterator::ARRAY: {
819 custom_iter->array.ptr += custom_iter->array.itemsize;
820 iter->
valid = (custom_iter->array.ptr != custom_iter->array.endptr);
823 case ActionGroupChannelsIterator::LISTBASE: {
828 if ((fcurve->
next) && (fcurve->
next->
grp == grp)) {
829 custom_iter->listbase.link = custom_iter->listbase.link->next;
830 iter->
valid = (custom_iter->listbase.link !=
nullptr);
833 custom_iter->listbase.link =
nullptr;
845 ActionGroupChannelsIterator *custom_iter =
static_cast<ActionGroupChannelsIterator *
>(
849 switch (custom_iter->tag) {
850 case ActionGroupChannelsIterator::ARRAY:
851 fcurve = *
reinterpret_cast<FCurve **
>(custom_iter->array.ptr);
853 case ActionGroupChannelsIterator::LISTBASE:
854 fcurve =
reinterpret_cast<FCurve *
>(custom_iter->listbase.link);
861# ifdef WITH_ANIM_BAKLAVA
873 if (use_backward_compatible_api(action)) {
887 if (use_backward_compatible_api(action)) {
897 if (use_backward_compatible_api(action)) {
908 if (use_backward_compatible_api(action)) {
920 if (use_backward_compatible_api(action)) {
936# ifdef WITH_ANIM_BAKLAVA
938 if (use_backward_compatible_api(action)) {
964# ifdef WITH_ANIM_BAKLAVA
966 if (use_backward_compatible_api(action)) {
971 "Action group '%s' not found in action '%s'",
990 "Action group '%s' not found in action '%s'",
1014# ifdef WITH_ANIM_BAKLAVA
1019 if (use_backward_compatible_api(action)) {
1033 if (use_backward_compatible_api(action)) {
1043 if (use_backward_compatible_api(action)) {
1054 if (use_backward_compatible_api(action)) {
1063static int rna_iterator_Action_fcurves_length(
PointerRNA *
ptr)
1066 if (use_backward_compatible_api(action)) {
1071 return channelbag->
fcurves().size();
1081 const char *data_path,
1086 if (data_path[0] ==
'\0') {
1092 if (group && group[0] !=
'\0') {
1096# ifdef WITH_ANIM_BAKLAVA
1098 if (use_backward_compatible_api(action)) {
1109 "F-Curve '%s[%d]' already exists in action '%s'",
1124 "F-Curve '%s[%d]' already exists in action '%s'",
1140 const char *data_path,
1143 if (data_path[0] ==
'\0') {
1148# ifdef WITH_ANIM_BAKLAVA
1150 if (use_backward_compatible_api(action)) {
1155 return channelbag->
fcurve_find({data_path, index});
1167# ifdef WITH_ANIM_BAKLAVA
1169 if (use_backward_compatible_api(action)) {
1192 "F-Curve's action group '%s' not found in action '%s'",
1217static void rna_Action_fcurve_clear(
bAction *act)
1219# ifdef WITH_ANIM_BAKLAVA
1221 if (use_backward_compatible_api(action)) {
1249static void rna_Action_pose_markers_remove(
bAction *act,
1257 "Timeline marker '%s' not found in action '%s'",
1274static void rna_Action_active_pose_marker_set(
PointerRNA *
ptr,
1282static int rna_Action_active_pose_marker_index_get(
PointerRNA *
ptr)
1288static void rna_Action_active_pose_marker_index_set(
PointerRNA *
ptr,
int value)
1294static void rna_Action_active_pose_marker_index_range(
1303# ifdef WITH_ANIM_BAKLAVA
1311 return rna_action(
ptr).is_action_legacy();
1313static bool rna_Action_is_action_layered_get(
PointerRNA *
ptr)
1315 return rna_action(
ptr).is_action_layered();
1319static void rna_Action_frame_range_get(
PointerRNA *
ptr,
float *r_values)
1321 const float2 frame_range = rna_action(
ptr).get_frame_range();
1322 r_values[0] = frame_range[0];
1323 r_values[1] = frame_range[1];
1326static void rna_Action_frame_range_set(
PointerRNA *
ptr,
const float *values)
1331 data->frame_start = values[0];
1332 data->frame_end = values[1];
1333 CLAMP_MIN(data->frame_end, data->frame_start);
1336static void rna_Action_curve_frame_range_get(
PointerRNA *
ptr,
float *values)
1339 const float2 frame_range = rna_action(
ptr).get_frame_range_of_keys(
false);
1340 values[0] = frame_range[0];
1341 values[1] = frame_range[1];
1344static void rna_Action_use_frame_range_set(
PointerRNA *
ptr,
bool value)
1359 action.
flag &= ~ACT_FRAME_RANGE;
1363static void rna_Action_start_frame_set(
PointerRNA *
ptr,
float value)
1367 data->frame_start = value;
1368 CLAMP_MIN(data->frame_end, data->frame_start);
1371static void rna_Action_end_frame_set(
PointerRNA *
ptr,
float value)
1375 data->frame_end = value;
1376 CLAMP_MAX(data->frame_start, data->frame_end);
1379static void rna_Action_deselect_keys(
bAction *act)
1402 if (action.
idroot == 0) {
1406 return GS(srcId->name) == action.
idroot;
1430 switch (saction->mode) {
1465static std::optional<std::string> rna_DopeSheet_path(
const PointerRNA *
ptr)
1476 if (sipo->
ads == ads) {
1477 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1482 if (snla->
ads == ads) {
1483 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1488 if (&saction->
ads == ads) {
1489 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1507 if (_rna_ActionSlot_id_root_items) {
1508 return _rna_ActionSlot_id_root_items;
1539 _rna_ActionSlot_id_root_items = items;
1557 srna,
"Dope Sheet",
"Settings for filtering the channels shown in animation editors");
1564 prop,
"Source",
"ID-Block representing source data, usually ID_SCE (i.e. Scene)");
1571 "Show Data-Block Filters",
1572 "Show options for whether channels related to certain types of data are included");
1580 prop,
"Only Show Selected",
"Only include channels relating to selected objects and data");
1593 prop,
"Show Hidden",
"Include channels from objects/bone that are not visible");
1601 "Alphabetically sorts data-blocks - mainly objects in the scene "
1602 "(disable to increase viewport speed)");
1617 "Only include F-Curves and drivers that are disabled or have errors");
1628 prop,
"Filtering Collection",
"Collection that included object should be a member of");
1651 "Multi-Word Fuzzy Filter",
1652 "Perform fuzzy/multi-word matching.\n"
1653 "Warning: May be slow");
1661 "Include Missing NLA",
1662 "Include animation data-blocks with no NLA data (NLA editor only)");
1670 prop,
"Display Summary",
"Display an additional 'summary' line (Dope Sheet editors only)");
1679 "Collapse summary when shown, so all other channels get hidden (Dope Sheet editors only)");
1687 "Display Transforms",
1688 "Include visualization of object-level animation data (mostly transforms)");
1695 prop,
"Display Shape Keys",
"Include visualization of shape key related animation data");
1703 "Display Modifier Data",
1704 "Include visualization of animation data related to data-blocks linked to modifiers");
1711 prop,
"Display Meshes",
"Include visualization of mesh related animation data");
1718 prop,
"Display Lattices",
"Include visualization of lattice related animation data");
1725 prop,
"Display Camera",
"Include visualization of camera related animation data");
1732 prop,
"Display Material",
"Include visualization of material related animation data");
1739 prop,
"Display Light",
"Include visualization of light related animation data");
1746 prop,
"Display Line Style",
"Include visualization of Line Style related Animation data");
1753 prop,
"Display Texture",
"Include visualization of texture related animation data");
1760 prop,
"Display Curve",
"Include visualization of curve related animation data");
1767 prop,
"Display World",
"Include visualization of world related animation data");
1774 prop,
"Display Scene",
"Include visualization of scene related animation data");
1781 prop,
"Display Particle",
"Include visualization of particle related animation data");
1788 prop,
"Display Metaball",
"Include visualization of metaball related animation data");
1795 prop,
"Display Armature",
"Include visualization of armature related animation data");
1802 prop,
"Display Node",
"Include visualization of node related animation data");
1809 prop,
"Display Speaker",
"Include visualization of speaker related animation data");
1816 prop,
"Display Cache Files",
"Include visualization of cache file related animation data");
1823 prop,
"Display Hair",
"Include visualization of hair related animation data");
1830 prop,
"Display Point Cloud",
"Include visualization of point cloud related animation data");
1837 prop,
"Display Volume",
"Include visualization of volume related animation data");
1845 "Display Grease Pencil",
1846 "Include visualization of Grease Pencil related animation data and frames");
1853 prop,
"Display Movie Clips",
"Include visualization of movie clip related animation data");
1861 "Variable Fallback As Error",
1862 "Include drivers that relied on any fallback values for their evaluation "
1863 "in the Only Show Errors filter, even if the driver evaluation succeeded");
1870# ifdef WITH_ANIM_BAKLAVA
1889 prop,
"rna_ActionSlots_active_get",
"rna_ActionSlots_active_set",
nullptr,
nullptr);
1903 "If given, the new slot will be named after this data-block, and limited to animating "
1904 "data-blocks of its type. If ommitted, limiting the ID type will happen as soon as the "
1905 "slot is assigned.");
1909 parm =
RNA_def_pointer(func,
"slot",
"ActionSlot",
"",
"Newly created action slot");
1916 "Remove the slot from the Action, including all animation that "
1917 "is associated with that slot");
1918 parm =
RNA_def_pointer(func,
"action_slot",
"ActionSlot",
"Action Slot",
"The slot to remove");
1939 "Add a layer to the Animation. Currently an Animation can only have at most one layer.");
1945 "Name of the layer, will be made unique within the Action");
1947 parm =
RNA_def_pointer(func,
"layer",
"ActionLayer",
"",
"Newly created animation layer");
1955 func,
"anim_layer",
"ActionLayer",
"Animation Layer",
"The layer to remove");
1959static void rna_def_action_slot(
BlenderRNA *brna)
1970 "Identifier for a set of channels in this Action, that can be used by a data-block "
1971 "to specify what it gets animated by");
1983 "Used when connecting an Action to a data-block, to find the correct slot handle. This is "
1984 "the display name, prefixed by two characters determined by the slot's ID type");
1993 prop,
"ID Root Type",
"Type of data-block that can be animated by this slot");
2002 "rna_ActionSlot_name_display_get",
2003 "rna_ActionSlot_name_display_length",
2004 "rna_ActionSlot_name_display_set");
2009 "Slot Display Name",
2010 "Name of the slot, for display in the user interface. This name combined with the slot's "
2011 "data-block type is unique within its Action");
2017 "Number specific to this Slot, unique within the Action"
2018 "This is used, for example, on a ActionKeyframeStrip to look up the "
2019 "ActionChannelBag for this Slot");
2026 "Whether this is the active slot, can be set by assigning to action.slots.active");
2050 func =
RNA_def_function(srna,
"debug_log_users",
"rna_ActionSlot_debug_log_users");
2071 "Add a new strip to the layer. Currently a layer can only have "
2072 "one strip, with infinite boundaries.");
2076 rna_enum_strip_type_items,
2077 int(animrig::Strip::Type::Keyframe),
2079 "The type of strip to create");
2081 parm =
RNA_def_pointer(func,
"strip",
"ActionStrip",
"",
"Newly created animation strip");
2089 func,
"anim_strip",
"ActionStrip",
"Animation Strip",
"The strip to remove");
2093static void rna_def_action_layer(
BlenderRNA *brna)
2108 prop,
"Influence",
"How much of this layer is used when blending into the lower layers");
2116 prop,
"Mix Mode",
"How animation of this layer is blended into the lower layers");
2125 "rna_iterator_ActionLayer_strips_begin",
2126 "rna_iterator_array_next",
2127 "rna_iterator_array_end",
2128 "rna_iterator_array_dereference_get",
2129 "rna_iterator_ActionLayer_strips_length",
2135 rna_def_ActionLayer_strips(brna, prop);
2150 "Animation Channels for Slots",
2151 "For each action slot, a list of animation channels that are meant for that slot");
2157 "Add a new channelbag to the strip, to contain animation channels for a specific slot");
2163 "The slot that should be animated by this channelbag");
2167 parm =
RNA_def_pointer(func,
"channelbag",
"ActionChannelBag",
"",
"Newly created channelbag");
2174 parm =
RNA_def_pointer(func,
"channelbag",
"ActionChannelBag",
"",
"The channelbag to remove");
2181static void rna_def_action_keyframe_strip(
BlenderRNA *brna)
2186 srna =
RNA_def_struct(brna,
"ActionKeyframeStrip",
"ActionStrip");
2188 srna,
"Keyframe Animation Strip",
"Strip with a set of F-Curves for each action slot");
2194 "rna_iterator_keyframestrip_channelbags_begin",
2195 "rna_iterator_array_next",
2196 "rna_iterator_array_end",
2197 "rna_iterator_array_dereference_get",
2198 "rna_iterator_keyframestrip_channelbags_length",
2202 rna_def_keyframestrip_channelbags(brna, prop);
2218 "Number that identifies a specific action slot",
2222 parm =
RNA_def_pointer(func,
"channels",
"ActionChannelBag",
"Channels",
"");
2233 "The slot that identifies which 'thing' should be keyed");
2236 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2246 "Index of the animated array element, or -1 if the property is not an array",
2257 "Value of the animated property",
2268 "Time, in frames, of the key",
2274 func,
"success",
true,
"Success",
"Whether the key was successfully inserted");
2280static void rna_def_action_strip(
BlenderRNA *brna)
2291 {
int(animrig::Strip::Type::Keyframe),
2295 "Strip with a set of F-Curves for each action slot"},
2296 {0,
nullptr, 0,
nullptr,
nullptr},
2305 rna_def_action_keyframe_strip(brna);
2319 srna,
"F-Curves",
"Collection of F-Curves for a specific action slot, on a specific strip");
2322 extern FCurve *ActionChannelBagFCurves_new_func(
ID * _selfid,
2326 const char *data_path,
2332 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path to use");
2334 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
2336 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"Newly created F-Curve");
2343 "Find an F-Curve. Note that this function performs a linear scan "
2344 "of all F-Curves in the channelbag.");
2346 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2348 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
2350 func,
"fcurve",
"FCurve",
"",
"The found F-Curve, or None if it doesn't exist");
2357 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"F-Curve to remove");
2382 parm =
RNA_def_string(func,
"name",
"Group", 0,
"",
"New name for the action group");
2384 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Newly created action group");
2390 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Action group to remove");
2395static void rna_def_action_channelbag(
BlenderRNA *brna)
2403 "Animation Channel Bag",
2404 "Collection of animation channels, typically associated with an action slot");
2413 "rna_iterator_ChannelBag_fcurves_begin",
2414 "rna_iterator_array_next",
2415 "rna_iterator_array_end",
2416 "rna_iterator_array_dereference_get",
2417 "rna_iterator_ChannelBag_fcurves_length",
2423 rna_def_channelbag_fcurves(brna, prop);
2428 "rna_iterator_ChannelBag_groups_begin",
2429 "rna_iterator_array_next",
2430 "rna_iterator_array_end",
2431 "rna_iterator_array_dereference_get",
2432 "rna_iterator_ChannelBag_groups_length",
2440 "Groupings of F-Curves for display purposes, in e.g. the dopesheet and graph editor");
2441 rna_def_channelbag_groups(brna, prop);
2473 "rna_ActionGroup_channels_begin",
2474 "rna_ActionGroup_channels_next",
2475 "rna_ActionGroup_channels_end",
2476 "rna_ActionGroup_channels_get",
2508 prop,
"Expanded in Graph Editor",
"Action group is expanded in graph editor");
2535# ifdef WITH_ANIM_BAKLAVA
2537 "rna_iterator_Action_groups_begin",
2538 "rna_iterator_Action_groups_next",
2539 "rna_iterator_Action_groups_end",
2540 "rna_iterator_Action_groups_get",
2541 "rna_iterator_Action_groups_length",
2549 parm =
RNA_def_string(func,
"name",
"Group", 0,
"",
"New name for the action group");
2551 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Newly created action group");
2557 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Action group to remove");
2573# ifdef WITH_ANIM_BAKLAVA
2575 "rna_iterator_Action_fcurves_begin",
2576 "rna_iterator_Action_fcurves_next",
2577 "rna_iterator_Action_fcurves_end",
2578 "rna_iterator_Action_fcurves_get",
2579 "rna_iterator_Action_fcurves_length",
2589 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path to use");
2591 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
2593 func,
"action_group",
nullptr, 0,
"Action Group",
"Acton group to add this F-Curve into");
2595 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"Newly created F-Curve");
2602 "Find an F-Curve. Note that this function performs a linear scan "
2603 "of all F-Curves in the action.");
2605 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2607 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
2609 func,
"fcurve",
"FCurve",
"",
"The found F-Curve, or None if it doesn't exist");
2616 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"F-Curve to remove");
2641 func,
"name",
"Marker", 0,
nullptr,
"New name for the marker (not unique)");
2643 parm =
RNA_def_pointer(func,
"marker",
"TimelineMarker",
"",
"Newly created marker");
2649 parm =
RNA_def_pointer(func,
"marker",
"TimelineMarker",
"",
"Timeline marker to remove");
2657 "rna_Action_active_pose_marker_get",
2658 "rna_Action_active_pose_marker_set",
2667 "rna_Action_active_pose_marker_index_get",
2668 "rna_Action_active_pose_marker_index_set",
2669 "rna_Action_active_pose_marker_index_range");
2701 "Type of ID block that action can be used on - "
2702 "DO NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING");
2716# ifdef WITH_ANIM_BAKLAVA
2721 prop,
"Is Empty",
"False when there is any Layer, Slot, or legacy F-Curve");
2729 "Return whether this is a legacy Action. Legacy Actions have no layers or slots. An "
2730 "empty Action considered as both a 'legacy' and a 'layered' Action.");
2736 "Is Layered Action",
2737 "Return whether this is a layered Action. An empty Action considered "
2738 "as both a 'layered' and a 'layered' Action.");
2744# ifdef WITH_ANIM_BAKLAVA
2748 "rna_iterator_animation_slots_begin",
2749 "rna_iterator_array_next",
2750 "rna_iterator_array_end",
2751 "rna_iterator_array_dereference_get",
2752 "rna_iterator_animation_slots_length",
2757 rna_def_action_slots(brna, prop);
2762 "rna_iterator_action_layers_begin",
2763 "rna_iterator_array_next",
2764 "rna_iterator_array_end",
2765 "rna_iterator_array_dereference_get",
2766 "rna_iterator_action_layers_length",
2771 rna_def_action_layers(brna, prop);
2781 prop,
"Pose Markers",
"Markers specific to this action, for labeling poses");
2791 "Manual Frame Range",
2792 "Manually specify the intended playback frame range for the action "
2793 "(this range is used by some tools, but does not affect animation evaluation)");
2802 "The action is intended to be used as a cycle looping over its manually set "
2803 "playback frame range (enabling this doesn't automatically make it loop)");
2812 prop,
"Start Frame",
"The start frame of the manually set intended playback range");
2821 prop,
"End Frame",
"The end frame of the manually set intended playback range");
2832 "The intended playback frame range of this action, using the manually set range "
2833 "if available, or the combined frame range of all F-Curves within this action "
2834 "if not (assigning sets the manual frame range)",
2838 prop,
"rna_Action_frame_range_get",
"rna_Action_frame_range_set",
nullptr);
2842 "curve_frame_range",
2847 "Curve Frame Range",
2848 "The combined frame range of all F-Curves within this action",
2856 func,
"Deselects all keys of the Action. The selection status of F-Curves is unchanged.");
2872# ifdef WITH_ANIM_BAKLAVA
2873 rna_def_action_slot(brna);
2874 rna_def_action_layer(brna);
2875 rna_def_action_strip(brna);
2876 rna_def_action_channelbag(brna);
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
Functions to work with AnimData.
Functions to insert, delete or modify keyframes.
Blender kernel action and pose functionality.
void BKE_action_fcurves_clear(bAction *act)
void action_groups_remove_channel(bAction *act, FCurve *fcu)
bActionGroup * action_groups_add_new(bAction *act, const char name[])
void BKE_blender_atexit_register(void(*func)(void *user_data), void *user_data)
void BKE_fcurve_free(FCurve *fcu)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_msg(a, msg)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
bool BLI_remlink_safe(struct ListBase *listbase, void *vlink) 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)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
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_ID
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
@ ID_RECALC_ANIMATION_NO_FLUSH
@ ADS_FILTER_DRIVER_FALLBACK_AS_ERROR
@ ADS_FILTER_NOMOVIECLIPS
@ ADS_FILTER_NOCACHEFILES
@ ADS_FILTER_NOPOINTCLOUD
@ ADS_FLAG_SHOW_DBFILTERS
@ ADS_FLAG_SUMMARY_COLLAPSED
@ ADT_CURVES_ALWAYS_VISIBLE
Read Guarded memory(de)allocation.
#define RNA_POINTER_INVALIDATE(ptr)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
constexpr PointerRNA PointerRNA_NULL
int UI_icon_from_idcode(int idcode)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
constexpr int64_t size() const
constexpr T * data() const
constexpr const T * data() const
constexpr int64_t first_index_try(const T &search_value) const
constexpr int64_t size() const
void unsafe_copy(char *dst) const
constexpr int64_t size() const
void slot_active_set(slot_handle_t slot_handle)
Slot & slot_add_for_id(const ID &animated_id)
void slot_name_define(Slot &slot, StringRefNull new_name)
void slot_name_propagate(Main &bmain, const Slot &slot)
blender::Span< const Layer * > layers() const
bool is_action_layered() const
blender::Span< const Slot * > slots() const
bool layer_remove(Layer &layer_to_remove)
float2 get_frame_range_of_keys(bool include_modifiers) const ATTR_WARN_UNUSED_RESULT
bool slot_remove(Slot &slot_to_remove)
Layer & layer_add(std::optional< StringRefNull > name)
bActionGroup & channel_group_create(StringRefNull name)
FCurve * fcurve_create_unique(Main *bmain, FCurveDescriptor fcurve_descriptor)
const FCurve * fcurve_find(FCurveDescriptor fcurve_descriptor) const
bool channel_group_remove(bActionGroup &group)
blender::Span< const bActionGroup * > channel_groups() const
blender::Span< const FCurve * > fcurves() const
bool fcurve_remove(FCurve &fcurve_to_remove)
std::string name_prefix_for_idtype() const
static constexpr int name_length_min
StringRefNull name_without_prefix() const
static constexpr slot_handle_t unassigned
SingleKeyingResult keyframe_insert(Main *bmain, const Slot &slot, FCurveDescriptor fcurve_descriptor, float2 time_value, const KeyframeSettings &settings, eInsertKeyFlags insert_key_flags=INSERTKEY_NOFLAGS)
bool channelbag_remove(ChannelBag &channelbag_to_remove)
const ChannelBag * channelbag_for_slot(const Slot &slot) const
blender::Span< const ChannelBag * > channelbags() const
int64_t find_channelbag_index(const ChannelBag &channelbag) const
ChannelBag & channelbag_for_slot_add(const Slot &slot)
const T & data(const Action &owning_action) const
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
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ChannelBag & channelbag_ensure(Action &action)
ChannelBag * channelbag_get(Action &action)
bool action_treat_as_legacy(const bAction &action)
KeyframeSettings get_keyframe_settings(bool from_userprefs)
FCurve * action_fcurve_ensure(Main *bmain, bAction *act, const char group[], PointerRNA *ptr, FCurveDescriptor fcurve_descriptor)
void action_deselect_keys(Action &action)
bool is_action_assignable_to(const bAction *dna_action, ID_Type id_code) ATTR_WARN_UNUSED_RESULT
decltype(::ActionSlot::handle) slot_handle_t
void reevaluate_fcurve_errors(bAnimContext *ac)
FCurve * fcurve_find_in_action(bAction *act, FCurveDescriptor fcurve_descriptor)
float wrap(float value, float max, float min)
const EnumPropertyItem rna_enum_id_type_items[]
void rna_iterator_array_end(CollectionPropertyIterator *iter)
void rna_iterator_listbase_end(CollectionPropertyIterator *)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
void rna_iterator_listbase_next(CollectionPropertyIterator *iter)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void rna_iterator_array_next(CollectionPropertyIterator *iter)
void * rna_iterator_array_dereference_get(CollectionPropertyIterator *iter)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
void * rna_iterator_listbase_get(CollectionPropertyIterator *iter)
static void rna_def_action_legacy(BlenderRNA *brna, StructRNA *srna)
static void rna_def_action(BlenderRNA *brna)
const EnumPropertyItem default_ActionSlot_id_root_items[]
static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_dopesheet(BlenderRNA *brna)
void RNA_def_action(BlenderRNA *brna)
static void rna_def_action_group(BlenderRNA *brna)
static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_api_action(StructRNA *srna)
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_struct_refine_func(StructRNA *srna, const char *refine)
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_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)
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_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)
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)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_property_update_notifier(PropertyRNA *prop, const int noteflag)
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_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
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_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
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_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
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_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_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
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)
bool rna_Action_actedit_assign_poll(PointerRNA *ptr, PointerRNA value)
void rna_def_actionbone_group_common(StructRNA *srna, int update_flag, const char *update_cb)
bool rna_Action_id_poll(PointerRNA *ptr, PointerRNA value)
struct FCurve ** fcurve_array
union CollectionPropertyIterator::@1329 internal
bool is_action_slot_to_id_map_dirty
std::optional< blender::StringRefNull > channel_group
void WM_report(eReportType type, const char *message)
void WM_main_add_notifier(uint type, void *reference)
void WM_reportf(eReportType type, const char *format,...)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)