27#include <fmt/format.h>
35 "Generate a curve using a factorized or expanded polynomial"},
40 "Generate a curve using standard math functions such as sin and cos"},
45 "Reshape F-Curve values, e.g. change amplitude of movements"},
52 "Restrict maximum and minimum values of F-Curve"},
56 "Stepped Interpolation",
57 "Snap values to nearest grid step, e.g. for a stop-motion look"},
58 {0,
nullptr, 0,
nullptr,
nullptr},
66 "Automatic handles only take immediately adjacent keys into account"},
70 "Continuous Acceleration",
71 "Automatic handles are adjusted to avoid jumps in acceleration, resulting "
72 "in smoother curves. However, key changes may affect interpolation over a "
73 "larger stretch of the curve."},
74 {0,
nullptr, 0,
nullptr,
nullptr},
80 ICON_KEYTYPE_KEYFRAME_VEC,
82 "Normal keyframe, e.g. for key poses"},
85 ICON_KEYTYPE_BREAKDOWN_VEC,
87 "A breakdown pose, e.g. for transitions between key poses"},
90 ICON_KEYTYPE_MOVING_HOLD_VEC,
92 "A keyframe that is part of a moving hold"},
95 ICON_KEYTYPE_EXTREME_VEC,
97 "An \"extreme\" pose, or some other purpose as needed"},
100 ICON_KEYTYPE_JITTER_VEC,
102 "A filler or baked keyframe for keying on ones, or some other purpose as needed"},
105 ICON_KEYTYPE_GENERATED_VEC,
107 "A key generated automatically by a tool, not manually created"},
108 {0,
nullptr, 0,
nullptr,
nullptr},
115 ICON_IPO_EASE_IN_OUT,
117 "Easing type is chosen automatically based on what the type of interpolation used "
118 "(e.g. Ease In for transitional types, and Ease Out for dynamic effects)"},
124 "Only on the end closest to the next keyframe"},
129 "Only on the end closest to the first keyframe"},
132 ICON_IPO_EASE_IN_OUT,
134 "Segment between both keyframes"},
135 {0,
nullptr, 0,
nullptr,
nullptr},
139 {
DTAR_ROTMODE_AUTO,
"AUTO", 0,
"Auto Euler",
"Euler using the rotation order of the target"},
151 "Decompose into a swing rotation to aim the X axis, followed by twist around it"},
156 "Decompose into a swing rotation to aim the Y axis, followed by twist around it"},
161 "Decompose into a swing rotation to aim the Z axis, followed by twist around it"},
162 {0,
nullptr, 0,
nullptr,
nullptr},
170 "Currently evaluating scene"},
175 "Currently evaluating view layer"},
176 {0,
nullptr, 0,
nullptr,
nullptr},
209 return &RNA_FModifierGenerator;
211 return &RNA_FModifierFunctionGenerator;
213 return &RNA_FModifierEnvelope;
215 return &RNA_FModifierCycles;
217 return &RNA_FModifierNoise;
219 return &RNA_FModifierLimits;
221 return &RNA_FModifierStepped;
223 return &RNA_UnknownType;
237 if (driver ==
nullptr) {
257 if (driver ==
nullptr) {
272static bool rna_ChannelDriver_is_simple_expression_get(
PointerRNA *
ptr)
279static void rna_ChannelDriver_update_data_impl(
Main *bmain,
295 ID *
id =
ptr->owner_id;
297 rna_ChannelDriver_update_data_impl(bmain, scene,
id, driver);
308 rna_ChannelDriver_update_data(bmain, scene,
ptr);
314 FCurve *fcu = rna_FCurve_find_driver_by_target(
ptr->owner_id, dtar);
322 rna_ChannelDriver_update_data_impl(bmain, scene,
ptr->owner_id, driver);
328 FCurve *fcu = rna_FCurve_find_driver_by_variable(
ptr->owner_id, dvar);
336 rna_ChannelDriver_update_data_impl(bmain, scene,
ptr->owner_id, driver);
343 FCurve *fcu = rna_FCurve_find_driver_by_variable(
ptr->owner_id, dvar);
351 rna_ChannelDriver_update_data_impl(bmain, scene,
ptr->owner_id, driver);
383static int rna_DriverTarget_id_editable(
const PointerRNA *
ptr,
const char ** )
389static int rna_DriverTarget_id_type_editable(
const PointerRNA *
ptr,
const char ** )
399static void rna_DriverTarget_id_type_set(
PointerRNA *
ptr,
int value)
406 data->idtype = value;
419static void rna_DriverTarget_RnaPath_get(
PointerRNA *
ptr,
char *value)
441static void rna_DriverTarget_RnaPath_set(
PointerRNA *
ptr,
const char *value)
459static void rna_DriverVariable_type_set(
PointerRNA *
ptr,
int value)
467void rna_DriverVariable_name_set(
PointerRNA *
ptr,
const char *value)
500static void rna_FKeyframe_handle1_get(
PointerRNA *
ptr,
float *values)
504 values[0] = bezt->vec[0][0];
505 values[1] = bezt->vec[0][1];
508static void rna_FKeyframe_handle1_set(
PointerRNA *
ptr,
const float *values)
512 bezt->vec[0][0] = values[0];
513 bezt->vec[0][1] = values[1];
516static void rna_FKeyframe_handle2_get(
PointerRNA *
ptr,
float *values)
520 values[0] = bezt->vec[2][0];
521 values[1] = bezt->vec[2][1];
524static void rna_FKeyframe_handle2_set(
PointerRNA *
ptr,
const float *values)
528 bezt->vec[2][0] = values[0];
529 bezt->vec[2][1] = values[1];
532static void rna_FKeyframe_ctrlpoint_get(
PointerRNA *
ptr,
float *values)
536 values[0] = bezt->vec[1][0];
537 values[1] = bezt->vec[1][1];
540static void rna_FKeyframe_ctrlpoint_set(
PointerRNA *
ptr,
const float *values)
544 bezt->vec[1][0] = values[0];
545 bezt->vec[1][1] = values[1];
548static void rna_FKeyframe_ctrlpoint_ui_set(
PointerRNA *
ptr,
const float *values)
552 const float frame_delta = values[0] - bezt->vec[1][0];
553 const float value_delta = values[1] - bezt->vec[1][1];
559 bezt->vec[0][0] += frame_delta;
560 bezt->vec[0][1] += value_delta;
562 bezt->vec[1][0] = values[0];
563 bezt->vec[1][1] = values[1];
565 bezt->vec[2][0] += frame_delta;
566 bezt->vec[2][1] += value_delta;
571static std::optional<std::string> rna_FCurve_path(
const PointerRNA *
ptr)
586 if (strip->type() != animrig::Strip::Type::Keyframe) {
592 const int fcurve_index = channelbag->fcurves().first_index_try(fcurve);
593 if (fcurve_index != -1) {
595 &action.
id, &RNA_ActionChannelbag, channelbag);
597 return fmt::format(
"{}.fcurves[{}]", *channelbag_path, fcurve_index);
606static void rna_FCurve_RnaPath_get(
PointerRNA *
ptr,
char *value)
628static void rna_FCurve_RnaPath_set(
PointerRNA *
ptr,
const char *value)
647 ID *pid =
ptr->owner_id;
653 if (
ELEM(
nullptr, pid, vid)) {
654 printf(
"ERROR: one of the ID's for the groups to assign to is invalid (ptr=%p, val=%p)\n",
659 if (value.
data && (pid != vid)) {
661 printf(
"ERROR: IDs differ - ptr=%p vs value=%p\n", pid, vid);
679 printf(
"ERROR: F-Curve already belongs to this group\n");
686 if (act ==
nullptr) {
688 printf(
"ERROR: cannot assign F-Curve to group, since F-Curve is not attached to any ID\n");
699 printf(
"ERROR: F-Curve (%p) doesn't exist in action '%s'\n", fcu, act->
id.
name);
729 "ERROR: F-Curve (datapath: '%s') doesn't belong to the same channel bag as "
730 "channel group '%s'\n",
738static void rna_FCurve_range(
FCurve *fcu,
float range[2])
749static void rna_tag_animation_update(
Main *bmain,
ID *
id)
763static void rna_FCurve_update_data_ex(
ID *
id,
FCurve *fcu,
Main *bmain)
769 rna_tag_animation_update(bmain,
id);
776 rna_FCurve_update_data_ex(
ptr->owner_id, (
FCurve *)
ptr->data, bmain);
789 rna_tag_animation_update(bmain,
ptr->owner_id);
833static void rna_FModifier_start_frame_set(
PointerRNA *
ptr,
float value)
844static void rna_FModifier_end_frame_set(
PointerRNA *
ptr,
float value)
855static void rna_FModifier_start_frame_range(
870static void rna_FModifier_end_frame_range(
884static void rna_FModifier_blending_range(
890 *
max = fcm->efra - fcm->sfra;
895 ID *
id =
ptr->owner_id;
902 rna_tag_animation_update(bmain,
id);
905static void rna_fModifier_name_set(
PointerRNA *
ptr,
const char *value)
921 rna_FModifier_update(bmain, scene,
ptr);
929 for (fm = fmo->prev; fm; fm = fm->prev) {
932 for (fm = fmo->next; fm; fm = fm->next) {
936 rna_FModifier_update(bmain, scene,
ptr);
939static int rna_FModifierGenerator_coefficients_get_length(
const PointerRNA *
ptr,
955static void rna_FModifierGenerator_coefficients_get(
PointerRNA *
ptr,
float *values)
962static void rna_FModifierGenerator_coefficients_set(
PointerRNA *
ptr,
const float *values)
969static void rna_FModifierLimits_minx_set(
PointerRNA *
ptr,
float value)
974 data->rect.xmin = value;
976 data->rect.xmax = std::max(
data->rect.xmin,
data->rect.xmax);
979static void rna_FModifierLimits_maxx_set(
PointerRNA *
ptr,
float value)
984 data->rect.xmax = value;
986 data->rect.xmin = std::min(
data->rect.xmax,
data->rect.xmin);
989static void rna_FModifierLimits_miny_set(
PointerRNA *
ptr,
float value)
994 data->rect.ymin = value;
996 data->rect.ymax = std::max(
data->rect.ymin,
data->rect.ymax);
999static void rna_FModifierLimits_maxy_set(
PointerRNA *
ptr,
float value)
1004 data->rect.ymax = value;
1006 data->rect.ymin = std::min(
data->rect.ymax,
data->rect.ymin);
1009static void rna_FModifierLimits_minx_range(
1021static void rna_FModifierLimits_maxx_range(
1034static void rna_FModifierLimits_miny_range(
1046static void rna_FModifierLimits_maxy_range(
1059static void rna_FModifierStepped_start_frame_range(
1069static void rna_FModifierStepped_end_frame_range(
1079static void rna_FModifierStepped_frame_start_set(
PointerRNA *
ptr,
float value)
1084 float prop_clamp_min = -
FLT_MAX, prop_clamp_max =
FLT_MAX, prop_soft_min, prop_soft_max;
1085 rna_FModifierStepped_start_frame_range(
1086 ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);
1087 value = std::clamp(value, prop_clamp_min, prop_clamp_max);
1092 data->start_frame = value;
1096static void rna_FModifierStepped_frame_end_set(
PointerRNA *
ptr,
float value)
1101 float prop_clamp_min = -
FLT_MAX, prop_clamp_max =
FLT_MAX, prop_soft_min, prop_soft_max;
1102 rna_FModifierStepped_end_frame_range(
1103 ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);
1104 value = std::clamp(value, prop_clamp_min, prop_clamp_max);
1109 data->end_frame = value;
1113static BezTriple *rna_FKeyframe_points_insert(
1114 ID *
id,
FCurve *fcu,
Main *bmain,
float frame,
float value,
int flag,
int keyframe_type)
1123 rna_tag_animation_update(bmain,
id);
1128 return fcu->
bezt + index;
1134static void rna_FKeyframe_points_add(
ID *
id,
FCurve *fcu,
Main *bmain,
int tot)
1141 rna_tag_animation_update(bmain,
id);
1144static void rna_FKeyframe_points_remove(
1148 int index = int(bezt - fcu->
bezt);
1149 if (index < 0 || index >= fcu->
totvert) {
1161 rna_tag_animation_update(bmain,
id);
1164static void rna_FKeyframe_points_clear(
ID *
id,
FCurve *fcu,
Main *bmain)
1168 rna_tag_animation_update(bmain,
id);
1171static void rna_FKeyframe_points_sort(
ID *
id,
FCurve *fcu,
Main *bmain)
1174 rna_tag_animation_update(bmain,
id);
1177static void rna_FKeyframe_points_deduplicate(
ID *
id,
FCurve *fcu,
Main *bmain)
1180 rna_tag_animation_update(bmain,
id);
1183static void rna_FKeyframe_points_handles_recalc(
ID *
id,
FCurve *fcu,
Main *bmain)
1186 rna_tag_animation_update(bmain,
id);
1196 rna_tag_animation_update(bmain,
id);
1202 fed.f1 = fed.f2 = 0;
1230 *(env->data +
i) = fed;
1231 return (env->data +
i);
1234static void rna_FModifierEnvelope_points_remove(
1240 int index = int(cp - env->data);
1243 if (index < 0 || index >= env->totvert) {
1248 rna_tag_animation_update(bmain,
id);
1250 if (env->totvert > 1) {
1253 memmove(env->data + index,
1254 env->data + (index + 1),
1266 env->data =
nullptr;
1270 point->invalidate();
1275 rna_tag_animation_update(bmain,
ptr->owner_id);
1278static void rna_FModifier_show_expanded_set(
PointerRNA *
ptr,
bool value)
1294 "POLYNOMIAL_FACTORISED",
1296 "Factorized Polynomial",
1298 {0,
nullptr, 0,
nullptr,
nullptr},
1303 srna,
"Generator F-Modifier",
"Deterministically generate values for the modified F-Curve");
1312 "Values generated by this modifier are applied on top of "
1313 "the existing values instead of overwriting them");
1329 "The highest power of 'x' for this polynomial (number of coefficients - 1)");
1341 "rna_FModifierGenerator_coefficients_get",
1342 "rna_FModifierGenerator_coefficients_set",
1345 prop,
"Coefficients",
"Coefficients for 'x' (starting from lowest power of x^0)");
1358 {0,
"SIN", 0,
"Sine",
""},
1359 {1,
"COS", 0,
"Cosine",
""},
1360 {2,
"TAN", 0,
"Tangent",
""},
1361 {3,
"SQRT", 0,
"Square Root",
""},
1362 {4,
"LN", 0,
"Natural Logarithm",
""},
1363 {5,
"SINC", 0,
"Normalized Sine",
"sin(x) / x"},
1364 {0,
nullptr, 0,
nullptr,
nullptr},
1367 srna =
RNA_def_struct(brna,
"FModifierFunctionGenerator",
"FModifier");
1369 srna,
"Built-In Function F-Modifier",
"Generate values using a built-in function");
1376 prop,
"Amplitude",
"Scale factor determining the maximum/minimum values");
1382 prop,
"Phase Multiple",
"Scale factor determining the 'speed' of the function");
1401 "Values generated by this modifier are applied on top of "
1402 "the existing values instead of overwriting them");
1420 srna =
RNA_def_struct(brna,
"FModifierEnvelopeControlPoint",
nullptr);
1459 srna =
RNA_def_struct(brna,
"FModifierEnvelopeControlPoints",
nullptr);
1463 srna,
"Control Points",
"Control points defining the shape of the envelope");
1474 "Frame to add this control-point",
1479 func,
"point",
"FModifierEnvelopeControlPoint",
"",
"Newly created control-point");
1482 func =
RNA_def_function(srna,
"remove",
"rna_FModifierEnvelope_points_remove");
1486 func,
"point",
"FModifierEnvelopeControlPoint",
"",
"Control-point to remove");
1505 prop,
"Control Points",
"Control points defining the shape of the envelope");
1513 prop,
"Reference Value",
"Value that envelope's influence is centered around / based on");
1520 prop,
"Default Minimum",
"Lower distance from Reference Value for 1:1 default influence");
1527 prop,
"Default Maximum",
"Upper distance from Reference Value for 1:1 default influence");
1544 "Repeat with Offset",
1545 "Repeat keyframe range, but with offset based on gradient between "
1546 "start and end values"},
1551 "Alternate between forward and reverse playback of keyframe range"},
1552 {0,
nullptr, 0,
nullptr,
nullptr},
1573 "Maximum number of cycles to allow before first keyframe (0 = infinite)");
1589 "Maximum number of cycles to allow after last keyframe (0 = infinite)");
1602 srna,
"Limit F-Modifier",
"Limit the time/value ranges of the modified F-Curve");
1633 prop,
nullptr,
"rna_FModifierLimits_minx_set",
"rna_FModifierLimits_minx_range");
1641 prop,
nullptr,
"rna_FModifierLimits_miny_set",
"rna_FModifierLimits_miny_range");
1649 prop,
nullptr,
"rna_FModifierLimits_maxx_set",
"rna_FModifierLimits_maxx_range");
1657 prop,
nullptr,
"rna_FModifierLimits_maxy_set",
"rna_FModifierLimits_maxy_range");
1674 {0,
nullptr, 0,
nullptr,
nullptr},
1700 "Amplitude of the noise - the amount that it modifies the underlying curve");
1722 "Gap between successive frequencies. Depth needs to be greater than 0 "
1723 "for this to have an effect");
1732 "Amount of high frequency detail. Depth needs to be greater than 0 for "
1733 "this to have an effect");
1747 "Use the legacy way of generating noise. Has the issue that it can "
1748 "produce values outside of -1/1");
1762 "Stepped Interpolation F-Modifier",
1763 "Hold each interpolated value from the F-Curve for several frames without "
1764 "changing the timing");
1779 "Reference number of frames before frames get held "
1780 "(use to get hold for '1-3' vs '5-7' holding patterns)");
1787 prop,
"Use Start Frame",
"Restrict modifier to only act after its 'start' frame");
1794 prop,
"Use End Frame",
"Restrict modifier to only act before its 'end' frame");
1802 "rna_FModifierStepped_frame_start_set",
1803 "rna_FModifierStepped_start_frame_range");
1805 prop,
"Start Frame",
"Frame that modifier's influence starts (if applicable)");
1812 prop,
nullptr,
"rna_FModifierStepped_frame_end_set",
"rna_FModifierStepped_end_frame_range");
1814 prop,
"End Frame",
"Frame that modifier's influence ends (if applicable)");
1865 prop,
"Disabled",
"F-Curve Modifier has invalid settings and will not be evaluated");
1883 "Restrict Frame Range",
1884 "F-Curve Modifier is only applied for the specified frame range to help "
1885 "mask off effects in order to chain them");
1892 prop,
nullptr,
"rna_FModifier_start_frame_set",
"rna_FModifier_start_frame_range");
1896 "Frame that modifier's influence starts (if Restrict Frame Range is in use)");
1903 prop,
nullptr,
"rna_FModifier_end_frame_set",
"rna_FModifier_end_frame_range");
1907 "Frame that modifier's influence ends (if Restrict Frame Range is in use)");
1915 prop,
"Blend In",
"Number of frames from start frame for influence to take effect");
1923 prop,
"Blend Out",
"Number of frames from end frame for influence to fade out");
1931 prop,
"Use Influence",
"F-Curve Modifier's effects will be tempered by a default factor");
1940 prop,
"Influence",
"Amount of influence F-Curve Modifier will have when not fading in/out");
1965 {0,
nullptr, 0,
nullptr,
nullptr},
1973 "Transforms include effects of parenting/restpose and constraints"},
1978 "Transforms don't include parenting/restpose or constraints"},
1983 "Transforms include effects of constraints but not "
1984 "parenting/restpose"},
1985 {0,
nullptr, 0,
nullptr,
nullptr},
1999 prop,
nullptr,
"rna_DriverTarget_id_set",
"rna_DriverTarget_id_typef",
nullptr);
2002 "ID-block that the specific property used can be found from "
2003 "(id_type property must be set first)");
2019 "rna_DriverTarget_RnaPath_get",
2020 "rna_DriverTarget_RnaPath_length",
2021 "rna_DriverTarget_RnaPath_set");
2053 prop,
"Context Property",
"Type of a context-dependent data-block to access property from");
2060 "Use the fallback value if the data path cannot be resolved, instead "
2061 "of failing to evaluate the driver");
2067 prop,
"Fallback",
"The value to use if the data path cannot be resolved");
2076 "Indicates that the most recent variable evaluation used the fallback value");
2089 "Use the value from some RNA property"},
2092 ICON_DRIVER_TRANSFORM,
2093 "Transform Channel",
2094 "Final transformation value of object or bone"},
2097 ICON_DRIVER_ROTATIONAL_DIFFERENCE,
2098 "Rotational Difference",
2099 "Use the angle between two bones"},
2102 ICON_DRIVER_DISTANCE,
2104 "Distance between two bones or objects"},
2109 "Use the value from some RNA property within the current evaluation context"},
2110 {0,
nullptr, 0,
nullptr,
nullptr},
2116 srna,
"Driver Variable",
"Variable from some source/target for driver relationship");
2125 "Name to use in scripted expressions/functions (no spaces or dots are allowed, "
2126 "and must start with a letter)");
2165 srna,
"ChannelDriver Variables",
"Collection of channel driver Variables");
2171 parm =
RNA_def_pointer(func,
"var",
"DriverVariable",
"",
"Newly created Driver Variable");
2180 func,
"variable",
"DriverVariable",
"",
"Variable to remove from the driver");
2196 {0,
nullptr, 0,
nullptr,
nullptr},
2202 srna,
"Driver",
"Driver for the value of a setting based on an external value");
2230 "Include a 'self' variable in the name-space, "
2231 "so drivers can easily reference the data being modified (object, bone, etc...)");
2237 prop,
"Invalid",
"Driver could not be evaluated in past, so should be skipped");
2244 "Simple Expression",
2245 "The scripted expression can be evaluated without using the full Python interpreter");
2288 srna,
"Keyframe",
"Bézier curve point with two handles defining a Keyframe on an F-Curve");
2324 "Interpolation method to use for segment of the F-Curve from "
2325 "this Keyframe until the next Keyframe");
2341 "Which ends of the segment between this and the next keyframe easing "
2342 "interpolation is applied to");
2355 prop,
"Amplitude",
"Amount to boost elastic bounces for 'elastic' easing");
2368 prop,
"rna_FKeyframe_handle1_get",
"rna_FKeyframe_handle1_set",
nullptr);
2370 prop,
"Left Handle",
"Coordinates of the left handle (before the control point)");
2376 prop,
"rna_FKeyframe_ctrlpoint_get",
"rna_FKeyframe_ctrlpoint_set",
nullptr);
2384 prop,
"rna_FKeyframe_ctrlpoint_get",
"rna_FKeyframe_ctrlpoint_ui_set",
nullptr);
2388 "Coordinates of the control point. Note: Changing this value also updates the handles "
2389 "similar to using the graph editor transform operator");
2396 prop,
"rna_FKeyframe_handle2_get",
"rna_FKeyframe_handle2_set",
nullptr);
2398 prop,
"Right Handle",
"Coordinates of the right handle (after the control point)");
2421 prop,
"rna_FCurve_active_modifier_get",
"rna_FCurve_active_modifier_set",
nullptr,
nullptr);
2429 parm =
RNA_def_pointer(func,
"fmodifier",
"FModifier",
"",
"New fmodifier");
2440 parm =
RNA_def_pointer(func,
"modifier",
"FModifier",
"",
"Removed modifier");
2458 "Don't add any new keyframes, but just replace existing ones"},
2459 {
INSERTKEY_NEEDED,
"NEEDED", 0,
"Needed",
"Only adds keyframes that are needed"},
2464 "Fast keyframe insertion to avoid recalculating the curve each time"},
2465 {0,
nullptr, 0,
nullptr,
nullptr},
2482 "X Value of this keyframe point",
2492 "Y Value of this keyframe point",
2496 RNA_def_enum_flag(func,
"options", keyframe_flag_items, 0,
"",
"Keyframe options");
2502 "Type of keyframe to insert");
2503 parm =
RNA_def_pointer(func,
"keyframe",
"Keyframe",
"",
"Newly created keyframe");
2510 func,
"count", 1, 0, INT_MAX,
"Number",
"Number of points to add to the spline", 0, INT_MAX);
2516 parm =
RNA_def_pointer(func,
"keyframe",
"Keyframe",
"",
"Keyframe to remove");
2524 "Fast keyframe removal to avoid recalculating the curve each time");
2534 func =
RNA_def_function(srna,
"deduplicate",
"rna_FKeyframe_points_deduplicate");
2537 "Ensure there are no duplicate keys. Assumes that the points have already been sorted");
2540 func =
RNA_def_function(srna,
"handles_recalc",
"rna_FKeyframe_points_handles_recalc");
2542 "Update handles after modifications to the keyframe points, to "
2543 "update things like auto-clamping");
2559 "Hold values of endpoint keyframes"},
2564 "Use slope of curve leading in/out of endpoint keyframes"},
2565 {0,
nullptr, 0,
nullptr,
nullptr},
2572 "Cycle through the rainbow, trying to give each curve a unique color"},
2577 "Use axis colors for transform and color properties, and auto-rainbow for the rest"},
2581 "Auto WXYZ to YRGB",
2582 "Use WXYZ axis colors for quaternion/axis-angle rotations, XYZ axis colors for other "
2583 "transform and color properties, and auto-rainbow for the rest"},
2588 "Use custom hand-picked color for F-Curve"},
2589 {0,
nullptr, 0,
nullptr,
nullptr},
2604 "Method used for evaluating value of F-Curve outside first and last keyframes");
2623 prop,
"rna_FCurve_RnaPath_get",
"rna_FCurve_RnaPath_length",
"rna_FCurve_RnaPath_set");
2631 prop,
"RNA Array Index",
"Index to the specific property affected by F-Curve if applicable");
2639 prop,
"Color Mode",
"Method used to determine color of F-Curve in Graph Editor");
2668 prop,
"Hide",
"F-Curve and its keyframes are hidden in the Graph Editor graphs");
2674 prop,
"Auto Handle Smoothing",
"Algorithm used to compute automatic handles");
2683 "False when F-Curve could not be evaluated in past, so should be skipped "
2692 "True if the curve contributes no animation due to lack of "
2693 "keyframes or useful modifiers, and should be deleted");
2722 "Evaluate F-Curve at given frame",
2733 "Value of F-Curve specific frame",
2742 func,
"Ensure keyframes are sorted in chronological order and handles are set correctly");
2755 srna,
"update_autoflags",
"update_autoflags_fcurve");
2758 "Update FCurve flags set automatically from affected property "
2759 "(currently, integer/discrete flags set when the property is not a float)");
2762 func,
"data",
"AnyType",
"Data",
"Data containing the property controlled by given FCurve");
Functions and classes to work with Actions.
Functions to modify FCurves.
void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve)
void action_groups_remove_channel(bAction *act, FCurve *fcu)
AnimData * BKE_animdata_from_id(const ID *id)
int BKE_fcm_envelope_find_index(FCM_EnvelopeData *array, float frame, int arraylen, bool *r_exists)
void BKE_fcurve_deduplicate_keys(FCurve *fcu)
void BKE_fmodifier_name_set(FModifier *fcm, const char *name)
int BKE_fcurve_bezt_binarysearch_index(const BezTriple array[], float frame, int arraylen, bool *r_replace)
void BKE_fcurve_handles_recalc(FCurve *fcu)
FModifier * add_fmodifier(ListBase *modifiers, int type, FCurve *owner_fcu)
bool remove_fmodifier(ListBase *modifiers, FModifier *fcm)
void set_active_fmodifier(ListBase *modifiers, FModifier *fcm)
bool BKE_fcurve_is_empty(const FCurve *fcu)
FModifier * find_active_fmodifier(ListBase *modifiers)
bool BKE_fcurve_calc_range(const FCurve *fcu, float *r_min, float *r_max, bool selected_keys_only)
void sort_time_fcurve(FCurve *fcu)
const FModifierTypeInfo * fmodifier_get_typeinfo(const FModifier *fcm)
void BKE_fcurve_delete_key(FCurve *fcu, int index)
void BKE_fcurve_delete_keys_all(FCurve *fcu)
struct DriverVar * driver_add_new_variable(struct ChannelDriver *driver)
void driver_variable_unique_name(struct DriverVar *dvar)
void BKE_driver_invalidate_expression(struct ChannelDriver *driver, bool expr_changed, bool varname_changed)
bool BKE_driver_has_simple_expression(struct ChannelDriver *driver)
void driver_free_variable_ex(struct ChannelDriver *driver, struct DriverVar *dvar)
void driver_change_variable_type(struct DriverVar *dvar, int type)
void driver_variable_name_validate(struct DriverVar *dvar)
bool BKE_idtype_idcode_is_linkable(short idcode)
void id_lib_extern(ID *id)
bool BKE_id_can_use_id(const ID &id_from, const ID &id_to)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define STRNCPY_UTF8(dst, src)
#define ARRAY_HAS_ITEM(arr_item, arr_start, arr_len)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_ACTION
#define BLT_I18NCONTEXT_ID_ID
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
#define MAX_DRIVER_TARGETS
@ DTAR_TRANSCHAN_SCALE_AVG
@ FCM_EXTRAPOLATE_CYCLIC_OFFSET
@ DTAR_OPTION_USE_FALLBACK
@ FCURVE_COLOR_AUTO_RAINBOW
@ FCM_NOISE_MODIF_REPLACE
@ FCM_NOISE_MODIF_SUBTRACT
@ FCM_NOISE_MODIF_MULTIPLY
@ DVAR_TYPE_TRANSFORM_CHAN
@ FMODIFIER_TYPE_FN_GENERATOR
@ FMODIFIER_TYPE_GENERATOR
@ FMODIFIER_TYPE_ENVELOPE
@ FCM_GENERATOR_POLYNOMIAL_FACTORISED
@ FCM_GENERATOR_POLYNOMIAL
@ FMODIFIER_FLAG_USEINFLUENCE
@ FMODIFIER_FLAG_DISABLED
@ FMODIFIER_FLAG_RANGERESTRICT
@ DTAR_ROTMODE_QUATERNION
@ DTAR_ROTMODE_SWING_TWIST_X
@ DTAR_ROTMODE_SWING_TWIST_Y
@ DTAR_ROTMODE_SWING_TWIST_Z
@ DTAR_FLAG_FALLBACK_USED
@ FCURVE_EXTRAPOLATE_CONSTANT
@ FCURVE_EXTRAPOLATE_LINEAR
@ FCURVE_SMOOTH_CONT_ACCEL
@ DTAR_CONTEXT_PROPERTY_ACTIVE_SCENE
@ DTAR_CONTEXT_PROPERTY_ACTIVE_VIEW_LAYER
Object is a sort of wrapper for general info.
@ UI_PANEL_DATA_EXPAND_ROOT
#define MEM_reallocN(vmemh, len)
StructRNA * ID_code_to_RNA_type(short idcode)
#define RNA_MAX_ARRAY_DIMENSION
#define RNA_ENUM_ITEM_SEPR
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
BMesh const char void * data
blender::Span< const Layer * > layers() const
bool is_action_layered() const
bool fcurve_assign_to_channel_group(FCurve &fcurve, bActionGroup &to_group)
blender::Span< const Channelbag * > channelbags() const
void ED_keyframes_add(FCurve *fcu, int num_keys_to_add)
float length(VecOp< float, D >) RET
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
void * MEM_mallocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 fmod(const float2 a, const float b)
KeyframeSettings get_keyframe_settings(bool from_userprefs)
SingleKeyingResult insert_vert_fcurve(FCurve *fcu, const float2 position, const KeyframeSettings &settings, eInsertKeyFlags flag)
Main Key-framing API call.
float wrap(float value, float max, float min)
const EnumPropertyItem rna_enum_id_type_items[]
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[]
const EnumPropertyItem rna_enum_keyframe_handle_type_items[]
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)
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_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
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_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)
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
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_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
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_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)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_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_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
static void rna_def_fmodifier_noise(BlenderRNA *brna)
static void rna_def_fmodifier_envelope(BlenderRNA *brna)
void RNA_def_fcurve(BlenderRNA *brna)
const EnumPropertyItem rna_enum_fmodifier_type_items[]
static const EnumPropertyItem rna_enum_driver_target_context_property_items[]
static void rna_def_fmodifier(BlenderRNA *brna)
static void rna_def_channeldriver(BlenderRNA *brna)
static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_beztriple_interpolation_easing_items[]
static void rna_def_drivervar(BlenderRNA *brna)
static void rna_def_fmodifier_cycles(BlenderRNA *brna)
static void rna_def_drivertarget(BlenderRNA *brna)
static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_fmodifier_stepped(BlenderRNA *brna)
static void rna_def_fmodifier_generator(BlenderRNA *brna)
const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[]
const EnumPropertyItem rna_enum_fcurve_auto_smoothing_items[]
static void rna_def_fcurve(BlenderRNA *brna)
const EnumPropertyItem rna_enum_driver_target_rotation_mode_items[]
static void rna_def_fmodifier_limits(BlenderRNA *brna)
static void rna_def_fpoint(BlenderRNA *brna)
static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
static void rna_def_fmodifier_envelope_control_points(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_fkeyframe(BlenderRNA *brna)
static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_api_fcurves(StructRNA *srna)
void RNA_api_drivers(StructRNA *)
std::optional< std::string > rna_Channelbag_path(const PointerRNA *ptr)
void(* verify_data)(FModifier *fcm)
struct ActionChannelbag * channelbag
eBezTriple_KeyframeType keyframe_type
void WM_main_add_notifier(uint type, void *reference)