64 for (
int i = 0; i < fcu->
totvert; i++) {
99 const bool only_selected_keys)
107 if ((fcu ==
nullptr) || (fcu->
bezt ==
nullptr) || (fcu->
totvert == 0) ||
108 (!cleardefault && fcu->
totvert == 1))
114 old_bezts = fcu->
bezt;
124 lastb->
f1 = lastb->
f2 = lastb->
f3 = 0;
130 for (i = 1; i < totCount; i++) {
131 float prev[2], cur[2],
next[2];
134 if (i < (totCount - 1)) {
135 beztn = (old_bezts + (i + 1));
144 bezt = (old_bezts + i);
147 prev[0] = lastb->
vec[1][0];
148 prev[1] = lastb->
vec[1][1];
149 cur[0] = bezt->
vec[1][0];
150 cur[1] = bezt->
vec[1][1];
152 if (only_selected_keys && !(bezt->
f2 &
SELECT)) {
155 lastb->
f1 = lastb->
f2 = lastb->
f3 = 0;
160 if (
IS_EQT(cur[0], prev[0], thresh)) {
167 if (cur[1] >
next[1]) {
168 if (
IS_EQT(cur[1], prev[1], thresh) == 0) {
176 if (
IS_EQT(cur[1], prev[1], thresh) == 0) {
186 if (
IS_EQT(cur[1], prev[1], thresh) == 0) {
190 else if (
IS_EQT(cur[1],
next[1], thresh) == 0) {
197 if (
IS_EQT(cur[1], prev[1], thresh) == 0) {
212 if (cleardefault && fcu->
totvert == 1) {
213 float default_value = 0.0f;
225 if (fcu->
bezt->
vec[1][1] == default_value) {
246 const int start_index,
247 int *r_segment_start_idx,
250 *r_segment_start_idx = 0;
253 bool in_segment =
false;
255 for (
int i = start_index; i < fcu->
totvert; i++) {
261 *r_segment_start_idx = i;
266 else if (in_segment) {
280 ListBase segments = {
nullptr,
nullptr};
287 int segment_start_idx = 0;
289 int current_index = 0;
295 segment->length = segment_len;
297 current_index = segment_start_idx + segment_len;
304 const BezTriple *start_bezt = index - 1 >= 0 ? &fcu->
bezt[index - 1] : &fcu->
bezt[index];
326 const float lerp_factor =
fabs(factor);
328 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
329 const float key_y_value =
interpf(target_bezt->
vec[1][1], fcu->
bezt[i].
vec[1][1], lerp_factor);
340 float default_value = 0;
371 return default_value;
387 for (
int i = 0; i < fcu->
totvert; i++) {
391 const float key_y_value =
interpf(default_value, fcu->
bezt[i].
vec[1][1], factor);
403 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
407 const float y_average = y / segment->length;
409 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
410 const float key_y_value =
interpf(y_average, fcu->
bezt[i].
vec[1][1], 1 - factor);
427 bw_coeff->
d1 =
static_cast<double *
>(
428 MEM_callocN(
sizeof(
double) * filter_order,
"coeff filtered"));
429 bw_coeff->
d2 =
static_cast<double *
>(
430 MEM_callocN(
sizeof(
double) * filter_order,
"coeff samples"));
431 bw_coeff->
A =
static_cast<double *
>(
MEM_callocN(
sizeof(
double) * filter_order,
"Butterworth A"));
444 const float sampling_frequency,
447 double s =
double(sampling_frequency);
448 const double a = tan(
M_PI * cutoff_frequency / s);
449 const double a2 = a * a;
453 s = a2 + 2.0 * a * r + 1.0;
454 bw_coeff->
A[i] = a2 / s;
455 bw_coeff->
d1[i] = 2.0 * (1 - a2) / s;
456 bw_coeff->
d2[i] = -(a2 - 2.0 * a * r + 1.0) / s;
464 w0[i] = bw_coeff->
d1[i] * w1[i] + bw_coeff->
d2[i] * w2[i] +
x;
465 x = bw_coeff->
A[i] * (w0[i] + 2.0 * w1[i] + w2[i]);
473 float *filtered_values,
474 const int start_index,
476 const int sample_index,
477 const int blend_in_out)
479 if (start_index == end_index || blend_in_out == 0) {
480 return samples[start_index];
483 const float blend_in_y_samples = samples[start_index];
484 const float blend_out_y_samples = samples[end_index];
486 const float blend_in_y_filtered = filtered_values[start_index + blend_in_out];
487 const float blend_out_y_filtered = filtered_values[end_index - blend_in_out];
489 const float slope_in_samples = samples[start_index] - samples[start_index - 1];
490 const float slope_out_samples = samples[end_index] - samples[end_index + 1];
491 const float slope_in_filtered = filtered_values[start_index + blend_in_out - 1] -
492 filtered_values[start_index + blend_in_out];
493 const float slope_out_filtered = filtered_values[end_index - blend_in_out] -
494 filtered_values[end_index - blend_in_out - 1];
496 if (sample_index - start_index <= blend_in_out) {
497 const int blend_index = sample_index - start_index;
498 const float blend_in_out_factor =
clamp_f(
float(blend_index) / blend_in_out, 0.0f, 1.0f);
499 const float blend_value =
interpf(blend_in_y_filtered +
500 slope_in_filtered * (blend_in_out - blend_index),
501 blend_in_y_samples + slope_in_samples * blend_index,
502 blend_in_out_factor);
505 if (end_index - sample_index <= blend_in_out) {
506 const int blend_index = end_index - sample_index;
507 const float blend_in_out_factor =
clamp_f(
float(blend_index) / blend_in_out, 0.0f, 1.0f);
508 const float blend_value =
interpf(blend_out_y_filtered +
509 slope_out_filtered * (blend_in_out - blend_index),
510 blend_out_y_samples + slope_out_samples * blend_index,
511 blend_in_out_factor);
520 const int sample_count,
522 const int blend_in_out,
523 const int sample_rate,
528 float *filtered_values =
static_cast<float *
>(
529 MEM_callocN(
sizeof(
float) * sample_count,
"Butterworth Filtered FCurve Values"));
531 double *w0 =
static_cast<double *
>(
MEM_callocN(
sizeof(
double) * filter_order,
"w0"));
532 double *w1 =
static_cast<double *
>(
MEM_callocN(
sizeof(
double) * filter_order,
"w1"));
533 double *w2 =
static_cast<double *
>(
MEM_callocN(
sizeof(
double) * filter_order,
"w2"));
537 const float fwd_offset = samples[0];
539 for (
int i = 0; i < sample_count; i++) {
540 const double x =
double(samples[i] - fwd_offset);
542 filtered_values[i] =
float(filtered_value) + fwd_offset;
545 for (
int i = 0; i < filter_order; i++) {
551 const float bwd_offset = filtered_values[sample_count - 1];
554 for (
int i = sample_count - 1; i >= 0; i--) {
555 const double x =
double(filtered_values[i] - bwd_offset);
557 filtered_values[i] =
float(filtered_value) + bwd_offset;
560 const int segment_end_index = segment->start_index + segment->length;
564 const int samples_start_index = filter_order * sample_rate;
565 const int samples_end_index =
int(right_bezt.
vec[1][0] - left_bezt.
vec[1][0] + filter_order) *
568 const int blend_in_out_clamped =
min_ii(blend_in_out,
569 (samples_end_index - samples_start_index) / 2);
571 for (
int i = segment->start_index; i < segment_end_index; i++) {
572 float blend_in_out_factor;
573 if (blend_in_out_clamped == 0) {
574 blend_in_out_factor = 1;
576 else if (i < segment->start_index + segment->length / 2) {
577 blend_in_out_factor =
min_ff(
float(i - segment->start_index) / blend_in_out_clamped, 1.0f);
580 blend_in_out_factor =
min_ff(
float(segment_end_index - i - 1) / blend_in_out_clamped, 1.0f);
583 const float x_delta = fcu->
bezt[i].
vec[1][0] - left_bezt.
vec[1][0] + filter_order;
586 const int filter_index = round(x_delta * sample_rate);
592 blend_in_out_clamped);
594 const float blended_value =
interpf(
595 filtered_values[filter_index], blend_value, blend_in_out_factor);
596 const float key_y_value =
interpf(blended_value, samples[filter_index], factor);
613 const double sigma_sq = 2.0 * sigma * sigma;
616 for (
int i = 0; i < kernel_size; i++) {
617 const double normalized_index =
double(i) / (kernel_size - 1);
618 r_kernel[i] =
exp(-normalized_index * normalized_index / sigma_sq);
625 sum += r_kernel[i] * 2;
630 for (
int i = 0; i < kernel_size; i++) {
639 const int kernel_size,
642 const int segment_end_index = segment->start_index + segment->length;
643 const float segment_start_x = fcu->
bezt[segment->start_index].
vec[1][0];
644 for (
int i = segment->start_index; i < segment_end_index; i++) {
647 const int sample_index = round(fcu->
bezt[i].
vec[1][0] - segment_start_x) + kernel_size;
649 double filter_result = samples[sample_index] * kernel[0];
650 for (
int j = 1; j <= kernel_size; j++) {
651 const double kernel_value = kernel[j];
652 filter_result += samples[sample_index + j] * kernel_value;
653 filter_result += samples[sample_index - j] * kernel_value;
655 const float key_y_value =
interpf(
float(filter_result), samples[sample_index], factor);
663 const float x_shift = (x - shift) * width;
664 const float y = x_shift /
sqrt(1 +
pow2f(x_shift));
666 return (y + 1) * 0.5f;
677 const float key_x_range = right_key->
vec[1][0] - left_key->
vec[1][0];
678 const float key_y_range = right_key->
vec[1][1] - left_key->
vec[1][1];
682 if (
IS_EQF(key_x_range, 0.0f)) {
687 const float shift = -factor;
691 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
693 const float x = ((fcu->
bezt[i].
vec[1][0] - left_key->
vec[1][0]) / key_x_range) * 2 - 1;
697 const float blend = (y - y_min) * (1 / (y_max - y_min));
699 const float key_y_value = left_key->
vec[1][1] + key_y_range *
blend;
714 const BezTriple segment_last_key = fcu->
bezt[segment->start_index + segment->length - 1];
715 y_delta = right_key->
vec[1][1] - segment_last_key.
vec[1][1];
718 const BezTriple segment_first_key = fcu->
bezt[segment->start_index];
719 y_delta = left_key->
vec[1][1] - segment_first_key.
vec[1][1];
722 const float offset_value = y_delta *
fabs(factor);
723 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
724 const float key_y_value = fcu->
bezt[i].
vec[1][1] + offset_value;
731static float s_curve(
float x,
float slope,
float width,
float height,
float xshift,
float yshift)
738 float y = height *
pow((x - xshift), slope) /
739 (
pow((x - xshift), slope) +
pow((width - (x - xshift)), slope)) +
743 if (x > xshift + width) {
746 else if (x < xshift) {
757 const float key_x_range = right_key->
vec[1][0] - left_key->
vec[1][0];
758 const float key_y_range = right_key->
vec[1][1] - left_key->
vec[1][1];
762 if (
IS_EQF(key_x_range, 0.0f)) {
766 const float slope = 3.0;
768 const float width = 2.0;
769 const float height = 2.0;
780 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
782 const float x = (fcu->
bezt[i].
vec[1][0] - left_key->
vec[1][0]) / key_x_range;
783 const float ease =
s_curve(x, slope, width, height, xy_shift, xy_shift);
784 const float base = left_key->
vec[1][1] + key_y_range * ease;
788 y_delta = base - fcu->
bezt[i].
vec[1][1];
791 y_delta = fcu->
bezt[i].
vec[1][1] - base;
794 const float key_y_value = fcu->
bezt[i].
vec[1][1] + y_delta * factor;
811 if (segment->start_index + segment->length >= fcu->
totvert - 1) {
814 reference_key = right_key;
815 beyond_key = fcu->
bezt[segment->start_index + segment->length + 1];
819 if (segment->start_index <= 1) {
822 reference_key = left_key;
823 beyond_key = fcu->
bezt[segment->start_index - 2];
828 const float y_delta = beyond_key.
vec[1][1] - reference_key->
vec[1][1];
829 const float x_delta = beyond_key.
vec[1][0] - reference_key->
vec[1][0];
836 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
840 const float new_x_delta = fcu->
bezt[i].
vec[1][0] - reference_key->
vec[1][0];
841 const float new_y_delta = new_x_delta * y_delta / x_delta;
843 const float delta = reference_key->
vec[1][1] + new_y_delta - fcu->
bezt[i].
vec[1][1];
845 const float key_y_value = fcu->
bezt[i].
vec[1][1] + delta *
fabs(factor);
861 const float key_x_range = right_key->
vec[1][0] - left_key->
vec[1][0];
862 const float key_y_range = right_key->
vec[1][1] - left_key->
vec[1][1];
866 if (
IS_EQF(key_x_range, 0.0f)) {
870 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
874 normalized_x = (fcu->
bezt[i].
vec[1][0] - left_key->
vec[1][0]) / key_x_range;
877 normalized_x = (right_key->
vec[1][0] - fcu->
bezt[i].
vec[1][0]) / key_x_range;
880 const float y_delta = key_y_range * normalized_x;
882 const float key_y_value = fcu->
bezt[i].
vec[1][1] + y_delta * factor;
894 const float key_x_range = right_key->
vec[1][0] - left_key->
vec[1][0];
895 const float key_y_range = right_key->
vec[1][1] - left_key->
vec[1][1];
899 if (
IS_EQF(key_x_range, 0.0f)) {
903 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
905 const float normalized_x = (fcu->
bezt[i].
vec[1][0] - left_key->
vec[1][0]) / key_x_range;
907 const float linear = left_key->
vec[1][1] + key_y_range * normalized_x;
909 const float delta = fcu->
bezt[i].
vec[1][1] - linear;
911 const float key_y_value = linear + delta * factor;
924 const float fcu_x_range = last_key->
vec[1][0] - first_key->
vec[1][0];
925 const float fcu_y_range = last_key->
vec[1][1] - first_key->
vec[1][1];
927 const float first_key_x = first_key->
vec[1][0];
931 float *y_values =
static_cast<float *
>(
932 MEM_callocN(
sizeof(
float) * segment->length,
"Time Offset Samples"));
934 for (
int i = 0; i < segment->length; i++) {
936 const float time = fcu->
bezt[segment->start_index + i].
vec[1][0] + frame_offset;
938 const float wrapped_time =
floored_fmod(time - first_key_x, fcu_x_range) + first_key_x;
939 const float delta_y = fcu_y_range *
floorf((time - first_key_x) / fcu_x_range);
941 const float key_y_value =
evaluate_fcurve(fcu, wrapped_time) + delta_y;
942 y_values[i] = key_y_value;
945 for (
int i = 0; i < segment->length; i++) {
968 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
969 const float key_y_value =
interpf(fcu->
bezt[i].
vec[1][1], reference_key->
vec[1][1], factor);
980 segment->start_index + segment->length);
982 const float lerp_factor = (factor + 1) / 2;
983 for (
int i = segment->start_index; i < segment->start_index + segment->length; i++) {
984 const float key_y_value =
interpf(right_bezt->
vec[1][1], left_bezt->
vec[1][1], lerp_factor);
1033 int bezt_segment_start_idx,
1034 int bezt_segment_len,
1038 int selected_len = bezt_segment_len;
1044 if (bezt_segment_len + bezt_segment_start_idx != fcu->
totvert &&
1050 bezt_segment_start_idx--;
1054 const int target_fcurve_verts =
ceil(bezt_segment_len - selected_len * remove_ratio);
1064 target_fcurve_verts);
1071 if (fcu ==
nullptr || fcu->
bezt ==
nullptr || fcu->
totvert == 0) {
1077 bool can_decimate_all_selected =
true;
1079 for (
int i = 0; i < fcu->
totvert; i++) {
1082 can_decimate_all_selected =
false;
1086 fcu->
bezt[i].
f2 &= ~BEZT_FLAG_TEMP_TAG;
1092 fcu, segment->start_index, segment->length, remove_ratio, error_sq_max);
1097 fcu->
bezt =
nullptr;
1100 for (
int i = 0; i < old_totvert; i++) {
1102 bezt->
f2 &= ~BEZT_FLAG_IGNORE_TAG;
1112 return can_decimate_all_selected;
1131 if (fcu->
bezt ==
nullptr) {
1137 for (
int i = 0; i < fcu->
totvert; i++, bezt++) {
1153 for (
int i = 0, x = 0; (i < fcu->
totvert) && (x < totSel); i++, bezt++) {
1156 tsb->
h1 = &bezt->
vec[0][1];
1157 tsb->
h2 = &bezt->
vec[1][1];
1158 tsb->
h3 = &bezt->
vec[2][1];
1161 if (x < totSel - 1) {
1179 for (
int i = 0; i < totSel; i++, tsb++) {
1182 if (
ELEM(i, 0, (totSel - 1)) == 0) {
1184 const tSmooth_Bezt *tP2 = (i - 2 > 0) ? (tsb - 2) : (
nullptr);
1186 const tSmooth_Bezt *tN2 = (i + 2 < totSel) ? (tsb + 2) : (
nullptr);
1188 const float p1 = *tP1->
h2;
1189 const float p2 = (tP2) ? (*tP2->
h2) : (*tP1->
h2);
1190 const float c1 = *tsb->
h2;
1191 const float n1 = *tN1->
h2;
1192 const float n2 = (tN2) ? (*tN2->
h2) : (*tN1->
h2);
1195 tsb->
y1 = (3 * p2 + 5 * p1 + 2 * c1 + n1 + n2) / 12;
1196 tsb->
y3 = (p2 + p1 + 2 * c1 + 5 * n1 + 3 * n2) / 12;
1198 tsb->
y2 = (tsb->
y1 + tsb->
y3) / 2;
1204 for (
int i = 0; i < totSel; i++, tsb++) {
1206 if (
ELEM(i, 0, (totSel - 1)) == 0) {
1211 *tsb->
h1 = ((*tsb->
h1) * 0.7f) + (tsb->
y1 * 0.3f);
1212 *tsb->
h3 = ((*tsb->
h3) * 0.7f) + (tsb->
y3 * 0.3f);
1329 char bone_name[
sizeof(pchan->
name)];
1343 for (i = 0, bezt = fcu->
bezt; i < fcu->
totvert; i++, bezt++) {
1355 nbezt = &newbuf[aci->
totvert];
1396 int ofs_start, ofs_end;
1401 char *str_start = aci->
rna_path + ofs_start;
1402 const char *str_end = aci->
rna_path + ofs_end;
1409 int len_old, prefix_l, postfix_l;
1411 prefix_l = str_start - aci->
rna_path;
1413 len_old = str_end - str_start;
1414 postfix_l = strlen(str_end);
1418 str_start[len_old] = 0;
1420 str_start[len_old] =
'\"';
1422 str_iter = *r_name =
static_cast<char *
>(
1423 MEM_mallocN(
sizeof(
char) * (prefix_l + postfix_l + len_new + 1),
"flipped_path"));
1425 memcpy(str_iter, aci->
rna_path, prefix_l);
1426 str_iter += prefix_l;
1427 memcpy(str_iter, bname_new, len_new);
1428 str_iter += len_new;
1429 memcpy(str_iter, str_end, postfix_l);
1430 str_iter[postfix_l] =
'\0';
1437 const short from_single,
1438 const short to_simple,
1447 char *name =
nullptr;
1470 const short from_single,
1486 printf(
"paste_animedit_keys: error ID has been removed!\n");
1496 int len_id = strlen(identifier);
1497 int len_path = strlen(fcu->
rna_path);
1498 if (len_id <= len_path) {
1500 if (
STREQ(identifier, fcu->
rna_path + (len_path - len_id))) {
1508 printf(
"paste_animedit_keys: failed to resolve path id:%s, '%s'!\n",
1521 const short from_single,
1541 const size_t slength = strlen(aci->
rna_path);
1563 bezt->
vec[0][1] = -bezt->
vec[0][1];
1564 bezt->
vec[1][1] = -bezt->
vec[1][1];
1565 bezt->
vec[2][1] = -bezt->
vec[2][1];
1578 for (i = 0, bezt = fcu->
bezt; i < fcu->
totvert; i++, bezt++) {
1583 switch (merge_mode) {
1599 f_min = aci->
bezt[0].
vec[1][0] + offset[0];
1608 if (f_min < f_max) {
1610 for (i = 0, bezt = fcu->
bezt; i < fcu->
totvert; i++, bezt++) {
1611 if ((f_min < bezt[0].vec[1][0]) && (bezt[0].
vec[1][0] < f_max)) {
1624 for (i = 0, bezt = aci->
bezt; i < aci->
totvert; i++, bezt++) {
1659 "Paste keys starting at current frame"},
1665 "Paste keys relative to the current frame when copying"},
1667 {0,
nullptr, 0,
nullptr,
nullptr},
1675 "Paste keys with the first key matching the key left of the cursor"},
1680 "Paste keys with the last key matching the key right of the cursor"},
1684 "Current Frame Value",
1685 "Paste keys relative to the value of the curve under the cursor"},
1690 "Paste keys relative to the Y-Position of the cursor"},
1695 "Paste keys with the same value as they were copied"},
1696 {0,
nullptr, 0,
nullptr,
nullptr},
1706 "Overwrite keys in pasted range"},
1710 "Overwrite Entire Range",
1711 "Overwrite keys in pasted range, using the range of all copied keys"},
1712 {0,
nullptr, 0,
nullptr,
nullptr},
1723 switch (value_offset_mode) {
1732 const float offset = cfra_y - aci->
bezt[0].
vec[1][1];
1741 const float offset = left_key.
vec[1][1] - aci->
bezt[0].
vec[1][1];
1750 const float offset = right_key.
vec[1][1] - aci->
bezt[aci->
totvert - 1].
vec[1][1];
1788 switch (offset_mode) {
1803 if (from_single && to_simple) {
1822 for (pass = 0; pass < 3; pass++) {
Functions to work with AnimData.
Functions to modify FCurves.
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
unsigned int BKE_curve_decimate_bezt_array(BezTriple *bezt_array, unsigned int bezt_array_len, unsigned int resolu, bool is_cyclic, char flag_test, char flag_set, float error_sq_max, unsigned int error_target_len)
int BKE_fcurve_bezt_binarysearch_index(const BezTriple array[], float frame, int arraylen, bool *r_replace)
void BKE_fcurve_handles_recalc(FCurve *fcu)
bool BKE_fcurve_is_empty(const FCurve *fcu)
bool BKE_fcurve_delete_keys_selected(FCurve *fcu)
void BKE_fcurve_keyframe_move_value_with_handles(BezTriple *keyframe, float new_value)
float evaluate_fcurve(const FCurve *fcu, float evaltime)
void BKE_fcurve_delete_keys_all(FCurve *fcu)
ListBase * which_libbase(Main *bmain, short type)
float BKE_scene_frame_get(const Scene *scene)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE float pow2f(float x)
MINLINE float clamp_f(float value, float min, float max)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE float floored_fmod(float f, float n)
MINLINE float interpf(float target, float origin, float t)
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void add_v3_v3(float r[3], const float a[3])
int bool bool bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, size_t str_len) ATTR_NONNULL(1
bool BLI_str_quoted_substr_range(const char *__restrict str, const char *__restrict prefix, int *__restrict r_start, int *__restrict r_end) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
bool bool BLI_str_quoted_substr(const char *__restrict str, const char *__restrict prefix, char *result, size_t result_maxncpy)
size_t BLI_string_flip_side_name(char *name_dst, const char *name_src, bool strip_number, size_t name_dst_maxncpy) ATTR_NONNULL(1
typedef double(DMatrix)[4][4]
@ INSERTKEY_OVERWRITE_FULL
#define BEZT_SEL_ALL(bezt)
#define BEZT_ISSEL_ANY(bezt)
#define BEZT_DESEL_ALL(bezt)
Object is a sort of wrapper for general info.
#define ANIM_UPDATE_DEFAULT
@ KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL
@ KEYFRAME_PASTE_MERGE_OVER_RANGE
@ KEYFRAME_PASTE_MERGE_OVER
@ KEYFRAME_PASTE_MERGE_MIX
@ KEYFRAME_PASTE_VALUE_OFFSET_RIGHT_KEY
@ KEYFRAME_PASTE_VALUE_OFFSET_NONE
@ KEYFRAME_PASTE_VALUE_OFFSET_CURSOR
@ KEYFRAME_PASTE_VALUE_OFFSET_CFRA
@ KEYFRAME_PASTE_VALUE_OFFSET_LEFT_KEY
@ KEYFRAME_PASTE_OFFSET_NONE
@ KEYFRAME_PASTE_OFFSET_CFRA_END
@ KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE
@ KEYFRAME_PASTE_OFFSET_CFRA_START
@ KEYFRAME_PASTE_NOTHING_TO_PASTE
@ KEYFRAME_PASTE_NOWHERE_TO_PASTE
Read Guarded memory(de)allocation.
void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
AnimData * ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
static T sum(const btAlignedObjectArray< T > &items)
pow(value.r - subtrahend, 2.0)") .do_static_compilation(true)
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
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
KeyframeEditFunc ANIM_editkeyframes_ok(short mode)
static float animcopy_cfra
void ED_anim_calculate_butterworth_coefficients(const float cutoff_frequency, const float sampling_frequency, ButterworthCoefficients *bw_coeff)
static float butterworth_calculate_blend_value(float *samples, float *filtered_values, const int start_index, const int end_index, const int sample_index, const int blend_in_out)
void clean_fcurve(bAnimContext *ac, bAnimListElem *ale, float thresh, bool cleardefault, const bool only_selected_keys)
static bool prepare_for_decimate(FCurve *fcu, int i)
static tAnimCopybufItem * pastebuf_match_path_full(const FCurve *fcu, const short from_single, const short to_simple, bool flip)
static tAnimCopybufItem * pastebuf_match_path_property(Main *bmain, const FCurve *fcu, const short from_single, const short)
void butterworth_smooth_fcurve_segment(FCurve *fcu, FCurveSegment *segment, float *samples, const int sample_count, const float factor, const int blend_in_out, const int sample_rate, ButterworthCoefficients *bw_coeff)
const EnumPropertyItem rna_enum_keyframe_paste_offset_items[]
static const BezTriple * fcurve_segment_end_get(FCurve *fcu, int index)
float get_default_rna_value(const FCurve *fcu, PropertyRNA *prop, PointerRNA *ptr)
bool decimate_fcurve(bAnimListElem *ale, float remove_ratio, float error_sq_max)
void breakdown_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor)
short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data)
static bool find_fcurve_segment(FCurve *fcu, const int start_index, int *r_segment_start_idx, int *r_segment_len)
const EnumPropertyItem rna_enum_keyframe_paste_merge_items[]
void ease_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor, const float width)
eKeyPasteError paste_animedit_keys(bAnimContext *ac, ListBase *anim_data, const eKeyPasteOffset offset_mode, const eKeyPasteValueOffset value_offset_mode, const eKeyMergeMode merge_mode, bool flip)
ButterworthCoefficients * ED_anim_allocate_butterworth_coefficients(const int filter_order)
static void flip_names(tAnimCopybufItem *aci, char **r_name)
void time_offset_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float frame_offset)
void ED_ANIM_get_1d_gauss_kernel(const float sigma, const int kernel_size, double *r_kernel)
static tAnimCopybufItem * pastebuf_match_index_only(const FCurve *fcu, const short from_single, const short)
void scale_average_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor)
void blend_offset_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor)
const EnumPropertyItem rna_enum_keyframe_paste_offset_value_items[]
void shear_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor, tShearDirection direction)
void ANIM_fcurves_copybuf_free()
static const BezTriple * fcurve_segment_start_get(FCurve *fcu, int index)
static float ease_sigmoid_function(const float x, const float width, const float shift)
void blend_to_ease_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor)
static void decimate_fcurve_segment(FCurve *fcu, int bezt_segment_start_idx, int bezt_segment_len, float remove_ratio, float error_sq_max)
static void paste_animedit_keys_fcurve(FCurve *fcu, tAnimCopybufItem *aci, float offset[2], const eKeyMergeMode merge_mode, bool flip)
void smooth_fcurve_segment(FCurve *fcu, FCurveSegment *segment, float *samples, const float factor, const int kernel_size, double *kernel)
static double butterworth_filter_value(double x, double *w0, double *w1, double *w2, ButterworthCoefficients *bw_coeff)
bool match_slope_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor)
void smooth_fcurve(FCurve *fcu)
void push_pull_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor)
void blend_to_default_fcurve(PointerRNA *id_ptr, FCurve *fcu, const float factor)
static void do_curve_mirror_flippping(tAnimCopybufItem *aci, BezTriple *bezt)
static ListBase animcopybuf
static float s_curve(float x, float slope, float width, float height, float xshift, float yshift)
ListBase find_fcurve_segments(FCurve *fcu)
bool duplicate_fcurve_keys(FCurve *fcu)
void scale_from_fcurve_segment_neighbor(FCurve *fcu, FCurveSegment *segment, const float factor, const FCurveSegmentAnchor anchor)
static float animcopy_firstframe
void blend_to_neighbor_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float factor)
static float paste_get_y_offset(bAnimContext *ac, tAnimCopybufItem *aci, bAnimListElem *ale, const eKeyPasteValueOffset value_offset_mode)
void ED_anim_free_butterworth_coefficients(ButterworthCoefficients *bw_coeff)
static float animcopy_lastframe
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 fabs(const float2 a)
ccl_device_inline float3 exp(float3 v)
ccl_device_inline float3 ceil(const float3 a)
int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag)
Lesser Key-framing API call.
void animdata_fcurve_delete(bAnimContext *ac, AnimData *adt, FCurve *fcu)
static bool point_is_selected(PTCacheEditPoint *point)
bool RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
int RNA_property_int_get_default(PointerRNA *ptr, PropertyRNA *prop)
float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
PropertyType RNA_property_type(PropertyRNA *prop)
int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
float RNA_property_float_get_default(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_boolean_get_default(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_identifier(const PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
eAnim_Update_Flags update