27#include <fmt/format.h>
37 "Generate a curve using a factorized or expanded polynomial"},
42 "Generate a curve using standard math functions such as sin and cos"},
47 "Reshape F-Curve values, e.g. change amplitude of movements"},
54 "Restrict maximum and minimum values of F-Curve"},
58 "Stepped Interpolation",
59 "Snap values to nearest grid step, e.g. for a stop-motion look"},
64 "Smooth curve using Gaussian smoothing"},
65 {0,
nullptr, 0,
nullptr,
nullptr},
73 "Automatic handles only take immediately adjacent keys into account"},
77 "Continuous Acceleration",
78 "Automatic handles are adjusted to avoid jumps in acceleration, resulting "
79 "in smoother curves. However, key changes may affect interpolation over a "
80 "larger stretch of the curve."},
81 {0,
nullptr, 0,
nullptr,
nullptr},
87 ICON_KEYTYPE_KEYFRAME_VEC,
89 "Normal keyframe, e.g. for key poses"},
92 ICON_KEYTYPE_BREAKDOWN_VEC,
94 "A breakdown pose, e.g. for transitions between key poses"},
97 ICON_KEYTYPE_MOVING_HOLD_VEC,
99 "A keyframe that is part of a moving hold"},
102 ICON_KEYTYPE_EXTREME_VEC,
104 "An \"extreme\" pose, or some other purpose as needed"},
107 ICON_KEYTYPE_JITTER_VEC,
109 "A filler or baked keyframe for keying on ones, or some other purpose as needed"},
112 ICON_KEYTYPE_GENERATED_VEC,
114 "A key generated automatically by a tool, not manually created"},
115 {0,
nullptr, 0,
nullptr,
nullptr},
122 ICON_IPO_EASE_IN_OUT,
124 "Easing type is chosen automatically based on what the type of interpolation used "
125 "(e.g. Ease In for transitional types, and Ease Out for dynamic effects)"},
131 "Only on the end closest to the next keyframe"},
136 "Only on the end closest to the first keyframe"},
139 ICON_IPO_EASE_IN_OUT,
141 "Segment between both keyframes"},
142 {0,
nullptr, 0,
nullptr,
nullptr},
146 {
DTAR_ROTMODE_AUTO,
"AUTO", 0,
"Auto Euler",
"Euler using the rotation order of the target"},
158 "Decompose into a swing rotation to aim the X axis, followed by twist around it"},
163 "Decompose into a swing rotation to aim the Y axis, followed by twist around it"},
168 "Decompose into a swing rotation to aim the Z axis, followed by twist around it"},
169 {0,
nullptr, 0,
nullptr,
nullptr},
177 "Currently evaluating scene"},
182 "Currently evaluating view layer"},
183 {0,
nullptr, 0,
nullptr,
nullptr},
221 return RNA_FModifierGenerator;
223 return RNA_FModifierFunctionGenerator;
225 return RNA_FModifierEnvelope;
227 return RNA_FModifierCycles;
229 return RNA_FModifierNoise;
231 return RNA_FModifierLimits;
233 return RNA_FModifierStepped;
235 return RNA_FModifierSmooth;
237 return RNA_UnknownType;
249 for (
FCurve &fcu : adt->drivers) {
251 if (driver ==
nullptr) {
269 for (
FCurve &fcu : adt->drivers) {
271 if (driver ==
nullptr) {
274 for (
DriverVar &dvar : driver->variables) {
286static bool rna_ChannelDriver_is_simple_expression_get(
PointerRNA *ptr)
293static void rna_ChannelDriver_update_data_impl(
Main *bmain,
309 ID *
id = ptr->owner_id;
311 rna_ChannelDriver_update_data_impl(bmain, scene,
id, driver);
322 rna_ChannelDriver_update_data(bmain, scene, ptr);
328 FCurve *fcu = rna_FCurve_find_driver_by_target(ptr->owner_id, dtar);
330 if (fcu ==
nullptr) [[unlikely]] {
336 rna_ChannelDriver_update_data_impl(bmain, scene, ptr->owner_id, driver);
342 FCurve *fcu = rna_FCurve_find_driver_by_variable(ptr->owner_id, dvar);
344 if (fcu ==
nullptr) [[unlikely]] {
350 rna_ChannelDriver_update_data_impl(bmain, scene, ptr->owner_id, driver);
357 FCurve *fcu = rna_FCurve_find_driver_by_variable(ptr->owner_id, dvar);
359 if (fcu ==
nullptr) [[unlikely]] {
365 rna_ChannelDriver_update_data_impl(bmain, scene, ptr->owner_id, driver);
378 ID *
id = value.data_as<
ID>();
402static int rna_DriverTarget_id_editable(
const PointerRNA *ptr,
const char ** )
408static int rna_DriverTarget_id_type_editable(
const PointerRNA *ptr,
const char ** )
418static void rna_DriverTarget_id_type_set(
PointerRNA *ptr,
int value)
425 data->idtype = value;
438static void rna_DriverTarget_RnaPath_get(
PointerRNA *ptr,
char *value)
442 if (dtar->rna_path) {
443 strcpy(value, dtar->rna_path);
450static int rna_DriverTarget_RnaPath_length(
PointerRNA *ptr)
454 if (dtar->rna_path) {
455 return strlen(dtar->rna_path);
460static void rna_DriverTarget_RnaPath_set(
PointerRNA *ptr,
const char *value)
466 if (dtar->rna_path) {
467 MEM_delete(dtar->rna_path);
474 dtar->rna_path =
nullptr;
478static void rna_DriverVariable_type_set(
PointerRNA *ptr,
int value)
486void rna_DriverVariable_name_set(
PointerRNA *ptr,
const char *value)
514 dvar_ptr->invalidate();
519static void rna_FKeyframe_handle1_get(
PointerRNA *ptr,
float *values)
523 values[0] = bezt->
vec[0][0];
524 values[1] = bezt->vec[0][1];
527static void rna_FKeyframe_handle1_set(
PointerRNA *ptr,
const float *values)
531 bezt->
vec[0][0] = values[0];
532 bezt->vec[0][1] = values[1];
535static void rna_FKeyframe_handle2_get(
PointerRNA *ptr,
float *values)
539 values[0] = bezt->
vec[2][0];
540 values[1] = bezt->vec[2][1];
543static void rna_FKeyframe_handle2_set(
PointerRNA *ptr,
const float *values)
547 bezt->
vec[2][0] = values[0];
548 bezt->vec[2][1] = values[1];
551static void rna_FKeyframe_ctrlpoint_get(
PointerRNA *ptr,
float *values)
555 values[0] = bezt->
vec[1][0];
556 values[1] = bezt->vec[1][1];
559static void rna_FKeyframe_ctrlpoint_set(
PointerRNA *ptr,
const float *values)
563 bezt->
vec[1][0] = values[0];
564 bezt->vec[1][1] = values[1];
567static void rna_FKeyframe_ctrlpoint_ui_set(
PointerRNA *ptr,
const float *values)
571 const float frame_delta = values[0] - bezt->
vec[1][0];
572 const float value_delta = values[1] - bezt->vec[1][1];
578 bezt->vec[0][0] += frame_delta;
579 bezt->vec[0][1] += value_delta;
581 bezt->vec[1][0] = values[0];
582 bezt->vec[1][1] = values[1];
584 bezt->vec[2][0] += frame_delta;
585 bezt->vec[2][1] += value_delta;
590static std::optional<std::string> rna_FCurve_path(
const PointerRNA *ptr)
596 if (
GS(ptr->owner_id->name) !=
ID_AC) {
602 if (std::optional<AncestorPointerRNA> channelbag_ancestor_ptr =
608 &action.id, channelbag_ancestor_ptr->type, channelbag_ancestor_ptr->data, ptr->ancestors};
609 BLI_assert_msg(channelbag_ptr.has_data(),
"PointerRNA ancestors should not be nullptr");
613 BLI_assert_msg(channelbag_path,
"ActionChannelbag instances should have an RNA path");
616 const int64_t index = channelbag->fcurves().first_index(fcurve);
618 return fmt::format(
"{}.fcurves[{}]", *channelbag_path,
index);
630 const int fcurve_index = channelbag->fcurves().first_index_try(fcurve);
631 if (fcurve_index != -1) {
633 action.id, RNA_ActionLayer,
layer);
635 layer_ptr, RNA_ActionStrip, strip);
637 layer_ptr, RNA_ActionChannelbag, channelbag);
639 return fmt::format(
"{}.fcurves[{}]", *channelbag_path, fcurve_index);
648static void rna_FCurve_RnaPath_get(
PointerRNA *ptr,
char *value)
652 strcpy(value, fcu->rna_path().c_str());
655static int rna_FCurve_RnaPath_length(
PointerRNA *ptr)
658 return fcu->rna_path().size();
661static void rna_FCurve_RnaPath_set(
PointerRNA *ptr,
const char *value)
666 fcu->rna_path_set(value);
670 fcu->rna_path_set(
"");
676 ID *pid = ptr->owner_id;
677 ID *vid = value.owner_id;
682 if (
ELEM(
nullptr, pid, vid)) {
683 printf(
"ERROR: one of the ID's for the groups to assign to is invalid (ptr=%p, val=%p)\n",
688 if (value && (pid != vid)) {
690 printf(
"ERROR: IDs differ - ptr=%p vs value=%p\n", pid, vid);
697 act = id_cast<bAction *>(pid);
702 act = (adt) ? adt->action :
nullptr;
706 if (fcu->grp == value.data) {
708 printf(
"ERROR: F-Curve already belongs to this group\n");
715 if (act ==
nullptr) {
717 printf(
"ERROR: cannot assign F-Curve to group, since F-Curve is not attached to any ID\n");
726 if (!channelbag.fcurve_assign_to_channel_group(*fcu, *group)) {
728 "ERROR: F-Curve (datapath: '%s') doesn't belong to the same channel bag as "
729 "channel group '%s'\n",
730 fcu->rna_path().c_str(),
737static void rna_FCurve_range(
FCurve *fcu,
float range[2])
742static bool rna_FCurve_is_empty_get(
PointerRNA *ptr)
748static void rna_tag_animation_update(
Main *bmain,
ID *
id)
753 if (adt && adt->action) {
762static void rna_FCurve_update_data_ex(
ID *
id,
FCurve *fcu,
Main *bmain)
768 rna_tag_animation_update(bmain,
id);
775 rna_FCurve_update_data_ex(ptr->owner_id,
static_cast<FCurve *
>(ptr->data), bmain);
788 rna_tag_animation_update(bmain, ptr->owner_id);
798static void rna_FCurve_active_modifier_set(
PointerRNA *ptr,
821 fcm_ptr->invalidate();
824static void rna_FModifier_active_set(
PointerRNA *ptr,
bool )
832static void rna_FModifier_start_frame_set(
PointerRNA *ptr,
float value)
840 fcm->efra = std::max(fcm->sfra, fcm->efra);
843static void rna_FModifier_end_frame_set(
PointerRNA *ptr,
float value)
851 fcm->sfra = std::min(fcm->efra, fcm->sfra);
854static void rna_FModifier_start_frame_range(
869static void rna_FModifier_end_frame_range(
883static void rna_FModifier_blending_range(
894 ID *
id = ptr->owner_id;
901 rna_tag_animation_update(bmain,
id);
904static void rna_fModifier_name_set(
PointerRNA *ptr,
const char *value)
916 if (fmi && fmi->verify_data) {
917 fmi->verify_data(fcm);
920 rna_FModifier_update(bmain, scene, ptr);
928 for (fm = fmo->prev; fm; fm = fm->prev) {
931 for (fm = fmo->next; fm; fm = fm->next) {
935 rna_FModifier_update(bmain, scene, ptr);
938static int rna_FModifierGenerator_coefficients_get_length(
const PointerRNA *ptr,
945 length[0] = gen->arraysize;
954static void rna_FModifierGenerator_coefficients_get(
PointerRNA *ptr,
float *values)
958 memcpy(values, gen->coefficients, gen->arraysize *
sizeof(
float));
961static void rna_FModifierGenerator_coefficients_set(
PointerRNA *ptr,
const float *values)
965 memcpy(gen->coefficients, values, gen->arraysize *
sizeof(
float));
968static void rna_FModifierLimits_minx_set(
PointerRNA *ptr,
float value)
973 data->rect.xmin = value;
975 data->rect.xmax = std::max(
data->rect.xmin,
data->rect.xmax);
978static void rna_FModifierLimits_maxx_set(
PointerRNA *ptr,
float value)
983 data->rect.xmax = value;
985 data->rect.xmin = std::min(
data->rect.xmax,
data->rect.xmin);
988static void rna_FModifierLimits_miny_set(
PointerRNA *ptr,
float value)
993 data->rect.ymin = value;
995 data->rect.ymax = std::max(
data->rect.ymin,
data->rect.ymax);
998static void rna_FModifierLimits_maxy_set(
PointerRNA *ptr,
float value)
1003 data->rect.ymax = value;
1005 data->rect.ymin = std::min(
data->rect.ymax,
data->rect.ymin);
1008static void rna_FModifierLimits_minx_range(
1020static void rna_FModifierLimits_maxx_range(
1033static void rna_FModifierLimits_miny_range(
1045static void rna_FModifierLimits_maxy_range(
1058static void rna_FModifierStepped_start_frame_range(
1068static void rna_FModifierStepped_end_frame_range(
1078static void rna_FModifierStepped_frame_start_set(
PointerRNA *ptr,
float value)
1083 float prop_clamp_min = -
FLT_MAX, prop_clamp_max =
FLT_MAX, prop_soft_min, prop_soft_max;
1084 rna_FModifierStepped_start_frame_range(
1085 ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);
1086 value = std::clamp(value, prop_clamp_min, prop_clamp_max);
1091 data->start_frame = value;
1095static void rna_FModifierStepped_frame_end_set(
PointerRNA *ptr,
float value)
1100 float prop_clamp_min = -
FLT_MAX, prop_clamp_max =
FLT_MAX, prop_soft_min, prop_soft_max;
1101 rna_FModifierStepped_end_frame_range(
1102 ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);
1103 value = std::clamp(value, prop_clamp_min, prop_clamp_max);
1108 data->end_frame = value;
1112static BezTriple *rna_FKeyframe_points_insert(
1113 ID *
id,
FCurve *fcu,
Main *bmain,
float frame,
float value,
int flag,
int keyframe_type)
1121 if ((fcu->bezt) && (
result == SingleKeyingResult::SUCCESS)) {
1122 rna_tag_animation_update(bmain,
id);
1127 return fcu->bezt +
index;
1133static void rna_FKeyframe_points_add(
ID *
id,
FCurve *fcu,
Main *bmain,
int tot)
1140 rna_tag_animation_update(bmain,
id);
1143static void rna_FKeyframe_points_remove(
1147 int index = int(bezt - fcu->bezt);
1148 if (index < 0 || index >= fcu->totvert) {
1154 bezt_ptr->invalidate();
1160 rna_tag_animation_update(bmain,
id);
1163static void rna_FKeyframe_points_clear(
ID *
id,
FCurve *fcu,
Main *bmain)
1169 rna_tag_animation_update(bmain,
id);
1172static void rna_FKeyframe_points_sort(
ID *
id,
FCurve *fcu,
Main *bmain)
1175 rna_tag_animation_update(bmain,
id);
1178static void rna_FKeyframe_points_deduplicate(
ID *
id,
FCurve *fcu,
Main *bmain)
1181 rna_tag_animation_update(bmain,
id);
1184static void rna_FKeyframe_points_handles_recalc(
ID *
id,
FCurve *fcu,
Main *bmain)
1187 rna_tag_animation_update(bmain,
id);
1197 rna_tag_animation_update(bmain,
id);
1203 fed.f1 = fed.f2 = 0;
1218 if (i < env->totvert) {
1219 memmove(env->data + i + 1, env->data + i, (env->totvert - i) *
sizeof(
FCM_EnvelopeData));
1225 env->data = MEM_new<FCM_EnvelopeData>(
"FCM_EnvelopeData");
1231 *(env->data + i) = fed;
1232 return (env->data + i);
1235static void rna_FModifierEnvelope_points_remove(
1241 int index = int(cp - env->data);
1244 if (index < 0 || index >= env->totvert) {
1249 rna_tag_animation_update(bmain,
id);
1251 if (env->totvert > 1) {
1254 memmove(env->data +
index,
1255 env->data + (
index + 1),
1266 MEM_delete(env->data);
1267 env->data =
nullptr;
1271 point->invalidate();
1276 rna_tag_animation_update(bmain, ptr->owner_id);
1279static void rna_FModifier_show_expanded_set(
PointerRNA *ptr,
bool value)
1299 "POLYNOMIAL_FACTORISED",
1301 "Factorized Polynomial",
1303 {0,
nullptr, 0,
nullptr,
nullptr},
1308 srna,
"Generator F-Modifier",
"Deterministically generate values for the modified F-Curve");
1317 "Values generated by this modifier are applied on top of "
1318 "the existing values instead of overwriting them");
1334 "The highest power of 'x' for this polynomial (number of coefficients - 1)");
1346 "rna_FModifierGenerator_coefficients_get",
1347 "rna_FModifierGenerator_coefficients_set",
1350 prop,
"Coefficients",
"Coefficients for 'x' (starting from lowest power of x^0)");
1363 {0,
"SIN", 0,
"Sine",
""},
1364 {1,
"COS", 0,
"Cosine",
""},
1365 {2,
"TAN", 0,
"Tangent",
""},
1366 {3,
"SQRT", 0,
"Square Root",
""},
1367 {4,
"LN", 0,
"Natural Logarithm",
""},
1368 {5,
"SINC", 0,
"Normalized Sine",
"sin(x) / x"},
1369 {0,
nullptr, 0,
nullptr,
nullptr},
1372 srna =
RNA_def_struct(brna,
"FModifierFunctionGenerator",
"FModifier");
1374 srna,
"Built-In Function F-Modifier",
"Generate values using a built-in function");
1381 prop,
"Amplitude",
"Scale factor determining the maximum/minimum values");
1388 prop,
"Phase Multiplier",
"Scale factor determining the 'speed' of the function");
1408 "Values generated by this modifier are applied on top of "
1409 "the existing values instead of overwriting them");
1427 srna =
RNA_def_struct(brna,
"FModifierEnvelopeControlPoint",
nullptr);
1466 srna =
RNA_def_struct(brna,
"FModifierEnvelopeControlPoints",
nullptr);
1470 srna,
"Control Points",
"Control points defining the shape of the envelope");
1481 "Frame to add this control-point",
1486 func,
"point",
"FModifierEnvelopeControlPoint",
"",
"Newly created control-point");
1490 func =
RNA_def_function(srna,
"remove",
"rna_FModifierEnvelope_points_remove");
1494 func,
"point",
"FModifierEnvelopeControlPoint",
"",
"Control-point to remove");
1513 prop,
"Control Points",
"Control points defining the shape of the envelope");
1521 prop,
"Reference Value",
"Value that envelope's influence is centered around / based on");
1528 prop,
"Default Minimum",
"Lower distance from Reference Value for 1:1 default influence");
1536 prop,
"Default Maximum",
"Upper distance from Reference Value for 1:1 default influence");
1554 "Repeat with Offset",
1555 "Repeat keyframe range, but with offset based on gradient between "
1556 "start and end values"},
1561 "Alternate between forward and reverse playback of keyframe range"},
1562 {0,
nullptr, 0,
nullptr,
nullptr},
1583 "Maximum number of cycles to allow before first keyframe (0 = infinite)");
1599 "Maximum number of cycles to allow after last keyframe (0 = infinite)");
1612 srna,
"Limit F-Modifier",
"Limit the time/value ranges of the modified F-Curve");
1643 prop,
nullptr,
"rna_FModifierLimits_minx_set",
"rna_FModifierLimits_minx_range");
1651 prop,
nullptr,
"rna_FModifierLimits_miny_set",
"rna_FModifierLimits_miny_range");
1659 prop,
nullptr,
"rna_FModifierLimits_maxx_set",
"rna_FModifierLimits_maxx_range");
1667 prop,
nullptr,
"rna_FModifierLimits_maxy_set",
"rna_FModifierLimits_maxy_range");
1684 {0,
nullptr, 0,
nullptr,
nullptr},
1711 "Amplitude of the noise - the amount that it modifies the underlying curve");
1736 "Gap between successive frequencies. Depth needs to be greater than 0 "
1737 "for this to have an effect");
1746 "Amount of high frequency detail. Depth needs to be greater than 0 for "
1747 "this to have an effect");
1761 "Use the legacy way of generating noise. Has the issue that it can "
1762 "produce values outside of -1/1");
1776 "Stepped Interpolation F-Modifier",
1777 "Hold each interpolated value from the F-Curve for several frames without "
1778 "changing the timing");
1794 "Reference number of frames before frames get held "
1795 "(use to get hold for '1-3' vs '5-7' holding patterns)");
1802 prop,
"Use Start Frame",
"Restrict modifier to only act after its 'start' frame");
1809 prop,
"Use End Frame",
"Restrict modifier to only act before its 'end' frame");
1817 "rna_FModifierStepped_frame_start_set",
1818 "rna_FModifierStepped_start_frame_range");
1820 prop,
"Start Frame",
"Frame that modifier's influence starts (if applicable)");
1827 prop,
nullptr,
"rna_FModifierStepped_frame_end_set",
"rna_FModifierStepped_end_frame_range");
1829 prop,
"End Frame",
"Frame that modifier's influence ends (if applicable)");
1851 "The shape of the Gaussian distribution in frames. Lower values will "
1852 "increase sharpness across the Filter Width.");
1861 "The number of frames to average around each keyframe. Higher values "
1862 "allow more smoothing, but will decrease performance.");
1913 prop,
"Disabled",
"F-Curve Modifier has invalid settings and will not be evaluated");
1931 "Restrict Frame Range",
1932 "F-Curve Modifier is only applied for the specified frame range to help "
1933 "mask off effects in order to chain them");
1940 prop,
nullptr,
"rna_FModifier_start_frame_set",
"rna_FModifier_start_frame_range");
1944 "Frame that modifier's influence starts (if Restrict Frame Range is in use)");
1951 prop,
nullptr,
"rna_FModifier_end_frame_set",
"rna_FModifier_end_frame_range");
1955 "Frame that modifier's influence ends (if Restrict Frame Range is in use)");
1963 prop,
"Blend In",
"Number of frames from start frame for influence to take effect");
1971 prop,
"Blend Out",
"Number of frames from end frame for influence to fade out");
1979 prop,
"Use Influence",
"F-Curve Modifier's effects will be tempered by a default factor");
1988 prop,
"Influence",
"Amount of influence F-Curve Modifier will have when not fading in/out");
2013 {0,
nullptr, 0,
nullptr,
nullptr},
2021 "Transforms include effects of parenting/restpose and constraints"},
2026 "Transforms don't include parenting/restpose or constraints"},
2031 "Transforms include effects of constraints but not "
2032 "parenting/restpose"},
2033 {0,
nullptr, 0,
nullptr,
nullptr},
2047 prop,
nullptr,
"rna_DriverTarget_id_set",
"rna_DriverTarget_id_typef",
nullptr);
2050 "ID-block that the specific property used can be found from "
2051 "(id_type property must be set first)");
2067 "rna_DriverTarget_RnaPath_get",
2068 "rna_DriverTarget_RnaPath_length",
2069 "rna_DriverTarget_RnaPath_set");
2101 prop,
"Context Property",
"Type of a context-dependent data-block to access property from");
2108 "Use the fallback value if the data path cannot be resolved, instead "
2109 "of failing to evaluate the driver");
2115 prop,
"Fallback",
"The value to use if the data path cannot be resolved");
2124 "Indicates that the most recent variable evaluation used the fallback value");
2137 "Use the value from some RNA property"},
2140 ICON_DRIVER_TRANSFORM,
2141 "Transform Channel",
2142 "Final transformation value of object or bone"},
2145 ICON_DRIVER_ROTATIONAL_DIFFERENCE,
2146 "Rotational Difference",
2147 "Use the angle between two bones"},
2150 ICON_DRIVER_DISTANCE,
2152 "Distance between two bones or objects"},
2157 "Use the value from some RNA property within the current evaluation context"},
2158 {0,
nullptr, 0,
nullptr,
nullptr},
2164 srna,
"Driver Variable",
"Variable from some source/target for driver relationship");
2173 "Name to use in scripted expressions/functions (no spaces or dots are allowed, "
2174 "and must start with a letter)");
2213 srna,
"ChannelDriver Variables",
"Collection of channel driver Variables");
2219 parm =
RNA_def_pointer(func,
"var",
"DriverVariable",
"",
"Newly created Driver Variable");
2229 func,
"variable",
"DriverVariable",
"",
"Variable to remove from the driver");
2245 {0,
nullptr, 0,
nullptr,
nullptr},
2251 srna,
"Driver",
"Driver for the value of a setting based on an external value");
2279 "Include a 'self' variable in the name-space, "
2280 "so drivers can easily reference the data being modified (object, bone, etc...)");
2286 prop,
"Invalid",
"Driver could not be evaluated in past, so should be skipped");
2293 "Simple Expression",
2294 "The scripted expression can be evaluated without using the full Python interpreter");
2337 srna,
"Keyframe",
"Bézier curve point with two handles defining a Keyframe on an F-Curve");
2373 "Interpolation method to use for segment of the F-Curve from "
2374 "this Keyframe until the next Keyframe");
2390 "Which ends of the segment between this and the next keyframe easing "
2391 "interpolation is applied to");
2404 prop,
"Amplitude",
"Amount to boost elastic bounces for 'elastic' easing");
2417 prop,
"rna_FKeyframe_handle1_get",
"rna_FKeyframe_handle1_set",
nullptr);
2419 prop,
"Left Handle",
"Coordinates of the left handle (before the control point)");
2425 prop,
"rna_FKeyframe_ctrlpoint_get",
"rna_FKeyframe_ctrlpoint_set",
nullptr);
2433 prop,
"rna_FKeyframe_ctrlpoint_get",
"rna_FKeyframe_ctrlpoint_ui_set",
nullptr);
2437 "Coordinates of the control point. Note: Changing this value also updates the handles "
2438 "similar to using the graph editor transform operator");
2445 prop,
"rna_FKeyframe_handle2_get",
"rna_FKeyframe_handle2_set",
nullptr);
2447 prop,
"Right Handle",
"Coordinates of the right handle (after the control point)");
2470 prop,
"rna_FCurve_active_modifier_get",
"rna_FCurve_active_modifier_set",
nullptr,
nullptr);
2478 parm =
RNA_def_pointer(func,
"fmodifier",
"FModifier",
"",
"New fmodifier");
2489 parm =
RNA_def_pointer(func,
"modifier",
"FModifier",
"",
"Removed modifier");
2507 "Don't add any new keyframes, but just replace existing ones"},
2508 {
INSERTKEY_NEEDED,
"NEEDED", 0,
"Needed",
"Only adds keyframes that are needed"},
2513 "Fast keyframe insertion to avoid recalculating the curve each time"},
2514 {0,
nullptr, 0,
nullptr,
nullptr},
2531 "X Value of this keyframe point",
2541 "Y Value of this keyframe point",
2545 RNA_def_enum_flag(func,
"options", keyframe_flag_items, 0,
"",
"Keyframe options");
2551 "Type of keyframe to insert");
2552 parm =
RNA_def_pointer(func,
"keyframe",
"Keyframe",
"",
"Newly created keyframe");
2559 func,
"count", 1, 0,
INT_MAX,
"Number",
"Number of points to add to the spline", 0,
INT_MAX);
2565 parm =
RNA_def_pointer(func,
"keyframe",
"Keyframe",
"",
"Keyframe to remove");
2573 "Fast keyframe removal to avoid recalculating the curve each time");
2583 func =
RNA_def_function(srna,
"deduplicate",
"rna_FKeyframe_points_deduplicate");
2586 "Ensure there are no duplicate keys. Assumes that the points have already been sorted");
2589 func =
RNA_def_function(srna,
"handles_recalc",
"rna_FKeyframe_points_handles_recalc");
2591 "Update handles after modifications to the keyframe points, to "
2592 "update things like auto-clamping");
2608 "Hold values of endpoint keyframes"},
2613 "Use slope of curve leading in/out of endpoint keyframes"},
2614 {0,
nullptr, 0,
nullptr,
nullptr},
2621 "Cycle through the rainbow, trying to give each curve a unique color"},
2626 "Use axis colors for transform and color properties, and auto-rainbow for the rest"},
2630 "Auto WXYZ to YRGB",
2631 "Use WXYZ axis colors for quaternion/axis-angle rotations, XYZ axis colors for other "
2632 "transform and color properties, and auto-rainbow for the rest"},
2637 "Use custom hand-picked color for F-Curve"},
2638 {0,
nullptr, 0,
nullptr,
nullptr},
2653 "Method used for evaluating value of F-Curve outside first and last keyframes");
2672 prop,
"rna_FCurve_RnaPath_get",
"rna_FCurve_RnaPath_length",
"rna_FCurve_RnaPath_set");
2680 prop,
"RNA Array Index",
"Index to the specific property affected by F-Curve if applicable");
2688 prop,
"Color Mode",
"Method used to determine color of F-Curve in Graph Editor");
2717 prop,
"Hide",
"F-Curve and its keyframes are hidden in the Graph Editor graphs");
2723 prop,
"Auto Handle Smoothing",
"Algorithm used to compute automatic handles");
2732 "False when F-Curve could not be evaluated in past, so should be skipped "
2741 "True if the curve contributes no animation due to lack of "
2742 "keyframes or useful modifiers, and should be deleted");
2771 "Evaluate F-Curve at given frame",
2782 "Value of F-Curve specific frame",
2791 func,
"Ensure keyframes are sorted in chronological order and handles are set correctly");
2804 srna,
"update_autoflags",
"update_autoflags_fcurve");
2807 "Update FCurve flags set automatically from affected property "
2808 "(currently, integer/discrete flags set when the property is not a float)");
2811 func,
"data",
"AnyType",
"Data",
"Data containing the property controlled by given FCurve");
Functions and classes to work with Actions.
Functions to modify FCurves.
#define STRNCPY_UTF8(dst, src)
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_ACTION
#define BLT_I18NCONTEXT_ID_ID
#define MAX_DRIVER_TARGETS
Object is a sort of wrapper for general info.
#define RNA_MAX_ARRAY_DIMENSION
#define RNA_ENUM_ITEM_SEPR
#define ARRAY_HAS_ITEM(arr_item, arr_start, arr_len)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLI_assert_msg(a, msg)
#define MEM_realloc_uninitialized(vmemh, len)
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
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.
BLI_INLINE Texture * wrap(MTLTexture *texture)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
static void rna_def_fmodifier_envelope_control_points(BlenderRNA *brna, PropertyRNA *cprop)
void id_lib_extern(ID *id, bool enforce_fix=false)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
@ UI_PANEL_DATA_EXPAND_ROOT
@ DVAR_TYPE_TRANSFORM_CHAN
static void rna_def_fmodifier_limits(BlenderRNA *brna)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
bool BKE_fcurve_calc_range(const FCurve *fcu, float *r_min, float *r_max, bool selected_keys_only)
const EnumPropertyItem rna_enum_fmodifier_type_items[]
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
void ED_keyframes_add(FCurve *fcu, int num_keys_to_add)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
const EnumPropertyItem rna_enum_id_type_items[]
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
static const EnumPropertyItem rna_enum_driver_target_context_property_items[]
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void BKE_driver_invalidate_expression(struct ChannelDriver *driver, bool expr_changed, bool varname_changed)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
static void rna_def_drivervar(BlenderRNA *brna)
@ FCM_GENERATOR_POLYNOMIAL
@ FCM_GENERATOR_POLYNOMIAL_FACTORISED
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
StructRNA * ID_code_to_RNA_type(short idcode)
bool BKE_idtype_idcode_is_linkable(short idcode)
static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void BKE_fmodifier_name_set(FModifier *fcm, const char *name)
void driver_free_variable_ex(struct ChannelDriver *driver, struct DriverVar *dvar)
void BKE_fcurve_delete_key(FCurve *fcu, int index)
std::optional< AncestorPointerRNA > RNA_struct_search_closest_ancestor_by_type(const PointerRNA *ptr, const StructRNA *srna)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
const FModifierTypeInfo * fmodifier_get_typeinfo(const FModifier *fcm)
FModifier * add_fmodifier(ListBaseT< FModifier > *modifiers, int type, FCurve *owner_fcu)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
static void rna_def_fmodifier(BlenderRNA *brna)
const EnumPropertyItem rna_enum_driver_target_rotation_mode_items[]
static void rna_def_fmodifier_smooth(BlenderRNA *brna)
@ DTAR_ROTMODE_QUATERNION
@ DTAR_ROTMODE_SWING_TWIST_Y
@ DTAR_ROTMODE_SWING_TWIST_Z
@ DTAR_ROTMODE_SWING_TWIST_X
bool remove_fmodifier(ListBaseT< FModifier > *modifiers, FModifier *fcm)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ FCM_NOISE_MODIF_REPLACE
@ FCM_NOISE_MODIF_SUBTRACT
@ FCM_NOISE_MODIF_MULTIPLY
static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
void RNA_def_property_float_default(PropertyRNA *prop, float value)
bool BKE_id_can_use_id(const ID &id_from, const ID &id_to)
@ FMODIFIER_TYPE_ENVELOPE
@ FMODIFIER_TYPE_FN_GENERATOR
@ FMODIFIER_TYPE_GENERATOR
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
AnimData * BKE_animdata_from_id(const ID *id)
void RNA_def_fcurve(BlenderRNA *brna)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
@ FCM_EXTRAPOLATE_CYCLIC_OFFSET
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void BKE_fcurve_handles_recalc(FCurve &fcu)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BMesh const char void * data
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
@ DTAR_CONTEXT_PROPERTY_ACTIVE_SCENE
@ DTAR_CONTEXT_PROPERTY_ACTIVE_VIEW_LAYER
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
@ DTAR_OPTION_USE_FALLBACK
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
const EnumPropertyItem rna_enum_beztriple_interpolation_easing_items[]
static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[]
static void rna_def_channeldriver(BlenderRNA *brna)
static void rna_def_fmodifier_noise(BlenderRNA *brna)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
FModifier * find_active_fmodifier(ListBaseT< FModifier > *modifiers)
void driver_variable_name_validate(struct DriverVar *dvar)
static void rna_def_fmodifier_generator(BlenderRNA *brna)
static void rna_def_fkeyframe(BlenderRNA *brna)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_fcurve(BlenderRNA *brna)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
@ DTAR_TRANSCHAN_SCALE_AVG
static void rna_def_fmodifier_envelope(BlenderRNA *brna)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_api_fcurves(StructRNA *srna)
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 BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[]
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
void driver_variable_unique_name(struct DriverVar *dvar)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
int BKE_fcm_envelope_find_index(FCM_EnvelopeData *array, float frame, int arraylen, bool *r_exists)
ID_Type GS(const char *name)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
std::optional< std::string > rna_Channelbag_path(const PointerRNA *ptr)
PointerRNA RNA_pointer_create_id_subdata(ID &id, StructRNA *type, void *data)
void BKE_fcurve_delete_keys_all(FCurve &fcu)
@ FCURVE_SMOOTH_CONT_ACCEL
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_property_update(PropertyRNA *prop, int noteflag, const char *func)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
void DEG_relations_tag_update(Main *bmain)
static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_fmodifier_stepped(BlenderRNA *brna)
int BKE_fcurve_bezt_binarysearch_index(const BezTriple array[], float frame, int arraylen, bool *r_replace)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
bool BKE_fcurve_is_empty(const FCurve *fcu)
static void rna_def_fmodifier_cycles(BlenderRNA *brna)
void BKE_fcurve_deduplicate_keys(FCurve *fcu)
static void rna_def_fpoint(BlenderRNA *brna)
@ FCURVE_COLOR_AUTO_RAINBOW
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
@ DTAR_FLAG_FALLBACK_USED
bool BKE_driver_has_simple_expression(struct ChannelDriver *driver)
void driver_change_variable_type(struct DriverVar *dvar, eDriverVar_Types type)
const EnumPropertyItem rna_enum_fcurve_auto_smoothing_items[]
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
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)
@ FCURVE_EXTRAPOLATE_CONSTANT
@ FCURVE_EXTRAPOLATE_LINEAR
void RNA_def_property_array(PropertyRNA *prop, int length)
void set_active_fmodifier(ListBaseT< FModifier > *modifiers, FModifier *fcm)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_api_drivers(StructRNA *)
static void rna_def_drivertarget(BlenderRNA *brna)
struct DriverVar * driver_add_new_variable(struct ChannelDriver *driver)
void sort_time_fcurve(FCurve &fcu)
const EnumPropertyItem rna_enum_keyframe_handle_type_items[]
@ FMODIFIER_FLAG_DISABLED
@ FMODIFIER_FLAG_RANGERESTRICT
@ FMODIFIER_FLAG_USEINFLUENCE