59 #define SMALL -1.0e-10
116 for (fcu = list->
first; fcu; fcu = fcn) {
178 for (sfcu = src->
first; sfcu; sfcu = sfcu->
next) {
192 if (driver !=
NULL) {
261 if (fcu && r_driven) {
279 if (
ELEM(
NULL, list, rna_path) || (array_index < 0)) {
284 for (fcu = list->
first; fcu; fcu = fcu->
next) {
309 if (
ELEM(
NULL, fcu_iter, rna_path)) {
314 for (fcu = fcu_iter; fcu; fcu = fcu->
next) {
342 if (
ELEM(
NULL, dst, src, dataPrefix, dataName)) {
345 if ((dataPrefix[0] == 0) || (dataName[0] == 0)) {
350 for (fcu = src->
first; fcu; fcu = fcu->
next) {
357 if (quotedName ==
NULL) {
362 if (
STREQ(quotedName, dataName)) {
387 NULL,
ptr, prop, rnaindex, r_adt, r_action, r_driven, r_special);
441 while (adt && step--) {
460 if (fcu && r_action) {
477 if (fcu && r_action) {
487 if (tpath && tpath != path) {
514 BezTriple array[],
float frame,
int arraylen,
float threshold,
bool *r_replace)
516 int start = 0, end = arraylen;
517 int loopbreaker = 0, maxloop = arraylen * 2;
526 if ((arraylen <= 0) || (
array ==
NULL)) {
535 framenum =
array[0].vec[1][0];
536 if (
IS_EQT(frame, framenum, threshold)) {
540 if (frame < framenum) {
545 framenum =
array[(arraylen - 1)].vec[1][0];
546 if (
IS_EQT(frame, framenum, threshold)) {
548 return (arraylen - 1);
550 if (frame > framenum) {
557 for (loopbreaker = 0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) {
561 int mid = start + ((end - start) / 2);
563 float midfra =
array[mid].vec[1][0];
566 if (
IS_EQT(frame, midfra, threshold)) {
572 if (frame > midfra) {
575 else if (frame < midfra) {
581 if (loopbreaker == (maxloop - 1)) {
586 "\tround = %d: start = %d, end = %d, arraylen = %d",
616 const bool do_sel_only)
635 for (
int i = 0; i < fcu->
totvert; bezt++, i++) {
645 for (
int i = 0; i < fcu->
totvert; bezt--, i++) {
669 const bool do_sel_only,
670 const bool include_handles)
672 float xminv = 999999999.0f, xmaxv = -999999999.0f;
673 float yminv = 999999999.0f, ymaxv = -999999999.0f;
674 bool foundvert =
false;
687 if (include_handles) {
688 xminv =
min_fff(xminv, bezt_first->
vec[0][0], bezt_first->
vec[1][0]);
689 xmaxv =
max_fff(xmaxv, bezt_last->vec[1][0], bezt_last->vec[2][0]);
692 xminv =
min_ff(xminv, bezt_first->
vec[1][0]);
693 xmaxv =
max_ff(xmaxv, bezt_last->vec[1][0]);
703 for (bezt = fcu->
bezt, i = 0; i < fcu->totvert; prevbezt = bezt, bezt++, i++) {
709 if (include_handles) {
742 for (fpt = fcu->
fpt, i = 0; i < fcu->totvert; fpt++, i++) {
743 if (fpt->
vec[1] < yminv) {
746 if (fpt->
vec[1] > ymaxv) {
773 printf(
"F-Curve calc bounds didn't find anything, so assuming minimum bounds of 1.0\n");
796 FCurve *fcu,
float *start,
float *end,
const bool do_sel_only,
const bool do_min_length)
798 float min = 999999999.0f,
max = -999999999.0f;
799 bool foundvert =
false;
825 if (foundvert ==
false) {
851 int fcurve_array_len,
852 const float interval,
857 const double interval_db =
max_ff(interval, 1e-3f);
859 for (
int fcurve_index = 0; fcurve_index < fcurve_array_len; fcurve_index++) {
860 const FCurve *fcu = fcurve_array[fcurve_index];
861 for (
int i = 0; i < fcu->
totvert; i++) {
863 const double value = round((
double)bezt->
vec[1][0] / interval_db);
864 BLI_assert(value > INT_MIN && value < INT_MAX);
870 float *frames =
MEM_mallocN(
sizeof(*frames) * frames_len, __func__);
876 frames[i] = (
double)value * interval_db;
881 *r_frames_len = frames_len;
886 int fcurve_array_len,
904 if (active_bezt ==
NULL) {
911 ptrdiff_t offset = active_bezt - fcu->
bezt;
912 if (offset < 0 || offset >= fcu->
totvert) {
932 (active_keyframe_index < 0)) {
936 const BezTriple *active_bezt = &fcu->
bezt[active_keyframe_index];
937 if (((active_bezt->
f1 | active_bezt->
f2 | active_bezt->
f3) &
SELECT) == 0) {
942 return active_keyframe_index;
949 const float value_delta = new_value - keyframe->
vec[1][1];
950 keyframe->
vec[0][1] += value_delta;
951 keyframe->
vec[1][1] = new_value;
952 keyframe->
vec[2][1] += value_delta;
1058 for (ce = lb->first; ce; ce = ce->
next) {
1067 if (ce->
cfra > bezt->vec[1][0]) {
1081 cen->
cfra = bezt->vec[1][0];
1082 cen->
sel = bezt->f2;
1116 CLOG_ERROR(&
LOG,
"No F-Curve with F-Curve Modifiers to Bake");
1120 CLOG_ERROR(&
LOG,
"Error: Frame range for Sampled F-Curve creation is inappropriate");
1125 fpt = new_fpt =
MEM_callocN(
sizeof(
FPoint) * (end - start + 1),
"FPoint Samples");
1128 for (cfra = start; cfra <= end; cfra++, fpt++) {
1130 fpt->
vec[1] = sample_cb(fcu,
data, (
float)cfra);
1144 fcu->
totvert = end - start + 1;
1162 CLOG_ERROR(&
LOG,
"No F-Curve with F-Curve Modifiers to Un-Bake");
1167 CLOG_ERROR(&
LOG,
"Error: Frame range to unbake F-Curve is inappropriate");
1173 CLOG_ERROR(&
LOG,
"Error: Curve contains no baked keyframes");
1184 int keyframes_to_insert = end - start;
1185 int sample_points = fcu->
totvert;
1187 bezt = fcu->
bezt =
MEM_callocN(
sizeof(*fcu->
bezt) * (
size_t)keyframes_to_insert, __func__);
1188 fcu->
totvert = keyframes_to_insert;
1191 for (; sample_points && (fpt->
vec[0] < start); fpt++, sample_points--) {
1196 int cur_pos = start;
1199 for (; keyframes_to_insert && (fpt->
vec[0] > start); cur_pos++, bezt++, keyframes_to_insert--) {
1202 bezt->
vec[1][1] = fpt->
vec[1];
1206 for (; keyframes_to_insert && sample_points;
1207 cur_pos++, bezt++, keyframes_to_insert--, fpt++, sample_points--) {
1213 for (fpt--; keyframes_to_insert; cur_pos++, bezt++, keyframes_to_insert--) {
1216 bezt->
vec[1][1] = fpt->
vec[1];
1250 if (
data &&
data->after_cycles == 0 &&
data->before_cycles == 0) {
1288 for (
int i = 0; i < 3; i++) {
1330 if (bezt->
vec[0][0] > bezt->
vec[1][0]) {
1331 bezt->
vec[0][0] = bezt->
vec[1][0];
1333 if (bezt->
vec[2][0] < bezt->
vec[1][0]) {
1334 bezt->
vec[2][0] = bezt->
vec[1][0];
1346 bezt->
vec[0][1] = bezt->
vec[2][1] = bezt->
vec[1][1];
1354 if (prev && prev->
vec[1][0] >= bezt->
vec[1][0]) {
1374 first->
vec[0][1] = first->
vec[2][1] = first->
vec[1][1];
1375 last->vec[0][1] = last->vec[2][1] = last->vec[1][1];
1418 for (
a = 0, bezt = fcu->
bezt; a < fcu->totvert;
a++, bezt++) {
1445 for (
a = 0, bezt = fcu->
bezt; a < fcu->totvert;
a++, bezt++) {
1449 if (bezt->
vec[1][0] > (bezt + 1)->vec[1][0]) {
1457 for (
a = 0, bezt = fcu->
bezt; a < fcu->totvert;
a++, bezt++) {
1459 if ((bezt->
vec[0][0] > bezt->
vec[1][0]) && (bezt->
vec[2][0] < bezt->
vec[1][0])) {
1486 for (
a = 0, bezt = fcu->
bezt;
a < (fcu->
totvert - 1);
a++, bezt++) {
1487 if (bezt->
vec[1][0] > (bezt + 1)->vec[1][0]) {
1492 else if (fcu->
fpt) {
1496 for (
a = 0, fpt = fcu->
fpt;
a < (fcu->
totvert - 1);
a++, fpt++) {
1497 if (fpt->
vec[0] > (fpt + 1)->vec[0]) {
1523 float h1[2], h2[2], len1, len2,
len, fac;
1526 h1[0] =
v1[0] -
v2[0];
1527 h1[1] =
v1[1] -
v2[1];
1529 h2[0] = v4[0] - v3[0];
1530 h2[1] = v4[1] - v3[1];
1537 len = v4[0] -
v1[0];
1538 len1 =
fabsf(h1[0]);
1539 len2 =
fabsf(h2[0]);
1542 if ((len1 + len2) == 0.0f) {
1550 v2[0] = (
v1[0] - fac * h1[0]);
1551 v2[1] = (
v1[1] - fac * h1[1]);
1556 v3[0] = (v4[0] - fac * h2[0]);
1557 v3[1] = (v4[1] - fac * h2[1]);
1568 static int solve_cubic(
double c0,
double c1,
double c2,
double c3,
float *o)
1570 double a, b,
c, p, q, d,
t, phi;
1580 q = (2 *
a *
a *
a -
a * b +
c) / 2;
1581 d = q * q + p * p * p;
1587 if ((o[0] >= (
float)
SMALL) && (o[0] <= 1.000001f)) {
1597 if ((o[0] >= (
float)
SMALL) && (o[0] <= 1.000001f)) {
1602 if ((o[nr] >= (
float)
SMALL) && (o[nr] <= 1.000001f)) {
1608 phi =
acos(-q /
sqrt(-(p * p * p)));
1611 q =
sqrt(3 - 3 * p * p);
1612 o[0] = (
float)(2 *
t * p -
a);
1614 if ((o[0] >= (
float)
SMALL) && (o[0] <= 1.000001f)) {
1617 o[nr] = (
float)(-
t * (p + q) -
a);
1619 if ((o[nr] >= (
float)
SMALL) && (o[nr] <= 1.000001f)) {
1622 o[nr] = (
float)(-
t * (p - q) -
a);
1624 if ((o[nr] >= (
float)
SMALL) && (o[nr] <= 1.000001f)) {
1635 p = b * b - 4 *
a *
c;
1639 o[0] = (
float)((-b - p) / (2 *
a));
1641 if ((o[0] >= (
float)
SMALL) && (o[0] <= 1.000001f)) {
1644 o[nr] = (
float)((-b + p) / (2 *
a));
1646 if ((o[nr] >= (
float)
SMALL) && (o[nr] <= 1.000001f)) {
1653 o[0] = (
float)(-b / (2 *
a));
1654 if ((o[0] >= (
float)
SMALL) && (o[0] <= 1.000001f)) {
1665 if ((o[0] >= (
float)
SMALL) && (o[0] <= 1.000001f)) {
1680 static int findzero(
float x,
float q0,
float q1,
float q2,
float q3,
float *o)
1682 const double c0 = q0 -
x;
1683 const double c1 = 3.0f * (
q1 - q0);
1684 const double c2 = 3.0f * (q0 - 2.0f *
q1 + q2);
1685 const double c3 = q3 - q0 + 3.0f * (
q1 - q2);
1690 static void berekeny(
float f1,
float f2,
float f3,
float f4,
float *o,
int b)
1692 float t, c0, c1, c2, c3;
1696 c1 = 3.0f * (f2 - f1);
1697 c2 = 3.0f * (f1 - 2.0f * f2 + f3);
1698 c3 = f4 - f1 + 3.0f * (f2 - f3);
1700 for (
a = 0;
a < b;
a++) {
1702 o[
a] = c0 +
t * c1 +
t *
t * c2 +
t *
t *
t * c3;
1720 const float *prev_coords = prev->
vec[1];
1721 float *prev_handle_right = prev->
vec[2];
1722 float *next_handle_left =
next->vec[0];
1723 const float *next_coords =
next->vec[1];
1725 float *new_handle_left = bezt->
vec[0];
1726 const float *new_coords = bezt->
vec[1];
1727 float *new_handle_right = bezt->
vec[2];
1729 if (new_coords[0] <= prev_coords[0] || new_coords[0] >= next_coords[0]) {
1739 prev_handle_right[0],
1740 next_handle_left[0],
1746 const float t = roots[0];
1747 if (t <= 0.0f || t >= 1.0f) {
1754 float split1[3][2], split2[2][2], split3[2];
1766 float diff_coords[2];
1768 add_v2_v2v2(new_handle_left, split2[0], diff_coords);
1769 add_v2_v2v2(new_handle_right, split2[1], diff_coords);
1771 *r_pdelta = diff_coords[1];
1784 BezTriple *endpoint_bezt = bezts + endpoint_offset;
1785 BezTriple *neighbor_bezt = endpoint_bezt +
1786 direction_to_neighbor;
1792 return endpoint_bezt->
vec[1][1];
1798 return endpoint_bezt->
vec[1][1];
1802 float fac = neighbor_bezt->
vec[1][0] - endpoint_bezt->
vec[1][0];
1806 return endpoint_bezt->
vec[1][1];
1809 fac = (neighbor_bezt->
vec[1][1] - endpoint_bezt->
vec[1][1]) / fac;
1810 return endpoint_bezt->
vec[1][1] - (fac * dx);
1815 int handle = direction_to_neighbor > 0 ? 0 : 2;
1817 float fac = endpoint_bezt->
vec[1][0] - endpoint_bezt->
vec[handle][0];
1821 return endpoint_bezt->
vec[1][1];
1824 fac = (endpoint_bezt->
vec[1][1] - endpoint_bezt->
vec[handle][1]) / fac;
1825 return endpoint_bezt->
vec[1][1] - (fac * dx);
1830 const float eps = 1.e-8f;
1854 return bezt->
vec[1][1];
1860 prevbezt = (
a > 0) ? (bezt - 1) : bezt;
1865 return bezt->
vec[1][1];
1868 if (evaltime < prevbezt->vec[1][0] || bezt->
vec[1][0] <
evaltime) {
1870 printf(
" ERROR: failed eval - p=%f b=%f, t=%f (%f)\n",
1871 prevbezt->
vec[1][0],
1880 const float begin = prevbezt->
vec[1][1];
1881 const float change = bezt->
vec[1][1] - prevbezt->
vec[1][1];
1882 const float duration = bezt->
vec[1][0] - prevbezt->
vec[1][0];
1884 const float amplitude = prevbezt->
amplitude;
1885 const float period = prevbezt->
period;
1891 return prevbezt->
vec[1][1];
1894 switch (prevbezt->
ipo) {
1897 float v1[2],
v2[2], v3[2], v4[2], opl[32];
1901 v1[0] = prevbezt->
vec[1][0];
1902 v1[1] = prevbezt->
vec[1][1];
1903 v2[0] = prevbezt->
vec[2][0];
1904 v2[1] = prevbezt->
vec[2][1];
1906 v3[0] = bezt->
vec[0][0];
1907 v3[1] = bezt->
vec[0][1];
1908 v4[0] = bezt->
vec[1][0];
1909 v4[1] = bezt->
vec[1][1];
1911 if (
fabsf(
v1[1] - v4[1]) < FLT_EPSILON &&
fabsf(
v2[1] - v3[1]) < FLT_EPSILON &&
1912 fabsf(v3[1] - v4[1]) < FLT_EPSILON) {
1924 printf(
" ERROR: findzero() failed at %f with %f %f %f %f\n",
1943 switch (prevbezt->
easing) {
1957 switch (prevbezt->
easing) {
1971 switch (prevbezt->
easing) {
1985 switch (prevbezt->
easing) {
1999 switch (prevbezt->
easing) {
2013 switch (prevbezt->
easing) {
2027 switch (prevbezt->
easing) {
2041 switch (prevbezt->
easing) {
2055 switch (prevbezt->
easing) {
2069 switch (prevbezt->
easing) {
2083 return prevbezt->
vec[1][1];
2092 if (evaltime <= bezts->vec[1][0]) {
2107 FPoint *prevfpt, *lastfpt, *fpt;
2108 float cvalue = 0.0f;
2112 lastfpt = prevfpt + fcu->
totvert - 1;
2117 cvalue = prevfpt->
vec[1];
2121 cvalue = lastfpt->
vec[1];
2127 fpt = prevfpt + ((int)
evaltime - (
int)prevfpt->
vec[0]);
2130 if ((
t != 0.0f) && (
t < 1.0f)) {
2131 cvalue =
interpf(fpt->
vec[1], (fpt + 1)->vec[1], 1.0f -
t);
2134 cvalue = fpt->
vec[1];
2169 else if (fcu->
fpt) {
2180 cvalue =
floorf(cvalue + 0.5f);
2207 float cvalue = 0.0f;
2220 bool do_linear =
true;
2296 if (fmi && fcm->data) {
2301 switch (fcm->type) {
2306 if (
data->coefficients) {
2344 switch (fcm->type) {
2373 switch (fcm->type) {
2387 switch (fcm->type) {
2423 if (dtar->rna_path) {
2474 if (tarIndex < dvar->num_targets) {
2478 dtar->rna_path =
NULL;
2493 if (fcurves ==
NULL) {
2505 if (tarIndex < dvar->num_targets) {
typedef float(TangentPoint)[2]
struct AnimData * BKE_animdata_from_id(struct ID *id)
char * BKE_animdata_driver_path_hack(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, char *base_path)
void BKE_nurb_bezt_handle_test(struct BezTriple *bezt, const eBezTriple_Flag__Alias sel_flag, const bool use_handle, const bool use_around_local)
void BKE_nurb_handle_calc_ex(struct BezTriple *bezt, struct BezTriple *prev, struct BezTriple *next, const eBezTriple_Flag__Alias handle_sel_flag, const bool is_fcurve, const char smoothing)
void BKE_nurb_handle_smooth_fcurve(struct BezTriple *bezt, int total, bool cyclic)
@ FMI_TYPE_GENERATE_CURVE
void copy_fmodifiers(ListBase *dst, const ListBase *src)
const FModifierTypeInfo * fmodifier_get_typeinfo(const struct FModifier *fcm)
void evaluate_value_fmodifiers(FModifiersStackStorage *storage, ListBase *modifiers, struct FCurve *fcu, float *cvalue, float evaltime)
float(* FcuSampleFunc)(struct FCurve *fcu, void *data, float evaltime)
#define BEZT_BINARYSEARCH_THRESH
float evaluate_time_fmodifiers(FModifiersStackStorage *storage, ListBase *modifiers, struct FCurve *fcu, float cvalue, float evaltime)
bool list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype)
void free_fmodifiers(ListBase *modifiers)
uint evaluate_fmodifiers_storage_size_per_modifier(ListBase *modifiers)
#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)
void fcurve_free_driver(struct FCurve *fcu)
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
struct ChannelDriver * fcurve_copy_driver(const struct ChannelDriver *driver)
void IDP_BlendWrite(struct BlendWriter *writer, const struct IDProperty *prop)
#define IDP_BlendDataRead(reader, prop)
void IDP_foreach_property(struct IDProperty *id_property_root, const int type_filter, IDPForeachPropertyCallback callback, void *user_data)
#define BKE_LIB_FOREACHID_PROCESS(_data, _id_super, _cb_flag)
void BKE_lib_query_idpropertiesForeachIDLink_callback(struct IDProperty *id_prop, void *user_data)
#define BKE_LIB_FOREACHID_PROCESS_ID(_data, _id, _cb_flag)
bool BKE_nlastrip_has_curves_for_property(const struct PointerRNA *ptr, const struct PropertyRNA *prop)
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(GSet *gs) ATTR_WARN_UNUSED_RESULT
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
BLI_INLINE void * BLI_gsetIterator_getKey(GSetIterator *gsi)
bool BLI_gset_add(GSet *gs, void *key)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
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 float interpf(float a, float b, float t)
MINLINE double sqrt3d(double d)
MINLINE float min_fff(float a, float b, float c)
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], const float t)
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])
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])
int BLI_sortutil_cmp_float(const void *a_, const void *b_)
char * BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict prefix) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
#define UNUSED_FUNCTION(x)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
#define ARRAY_LAST_ITEM(arr_start, arr_dtype, arr_len)
#define BLO_read_data_address(reader, ptr_p)
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_list(BlendDataReader *reader, struct ListBase *list)
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_read_id_address(reader, lib, id_ptr_p)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
#define BLO_expand(expander, id)
#define BLO_write_struct_list(writer, struct_name, list_ptr)
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
#define FCURVE_ACTIVE_KEYFRAME_NONE
@ FCURVE_EXTRAPOLATE_CONSTANT
#define BEZT_IS_AUTOH(bezt)
#define BEZT_ISSEL_ANY(bezt)
@ HD_AUTOTYPE_LOCKED_FINAL
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
float evaluate_fcurve(FCurve *fcu, float evaltime)
static BezTriple * cycle_offset_triple(bool cycle, BezTriple *out, const BezTriple *in, const BezTriple *from, const BezTriple *to)
static float fcurve_eval_samples(FCurve *fcu, FPoint *fpts, float evaltime)
static int BKE_fcurve_bezt_binarysearch_index_ex(BezTriple array[], float frame, int arraylen, float threshold, bool *r_replace)
float * BKE_fcurves_calc_keyed_frames_ex(FCurve **fcurve_array, int fcurve_array_len, const float interval, int *r_frames_len)
void BKE_fcurve_foreach_id(FCurve *fcu, LibraryForeachIDData *data)
bool BKE_fcurve_bezt_subdivide_handles(struct BezTriple *bezt, struct BezTriple *prev, struct BezTriple *next, float *r_pdelta)
bool BKE_fcurve_is_protected(FCurve *fcu)
FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], const int array_index)
FCurve * BKE_fcurve_iter_step(FCurve *fcu_iter, const char rna_path[])
void testhandles_fcurve(FCurve *fcu, eBezTriple_Flag sel_flag, const bool use_handle)
FCurve * BKE_fcurve_find_by_rna_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_animdata, bAction **r_action, bool *r_driven, bool *r_special)
int BKE_fcurve_bezt_binarysearch_index(BezTriple array[], float frame, int arraylen, bool *r_replace)
int BKE_fcurve_active_keyframe_index(const FCurve *fcu)
bool test_time_fcurve(FCurve *fcu)
void calchandles_fcurve_ex(FCurve *fcu, eBezTriple_Flag handle_sel_flag)
float fcurve_samplingcb_evalcurve(FCurve *fcu, void *UNUSED(data), float evaltime)
static float fcurve_eval_keyframes_extrapolate(FCurve *fcu, BezTriple *bezts, float evaltime, int endpoint_offset, int direction_to_neighbor)
bool BKE_fcurve_is_cyclic(FCurve *fcu)
void BKE_fmodifiers_blend_read_lib(BlendLibReader *reader, ID *id, ListBase *fmodifiers)
void BKE_fcurve_blend_read_data(BlendDataReader *reader, ListBase *fcurves)
static float evaluate_fcurve_ex(FCurve *fcu, float evaltime, float cvalue)
void calchandles_fcurve(FCurve *fcu)
static float fcurve_eval_keyframes_interpolate(FCurve *fcu, BezTriple *bezts, float evaltime)
static void UNUSED_FUNCTION() bezt_add_to_cfra_elem(ListBase *lb, BezTriple *bezt)
static void berekeny(float f1, float f2, float f3, float f4, float *o, int b)
void BKE_fcurve_keyframe_move_value_with_handles(struct BezTriple *keyframe, const float new_value)
bool BKE_fcurve_is_keyframable(FCurve *fcu)
bool BKE_fcurve_calc_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax, const bool do_sel_only, const bool include_handles)
bool BKE_fcurve_are_keyframes_usable(FCurve *fcu)
FCurve * BKE_fcurve_copy(const FCurve *fcu)
void BKE_fmodifiers_blend_write(BlendWriter *writer, ListBase *fmodifiers)
static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple **last, const bool do_sel_only)
static int solve_cubic(double c0, double c1, double c2, double c3, float *o)
float * BKE_fcurves_calc_keyed_frames(FCurve **fcurve_array, int fcurve_array_len, int *r_frames_len)
int BKE_fcurves_filter(ListBase *dst, ListBase *src, const char *dataPrefix, const char *dataName)
static int findzero(float x, float q0, float q1, float q2, float q3, float *o)
FCurve * BKE_fcurve_find_by_rna(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_adt, bAction **r_action, bool *r_driven, bool *r_special)
eFCU_Cycle_Type BKE_fcurve_get_cycle_type(FCurve *fcu)
float evaluate_fcurve_driver(PathResolvedRNA *anim_rna, FCurve *fcu, ChannelDriver *driver_orig, const AnimationEvalContext *anim_eval_context)
void BKE_fcurve_blend_read_expand(BlendExpander *expander, ListBase *fcurves)
void BKE_fcurve_active_keyframe_set(FCurve *fcu, const BezTriple *active_bezt)
void BKE_fmodifiers_blend_read_data(BlendDataReader *reader, ListBase *fmodifiers, FCurve *curve)
float evaluate_fcurve_only_curve(FCurve *fcu, float evaltime)
bool BKE_fcurve_calc_range(FCurve *fcu, float *start, float *end, const bool do_sel_only, const bool do_min_length)
void BKE_fcurve_blend_write(BlendWriter *writer, ListBase *fcurves)
void BKE_fcurves_free(ListBase *list)
FCurve * BKE_fcurve_create(void)
void BKE_fcurves_copy(ListBase *dst, ListBase *src)
static void init_unbaked_bezt_data(BezTriple *bezt)
float calculate_fcurve(PathResolvedRNA *anim_rna, FCurve *fcu, const AnimationEvalContext *anim_eval_context)
void BKE_fcurve_free(FCurve *fcu)
void BKE_fcurve_blend_read_lib(BlendLibReader *reader, ID *id, ListBase *fcurves)
void sort_time_fcurve(FCurve *fcu)
void BKE_fmodifiers_blend_read_expand(BlendExpander *expander, ListBase *fmodifiers)
void fcurve_samples_to_keyframes(FCurve *fcu, const int start, const int end)
FCurve * id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven)
bool BKE_fcurve_is_empty(FCurve *fcu)
static float fcurve_eval_keyframes(FCurve *fcu, BezTriple *bezts, float evaltime)
void fcurve_store_samples(FCurve *fcu, void *data, int start, int end, FcuSampleFunc sample_cb)
void BKE_fcurve_correct_bezpart(const float v1[2], float v2[2], float v3[2], const float v4[2])
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)
bool RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
const char * RNA_property_identifier(const PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
char * RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
struct ExprPyLike_Parsed * expr_simple
int active_keyframe_index