100 if (list ==
nullptr) {
109 for (
FCurve *fcu =
static_cast<FCurve *
>(list->first); fcu; fcu = fcn) {
127 if (fcu ==
nullptr) {
134 fcu_d->
next = fcu_d->
prev =
nullptr;
135 fcu_d->
grp =
nullptr;
157 if (
ELEM(
nullptr, dst, src)) {
198 if (driver !=
nullptr) {
212 ID *
id,
void *data,
StructRNA *type,
const char *prop_name,
int index,
bool *r_driven)
231 if (prop ==
nullptr) {
242 bool is_driven =
false;
244 adt, path->c_str(), index,
nullptr, &is_driven);
246 if (r_driven !=
nullptr) {
247 *r_driven = is_driven;
258 if (
ELEM(
nullptr, list, rna_path) || array_index < 0) {
266 if (
UNLIKELY(fcu->array_index == array_index && fcu->rna_path &&
267 fcu->rna_path[0] == rna_path[0] &&
STREQ(fcu->rna_path, rna_path)))
285 if (
ELEM(
nullptr, fcu_iter, rna_path)) {
290 for (
FCurve *fcu = fcu_iter; fcu; fcu = fcu->
next) {
292 if (fcu->rna_path &&
STREQ(fcu->rna_path, rna_path)) {
301 AnimData *animdata,
const char *rna_path,
int rna_index,
bAction **r_action,
bool *r_driven)
303 if (r_driven !=
nullptr) {
306 if (r_action !=
nullptr) {
315 *r_action = animdata->
action;
325 if (fcu !=
nullptr) {
326 if (r_driven !=
nullptr) {
345 nullptr,
ptr, prop, rnaindex, r_adt, r_action, r_driven, r_special);
357 if (r_animdata !=
nullptr) {
358 *r_animdata =
nullptr;
360 if (r_action !=
nullptr) {
363 if (r_driven !=
nullptr) {
384 *r_animdata =
nullptr;
400 if (adt ==
nullptr) {
412 adt, rna_path->c_str(), rnaindex, r_action, r_driven);
414 if (fcu !=
nullptr && r_animdata !=
nullptr) {
434 const float threshold,
437 int start = 0, end = arraylen;
438 int loopbreaker = 0, maxloop = arraylen * 2;
447 if (arraylen <= 0 ||
array ==
nullptr) {
454 float framenum =
array[0].vec[1][0];
455 if (
IS_EQT(frame, framenum, threshold)) {
459 if (frame < framenum) {
464 framenum =
array[(arraylen - 1)].vec[1][0];
465 if (
IS_EQT(frame, framenum, threshold)) {
467 return (arraylen - 1);
469 if (frame > framenum) {
476 for (loopbreaker = 0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) {
480 const int mid = start + ((end - start) / 2);
482 const float midfra =
array[mid].vec[1][0];
485 if (
IS_EQT(frame, midfra, threshold)) {
491 if (frame > midfra) {
494 else if (frame < midfra) {
500 if (loopbreaker == (maxloop - 1)) {
505 "\tround = %d: start = %d, end = %d, arraylen = %d",
536 const bool selected_keys_only,
537 const float frame_range[2],
542 if (fcu->
bezt ==
nullptr) {
550 if (frame_range !=
nullptr) {
552 bool replace =
false;
554 fcu->
bezt, frame_range[0], fcu->
totvert, &replace);
556 fcu->
bezt, frame_range[1], fcu->
totvert, &replace);
559 if (*r_first == *r_last) {
570 if (selected_keys_only) {
572 for (
int i = *r_first; i <= *r_last; i++) {
582 for (
int i = *r_last; i >= *r_first; i--) {
599 const int index_range[2],
600 const bool include_handles,
604 *r_min = bezt_array[index_range[0]].
vec[1][0];
605 *r_max = bezt_array[index_range[1]].
vec[1][0];
607 if (include_handles) {
609 for (
int i = index_range[0]; i <= index_range[1]; i++) {
618 const int index_range[2],
619 const bool selected_keys_only,
620 const bool include_handles,
624 *r_min = bezt_array[index_range[0]].
vec[1][1];
625 *r_max = bezt_array[index_range[0]].
vec[1][1];
627 for (
int i = index_range[0]; i <= index_range[1]; i++) {
634 *r_min =
min_ff(*r_min, bezt->
vec[1][1]);
635 *r_max =
max_ff(*r_max, bezt->
vec[1][1]);
637 if (include_handles) {
645 const bool selected_keys_only,
646 const bool include_handles,
647 const float frame_range[2],
652 fcu, selected_keys_only, frame_range, &index_range[0], &index_range[1]);
653 if (!found_indices) {
657 fcu->
bezt, index_range, include_handles, &r_bounds->
xmin, &r_bounds->
xmax);
669 r_bounds->
xmin = INFINITY;
670 r_bounds->
xmax = -INFINITY;
671 r_bounds->
ymin = INFINITY;
672 r_bounds->
ymax = -INFINITY;
674 const int first_index = 0;
675 const int last_index = fcu->
totvert - 1;
676 int start_index = first_index;
677 int end_index = last_index;
679 if (frame_range !=
nullptr) {
681 const float start_index_f = frame_range[0] - fcu->
fpt[0].
vec[0];
682 const float end_index_f = start_index_f + frame_range[1] - frame_range[0];
684 if (start_index_f > fcu->
totvert - 1 || end_index_f < 0) {
695 r_bounds->
xmin = fcu->
fpt[start_index].
vec[0];
698 for (
int i = start_index; i <= end_index; i++) {
707 const bool selected_keys_only,
708 const bool include_handles,
709 const float frame_range[2],
718 fcu, selected_keys_only, include_handles, frame_range, r_bounds);
724 return founds_bounds;
733 const bool selected_keys_only)
737 bool foundvert =
false;
746 fcu, selected_keys_only,
nullptr, &index_range[0], &index_range[1]);
750 const bool include_handles =
false;
767 int fcurve_array_len,
768 const float interval,
773 const double interval_db =
max_ff(interval, 1e-3f);
775 for (
int fcurve_index = 0; fcurve_index < fcurve_array_len; fcurve_index++) {
776 const FCurve *fcu = fcurve_array[fcurve_index];
777 for (
int i = 0; i < fcu->
totvert; i++) {
779 const double value = round(
double(bezt->
vec[1][0]) / interval_db);
780 BLI_assert(value > INT_MIN && value < INT_MAX);
786 float *frames =
static_cast<float *
>(
MEM_mallocN(
sizeof(*frames) * frames_len, __func__));
792 frames[i] =
double(value) * interval_db;
797 *r_frames_len = frames_len;
802 int fcurve_array_len,
816 if (active_bezt ==
nullptr) {
823 const ptrdiff_t offset = active_bezt - fcu->
bezt;
824 if (offset < 0 || offset >= fcu->
totvert) {
840 if (fcu->
bezt ==
nullptr || active_keyframe_index >= fcu->
totvert || active_keyframe_index < 0) {
844 const BezTriple *active_bezt = &fcu->
bezt[active_keyframe_index];
845 if (((active_bezt->
f1 | active_bezt->
f2 | active_bezt->
f3) &
SELECT) == 0) {
850 return active_keyframe_index;
857 const float time_delta = new_time - keyframe->
vec[1][0];
858 keyframe->
vec[0][0] += time_delta;
859 keyframe->
vec[1][0] = new_time;
860 keyframe->
vec[2][0] += time_delta;
865 const float value_delta = new_value - keyframe->
vec[1][1];
866 keyframe->
vec[0][1] += value_delta;
867 keyframe->
vec[1][1] = new_value;
868 keyframe->
vec[2][1] += value_delta;
878 if (fcu ==
nullptr) {
942 for (bezt = fcu->
bezt, i = 0; i < fcu->
totvert; ++i, ++bezt) {
955 for (
int i = 0; i < fcu.
totvert; i++) {
996 if (
ELEM(
nullptr, fcu, sample_cb)) {
997 CLOG_ERROR(&
LOG,
"No F-Curve with F-Curve Modifiers to Bake");
1001 CLOG_ERROR(&
LOG,
"Error: Frame range for Sampled F-Curve creation is inappropriate");
1011 for (
int cfra = start; cfra <= end; cfra++, fpt++) {
1013 fpt->
vec[1] = sample_cb(fcu, data,
float(cfra));
1025 fcu->
bezt =
nullptr;
1027 fcu->
totvert = end - start + 1;
1043 if (fcu ==
nullptr) {
1044 CLOG_ERROR(&
LOG,
"No F-Curve with F-Curve Modifiers to Un-Bake");
1049 CLOG_ERROR(&
LOG,
"Error: Frame range to unbake F-Curve is inappropriate");
1053 if (fcu->
fpt ==
nullptr) {
1055 CLOG_ERROR(&
LOG,
"Error: Curve contains no baked keyframes");
1065 int keyframes_to_insert = end - start;
1066 int sample_points = fcu->
totvert;
1069 MEM_callocN(
sizeof(*fcu->
bezt) *
size_t(keyframes_to_insert), __func__));
1070 fcu->
totvert = keyframes_to_insert;
1073 for (; sample_points && (fpt->
vec[0] < start); fpt++, sample_points--) {
1078 int cur_pos = start;
1081 for (; keyframes_to_insert && (fpt->
vec[0] > start); cur_pos++, bezt++, keyframes_to_insert--) {
1084 bezt->
vec[1][1] = fpt->
vec[1];
1088 for (; keyframes_to_insert && sample_points;
1089 cur_pos++, bezt++, keyframes_to_insert--, fpt++, sample_points--)
1096 for (fpt--; keyframes_to_insert; cur_pos++, bezt++, keyframes_to_insert--) {
1099 bezt->
vec[1][1] = fpt->
vec[1];
1132 if (data && data->after_cycles == 0 && data->before_cycles == 0) {
1169 for (
int i = 0; i < 3; i++) {
1184 if (
ELEM(
nullptr, fcu, fcu->
bezt) ||
1197 for (const int i : range) {
1198 BezTriple *bezt = &fcu->bezt[i];
1199 BezTriple *prev = nullptr;
1200 BezTriple *next = nullptr;
1205 prev = cycle_offset_triple(cycle, &tmp, &fcu->bezt[fcu->totvert - 2], last, first);
1207 if (i < fcu->totvert - 1) {
1211 next = cycle_offset_triple(cycle, &tmp, &fcu->bezt[1], first, last);
1215 CLAMP_MAX(bezt->vec[0][0], bezt->vec[1][0]);
1216 CLAMP_MIN(bezt->vec[2][0], bezt->vec[1][0]);
1219 BKE_nurb_handle_calc_ex(bezt, prev, next, handle_sel_flag, true, fcu->auto_smoothing);
1222 if (BEZT_IS_AUTOH(bezt) && !cycle) {
1224 if (ELEM(i, 0, fcu->totvert - 1)) {
1226 if (fcu->extend == FCURVE_EXTRAPOLATE_CONSTANT) {
1227 bezt->vec[0][1] = bezt->vec[2][1] = bezt->vec[1][1];
1229 bezt->auto_handle_type = HD_AUTOTYPE_LOCKED_FINAL;
1235 if (prev && prev->vec[1][0] >= bezt->vec[1][0]) {
1236 prev->auto_handle_type = bezt->auto_handle_type = HD_AUTOTYPE_LOCKED_FINAL;
1245 first->vec[0][1] = first->vec[2][1] = first->vec[1][1];
1246 last->vec[0][1] = last->vec[2][1] = last->vec[1][1];
1264 if (
ELEM(
nullptr, fcu, fcu->
bezt)) {
1271 for (a = 0, bezt = fcu->
bezt; a < fcu->
totvert; a++, bezt++) {
1282 if (fcu->
bezt ==
nullptr) {
1296 for (a = 0, bezt = fcu->
bezt; a < fcu->
totvert; a++, bezt++) {
1300 if (bezt->
vec[1][0] > (bezt + 1)->vec[1][0]) {
1301 std::swap(*bezt, *(bezt + 1));
1308 for (a = 0, bezt = fcu->
bezt; a < fcu->
totvert; a++, bezt++) {
1310 if ((bezt->
vec[0][0] > bezt->
vec[1][0]) && (bezt->
vec[2][0] < bezt->
vec[1][0])) {
1327 if (fcu ==
nullptr) {
1336 for (a = 0, bezt = fcu->
bezt; a < (fcu->
totvert - 1); a++, bezt++) {
1337 if (bezt->
vec[1][0] > (bezt + 1)->vec[1][0]) {
1342 else if (fcu->
fpt) {
1346 for (a = 0, fpt = fcu->
fpt; a < (fcu->
totvert - 1); a++, fpt++) {
1347 if (fpt->
vec[0] > (fpt + 1)->vec[0]) {
1365 float h1[2], h2[2], len1, len2,
len, fac;
1368 h1[0] = v1[0] -
v2[0];
1369 h1[1] = v1[1] -
v2[1];
1371 h2[0] = v4[0] - v3[0];
1372 h2[1] = v4[1] - v3[1];
1379 len = v4[0] - v1[0];
1380 len1 =
fabsf(h1[0]);
1381 len2 =
fabsf(h2[0]);
1384 if ((len1 + len2) == 0.0f) {
1392 v2[0] = (v1[0] - fac * h1[0]);
1393 v2[1] = (v1[1] - fac * h1[1]);
1398 v3[0] = (v4[0] - fac * h2[0]);
1399 v3[1] = (v4[1] - fac * h2[1]);
1409static int solve_cubic(
double c0,
double c1,
double c2,
double c3,
float *o)
1411 double a,
b, c, p, q, d, t, phi;
1421 q = (2 * a * a * a - a *
b + c) / 2;
1422 d = q * q + p * p * p;
1428 if ((o[0] >=
float(
SMALL)) && (o[0] <= 1.000001f)) {
1436 o[0] =
float(2 * t - a);
1438 if ((o[0] >=
float(
SMALL)) && (o[0] <= 1.000001f)) {
1441 o[nr] =
float(-t - a);
1443 if ((o[nr] >=
float(
SMALL)) && (o[nr] <= 1.000001f)) {
1449 phi = acos(-q /
sqrt(-(p * p * p)));
1452 q =
sqrt(3 - 3 * p * p);
1453 o[0] =
float(2 * t * p - a);
1455 if ((o[0] >=
float(
SMALL)) && (o[0] <= 1.000001f)) {
1458 o[nr] =
float(-t * (p + q) - a);
1460 if ((o[nr] >=
float(
SMALL)) && (o[nr] <= 1.000001f)) {
1463 o[nr] =
float(-t * (p - q) - a);
1465 if ((o[nr] >=
float(
SMALL)) && (o[nr] <= 1.000001f)) {
1476 p =
b *
b - 4 * a * c;
1480 o[0] =
float((-
b - p) / (2 * a));
1482 if ((o[0] >=
float(
SMALL)) && (o[0] <= 1.000001f)) {
1485 o[nr] =
float((-
b + p) / (2 * a));
1487 if ((o[nr] >=
float(
SMALL)) && (o[nr] <= 1.000001f)) {
1494 o[0] =
float(-
b / (2 * a));
1495 if ((o[0] >=
float(
SMALL)) && (o[0] <= 1.000001f)) {
1506 if ((o[0] >=
float(
SMALL)) && (o[0] <= 1.000001f)) {
1521static int findzero(
float x,
float q0,
float q1,
float q2,
float q3,
float *o)
1523 const double c0 = q0 -
x;
1524 const double c1 = 3.0f * (
q1 - q0);
1525 const double c2 = 3.0f * (q0 - 2.0f *
q1 + q2);
1526 const double c3 = q3 - q0 + 3.0f * (
q1 - q2);
1531static void berekeny(
float f1,
float f2,
float f3,
float f4,
float *o,
int b)
1533 float t, c0, c1, c2, c3;
1537 c1 = 3.0f * (f2 - f1);
1538 c2 = 3.0f * (f1 - 2.0f * f2 + f3);
1539 c3 = f4 - f1 + 3.0f * (f2 - f3);
1541 for (a = 0; a <
b; a++) {
1543 o[a] = c0 + t * c1 + t * t * c2 + t * t * t * c3;
1559 const float *prev_coords = prev->vec[1];
1560 float *prev_handle_right = prev->vec[2];
1561 float *next_handle_left =
next->vec[0];
1562 const float *next_coords =
next->vec[1];
1564 float *new_handle_left = bezt->
vec[0];
1565 const float *new_coords = bezt->
vec[1];
1566 float *new_handle_right = bezt->
vec[2];
1568 if (new_coords[0] <= prev_coords[0] || new_coords[0] >= next_coords[0]) {
1578 prev_handle_right[0],
1579 next_handle_left[0],
1586 const float t = roots[0];
1587 if (t <= 0.0f || t >= 1.0f) {
1594 float split1[3][2], split2[2][2], split3[2];
1596 interp_v2_v2v2(split1[1], prev_handle_right, next_handle_left, t);
1606 float diff_coords[2];
1608 add_v2_v2v2(new_handle_left, split2[0], diff_coords);
1609 add_v2_v2v2(new_handle_right, split2[1], diff_coords);
1611 *r_pdelta = diff_coords[1];
1624 if (new_totvert == 0) {
1637 if (fcu ==
nullptr) {
1670 const int removed_index_count = index_range[1] - index_range[0];
1671 memmove(&fcu->
bezt[index_range[0]],
1672 &fcu->
bezt[index_range[1]],
1674 fcu->
totvert -= removed_index_count;
1682 const BezTriple *a,
const int size_a,
const BezTriple *
b,
const int size_b,
int *r_merged_size)
1692 const int max_ulps = 32;
1694 while (iterator_a < size_a || iterator_b < size_b) {
1695 if (iterator_a >= size_a) {
1696 const int remaining_keys = size_b - iterator_b;
1697 memcpy(&large_array[*r_merged_size], &
b[iterator_b],
sizeof(
BezTriple) * remaining_keys);
1698 (*r_merged_size) += remaining_keys;
1701 if (iterator_b >= size_b) {
1702 const int remaining_keys = size_a - iterator_a;
1703 memcpy(&large_array[*r_merged_size], &a[iterator_a],
sizeof(
BezTriple) * remaining_keys);
1704 (*r_merged_size) += remaining_keys;
1711 memcpy(&large_array[*r_merged_size], &a[iterator_a],
sizeof(
BezTriple));
1715 else if (a[iterator_a].vec[1][0] <
b[iterator_b].vec[1][0]) {
1716 memcpy(&large_array[*r_merged_size], &a[iterator_a],
sizeof(
BezTriple));
1720 memcpy(&large_array[*r_merged_size], &
b[iterator_b],
sizeof(
BezTriple));
1727 if (*r_merged_size < size_a + size_b) {
1728 minimal_array =
static_cast<BezTriple *
>(
1732 minimal_array = large_array;
1735 return minimal_array;
1740 if (fcu->
bezt ==
nullptr) {
1744 bool changed =
false;
1747 for (
int i = 0; i < fcu->
totvert; i++) {
1785 ListBase retained_keys = {
nullptr,
nullptr};
1790 if ((fcu->
totvert == 0) || (fcu->
bezt ==
nullptr)) {
1798 for (
int i = 0; i < fcu->
totvert; i++) {
1807 rk->val += bezt->
vec[1][1];
1813 if (rk->frame < bezt->
vec[1][0]) {
1820 if (found ==
false) {
1825 rk->
val = bezt->
vec[1][1];
1836 printf(
"%s: nothing to do for FCurve %p (rna_path = '%s')\n", __func__, fcu, fcu->
rna_path);
1843 rk->val = rk->val /
float(rk->tot_count);
1851 for (
int i = fcu->
totvert - 1; i >= 0; i--) {
1865 if (rk->del_count == rk->tot_count - 1) {
1867 if (can_average_points) {
1869 bezt->
vec[1][1] = rk->val;
1906 BLI_assert_msg(fcu->
bezt,
"this function only works with regular (non-sampled) FCurves");
1907 if (fcu->
bezt ==
nullptr) {
1911 int prev_bezt_index = 0;
1912 for (
int i = 1; i < fcu->
totvert; i++) {
1916 const float bezt_x = bezt->
vec[1][0];
1917 const float prev_x = prev_bezt->
vec[1][0];
1923 if (
floor(bezt_x) == bezt_x) {
1941 if (prev_bezt_index != i) {
1943 fcu->
bezt[prev_bezt_index] = *bezt;
1959 int endpoint_offset,
1960 int direction_to_neighbor)
1963 const BezTriple *endpoint_bezt = bezts + endpoint_offset;
1965 const BezTriple *neighbor_bezt = endpoint_bezt + direction_to_neighbor;
1972 return endpoint_bezt->
vec[1][1];
1978 return endpoint_bezt->
vec[1][1];
1981 const float dx = endpoint_bezt->
vec[1][0] -
evaltime;
1982 float fac = neighbor_bezt->
vec[1][0] - endpoint_bezt->
vec[1][0];
1986 return endpoint_bezt->
vec[1][1];
1989 fac = (neighbor_bezt->
vec[1][1] - endpoint_bezt->
vec[1][1]) / fac;
1990 return endpoint_bezt->
vec[1][1] - (fac * dx);
1995 const int handle = direction_to_neighbor > 0 ? 0 : 2;
1996 const float dx = endpoint_bezt->
vec[1][0] -
evaltime;
1997 float fac = endpoint_bezt->
vec[1][0] - endpoint_bezt->
vec[handle][0];
2001 return endpoint_bezt->
vec[1][1];
2004 fac = (endpoint_bezt->
vec[1][1] - endpoint_bezt->
vec[handle][1]) / fac;
2005 return endpoint_bezt->
vec[1][1] - (fac * dx);
2012 const float eps = 1.e-8f;
2035 return bezt->
vec[1][1];
2041 const BezTriple *prevbezt = (a > 0) ? (bezt - 1) : bezt;
2046 return bezt->
vec[1][1];
2051 printf(
" ERROR: failed eval - p=%f b=%f, t=%f (%f)\n",
2052 prevbezt->
vec[1][0],
2061 const float begin = prevbezt->
vec[1][1];
2062 const float change = bezt->
vec[1][1] - prevbezt->
vec[1][1];
2063 const float duration = bezt->
vec[1][0] - prevbezt->
vec[1][0];
2064 const float time =
evaltime - prevbezt->
vec[1][0];
2065 const float amplitude = prevbezt->
amplitude;
2066 const float period = prevbezt->
period;
2072 return prevbezt->
vec[1][1];
2075 switch (prevbezt->
ipo) {
2078 float v1[2],
v2[2], v3[2], v4[2], opl[32];
2082 v1[0] = prevbezt->
vec[1][0];
2083 v1[1] = prevbezt->
vec[1][1];
2084 v2[0] = prevbezt->
vec[2][0];
2085 v2[1] = prevbezt->
vec[2][1];
2087 v3[0] = bezt->
vec[0][0];
2088 v3[1] = bezt->
vec[0][1];
2089 v4[0] = bezt->
vec[1][0];
2090 v4[1] = bezt->
vec[1][1];
2092 if (
fabsf(v1[1] - v4[1]) < FLT_EPSILON &&
fabsf(
v2[1] - v3[1]) < FLT_EPSILON &&
2093 fabsf(v3[1] - v4[1]) < FLT_EPSILON)
2106 printf(
" ERROR: findzero() failed at %f with %f %f %f %f\n",
2116 berekeny(v1[1],
v2[1], v3[1], v4[1], opl, 1);
2125 switch (prevbezt->
easing) {
2139 switch (prevbezt->
easing) {
2153 switch (prevbezt->
easing) {
2167 switch (prevbezt->
easing) {
2181 switch (prevbezt->
easing) {
2195 switch (prevbezt->
easing) {
2209 switch (prevbezt->
easing) {
2223 switch (prevbezt->
easing) {
2237 switch (prevbezt->
easing) {
2251 switch (prevbezt->
easing) {
2265 return prevbezt->
vec[1][1];
2289 float cvalue = 0.0f;
2292 const FPoint *prevfpt = fpts;
2298 cvalue = prevfpt->
vec[1];
2302 cvalue = lastfpt->
vec[1];
2311 if (t != 0.0f && t < 1.0f) {
2312 cvalue =
interpf(fpt->
vec[1], (fpt + 1)->vec[1], 1.0f - t);
2315 cvalue = fpt->
vec[1];
2349 else if (fcu->
fpt) {
2360 cvalue =
floorf(cvalue + 0.5f);
2387 float cvalue = 0.0f;
2399 bool do_linear =
true;
2474 if (fmi && fcm->data) {
2479 switch (fcm->type) {
2484 if (data->coefficients) {
2516 fcm->data =
nullptr;
2521 switch (fcm->type) {
2562 if (dtar->rna_path) {
2597 fcu->
flag &= ~FCURVE_DISABLED;
2618 if (tarIndex < dvar->num_targets) {
2622 dtar->rna_path =
nullptr;
Functions and classes to work with Actions.
Functions to work with AnimData.
AnimData * BKE_animdata_from_id(const ID *id)
@ NURB_HANDLE_TEST_KNOT_ONLY
void BKE_nurb_handle_smooth_fcurve(BezTriple *bezt, int total, bool cyclic)
void BKE_nurb_bezt_handle_test(BezTriple *bezt, eBezTriple_Flag__Alias sel_flag, const eNurbHandleTest_Mode handle_mode, bool use_around_local)
@ FMI_TYPE_GENERATE_CURVE
const FModifierTypeInfo * get_fmodifier_typeinfo(int type)
float evaluate_time_fmodifiers(FModifiersStackStorage *storage, const ListBase *modifiers, const FCurve *fcu, float cvalue, float evaltime)
void copy_fmodifiers(ListBase *dst, const ListBase *src)
uint evaluate_fmodifiers_storage_size_per_modifier(const ListBase *modifiers)
void evaluate_value_fmodifiers(FModifiersStackStorage *storage, const ListBase *modifiers, const FCurve *fcu, float *cvalue, float evaltime)
bool list_has_suitable_fmodifier(const ListBase *modifiers, int mtype, short acttype)
float(* FcuSampleFunc)(FCurve *fcu, void *data, float evaltime)
#define BEZT_BINARYSEARCH_THRESH
void free_fmodifiers(ListBase *modifiers)
const FModifierTypeInfo * fmodifier_get_typeinfo(const FModifier *fcm)
#define DRIVER_TARGETS_LOOPER_BEGIN(dvar)
float evaluate_driver(struct PathResolvedRNA *anim_rna, struct ChannelDriver *driver, struct ChannelDriver *driver_orig, const struct AnimationEvalContext *anim_eval_context)
struct ChannelDriver * fcurve_copy_driver(const struct ChannelDriver *driver)
void fcurve_free_driver(struct FCurve *fcu)
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
bool BKE_nlastrip_has_curves_for_property(const PointerRNA *ptr, const PropertyRNA *prop)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
float BLI_easing_sine_ease_in(float time, float begin, float change, float duration)
float BLI_easing_back_ease_out(float time, float begin, float change, float duration, float overshoot)
float BLI_easing_linear_ease(float time, float begin, float change, float duration)
float BLI_easing_bounce_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_quint_ease_out(float time, float begin, float change, float duration)
float BLI_easing_quart_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_circ_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_quart_ease_out(float time, float begin, float change, float duration)
float BLI_easing_bounce_ease_in(float time, float begin, float change, float duration)
float BLI_easing_circ_ease_in(float time, float begin, float change, float duration)
float BLI_easing_expo_ease_in(float time, float begin, float change, float duration)
float BLI_easing_expo_ease_out(float time, float begin, float change, float duration)
float BLI_easing_elastic_ease_in(float time, float begin, float change, float duration, float amplitude, float period)
float BLI_easing_quad_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_elastic_ease_out(float time, float begin, float change, float duration, float amplitude, float period)
float BLI_easing_cubic_ease_in(float time, float begin, float change, float duration)
float BLI_easing_elastic_ease_in_out(float time, float begin, float change, float duration, float amplitude, float period)
float BLI_easing_quint_ease_in(float time, float begin, float change, float duration)
float BLI_easing_sine_ease_out(float time, float begin, float change, float duration)
float BLI_easing_bounce_ease_out(float time, float begin, float change, float duration)
float BLI_easing_quad_ease_in(float time, float begin, float change, float duration)
float BLI_easing_quad_ease_out(float time, float begin, float change, float duration)
float BLI_easing_circ_ease_out(float time, float begin, float change, float duration)
float BLI_easing_cubic_ease_out(float time, float begin, float change, float duration)
float BLI_easing_back_ease_in(float time, float begin, float change, float duration, float overshoot)
float BLI_easing_quint_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_expo_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_quart_ease_in(float time, float begin, float change, float duration)
float BLI_easing_back_ease_in_out(float time, float begin, float change, float duration, float overshoot)
float BLI_easing_cubic_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_sine_ease_in_out(float time, float begin, float change, float duration)
#define GSET_ITER_INDEX(gs_iter_, gset_, i_)
GSet * BLI_gset_int_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
unsigned int BLI_gset_len(const GSet *gs) ATTR_WARN_UNUSED_RESULT
BLI_INLINE void * BLI_gsetIterator_getKey(GSetIterator *gsi)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_gset_add(GSet *gs, void *key)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
ListBase BLI_listbase_from_link(struct Link *some_link)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_fff(float a, float b, float c)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE double sqrt3d(double d)
MINLINE float interpf(float target, float origin, float t)
MINLINE float min_fff(float a, float b, float c)
MINLINE int clamp_i(int value, int min, int max)
MINLINE int compare_ff_relative(float a, float b, float max_diff, int max_ulps)
MINLINE void swap_v2_v2(float a[2], float b[2])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void add_v3_v3(float r[3], const float a[3])
bool BLI_rctf_is_valid(const struct rctf *rect)
int BLI_sortutil_cmp_float(const void *a_, const void *b_)
#define STRNCPY(dst, src)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
void * BLO_read_struct_by_name_array(BlendDataReader *reader, const char *struct_name, uint32_t items_num, const void *old_address)
void BLO_write_struct_by_name(BlendWriter *writer, const char *struct_name, const void *data_ptr)
void BLO_read_float_array(BlendDataReader *reader, int array_size, float **ptr_p)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void BLO_write_float_array(BlendWriter *writer, uint num, const float *data_ptr)
void BLO_write_string(BlendWriter *writer, const char *data_ptr)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct_array(reader, struct_name, array_size, ptr_p)
#define BLO_write_struct_list(writer, struct_name, list_ptr)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BLT_I18NCONTEXT_ID_ACTION
#define CTX_DATA_(context, msgid)
typedef double(DMatrix)[4][4]
#define CLOG_ERROR(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
@ FCM_EXTRAPOLATE_CYCLIC_OFFSET
@ FMODIFIER_TYPE_FN_GENERATOR
@ FMODIFIER_TYPE_GENERATOR
@ FMODIFIER_TYPE_ENVELOPE
@ FMODIFIER_FLAG_USEINFLUENCE
@ FMODIFIER_FLAG_DISABLED
@ FMODIFIER_FLAG_RANGERESTRICT
@ DRIVER_FLAG_PYTHON_BLOCKED
#define FCURVE_ACTIVE_KEYFRAME_NONE
@ FCURVE_EXTRAPOLATE_CONSTANT
#define BEZT_IS_AUTOH(bezt)
#define BEZT_ISSEL_ANY(bezt)
#define BEZT_DESEL_ALL(bezt)
@ HD_AUTOTYPE_LOCKED_FINAL
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
void BKE_fcurve_deduplicate_keys(FCurve *fcu)
bool BKE_fcurve_is_cyclic(const FCurve *fcu)
void BKE_fcurve_keyframe_move_time_with_handles(BezTriple *keyframe, const float new_time)
float * BKE_fcurves_calc_keyed_frames(FCurve **fcurve_array, int fcurve_array_len, int *r_frames_len)
FCurve * BKE_fcurve_copy(const FCurve *fcu)
bool BKE_fcurve_calc_range(const FCurve *fcu, float *r_min, float *r_max, const bool selected_keys_only)
FCurve * BKE_fcurve_create()
void BKE_fcurve_foreach_id(FCurve *fcu, LibraryForeachIDData *data)
void BKE_fcurve_blend_write_data(BlendWriter *writer, FCurve *fcu)
bool BKE_fcurve_is_keyframable(const FCurve *fcu)
int BKE_fcurve_bezt_binarysearch_index(const BezTriple array[], const float frame, const int arraylen, bool *r_replace)
void BKE_fmodifier_name_set(FModifier *fcm, const char *name)
static void calculate_bezt_bounds_y(BezTriple *bezt_array, const int index_range[2], const bool selected_keys_only, const bool include_handles, float *r_min, float *r_max)
void testhandles_fcurve(FCurve *fcu, eBezTriple_Flag sel_flag, const bool use_handle)
FCurve * BKE_fcurve_find_by_rna_context_ui(bContext *, const PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_animdata, bAction **r_action, bool *r_driven, bool *r_special)
static void calculate_bezt_bounds_x(BezTriple *bezt_array, const int index_range[2], const bool include_handles, float *r_min, float *r_max)
void BKE_fcurve_delete_keys(FCurve *fcu, blender::uint2 index_range)
static BezTriple * cycle_offset_triple(bool cycle, BezTriple *out, const BezTriple *in, const BezTriple *from, const BezTriple *to)
FCurve * BKE_animadata_fcurve_find_by_rna_path(AnimData *animdata, const char *rna_path, int rna_index, bAction **r_action, bool *r_driven)
int BKE_fcurve_active_keyframe_index(const FCurve *fcu)
void BKE_fcurve_handles_recalc(FCurve *fcu)
float * BKE_fcurves_calc_keyed_frames_ex(FCurve **fcurve_array, int fcurve_array_len, const float interval, int *r_frames_len)
bool test_time_fcurve(FCurve *fcu)
static float fcurve_eval_keyframes_interpolate(const FCurve *fcu, const BezTriple *bezts, float evaltime)
static float fcurve_eval_samples(const FCurve *fcu, const FPoint *fpts, float evaltime)
static void berekeny(float f1, float f2, float f3, float f4, float *o, int b)
void BKE_fcurve_handles_recalc_ex(FCurve *fcu, eBezTriple_Flag handle_sel_flag)
void BKE_fcurve_bezt_shrink(FCurve *fcu, const int new_totvert)
FCurve * BKE_fcurve_iter_step(FCurve *fcu_iter, const char rna_path[])
void BKE_fcurve_blend_write_listbase(BlendWriter *writer, ListBase *fcurves)
static float fcurve_eval_keyframes(const FCurve *fcu, const BezTriple *bezts, float evaltime)
float evaluate_fcurve_only_curve(const FCurve *fcu, float evaltime)
bool BKE_fcurve_is_empty(const FCurve *fcu)
float fcurve_samplingcb_evalcurve(FCurve *fcu, void *, float evaltime)
bool BKE_fcurve_delete_keys_selected(FCurve *fcu)
FCurve * BKE_fcurve_find_by_rna(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_adt, bAction **r_action, bool *r_driven, bool *r_special)
void BKE_fmodifiers_blend_write(BlendWriter *writer, ListBase *fmodifiers)
void BKE_fcurve_blend_read_data_listbase(BlendDataReader *reader, ListBase *fcurves)
static int solve_cubic(double c0, double c1, double c2, double c3, float *o)
eFCU_Cycle_Type BKE_fcurve_get_cycle_type(const FCurve *fcu)
static int findzero(float x, float q0, float q1, float q2, float q3, float *o)
bool BKE_fcurve_calc_bounds(const FCurve *fcu, const bool selected_keys_only, const bool include_handles, const float frame_range[2], rctf *r_bounds)
float evaluate_fcurve_driver(PathResolvedRNA *anim_rna, FCurve *fcu, ChannelDriver *driver_orig, const AnimationEvalContext *anim_eval_context)
void BKE_fcurve_deselect_all_keys(FCurve &fcu)
void BKE_fcurve_active_keyframe_set(FCurve *fcu, const BezTriple *active_bezt)
FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], const int array_index)
bool BKE_fcurve_is_protected(const FCurve *fcu)
static void fcurve_bezt_free(FCurve *fcu)
void BKE_fcurve_keyframe_move_value_with_handles(BezTriple *keyframe, const float new_value)
void BKE_fmodifiers_blend_read_data(BlendDataReader *reader, ListBase *fmodifiers, FCurve *curve)
bool BKE_fcurve_bezt_subdivide_handles(BezTriple *bezt, BezTriple *prev, BezTriple *next, float *r_pdelta)
bool BKE_fcurve_are_keyframes_usable(const FCurve *fcu)
void BKE_fcurves_free(ListBase *list)
static float fcurve_eval_keyframes_extrapolate(const FCurve *fcu, const BezTriple *bezts, float evaltime, int endpoint_offset, int direction_to_neighbor)
void BKE_fcurves_copy(ListBase *dst, ListBase *src)
float evaluate_fcurve(const FCurve *fcu, float evaltime)
void BKE_fcurve_rnapath_set(FCurve &fcu, blender::StringRef rna_path)
static void init_unbaked_bezt_data(BezTriple *bezt)
void BKE_fcurve_merge_duplicate_keys(FCurve *fcu, const int sel_flag, const bool use_handle)
bool BKE_fcurve_has_selected_control_points(const FCurve *fcu)
float calculate_fcurve(PathResolvedRNA *anim_rna, FCurve *fcu, const AnimationEvalContext *anim_eval_context)
void BKE_fcurve_free(FCurve *fcu)
static bool calculate_fpt_bounds(const FCurve *fcu, const float frame_range[2], rctf *r_bounds)
static bool get_bounding_bezt_indices(const FCurve *fcu, const bool selected_keys_only, const float frame_range[2], int *r_first, int *r_last)
void sort_time_fcurve(FCurve *fcu)
FCurve * id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven)
static bool calculate_bezt_bounds(const FCurve *fcu, const bool selected_keys_only, const bool include_handles, const float frame_range[2], rctf *r_bounds)
void fcurve_samples_to_keyframes(FCurve *fcu, const int start, const int end)
void fcurve_store_samples(FCurve *fcu, void *data, int start, int end, FcuSampleFunc sample_cb)
BezTriple * BKE_bezier_array_merge(const BezTriple *a, const int size_a, const BezTriple *b, const int size_b, int *r_merged_size)
void BKE_fcurve_correct_bezpart(const float v1[2], float v2[2], float v3[2], const float v4[2])
void BKE_fcurve_blend_read_data(BlendDataReader *reader, FCurve *fcu)
void BKE_fcurve_delete_key(FCurve *fcu, int index)
static int BKE_fcurve_bezt_binarysearch_index_ex(const BezTriple array[], const float frame, const int arraylen, const float threshold, bool *r_replace)
static float evaluate_fcurve_ex(const FCurve *fcu, float evaltime, float cvalue)
void BKE_fcurve_delete_keys_all(FCurve *fcu)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
constexpr int64_t size() const
constexpr const char * data() const
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_dupallocN)(const void *vmemh)
ccl_device_inline float2 floor(const float2 a)
ccl_device_inline float3 cos(float3 v)
FCurve * fcurve_find_in_action_slot(bAction *act, slot_handle_t slot_handle, FCurveDescriptor fcurve_descriptor)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_animateable(const PointerRNA *ptr, PropertyRNA *prop_orig)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
const char * RNA_property_identifier(const PropertyRNA *prop)
std::optional< std::string > RNA_path_from_ID_to_property(const PointerRNA *ptr, PropertyRNA *prop)
struct ExprPyLike_Parsed * expr_simple
int active_keyframe_index
ccl_device_inline int abs(int x)