36 {int(animrig::Layer::MixMode::Replace),
40 "Channels in this layer override the same channels from underlying layers"},
41 {int(animrig::Layer::MixMode::Offset),
45 "Channels in this layer are added to underlying layers as sequential operations"},
46 {int(animrig::Layer::MixMode::Add),
50 "Channels in this layer are added to underlying layers on a per-channel basis"},
51 {int(animrig::Layer::MixMode::Subtract),
55 "Channels in this layer are subtracted to underlying layers on a per-channel basis"},
56 {int(animrig::Layer::MixMode::Multiply),
60 "Channels in this layer are multiplied with underlying layers on a per-channel basis"},
61 {0,
nullptr, 0,
nullptr,
nullptr},
66 {int(animrig::Strip::Type::Keyframe),
70 "Strip containing keyframes on F-Curves"},
71 {0,
nullptr, 0,
nullptr,
nullptr},
81 "Not yet specified. When this slot is first assigned to a data-block, this will be set to "
82 "the type of that data-block"},
83 {0,
nullptr, 0,
nullptr,
nullptr},
111# include <fmt/format.h>
198 "Cannot add slots to a legacy Action '%s'. Convert it to a layered Action first.",
215void rna_Action_slots_remove(
bAction *dna_action,
241 return action.
layers().size();
254 "Cannot add layers to a legacy Action '%s'. Convert it to a layered Action first.",
259 if (action.
layers().size() >= 1) {
272void rna_Action_layers_remove(
bAction *dna_action,
295static int rna_iterator_animation_slots_length(
PointerRNA *
ptr)
298 return action.
slots().size();
301static std::optional<std::string> rna_ActionSlot_path(
const PointerRNA *
ptr)
305 char identifier_esc[
sizeof(slot.
identifier) * 2];
307 return fmt::format(
"slots[\"{}\"]", identifier_esc);
317void rna_ActionSlot_name_display_get(
PointerRNA *
ptr,
char *value)
329static void rna_ActionSlot_name_display_set(
PointerRNA *
ptr,
const char *name)
335 if (name_ref.is_empty()) {
343static void rna_ActionSlot_identifier_set(
PointerRNA *
ptr,
const char *identifier)
347 const StringRef identifier_ref(identifier);
357 const std::string identifier_with_correct_prefix = slot.
idtype_string() +
358 identifier_ref.substr(2);
360 if (identifier_with_correct_prefix != identifier_ref) {
363 "Attempted to set slot identifier to \"%s\", but the type prefix doesn't match the "
364 "slot's 'target_id_type' \"%s\". Setting to \"%s\" instead.\n",
367 identifier_with_correct_prefix.c_str());
403static std::optional<std::string> rna_ActionLayer_path(
const PointerRNA *
ptr)
407 char name_esc[
sizeof(layer.
name) * 2];
409 return fmt::format(
"layers[\"{}\"]", name_esc);
419static int rna_iterator_ActionLayer_strips_length(
PointerRNA *
ptr)
422 return layer.
strips().size();
429 switch (strip.
type()) {
430 case animrig::Strip::Type::Keyframe:
431 return &RNA_ActionKeyframeStrip;
433 return &RNA_UnknownType;
439 const animrig::Strip::Type strip_type = animrig::Strip::Type(type);
443 if (layer.
strips().size() >= 1) {
457void rna_ActionStrips_remove(
473static std::optional<std::string> rna_ActionStrip_path(
const PointerRNA *
ptr)
486 const std::optional<std::string> layer_path = rna_ActionLayer_path(&layer_ptr);
487 BLI_assert_msg(layer_path,
"Every animation layer should have a valid RNA path.");
488 const std::string strip_path = fmt::format(
"{}.strips[{}]", *layer_path, index);
504static int rna_iterator_keyframestrip_channelbags_length(
PointerRNA *
ptr)
535static void rna_Channelbags_remove(
ID *dna_action_id,
556static bool rna_ActionStrip_key_insert(
ID *dna_action_id,
561 const char *rna_path,
562 const int array_index,
566 if (dna_slot ==
nullptr) {
578 bmain, slot, {rna_path, array_index}, {time, value}, settings,
INSERTKEY_NOFLAGS);
596 if (strip->
type() != animrig::Strip::Type::Keyframe) {
608 const std::optional<std::string> layer_path = rna_ActionLayer_path(&layer_ptr);
609 BLI_assert_msg(layer_path,
"Every animation layer should have a valid RNA path.");
610 return fmt::format(
"{}.strips[{}].channelbags[{}]", *layer_path, strip_index, index);
634static int rna_iterator_Channelbag_fcurves_length(
PointerRNA *
ptr)
643 const char *data_path,
647 if (data_path[0] ==
'\0') {
653 FCurve *fcurve =
self.fcurve_create_unique(bmain, {data_path, index});
657 "F-Curve '%s[%d]' already exists in this channelbag",
667 const char *data_path,
670 if (data_path[0] ==
'\0') {
676 return self.fcurve_find({data_path, index});
679static void rna_Channelbag_fcurve_remove(
ID *dna_action_id,
688 if (!
self.fcurve_remove(*fcurve)) {
697static void rna_Channelbag_fcurve_clear(
ID *dna_action_id,
701 dna_channelbag->wrap().fcurves_clear();
712static int rna_iterator_Channelbag_groups_length(
PointerRNA *
ptr)
723 return &
self.channel_group_create(name);
734 if (!
self.channel_group_remove(*agrp)) {
737 "Could not remove the F-Curve Group from the collection because it doesn't exist "
738 "in the collection");
777struct ActionGroupChannelsIterator {
786 ListBaseIterator listbase;
804 if (group->wrap().is_legacy()) {
805 custom_iter->tag = ActionGroupChannelsIterator::LISTBASE;
806 custom_iter->listbase.link =
static_cast<Link *
>(group->channels.first);
808 iter->
valid = custom_iter->listbase.link !=
nullptr;
815 custom_iter->tag = ActionGroupChannelsIterator::ARRAY;
816 custom_iter->array.ptr =
reinterpret_cast<char *
>(cbag.
fcurve_array + group->fcurve_range_start);
817 custom_iter->array.endptr =
reinterpret_cast<char *
>(
818 cbag.
fcurve_array + group->fcurve_range_start + group->fcurve_range_length);
819 custom_iter->array.itemsize =
sizeof(
FCurve *);
820 custom_iter->array.length = group->fcurve_range_length;
822 iter->
valid = group->fcurve_range_length > 0;
835 ActionGroupChannelsIterator *custom_iter =
static_cast<ActionGroupChannelsIterator *
>(
841 switch (custom_iter->tag) {
842 case ActionGroupChannelsIterator::ARRAY: {
843 custom_iter->array.ptr += custom_iter->array.itemsize;
844 iter->
valid = (custom_iter->array.ptr != custom_iter->array.endptr);
847 case ActionGroupChannelsIterator::LISTBASE: {
852 if ((fcurve->
next) && (fcurve->
next->
grp == grp)) {
853 custom_iter->listbase.link = custom_iter->listbase.link->next;
854 iter->
valid = (custom_iter->listbase.link !=
nullptr);
857 custom_iter->listbase.link =
nullptr;
869 ActionGroupChannelsIterator *custom_iter =
static_cast<ActionGroupChannelsIterator *
>(
873 switch (custom_iter->tag) {
874 case ActionGroupChannelsIterator::ARRAY:
875 fcurve = *
reinterpret_cast<FCurve **
>(custom_iter->array.ptr);
877 case ActionGroupChannelsIterator::LISTBASE:
878 fcurve =
reinterpret_cast<FCurve *
>(custom_iter->listbase.link);
896 if (use_backward_compatible_api(action)) {
910 if (use_backward_compatible_api(action)) {
920 if (use_backward_compatible_api(action)) {
931 if (use_backward_compatible_api(action)) {
943 if (use_backward_compatible_api(action)) {
958 if (use_backward_compatible_api(action)) {
982 if (use_backward_compatible_api(action)) {
987 "Action group '%s' not found in action '%s'",
1005 "Action group '%s' not found in action '%s'",
1033 if (use_backward_compatible_api(action)) {
1047 if (use_backward_compatible_api(action)) {
1057 if (use_backward_compatible_api(action)) {
1068 if (use_backward_compatible_api(action)) {
1077static int rna_iterator_Action_fcurves_length(
PointerRNA *
ptr)
1080 if (use_backward_compatible_api(action)) {
1085 return channelbag->
fcurves().size();
1093 const char *data_path,
1098 if (data_path[0] ==
'\0') {
1104 if (group && group[0] !=
'\0') {
1109 if (use_backward_compatible_api(action)) {
1120 "F-Curve '%s[%d]' already exists in action '%s'",
1134 "F-Curve '%s[%d]' already exists in action '%s'",
1150 const char *data_path,
1153 if (data_path[0] ==
'\0') {
1159 if (use_backward_compatible_api(action)) {
1164 return channelbag->
fcurve_find({data_path, index});
1176 if (use_backward_compatible_api(action)) {
1198 "F-Curve's action group '%s' not found in action '%s'",
1223static void rna_Action_fcurve_clear(
bAction *act)
1226 if (use_backward_compatible_api(action)) {
1251static void rna_Action_pose_markers_remove(
bAction *act,
1259 "Timeline marker '%s' not found in action '%s'",
1276static void rna_Action_active_pose_marker_set(
PointerRNA *
ptr,
1284static int rna_Action_active_pose_marker_index_get(
PointerRNA *
ptr)
1290static void rna_Action_active_pose_marker_index_set(
PointerRNA *
ptr,
int value)
1296static void rna_Action_active_pose_marker_index_range(
1312 return rna_action(
ptr).is_action_legacy();
1314static bool rna_Action_is_action_layered_get(
PointerRNA *
ptr)
1316 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];
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)
1363static void rna_Action_start_frame_set(
PointerRNA *
ptr,
float value)
1367 data->frame_start = value;
1371static void rna_Action_end_frame_set(
PointerRNA *
ptr,
float value)
1375 data->frame_end = value;
1379static void rna_Action_deselect_keys(
bAction *act)
1385static FCurve *rna_Action_fcurve_ensure_for_datablock(
bAction *_self,
1389 const char *data_path,
1390 const int array_index)
1397 "Assign action \"%s\" to \"%s\" before calling this function",
1399 datablock->
name + 2);
1404 if (data_path[0] ==
'\0') {
1411 bmain, *_self, *datablock, {data_path, array_index});
1423 ID *srcId =
ptr->owner_id;
1436 if (action.
idroot == 0) {
1440 return GS(srcId->name) == action.
idroot;
1466 switch (saction->mode) {
1493 if (filtering_enabled) {
1496 ListBase anim_data = {
nullptr,
nullptr};
1514 if (filtering_enabled) {
1533 reevaluate_fcurve_errors(&ac);
1536static std::optional<std::string> rna_DopeSheet_path(
const PointerRNA *
ptr)
1547 if (sipo->
ads == ads) {
1548 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1553 if (snla->
ads == ads) {
1554 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1559 if (&saction->
ads == ads) {
1560 return fmt::format(
"areas[{}].spaces[{}].dopesheet", area_index, space_index);
1585 if (_rna_ActionSlot_target_id_type_items) {
1586 return _rna_ActionSlot_target_id_type_items;
1617 _rna_ActionSlot_target_id_type_items = items;
1624static void rna_ActionSlot_target_id_type_set(
PointerRNA *
ptr,
int value)
1632 "WARNING: ignoring assignment to target_id_type of Slot '%s' in Action '%s'. A Slot's "
1633 "target_id_type can only be changed when currently 'UNSPECIFIED'.\n",
1653 if (action.
slots().is_empty()) {
1668static void rna_Action_id_root_set(
PointerRNA *
ptr,
int value)
1680 if (action.
slots().is_empty()) {
1702 srna,
"Dope Sheet",
"Settings for filtering the channels shown in animation editors");
1709 prop,
"Source",
"ID-Block representing source data, usually ID_SCE (i.e. Scene)");
1716 "Show Data-Block Filters",
1717 "Show options for whether channels related to certain types of data are included");
1725 prop,
"Only Show Selected",
"Only include channels relating to selected objects and data");
1733 "Only Show Slot of Active Object",
1734 "Only show the slot of the active Object. Otherwise show all the Action's Slots");
1741 prop,
"Show Hidden",
"Include channels from objects/bone that are not visible");
1749 "Alphabetically sorts data-blocks - mainly objects in the scene "
1750 "(disable to increase viewport speed)");
1765 "Only include F-Curves and drivers that are disabled or have errors");
1776 prop,
"Filtering Collection",
"Collection that included object should be a member of");
1799 "Multi-Word Fuzzy Filter",
1800 "Perform fuzzy/multi-word matching.\n"
1801 "Warning: May be slow");
1809 "Include Missing NLA",
1810 "Include animation data-blocks with no NLA data (NLA editor only)");
1818 prop,
"Display Summary",
"Display an additional 'summary' line (Dope Sheet editors only)");
1827 "Collapse summary when shown, so all other channels get hidden (Dope Sheet editors only)");
1835 "Display Transforms",
1836 "Include visualization of object-level animation data (mostly transforms)");
1843 prop,
"Display Shape Keys",
"Include visualization of shape key related animation data");
1851 "Display Modifier Data",
1852 "Include visualization of animation data related to data-blocks linked to modifiers");
1859 prop,
"Display Meshes",
"Include visualization of mesh related animation data");
1866 prop,
"Display Lattices",
"Include visualization of lattice related animation data");
1873 prop,
"Display Camera",
"Include visualization of camera related animation data");
1880 prop,
"Display Material",
"Include visualization of material related animation data");
1887 prop,
"Display Light",
"Include visualization of light related animation data");
1894 prop,
"Display Line Style",
"Include visualization of Line Style related Animation data");
1901 prop,
"Display Texture",
"Include visualization of texture related animation data");
1908 prop,
"Display Curve",
"Include visualization of curve related animation data");
1915 prop,
"Display World",
"Include visualization of world related animation data");
1922 prop,
"Display Scene",
"Include visualization of scene related animation data");
1929 prop,
"Display Particle",
"Include visualization of particle related animation data");
1936 prop,
"Display Metaball",
"Include visualization of metaball related animation data");
1943 prop,
"Display Armature",
"Include visualization of armature related animation data");
1950 prop,
"Display Node",
"Include visualization of node related animation data");
1957 prop,
"Display Speaker",
"Include visualization of speaker related animation data");
1964 prop,
"Display Cache Files",
"Include visualization of cache file related animation data");
1971 prop,
"Display Hair",
"Include visualization of hair related animation data");
1978 prop,
"Display Point Cloud",
"Include visualization of point cloud related animation data");
1985 prop,
"Display Volume",
"Include visualization of volume related animation data");
1992 prop,
"Display Light Probe",
"Include visualization of lightprobe related animation data");
2000 "Display Grease Pencil",
2001 "Include visualization of Grease Pencil related animation data and frames");
2008 prop,
"Display Movie Clips",
"Include visualization of movie clip related animation data");
2016 "Variable Fallback As Error",
2017 "Include drivers that relied on any fallback values for their evaluation "
2018 "in the Only Show Errors filter, even if the driver evaluation succeeded");
2042 prop,
"rna_ActionSlots_active_get",
"rna_ActionSlots_active_set",
nullptr,
nullptr);
2057 "The data-block type that the slot is intended for. This is combined with the slot name to "
2058 "create the slot's unique identifier, and is also used to limit (on a best-effort basis) "
2059 "which data-blocks the slot can be assigned to.");
2068 "Name of the slot. This will be made unique within the Action among slots of the same type");
2071 parm =
RNA_def_pointer(func,
"slot",
"ActionSlot",
"",
"Newly created action slot");
2078 "Remove the slot from the Action, including all animation that "
2079 "is associated with that slot");
2080 parm =
RNA_def_pointer(func,
"action_slot",
"ActionSlot",
"Action Slot",
"The slot to remove");
2101 "Add a layer to the Animation. Currently an Animation can only have at most one layer.");
2107 "Name of the layer, will be made unique within the Action");
2109 parm =
RNA_def_pointer(func,
"layer",
"ActionLayer",
"",
"Newly created animation layer");
2117 func,
"anim_layer",
"ActionLayer",
"Animation Layer",
"The layer to remove");
2134 "Identifier for a set of channels in this Action, that can be used by a data-block "
2135 "to specify what it gets animated by");
2147 "Used when connecting an Action to a data-block, to find the correct slot handle. This is "
2148 "the display name, prefixed by two characters determined by the slot's ID type");
2154 prop,
nullptr,
"rna_ActionSlot_target_id_type_set",
"rna_ActionSlot_target_id_type_itemf");
2159 "Type of data-block that this slot is intended to animate; can be set "
2160 "when 'UNSPECIFIED' but is otherwise read-only");
2169 "rna_ActionSlot_name_display_get",
2170 "rna_ActionSlot_name_display_length",
2171 "rna_ActionSlot_name_display_set");
2177 "Slot Display Name",
2178 "Name of the slot, for display in the user interface. This name combined with the slot's "
2179 "data-block type is unique within its Action");
2185 "Number specific to this Slot, unique within the Action.\n"
2186 "This is used, for example, on a ActionKeyframeStrip to look up the "
2187 "ActionChannelbag for this Slot");
2194 "Whether this is the active slot, can be set by assigning to action.slots.active");
2216 func,
"Return the data-blocks that are animated by this slot of this action");
2224 func,
"Duplicate this slot, including all the animation data associated with it");
2248 "Add a new strip to the layer. Currently a layer can only have "
2249 "one strip, with infinite boundaries.");
2254 int(animrig::Strip::Type::Keyframe),
2256 "The type of strip to create");
2258 parm =
RNA_def_pointer(func,
"strip",
"ActionStrip",
"",
"Newly created animation strip");
2266 func,
"anim_strip",
"ActionStrip",
"Animation Strip",
"The strip to remove");
2291 prop,
"Influence",
"How much of this layer is used when blending into the lower layers");
2299 prop,
"Mix Mode",
"How animation of this layer is blended into the lower layers");
2309 "rna_iterator_ActionLayer_strips_begin",
2310 "rna_iterator_array_next",
2311 "rna_iterator_array_end",
2312 "rna_iterator_array_dereference_get",
2313 "rna_iterator_ActionLayer_strips_length",
2334 "Animation Channels for Slots",
2335 "For each action slot, a list of animation channels that are meant for that slot");
2341 "Add a new channelbag to the strip, to contain animation channels for a specific slot");
2347 "The slot that should be animated by this channelbag");
2351 parm =
RNA_def_pointer(func,
"channelbag",
"ActionChannelbag",
"",
"Newly created channelbag");
2358 parm =
RNA_def_pointer(func,
"channelbag",
"ActionChannelbag",
"",
"The channelbag to remove");
2370 srna =
RNA_def_struct(brna,
"ActionKeyframeStrip",
"ActionStrip");
2372 srna,
"Keyframe Animation Strip",
"Strip with a set of F-Curves for each action slot");
2378 "rna_iterator_keyframestrip_channelbags_begin",
2379 "rna_iterator_array_next",
2380 "rna_iterator_array_end",
2381 "rna_iterator_array_dereference_get",
2382 "rna_iterator_keyframestrip_channelbags_length",
2397 func,
"slot",
"ActionSlot",
"Slot",
"The slot for which to find the channelbag");
2402 "Create if necessary",
2403 "Ensure the channelbag exists for this slot, creating it if necessary");
2404 parm =
RNA_def_pointer(func,
"channels",
"ActionChannelbag",
"Channels",
"");
2415 "The slot that identifies which 'thing' should be keyed");
2418 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2428 "Index of the animated array element, or -1 if the property is not an array",
2439 "Value of the animated property",
2450 "Time, in frames, of the key",
2456 func,
"success",
true,
"Success",
"Whether the key was successfully inserted");
2473 {int(animrig::Strip::Type::Keyframe),
2477 "Strip with a set of F-Curves for each action slot"},
2478 {0,
nullptr, 0,
nullptr,
nullptr},
2501 srna,
"F-Curves",
"Collection of F-Curves for a specific action slot, on a specific strip");
2504 extern FCurve *ActionChannelbagFCurves_new_func(
ID * _selfid,
2508 const char *data_path,
2514 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path to use");
2516 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
2518 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"Newly created F-Curve");
2525 "Find an F-Curve. Note that this function performs a linear scan "
2526 "of all F-Curves in the channelbag.");
2528 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2530 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
2532 func,
"fcurve",
"FCurve",
"",
"The found F-Curve, or None if it doesn't exist");
2539 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"F-Curve to remove");
2564 parm =
RNA_def_string(func,
"name",
"Group", 0,
"",
"New name for the action group");
2566 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Newly created action group");
2572 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Action group to remove");
2585 "Animation Channel Bag",
2586 "Collection of animation channels, typically associated with an action slot");
2601 "rna_iterator_Channelbag_fcurves_begin",
2602 "rna_iterator_array_next",
2603 "rna_iterator_array_end",
2604 "rna_iterator_array_dereference_get",
2605 "rna_iterator_Channelbag_fcurves_length",
2616 "rna_iterator_Channelbag_groups_begin",
2617 "rna_iterator_array_next",
2618 "rna_iterator_array_end",
2619 "rna_iterator_array_dereference_get",
2620 "rna_iterator_Channelbag_groups_length",
2628 "Groupings of F-Curves for display purposes, in e.g. the dopesheet and graph editor");
2660 "rna_ActionGroup_channels_begin",
2661 "rna_ActionGroup_channels_next",
2662 "rna_ActionGroup_channels_end",
2663 "rna_ActionGroup_channels_get",
2695 prop,
"Expanded in Graph Editor",
"Action group is expanded in graph editor");
2723 "rna_iterator_Action_groups_begin",
2724 "rna_iterator_Action_groups_next",
2725 "rna_iterator_Action_groups_end",
2726 "rna_iterator_Action_groups_get",
2727 "rna_iterator_Action_groups_length",
2734 parm =
RNA_def_string(func,
"name",
"Group", 0,
"",
"New name for the action group");
2736 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Newly created action group");
2742 parm =
RNA_def_pointer(func,
"action_group",
"ActionGroup",
"",
"Action group to remove");
2760 "Collection of action F-Curves. Note that this is a legacy API that is unaware of action "
2761 "slots, and will only consider the F-Curves for this action's first slot");
2763 "rna_iterator_Action_fcurves_begin",
2764 "rna_iterator_Action_fcurves_next",
2765 "rna_iterator_Action_fcurves_end",
2766 "rna_iterator_Action_fcurves_get",
2767 "rna_iterator_Action_fcurves_length",
2775 "Add an F-Curve for the first slot of this action, creating the "
2776 "necessary layer, strip, and slot if necessary");
2778 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path to use");
2780 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
2782 func,
"action_group",
nullptr, 0,
"Action Group",
"Acton group to add this F-Curve into");
2784 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"Newly created F-Curve");
2791 "Find an F-Curve. Note that this function performs a linear scan "
2792 "of all F-Curves for the action's first slot.");
2794 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
2796 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
2798 func,
"fcurve",
"FCurve",
"",
"The found F-Curve, or None if it doesn't exist");
2805 parm =
RNA_def_pointer(func,
"fcurve",
"FCurve",
"",
"F-Curve to remove");
2830 func,
"name",
"Marker", 0,
nullptr,
"New name for the marker (not unique)");
2832 parm =
RNA_def_pointer(func,
"marker",
"TimelineMarker",
"",
"Newly created marker");
2838 parm =
RNA_def_pointer(func,
"marker",
"TimelineMarker",
"",
"Timeline marker to remove");
2846 "rna_Action_active_pose_marker_get",
2847 "rna_Action_active_pose_marker_set",
2856 "rna_Action_active_pose_marker_index_get",
2857 "rna_Action_active_pose_marker_index_set",
2858 "rna_Action_active_pose_marker_index_range");
2875 "Legacy API, for backward compatibility with code that does not handle slotted actions yet. "
2876 "This collection contains the F-Curves for the action's first slot");
2885 "Legacy API, for backward compatibility with code that does not handle slotted actions yet. "
2886 "This collection contains the F-Curve groups for the action's first slot");
2895 "rna_Action_id_root_get",
2896 "rna_Action_id_root_set",
2897 "rna_ActionSlot_target_id_type_itemf");
2903 "Legacy API, for backward compatibility with code that does not handle slotted actions yet. "
2904 "Type of data-block that the action's first slot can be used on. Do not change unless you "
2905 "know what you are doing");
2926 prop,
"Is Empty",
"False when there is any Layer, Slot, or legacy F-Curve");
2934 "Return whether this is a legacy Action. Legacy Actions have no layers or slots. An "
2935 "empty Action is considered as both a 'legacy' and a 'layered' Action. Since Blender 4.4 "
2936 "actions are automatically updated to layered actions, and thus this will only return True "
2937 "when the action is empty");
2944 "Is Layered Action",
2945 "Return whether this is a layered Action. An empty Action is considered "
2946 "as both a 'legacy' and a 'layered' Action.");
2953 "rna_iterator_animation_slots_begin",
2954 "rna_iterator_array_next",
2955 "rna_iterator_array_end",
2956 "rna_iterator_array_dereference_get",
2957 "rna_iterator_animation_slots_length",
2967 "rna_iterator_action_layers_begin",
2968 "rna_iterator_array_next",
2969 "rna_iterator_array_end",
2970 "rna_iterator_array_dereference_get",
2971 "rna_iterator_action_layers_length",
2985 prop,
"Pose Markers",
"Markers specific to this action, for labeling poses");
2995 "Manual Frame Range",
2996 "Manually specify the intended playback frame range for the action "
2997 "(this range is used by some tools, but does not affect animation evaluation)");
3006 "The action is intended to be used as a cycle looping over its manually set "
3007 "playback frame range (enabling this doesn't automatically make it loop)");
3016 prop,
"Start Frame",
"The start frame of the manually set intended playback range");
3025 prop,
"End Frame",
"The end frame of the manually set intended playback range");
3036 "The intended playback frame range of this action, using the manually set range "
3037 "if available, or the combined frame range of all F-Curves within this action "
3038 "if not (assigning sets the manual frame range)",
3042 prop,
"rna_Action_frame_range_get",
"rna_Action_frame_range_set",
nullptr);
3046 "curve_frame_range",
3051 "Curve Frame Range",
3052 "The combined frame range of all F-Curves within this action",
3058 func =
RNA_def_function(srna,
"deselect_keys",
"rna_Action_deselect_keys");
3060 func,
"Deselects all keys of the Action. The selection status of F-Curves is unchanged.");
3064 srna,
"fcurve_ensure_for_datablock",
"rna_Action_fcurve_ensure_for_datablock");
3067 "Ensure that an F-Curve exists, with the given data path and array index, for the given "
3068 "data-block. This action must already be assigned to the data-block. This function will "
3069 "also create the layer, keyframe strip, and action slot if necessary, and take care of "
3070 "assigning the action slot too");
3077 "The data-block animated by this action, for which to ensure the F-Curve "
3078 "exists. This action must already be assigned to the data-block");
3080 parm =
RNA_def_string(func,
"data_path",
nullptr, 0,
"Data Path",
"F-Curve data path");
3082 RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Array index", 0, INT_MAX);
3083 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 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)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
bool BLI_remlink_safe(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const 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)
@ ID_RECALC_ANIMATION_NO_FLUSH
@ ADS_FILTER_NOLIGHTPROBE
@ ADS_FILTER_DRIVER_FALLBACK_AS_ERROR
@ ADS_FILTER_NOMOVIECLIPS
@ ADS_FILTER_NOCACHEFILES
@ ADS_FILTER_NOPOINTCLOUD
@ ADS_FILTER_ONLY_SLOTS_OF_ACTIVE
@ ADS_FLAG_SHOW_DBFILTERS
@ ADS_FLAG_SUMMARY_COLLAPSED
@ ADT_CURVES_ALWAYS_VISIBLE
@ RPT_ERROR_INVALID_INPUT
@ ANIMFILTER_DATA_VISIBLE
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
int UI_icon_from_idcode(int idcode)
void ANIM_animdata_freelist(ListBase *anim_data)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
BMesh const char void * data
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
constexpr IndexRange index_range() const
void copy_unsafe(char *dst) const
constexpr int64_t size() const
void slot_active_set(slot_handle_t slot_handle)
void slot_display_name_define(Slot &slot, StringRefNull new_display_name)
void slot_identifier_propagate(Main &bmain, const Slot &slot)
const Slot * slot(int64_t index) const
void slot_idtype_define(Slot &slot, ID_Type idtype)
blender::Span< const Layer * > layers() const
bool is_action_layered() const
void slot_display_name_set(Main &bmain, Slot &slot, StringRefNull new_display_name)
Slot & slot_add_for_id_type(ID_Type idtype)
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
void slot_identifier_define(Slot &slot, StringRefNull new_identifier)
bool slot_remove(Slot &slot_to_remove)
Slot * slot_for_handle(slot_handle_t handle)
Layer & layer_add(std::optional< StringRefNull > name)
bool channel_group_remove(bActionGroup &group)
bActionGroup & channel_group_create(StringRefNull name)
bool fcurve_remove(FCurve &fcurve_to_remove)
FCurve * fcurve_create_unique(Main *bmain, const FCurveDescriptor &fcurve_descriptor)
const FCurve * fcurve_find(const FCurveDescriptor &fcurve_descriptor) const
blender::Span< const FCurve * > fcurves() const
blender::Span< const bActionGroup * > channel_groups() const
bool strip_remove(Action &owning_action, Strip &strip)
blender::Span< const Strip * > strips() const
const Strip * strip(int64_t index) const
Strip & strip_add(Action &owning_action, Strip::Type strip_type)
StringRef identifier_prefix() const
std::string idtype_string() const
static constexpr int identifier_length_min
Span< ID * > users(Main &bmain) const
static constexpr slot_handle_t unassigned
StringRefNull identifier_without_prefix() const
const Channelbag * channelbag_for_slot(const Slot &slot) const
int64_t find_channelbag_index(const Channelbag &channelbag) const
Channelbag & channelbag_for_slot_add(const Slot &slot)
SingleKeyingResult keyframe_insert(Main *bmain, const Slot &slot, const FCurveDescriptor &fcurve_descriptor, float2 time_value, const KeyframeSettings &settings, eInsertKeyFlags insert_key_flags=INSERTKEY_NOFLAGS, std::optional< float2 > cycle_range=std::nullopt)
Channelbag & channelbag_for_slot_ensure(const Slot &slot)
blender::Span< const Channelbag * > channelbags() const
bool channelbag_remove(Channelbag &channelbag_to_remove)
const T & data(const Action &owning_action) const
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
Slot & slot_ensure(Action &action)
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)
void action_deselect_keys(Action &action)
Slot & duplicate_slot(Action &action, const Slot &slot)
FCurve * action_fcurve_ensure_legacy(Main *bmain, bAction *act, const char group[], PointerRNA *ptr, const FCurveDescriptor &fcurve_descriptor)
bool is_action_assignable_to(const bAction *dna_action, ID_Type id_code)
Action * get_action(ID &animated_id)
FCurve & action_fcurve_ensure(Main *bmain, bAction &action, ID &animated_id, const FCurveDescriptor &fcurve_descriptor)
FCurve * fcurve_find_in_action(bAction *act, const 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_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
const PointerRNA PointerRNA_NULL
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void rna_iterator_listbase_next(CollectionPropertyIterator *iter)
void rna_iterator_array_next(CollectionPropertyIterator *iter)
void * rna_iterator_array_dereference_get(CollectionPropertyIterator *iter)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void * rna_iterator_listbase_get(CollectionPropertyIterator *iter)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
static void rna_def_action_slots(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_channelbag_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_action_slot(BlenderRNA *brna)
static void rna_def_action_legacy(BlenderRNA *brna, StructRNA *srna)
static void rna_def_channelbag_groups(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_action_keyframe_strip(BlenderRNA *brna)
static void rna_def_action(BlenderRNA *brna)
static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_ActionLayer_strips(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_action_channelbag(BlenderRNA *brna)
const EnumPropertyItem default_ActionSlot_target_id_type_items[]
static void rna_def_dopesheet(BlenderRNA *brna)
static void rna_def_action_layer(BlenderRNA *brna)
static void rna_def_keyframestrip_channelbags(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_strip_type_items[]
void RNA_def_action(BlenderRNA *brna)
static void rna_def_action_layers(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_action_strip(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_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_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_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)
std::optional< std::string > rna_Channelbag_path(const PointerRNA *ptr)
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)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
struct FCurve ** fcurve_array
union CollectionPropertyIterator::@277172262001176145116102322066145204253046376362 internal
std::optional< blender::StringRefNull > channel_group
void WM_global_report(eReportType type, const char *message)
void WM_main_add_notifier(uint type, void *reference)
void WM_global_reportf(eReportType type, const char *format,...)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)