10#define DNA_DEPRECATED_ALLOW
100#define VALID_CONS_TARGET(ct) ((ct) && (ct->tar))
145 cob->
type = datatype;
174 cob->
type = datatype;
206 float delta[4][4], imat[4][4];
209 if (cob ==
nullptr) {
259 const bool keep_scale)
261 float diff_mat[4][4];
265 if (ob ==
nullptr || mat ==
nullptr) {
331 mul_m4_m4m4(mat, ob->object_to_world().ptr(), mat);
526 float imat[3][3], tmat[3][3];
533 if (defgroup == -1) {
537 float vec[3] = {0.0f, 0.0f, 0.0f};
538 float normal[3] = {0.0f, 0.0f, 0.0f};
539 float weightsum = 0.0f;
550 if (dw && dw->
weight > 0.0f) {
558 else if (mesh_eval) {
568 for (
const int i : positions.index_range()) {
572 if (dw && dw->
weight > 0.0f) {
596 copy_m3_m4(imat, ob->object_to_world().ptr());
617 mul_v3_m4v3(mat[3], ob->object_to_world().ptr(), vec);
628 const float *co = dl ? dl->
verts :
nullptr;
633 float vec[3] = {0.0f, 0.0f, 0.0f}, tvec[3];
642 if (defgroup == -1) {
652 for (i = 0; i < tot_verts; i++, dv++) {
655 if (dw && dw->
weight > 0.0f) {
657 memcpy(tvec, co ? co : bp->
vec,
sizeof(
float[3]));
678 mul_v3_m4v3(tvec, ob->object_to_world().ptr(), vec);
687 const char *substring,
696 if (substring[0] ==
'\0') {
730 if (headtail < 0.000001f && !(is_bbone && full_bbone)) {
746 interp_m4_m4m4(tempmat, bbone[index].mat, bbone[index + 1].mat, fac);
752 interp_v3_v3v3(loc, bbone[index].mat[3], bbone[index + 1].mat[3], fac);
758 mul_m4_m4m4(mat, ob->object_to_world().ptr(), tempmat);
761 float tempmat[4][4], loc[3];
770 mul_m4_m4m4(mat, ob->object_to_world().ptr(), tempmat);
801 CONSTRAINT_TYPE_CONSTRNAME,
802 sizeof(bConstrNameConstraint),
804 "bConstrNameConstraint",
806 constrname_id_looper,
810 constrname_flush_tars,
811 constrname_get_tarmat,
869#define SINGLETARGET_GET_TARS(con, datatar, datasubtarget, ct, list) \
871 ct = static_cast<bConstraintTarget *>( \
872 MEM_callocN(sizeof(bConstraintTarget), "tempConstraintTarget")); \
875 STRNCPY(ct->subtarget, datasubtarget); \
876 ct->space = con->tarspace; \
877 ct->flag = CONSTRAINT_TAR_TEMP; \
880 if ((ct->tar->type == OB_ARMATURE) && (ct->subtarget[0])) { \
881 bPoseChannel *pchan = BKE_pose_channel_find_name(ct->tar->pose, ct->subtarget); \
882 ct->type = CONSTRAINT_OBTYPE_BONE; \
883 ct->rotOrder = (pchan) ? (pchan->rotmode) : int(EULER_ORDER_DEFAULT); \
885 else if (OB_TYPE_SUPPORT_VGROUP(ct->tar->type) && (ct->subtarget[0])) { \
886 ct->type = CONSTRAINT_OBTYPE_VERT; \
887 ct->rotOrder = EULER_ORDER_DEFAULT; \
890 ct->type = CONSTRAINT_OBTYPE_OBJECT; \
891 ct->rotOrder = ct->tar->rotmode; \
895 BLI_addtail(list, ct); \
905#define SINGLETARGETNS_GET_TARS(con, datatar, ct, list) \
907 ct = static_cast<bConstraintTarget *>( \
908 MEM_callocN(sizeof(bConstraintTarget), "tempConstraintTarget")); \
911 ct->space = con->tarspace; \
912 ct->flag = CONSTRAINT_TAR_TEMP; \
915 ct->type = CONSTRAINT_OBTYPE_OBJECT; \
917 BLI_addtail(list, ct); \
927#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, no_copy) \
930 bConstraintTarget *ctn = ct->next; \
931 if (no_copy == 0) { \
933 STRNCPY(datasubtarget, ct->subtarget); \
934 con->tarspace = char(ct->space); \
937 BLI_freelinkN(list, ct); \
949#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, no_copy) \
952 bConstraintTarget *ctn = ct->next; \
953 if (no_copy == 0) { \
955 con->tarspace = char(ct->space); \
958 BLI_freelinkN(list, ct); \
986 func(con, (
ID **)&data->tar,
false, userdata);
1031 con->
flag &= ~CONSTRAINT_SPACEONCE;
1037 float inverse_matrix[4][4];
1045 float loc[3], eul[3], size[3];
1046 float loco[3], eulo[3], sizeo[3];
1059 loc[0] = loco[0] = 0.0f;
1062 loc[1] = loco[1] = 0.0f;
1065 loc[2] = loco[2] = 0.0f;
1068 eul[0] = eulo[0] = 0.0f;
1071 eul[1] = eulo[1] = 0.0f;
1074 eul[2] = eulo[2] = 0.0f;
1077 size[0] = sizeo[0] = 1.0f;
1080 size[1] = sizeo[1] = 1.0f;
1083 size[2] = sizeo[2] = 1.0f;
1094 if (cob->
pchan !=
nullptr) {
1095 mul_m4_series(data->invmat, data->invmat, cob->
ob->object_to_world().ptr());
1100 data->flag &= ~CHILDOF_SET_INVERSE;
1105 if (orig_con !=
nullptr) {
1109 orig_data->
flag &= ~CHILDOF_SET_INVERSE;
1116 float orig_cob_matrix[4][4];
1124 cob->
matrix[3][0] = orig_cob_matrix[3][0];
1127 cob->
matrix[3][1] = orig_cob_matrix[3][1];
1130 cob->
matrix[3][2] = orig_cob_matrix[3][2];
1140 "bChildOfConstraint",
1158 data->reserved2 =
UP_Y;
1166 func(con, (
ID **)&data->tar,
false, userdata);
1212 const float target_up[3],
1267 if (axis != upflag) {
1268 right_index = 3 - axis - upflag;
1272 m[right_index][0] = neg * right[0];
1273 m[right_index][1] = neg * right[1];
1274 m[right_index][2] = neg * right[2];
1292 float size[3], vec[3];
1300 cob->
matrix[0][0] = size[0];
1304 cob->
matrix[1][1] = size[1];
1308 cob->
matrix[2][2] = size[2];
1315 std::clamp<short>(data->reserved1, 0, 5),
1316 std::clamp<short>(data->reserved2, 0, 2),
1328 "bTrackToConstraint",
1346 data->orientweight = 1.0f;
1347 data->iterations = 500;
1357 func(con, (
ID **)&data->tar,
false, userdata);
1360 func(con, (
ID **)&data->poletar,
false, userdata);
1413 if (ob ==
nullptr) {
1419 mul_v3_m4v3(vec, ob->object_to_world().ptr(), data->grabtarget);
1434 "bKinematicConstraint",
1452 data->upflag =
UP_Z;
1454 data->followflag = 0;
1462 func(con, (
ID **)&data->tar,
false, userdata);
1501 float vec[4], radius;
1514 curvetime = cu->
ctime - data->offset;
1527 CLAMP(curvetime, 0.0f, 1.0f);
1532 curvetime = data->offset_fac;
1548 std::clamp<short>(data->trackflag, 0, 5),
1549 std::clamp<short>(data->upflag, 0, 2));
1554 float tmat[4][4], rmat[4][4];
1615 "bFollowPathConstraint",
1633 if (cob->
matrix[3][0] < data->xmin) {
1634 cob->
matrix[3][0] = data->xmin;
1638 if (cob->
matrix[3][0] > data->xmax) {
1639 cob->
matrix[3][0] = data->xmax;
1643 if (cob->
matrix[3][1] < data->ymin) {
1644 cob->
matrix[3][1] = data->ymin;
1648 if (cob->
matrix[3][1] > data->ymax) {
1649 cob->
matrix[3][1] = data->ymax;
1653 if (cob->
matrix[3][2] < data->zmin) {
1654 cob->
matrix[3][2] = data->zmin;
1658 if (cob->
matrix[3][2] > data->zmax) {
1659 cob->
matrix[3][2] = data->zmax;
1667 N_(
"Limit Location"),
1668 "bLocLimitConstraint",
1686 const float b = angle * (0.5 /
M_PI) + 0.5;
1687 return ((
b - std::floor(
b)) - 0.5) * (2.0 *
M_PI);
1703 if ((max -
min) >= (2 *
M_PI)) {
1722 if (min_wrapped < max_wrapped) {
1723 return angle + std::clamp(0.0f, min_wrapped, max_wrapped);
1728 if (max_wrapped >= 0.0 || min_wrapped <= 0.0) {
1733 if (std::fabs(max_wrapped) < std::fabs(min_wrapped)) {
1734 return angle + max_wrapped;
1736 return angle + min_wrapped;
1760 rot_order = data->euler_order;
1786 eul[0] =
clamp_f(eul[0], data->xmin, data->xmax);
1789 eul[1] =
clamp_f(eul[1], data->ymin, data->ymax);
1792 eul[2] =
clamp_f(eul[2], data->zmin, data->zmax);
1798 eul[0] =
clamp_angle(eul[0], data->xmin, data->xmax);
1801 eul[1] =
clamp_angle(eul[1], data->ymin, data->ymax);
1804 eul[2] =
clamp_angle(eul[2], data->zmin, data->zmax);
1814 N_(
"Limit Rotation"),
1815 "bRotLimitConstraint",
1831 float obsize[3], size[3];
1838 if (size[0] < data->xmin) {
1839 size[0] = data->xmin;
1843 if (size[0] > data->xmax) {
1844 size[0] = data->xmax;
1848 if (size[1] < data->ymin) {
1849 size[1] = data->ymin;
1853 if (size[1] > data->ymax) {
1854 size[1] = data->ymax;
1858 if (size[2] < data->zmin) {
1859 size[2] = data->zmin;
1863 if (size[2] > data->zmax) {
1864 size[2] = data->zmax;
1883 "bSizeLimitConstraint",
1908 func(con, (
ID **)&data->tar,
false, userdata);
1943 float offset[3] = {0.0f, 0.0f, 0.0f};
1955 cob->
matrix[3][0] += offset[0];
1963 cob->
matrix[3][1] += offset[1];
1971 cob->
matrix[3][2] += offset[2];
1979 N_(
"Copy Location"),
1980 "bLocateLikeConstraint",
2005 func(con, (
ID **)&data->tar,
false, userdata);
2040 float loc[3], size[3], oldrot[3][3], newrot[3][3];
2041 float eul[3], obeul[3], defeul[3];
2049 rot_order = data->euler_order;
2065 bool legacy_offset =
false;
2067 switch (data->mix_mode) {
2069 legacy_offset =
true;
2085 if (legacy_offset) {
2098 if (legacy_offset) {
2111 if (legacy_offset) {
2131 switch (data->mix_mode) {
2156 N_(
"Copy Rotation"),
2157 "bRotateLikeConstraint",
2183 func(con, (
ID **)&data->tar,
false, userdata);
2218 float obsize[3], size[3];
2228 if ((data->flag & all_axes) == all_axes) {
2253 for (
int i = 0; i < 3; i++) {
2254 size[i] =
powf(size[i], data->power);
2287 "bSizeLikeConstraint",
2305 func(con, (
ID **)&data->tar,
false, userdata);
2340 float target_mat[4][4];
2351 switch (data->mix_mode) {
2392 N_(
"Copy Transforms"),
2393 "bTransLikeConstraint",
2411 data->volume = 1.0f;
2418 float volume = data->
volume;
2419 float fac = 1.0f, total_scale = 1.0f;
2425 switch (data->mode) {
2427 total_scale = obsize[0] * obsize[1] * obsize[2];
2430 total_scale =
pow3f(obsize[data->free_axis]);
2433 total_scale = obsize[data->free_axis];
2437 if (total_scale != 0) {
2438 fac =
sqrtf(volume / total_scale);
2442 switch (data->free_axis) {
2461 N_(
"Maintain Volume"),
2462 "bSameVolumeConstraint",
2510 list->last = data->targets.last;
2512 return data->tarnum;
2524 func(con, (
ID **)&ct->tar,
false, userdata);
2528 func(con, (
ID **)&data->text,
true, userdata);
2594 "bPythonConstraint",
2642 func(con, (
ID **)&ct->tar,
false, userdata);
2653 if (ct !=
nullptr) {
2657 if (pchan !=
nullptr) {
2668 const float iobmat[4][4],
2669 const float basemat[4][4],
2670 const float bonemat[4][4],
2671 const float pivot[3],
2673 float r_sum_mat[4][4],
2676 if (weight == 0.0f) {
2685 if (r_sum_dq !=
nullptr) {
2686 float basemat_world[4][4];
2705 const bool force_envelope,
2707 float r_sum_mat[4][4],
2710 float iobmat[4][4], co[3];
2712 float weight = ct->
weight;
2728 float basemat[4][4];
2735 if (r_sum_dq !=
nullptr) {
2743 b_bone_mats[index + 1].
mat,
2745 weight * (1.0f -
blend),
2749 if (r_sum_dq !=
nullptr) {
2757 b_bone_mats[index + 2].
mat,
2776 *r_totweight += weight;
2783 float sum_mat[4][4], input_co[3];
2785 float weight = 0.0f;
2789 memset(&sum_dq, 0,
sizeof(sum_dq));
2798 mul_m4_v3(cob->
ob->object_to_world().ptr(), input_co);
2807 if (ct->weight <= 0.0f) {
2818 if (pchan ==
nullptr || pchan->
bone ==
nullptr) {
2826 if (weight > 0.0f) {
2827 if (pdq !=
nullptr) {
2844 "bArmatureConstraint",
2873 func(con, (
ID **)&data->tar,
false, userdata);
2876 func(con, (
ID **)&data->act,
true, userdata);
2919 float tempmat[4][4], vec[3];
2928 s = data->eval_time;
2947 if (data->type < 10) {
2953 else if (data->type < 20) {
2956 axis = data->type - 10;
2961 axis = data->type - 20;
2970 const float range = data->max - data->min;
2971 if ((range == 0.0f) || (
ushort(axis) > 2)) {
2975 s = (vec[axis] - data->min) / range;
2980 t = (s * (data->end - data->start)) + data->start;
2985 printf(
"do Action Constraint %s - Ob %s Pchan %s\n",
3001 data->action_slot_handle,
3003 &anim_eval_context);
3008 bPose pose = {{
nullptr}};
3024 data->action_slot_handle,
3026 &anim_eval_context);
3037 puts(
"Error: unknown owner type for Action Constraint");
3048 switch (data->mix_mode) {
3086 "bActionConstraint",
3112 func(con, (
ID **)&data->tar,
false, userdata);
3147 float vec[3], vec2[3];
3155 switch (data->lockflag) {
3158 switch (data->trackflag) {
3226 switch (data->trackflag) {
3294 switch (data->trackflag) {
3370 totmat[0][0] = tmpmat[0][0];
3371 totmat[0][1] = tmpmat[0][1];
3372 totmat[0][2] = tmpmat[0][2];
3373 totmat[1][0] = tmpmat[1][0];
3374 totmat[1][1] = tmpmat[1][1];
3375 totmat[1][2] = tmpmat[1][2];
3376 totmat[2][0] = tmpmat[2][0];
3377 totmat[2][1] = tmpmat[2][1];
3378 totmat[2][2] = tmpmat[2][2];
3402 "bLockTrackConstraint",
3427 func(con, (
ID **)&data->tar,
false, userdata);
3463 float dvec[3], dist, sfac = 1.0f;
3464 short clamp_surf = 0;
3470 if (data->dist == 0) {
3476 if (orig_con !=
nullptr) {
3479 orig_data->
dist = data->dist;
3486 if (dist <= data->dist) {
3489 sfac = data->dist / dist;
3494 if (dist <= (data->dist + data->soft)) {
3501 if (dist >= data->dist) {
3504 sfac = data->dist / dist;
3510 if (dist >= (data->dist - data->soft)) {
3511 sfac =
float(data->soft * (1.0f -
expf(-(dist - data->dist) / data->soft)) + data->dist);
3521 if (
IS_EQF(dist, data->dist) == 0) {
3524 sfac = data->dist / dist;
3543 N_(
"Limit Distance"),
3544 "bDistLimitConstraint",
3563 data->orglength = 0.0;
3565 data->bulge_max = 1.0f;
3566 data->bulge_min = 1.0f;
3574 func(con, (
ID **)&data->tar,
false, userdata);
3610 float size[3], scale[3], vec[3], xx[3], zz[3],
orth[3];
3637 if (data->orglength == 0) {
3638 data->orglength = dist;
3643 if (orig_con !=
nullptr) {
3650 scale[1] = dist / data->orglength;
3652 bulge =
powf(data->orglength / dist, data->bulge);
3656 float bulge_max =
max_ff(data->bulge_max, 1.0f);
3657 float hard =
min_ff(bulge, bulge_max);
3659 float range = bulge_max - 1.0f;
3660 float scale_fac = (range > 0.0f) ? 1.0f / range : 0.0f;
3661 float soft = 1.0f + range *
atanf((bulge - 1.0f) * scale_fac) /
float(
M_PI_2);
3663 bulge =
interpf(soft, hard, data->bulge_smooth);
3668 float bulge_min = std::clamp(data->bulge_min, 0.0f, 1.0f);
3669 float hard =
max_ff(bulge, bulge_min);
3671 float range = 1.0f - bulge_min;
3672 float scale_fac = (range > 0.0f) ? 1.0f / range : 0.0f;
3673 float soft = 1.0f - range *
atanf((1.0f - bulge) * scale_fac) /
float(
M_PI_2);
3675 bulge =
interpf(soft, hard, data->bulge_smooth);
3679 switch (data->volmode) {
3682 scale[0] =
sqrtf(bulge);
3683 scale[2] = scale[0];
3705 switch (data->plane) {
3752 "bStretchToConstraint",
3770 data->offset = 0.0f;
3779 func(con, (
ID **)&data->tar,
false, userdata);
3815 float obmat[4][4], imat[4][4], tarmat[4][4], tmat[4][4];
3830 switch (data->minmaxflag) {
3832 val1 = tarmat[3][2];
3833 val2 = obmat[3][2] - data->offset;
3837 val1 = tarmat[3][1];
3838 val2 = obmat[3][1] - data->offset;
3842 val1 = tarmat[3][0];
3843 val2 = obmat[3][0] - data->offset;
3847 val2 = tarmat[3][2];
3848 val1 = obmat[3][2] - data->offset;
3852 val2 = tarmat[3][1];
3853 val1 = obmat[3][1] - data->offset;
3857 val2 = tarmat[3][0];
3858 val1 = obmat[3][0] - data->offset;
3866 obmat[3][index] = tarmat[3][index] + data->offset;
3883 "bMinMaxConstraint",
3901 func(con, (
ID **)&data->tar,
false, userdata);
3952 float obmat[4][4], ownLoc[3];
3953 float curveMin[3], curveMax[3];
3954 float targetMatrix[4][4];
3967 if (data->tar->runtime->curve_cache && data->tar->runtime->curve_cache->anim_path_accum_length)
3969 float vec[4], totmat[4][4];
3983 if ((size[2] > size[0]) && (size[2] > size[1])) {
3986 else if ((size[1] > size[0]) && (size[1] > size[2])) {
3994 clamp_axis = data->flag - 1;
4000 float len = (curveMax[clamp_axis] - curveMin[clamp_axis]);
4006 if (ownLoc[clamp_axis] < curveMin[clamp_axis]) {
4008 offset = curveMin[clamp_axis] -
4009 ceilf((curveMin[clamp_axis] - ownLoc[clamp_axis]) /
len) *
len;
4013 curvetime = (ownLoc[clamp_axis] - offset) / (
len);
4015 else if (ownLoc[clamp_axis] > curveMax[clamp_axis]) {
4017 offset = curveMax[clamp_axis] +
4018 int((ownLoc[clamp_axis] - curveMax[clamp_axis]) /
len) *
len;
4022 curvetime = (ownLoc[clamp_axis] - offset) / (
len);
4026 curvetime = (ownLoc[clamp_axis] - curveMin[clamp_axis]) / (
len);
4036 if (ownLoc[clamp_axis] <= curveMin[clamp_axis]) {
4039 else if (ownLoc[clamp_axis] >= curveMax[clamp_axis]) {
4042 else if (
IS_EQF((curveMax[clamp_axis] - curveMin[clamp_axis]), 0.0f) ==
false) {
4043 curvetime = (ownLoc[clamp_axis] - curveMin[clamp_axis]) /
4044 (curveMax[clamp_axis] - curveMin[clamp_axis]);
4056 mul_m4_m4m4(targetMatrix, ct->
tar->object_to_world().ptr(), totmat);
4069 "bClampToConstraint",
4090 for (
int i = 0; i < 3; i++) {
4091 data->from_min_scale[i] = data->from_max_scale[i] = 1.0f;
4092 data->to_min_scale[i] = data->to_max_scale[i] = 1.0f;
4101 func(con, (
ID **)&data->tar,
false, userdata);
4137 float *from_min, *from_max, *to_min, *to_max;
4138 float loc[3],
rot[3][3], oldeul[3], size[3];
4139 float newloc[3], newrot[3][3], neweul[3], newsize[3];
4140 float dbuf[4], sval[3];
4141 float *
const dvec = dbuf + 1;
4144 switch (data->from) {
4155 from_min = data->from_min_scale;
4156 from_max = data->from_max_scale;
4160 ct->
matrix, cob->
rotOrder, data->from_rotation_mode, -1,
true, dbuf);
4161 from_min = data->from_min_rot;
4162 from_max = data->from_max_rot;
4167 from_min = data->from_min;
4168 from_max = data->from_max;
4176 rot_order = data->to_euler_order;
4184 for (
int i = 0; i < 3; i++) {
4185 if (from_max[i] - from_min[i]) {
4186 sval[i] = (dvec[i] - from_min[i]) / (from_max[i] - from_min[i]);
4195 for (
int i = 0; i < 3; i++) {
4196 CLAMP(dvec[i], from_min[i], from_max[i]);
4197 if (from_max[i] - from_min[i]) {
4198 sval[i] = (dvec[i] - from_min[i]) / (from_max[i] - from_min[i]);
4209 to_min = data->to_min_scale;
4210 to_max = data->to_max_scale;
4211 for (
int i = 0; i < 3; i++) {
4212 newsize[i] = to_min[i] + (sval[
int(data->map[i])] * (to_max[i] - to_min[i]));
4214 switch (data->mix_mode_scale) {
4225 to_min = data->to_min_rot;
4226 to_max = data->to_max_rot;
4227 for (
int i = 0; i < 3; i++) {
4228 neweul[i] = to_min[i] + (sval[
int(data->map[i])] * (to_max[i] - to_min[i]));
4230 switch (data->mix_mode_rot) {
4252 to_min = data->to_min;
4253 to_max = data->to_max;
4254 for (
int i = 0; i < 3; i++) {
4255 newloc[i] = (to_min[i] + (sval[
int(data->map[i])] * (to_max[i] - to_min[i])));
4257 switch (data->mix_mode_loc) {
4277 N_(
"Transformation"),
4278 "bTransformConstraint",
4296 func(con, (
ID **)&data->target,
false, userdata);
4342 float co[3] = {0.0f, 0.0f, 0.0f};
4343 bool track_normal =
false;
4344 float track_no[3] = {0.0f, 0.0f, 0.0f};
4372 if (nearest.index < 0) {
4378 if (do_track_normal) {
4379 track_normal =
true;
4381 &
tree,
nullptr, nearest.index, nearest.co, nearest.no, track_no);
4396 const float dist =
len_v3v3(co, nearest.co);
4400 co, co, nearest.co, (dist - scon->
dist) / dist);
4411 float no[3] = {0.0f, 0.0f, 0.0f};
4460 if (hit.index < 0) {
4465 if (do_track_normal) {
4466 track_normal =
true;
4468 &
tree, &transform, hit.index, hit.co, hit.no, track_no);
4510 "bShrinkwrapConstraint",
4535 func(con, (
ID **)&data->tar,
false, userdata);
4595 float obvec[3], obloc[3];
4596 float raxis[3], rangle;
4597 float rmat[3][3], tmat[4][4];
4632 if (
norm < FLT_EPSILON) {
4653 else if (
norm < 0.1f) {
4675 "bDampTrackConstraint",
4711 data->bulge_max = 1.0f;
4712 data->bulge_min = 1.0f;
4723 func(con, (
ID **)&data->tar,
false, userdata);
4770 "bSplineIKConstraint",
4788 func(con, (
ID **)&data->tar,
false, userdata);
4822 float pivot[3], vec[3];
4826 float axis[3],
angle;
4828 const int rot_axis = std::clamp(
4842 if (
rot[rot_axis] > 0.0f) {
4916 data->
clip =
nullptr;
4924 func(con, (
ID **)&data->clip,
true, userdata);
4925 func(con, (
ID **)&data->camera,
false, userdata);
4926 func(con, (
ID **)&data->depth_ob,
false, userdata);
4947 if (data->object[0]) {
4957 if (data->camera ==
nullptr) {
4962 return data->camera;
4990 context->
flag = data->flag;
4991 context->frame_method = data->frame_method;
4994 context->scene = cob->
scene;
4998 if (context->clip ==
nullptr || context->camera_object ==
nullptr) {
5001 context->depth_object = data->depth_ob;
5003 context->tracking = &context->clip->tracking;
5005 if (context->tracking_object ==
nullptr) {
5010 if (context->track ==
nullptr) {
5014 context->depsgraph_time =
DEG_get_ctime(context->depsgraph);
5016 context->depsgraph_time);
5024 Object *camera_object = context->camera_object;
5034 float camera_obmat[4][4];
5035 copy_m4_m4(camera_obmat, camera_object->object_to_world().ptr());
5038 float reconstructed_camera_mat[4][4];
5040 tracking, tracking_object, context->clip_frame, reconstructed_camera_mat);
5041 float reconstructed_camera_mat_inv[4][4];
5042 invert_m4_m4(reconstructed_camera_mat_inv, reconstructed_camera_mat);
5051 Object *camera_object = context->camera_object;
5058 float reconstructed_camera_mat[4][4];
5082 const int clip_width,
5083 const int clip_height,
5084 float marker_position[2])
5091 marker_position[0] *= clip_width;
5092 marker_position[1] *= clip_height;
5095 context->tracking, clip_width, clip_height, marker_position, marker_position);
5098 marker_position[0] /= clip_width;
5099 marker_position[1] /= clip_height;
5104 const int clip_width,
5105 const int clip_height,
5106 float marker_position[2])
5112 Scene *scene = context->scene;
5116 const float w_src = clip_width * clip->
aspx;
5117 const float h_src = clip_height * clip->aspy;
5119 const float w_dst = scene->r.xsch * scene->r.xasp;
5120 const float h_dst = scene->r.ysch * scene->r.yasp;
5122 const float asp_src = w_src / h_src;
5123 const float asp_dst = w_dst / h_dst;
5125 if (
fabsf(asp_src - asp_dst) < FLT_EPSILON) {
5131 float div = asp_src / asp_dst;
5132 float cent =
float(clip_width) / 2.0f;
5134 marker_position[0] = (((marker_position[0] * clip_width - cent) * div) + cent) / clip_width;
5138 float div = asp_dst / asp_src;
5139 float cent =
float(clip_height) / 2.0f;
5141 marker_position[1] = (((marker_position[1] * clip_height - cent) * div) + cent) / clip_height;
5150 Object *camera_object = context->camera_object;
5152 float camera_matrix[4][4];
5155 const float z_axis[3] = {0.0f, 0.0f, 1.0f};
5158 float camera_axis[3];
5166 float projection[3];
5169 return len_v3(projection);
5176 if (context->depth_object ==
nullptr) {
5180 Object *depth_object = context->depth_object;
5182 if (depth_mesh ==
nullptr) {
5186 float depth_object_mat_inv[4][4];
5187 invert_m4_m4(depth_object_mat_inv, depth_object->object_to_world().ptr());
5189 float ray_start[3], ray_end[3];
5191 ray_start, depth_object_mat_inv, context->camera_object->object_to_world().location());
5194 float ray_direction[3];
5222 Scene *scene = context->scene;
5225 Object *camera_object = context->camera_object;
5226 const float clip_frame = context->clip_frame;
5227 const float aspect = (scene->r.xsch * scene->r.xasp) / (scene->r.ysch * scene->r.yasp);
5230 if (object_depth < FLT_EPSILON) {
5234 int clip_width, clip_height;
5237 float marker_position[2];
5250 vec[0] =
params.ortho_scale * (marker_position[0] - 0.5f +
params.shiftx);
5251 vec[1] =
params.ortho_scale * (marker_position[1] - 0.5f +
params.shifty);
5252 vec[2] = -object_depth;
5254 if (aspect > 1.0f) {
5262 mul_v3_m4v3(disp, camera_object->object_to_world().ptr(), vec);
5264 copy_m4_m4(rmat, camera_object->object_to_world().ptr());
5271 const float d = (object_depth *
params.sensor_x) / (2.0f *
params.lens);
5274 vec[0] = d * (2.0f * (marker_position[0] +
params.shiftx) - 1.0f);
5275 vec[1] = d * (2.0f * (marker_position[1] +
params.shifty) - 1.0f);
5276 vec[2] = -object_depth;
5278 if (aspect > 1.0f) {
5286 mul_v3_m4v3(disp, camera_object->object_to_world().ptr(), vec);
5289 copy_m4_m4(rmat, camera_object->object_to_world().ptr());
5319 "bFollowTrackConstraint",
5336 data->
clip =
nullptr;
5344 func(con, (
ID **)&data->clip,
true, userdata);
5359 float mat[4][4], obmat[4][4];
5376 N_(
"Camera Solver"),
5377 "bCameraSolverConstraint",
5394 data->
clip =
nullptr;
5403 func(con, (
ID **)&data->clip,
false, userdata);
5404 func(con, (
ID **)&data->camera,
false, userdata);
5413 Object *camob = data->camera ? data->camera : scene->camera;
5418 if (!camob || !clip) {
5424 if (!tracking_object) {
5428 float mat[4][4], obmat[4][4], imat[4][4], parmat[4][4];
5435 mul_m4_m4m4(parmat, camob->object_to_world().ptr(), imat);
5443 data->flag &= ~OBJECTSOLVER_SET_INVERSE;
5448 if (orig_con !=
nullptr) {
5452 orig_data->
flag &= ~OBJECTSOLVER_SET_INVERSE;
5462 N_(
"Object Solver"),
5463 "bObjectSolverConstraint",
5479 func(con, (
ID **)&data->cache_file,
true, userdata);
5484#if defined(WITH_ALEMBIC) || defined(WITH_USD)
5488 CacheFile *cache_file = data->cache_file;
5502 if (!data->reader || !
STREQ(data->reader_object_path, data->object_path)) {
5503 STRNCPY(data->reader_object_path, data->object_path);
5507 switch (cache_file->
type) {
5546 data->reader_object_path[0] =
'\0';
5560 N_(
"Transform Cache"),
5561 "bTransformCacheConstraint",
5631 CLOG_WARN(&
LOG,
"No valid constraint type-info data available. Type = %i", type);
5661 if (*idpoin && is_reference) {
5680 func(con,
reinterpret_cast<ID **
>(&con->ipo),
false, userdata);
5740 const short type = con->
type;
5770 ListBase single_con = {new_con, new_con};
5824 single_con.
first = new_con;
5825 single_con.
last = new_con;
5881 const char *newName;
5906 newName = (name && name[0]) ? name :
DATA_(cti->
name);
5911 newName = (name && name[0]) ? name :
DATA_(
"Const");
5997 if (pchan ==
nullptr) {
6048 if ((*idpoin) && (is_reference)) {
6057 const bool do_extern)
6094 if (pchan ==
nullptr) {
6120 srccon = srccon->
next, con = con->
next)
6162 if (con_iter == con) {
6166 con_iter->flag &= ~CONSTRAINT_ACTIVE;
6196 if (r_pchan !=
nullptr) {
6202 if (result !=
nullptr) {
6206 if (ob->
pose !=
nullptr) {
6210 if (result !=
nullptr) {
6211 if (r_pchan !=
nullptr) {
6231 if (
ELEM(orig_ob,
nullptr, ob)) {
6238 if (pchan !=
nullptr) {
6241 if (orig_pchan ==
nullptr) {
6261 if (r_orig_ob !=
nullptr) {
6262 *r_orig_ob = orig_ob;
6279 Object *orig_ob =
nullptr;
6282 if (orig_con !=
nullptr) {
6364 ListBase targets = {
nullptr,
nullptr};
6371 cob->
type = ownertype;
6374 switch (ownertype) {
6378 cob->
pchan =
nullptr;
6496 if (cob ==
nullptr) {
6503 ListBase targets = {
nullptr,
nullptr};
6506 if (cti ==
nullptr) {
6517 if (con->enforce == 0.0f) {
6564 float solution[4][4];
6577 if (cti && con->data) {
6582 switch (con->type) {
6634 con->data =
nullptr;
6642 if (con->data ==
nullptr) {
6648 con->flag &= ~CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
6651 switch (con->type) {
6677 con->lin_error = 0.0f;
6678 con->rot_error = 0.0f;
6681 data->
flag &= ~CONSTRAINT_IK_AUTO;
6687 data->reader_object_path[0] =
'\0';
void ABC_get_transform(struct CacheReader *reader, float r_mat_world[4][4], double time, float scale)
Functions and classes to work with Actions.
void BIK_clear_data(struct bPose *pose)
Blender kernel action and pose functionality.
void BKE_pose_free_data(bPose *pose) ATTR_NONNULL(1)
void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, int32_t action_slot_handle, char groupname[], const AnimationEvalContext *anim_eval_context) ATTR_NONNULL(1
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
bPoseChannel * BKE_pose_channel_ensure(bPose *pose, const char *name) ATTR_NONNULL(2)
bool BKE_where_on_path(const struct Object *ob, float ctime, float r_vec[4], float r_dir[3], float r_quat[4], float *r_radius, float *r_weight)
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
void BKE_pchan_bbone_deform_segment_index(const bPoseChannel *pchan, const float *co, int *r_index, float *r_blend_next)
void BKE_armature_mat_bone_to_pose(bPoseChannel *pchan, const float inmat[4][4], float outmat[4][4])
void BKE_pchan_calc_mat(bPoseChannel *pchan)
void BKE_pchan_apply_mat4(bPoseChannel *pchan, const float mat[4][4], bool use_compat)
float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float rad1, float rad2, float rdist)
void BKE_armature_mat_pose_to_bone(bPoseChannel *pchan, const float inmat[4][4], float outmat[4][4])
void BKE_pchan_bbone_deform_clamp_segment_index(const bPoseChannel *pchan, float head_tail, int *r_index, float *r_blend_next)
void free_bvhtree_from_mesh(BVHTreeFromMesh *data)
BVHTree * BKE_bvhtree_from_mesh_get(BVHTreeFromMesh *data, const Mesh *mesh, BVHCacheType bvh_cache_type, int tree_type)
@ BVHTREE_FROM_CORNER_TRIS
bool BKE_cache_file_uses_render_procedural(const CacheFile *cache_file, Scene *scene)
void BKE_cachefile_reader_free(CacheFile *cache_file, CacheReader **reader)
double BKE_cachefile_time_offset(const CacheFile *cache_file, double time, double fps)
void BKE_cachefile_reader_open(CacheFile *cache_file, CacheReader **reader, Object *object, const char *object_path)
Camera data-block and utility functions.
void BKE_camera_params_init(CameraParams *params)
void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob)
void(* ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, bool is_reference, void *userdata)
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
void * CustomData_bmesh_get(const CustomData *data, void *block, eCustomDataType type)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
display list (or rather multi purpose list) stuff.
DispList * BKE_displist_find(struct ListBase *lb, int type)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
void BKE_driver_target_matrix_to_rot_channels(float mat[4][4], int auto_order, int rotation_mode, int channel, bool angles, float r_buf[4])
#define IDP_BlendDataRead(reader, prop)
void IDP_FreeProperty(IDProperty *prop)
IDProperty * IDP_CopyProperty(const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_BlendWrite(BlendWriter *writer, const IDProperty *prop)
void id_lib_extern(ID *id)
@ LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG
@ LIB_ID_CREATE_NO_USER_REFCOUNT
@ IDWALK_DO_DEPRECATED_POINTERS
float BKE_movieclip_remap_scene_to_clip_frame(const struct MovieClip *clip, float framenr)
void BKE_movieclip_get_size(struct MovieClip *clip, const struct MovieClipUser *user, int *r_width, int *r_height)
General operations, lookup, etc. for blender objects.
void BKE_object_where_is_calc_mat4(const Object *ob, float r_obmat[4][4])
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
Mesh * BKE_object_get_evaluated_mesh(const Object *object_eval)
std::optional< blender::Bounds< blender::float3 > > BKE_object_boundbox_get(const Object *ob)
void BKE_object_to_mat4(const Object *ob, float r_mat[4][4])
float BKE_scene_frame_get(const Scene *scene)
bool BKE_shrinkwrap_project_normal(char options, const float vert[3], const float dir[3], float ray_radius, const SpaceTransform *transf, ShrinkwrapTreeData *tree, BVHTreeRayHit *hit)
void BKE_shrinkwrap_free_tree(ShrinkwrapTreeData *data)
void BKE_shrinkwrap_snap_point_to_surface(const ShrinkwrapTreeData *tree, const SpaceTransform *transform, int mode, int hit_idx, const float hit_co[3], const float hit_no[3], float goal_dist, const float point_co[3], float r_point_co[3])
#define NULL_BVHTreeFromMesh
void BKE_shrinkwrap_compute_smooth_normal(const ShrinkwrapTreeData *tree, const SpaceTransform *transform, int tri_idx, const float hit_co[3], const float hit_no[3], float r_no[3])
bool BKE_shrinkwrap_init_tree(ShrinkwrapTreeData *data, Mesh *mesh, int shrinkType, int shrinkMode, bool force_normals)
void BKE_shrinkwrap_find_nearest_surface(ShrinkwrapTreeData *tree, BVHTreeNearest *nearest, float co[3], int type)
struct MovieTrackingObject * BKE_tracking_object_get_camera(const struct MovieTracking *tracking)
void BKE_tracking_get_camera_object_matrix(const struct Object *camera_object, float mat[4][4])
struct MovieTrackingObject * BKE_tracking_object_get_named(struct MovieTracking *tracking, const char *name)
struct MovieTrackingTrack * BKE_tracking_object_find_track_with_name(struct MovieTrackingObject *tracking_object, const char *name)
void BKE_tracking_marker_get_subframe_position(struct MovieTrackingTrack *track, float framenr, float pos[2])
void BKE_tracking_undistort_v2(struct MovieTracking *tracking, int image_width, int image_height, const float co[2], float r_co[2])
void BKE_tracking_camera_get_reconstructed_interpolate(struct MovieTracking *tracking, struct MovieTrackingObject *tracking_object, float framenr, float mat[4][4])
#define BLI_assert_msg(a, msg)
#define BVH_RAYCAST_DIST_MAX
int BLI_bvhtree_ray_cast(const BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
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)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE float clamp_f(float value, float min, float max)
MINLINE float min_ff(float a, float b)
MINLINE float square_f(float a)
MINLINE float pow3f(float x)
MINLINE float interpf(float target, float origin, float t)
float mat4_to_volume_scale(const float mat[4][4])
void BLI_space_transform_from_matrices(struct SpaceTransform *data, const float local[4][4], const float target[4][4])
void interp_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4], float t)
void mul_m3_v3(const float M[3][3], float r[3])
void madd_m4_m4m4fl(float R[4][4], const float A[4][4], const float B[4][4], float f)
void zero_m4(float m[4][4])
void mul_m4_fl(float R[4][4], float f)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void BLI_space_transform_apply(const struct SpaceTransform *data, float co[3])
void unit_m3(float m[3][3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
void unit_m4(float m[4][4])
void loc_rot_size_to_mat4(float R[4][4], const float loc[3], const float rot[3][3], const float size[3])
void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], const float wmat[4][4])
void translate_m4(float mat[4][4], float Tx, float Ty, float Tz)
void normalize_m3(float R[3][3]) ATTR_NONNULL()
void rescale_m4(float mat[4][4], const float scale[3])
void loc_eulO_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3], short order)
void mul_m4_v3(const float M[4][4], float r[3])
void invert_m4_m4_safe(float inverse[4][4], const float mat[4][4])
void orthogonalize_m4_stable(float R[4][4], int axis, bool normalize)
#define mul_m4_series(...)
void scale_m4_fl(float R[4][4], float scale)
void mul_m4_m4m4_split_channels(float R[4][4], const float A[4][4], const float B[4][4])
void normalize_m4_ex(float R[4][4], float r_scale[3]) ATTR_NONNULL()
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool is_negative_m4(const float mat[4][4])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void mul_m4_m4m4_aligned_scale(float R[4][4], const float A[4][4], const float B[4][4])
bool invert_m4(float mat[4][4])
void BLI_space_transform_invert_normal(const struct SpaceTransform *data, float no[3])
void mat4_to_size(float size[3], const float M[4][4])
void transpose_m3(float R[3][3])
void BLI_space_transform_invert(const struct SpaceTransform *data, float co[3])
float determinant_m3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void mul_m4_m3m4(float R[4][4], const float A[3][3], const float B[4][4])
void mul_v3_mat3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void mul_mat3_m4_v3(const float mat[4][4], float r[3])
void normalize_m4(float R[4][4]) ATTR_NONNULL()
void rotate_eulO(float beul[3], short order, char axis, float angle)
void axis_angle_normalized_to_mat3(float R[3][3], const float axis[3], float angle)
void mat4_to_eul(float eul[3], const float mat[4][4])
void quat_to_mat4(float m[4][4], const float q[4])
void dquat_to_mat4(float R[4][4], const DualQuat *dq)
void mat4_to_eulO(float eul[3], short order, const float m[4][4])
void mat4_to_dquat(DualQuat *dq, const float basemat[4][4], const float mat[4][4])
void compatible_eul(float eul[3], const float oldrot[3])
void quat_apply_track(float quat[4], short axis, short upflag)
void eulO_to_mat3(float M[3][3], const float e[3], short order)
void add_weighted_dq_dq_pivot(DualQuat *dq_sum, const DualQuat *dq, const float pivot[3], float weight, bool compute_scale_matrix)
void normalize_dq(DualQuat *dq, float totweight)
void mat3_to_eulO(float eul[3], short order, const float m[3][3])
void mat3_normalized_to_axis_angle(float axis[3], float *angle, const float mat[3][3])
void mat4_to_compatible_eulO(float eul[3], const float oldrot[3], short order, const float mat[4][4])
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_fl(float r[3], float f)
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void cross_v3_v3v3_hi_prec(float r[3], const float a[3], const float b[3])
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 negate_v3_v3(float r[3], const float a[3])
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float normalize_v3(float n[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
#define STRNCPY(dst, src)
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 INIT_MINMAX(min, max)
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_write_float_array(BlendWriter *writer, uint num, const float *data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct(reader, struct_name, ptr_p)
void BPY_pyconstraint_exec(bPythonConstraint *con, bConstraintOb *cob, ListBase *targets)
void BPY_pyconstraint_target(bPythonConstraint *con, bConstraintTarget *ct)
#define CLOG_WARN(clg_ref,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
bool DEG_is_active(const Depsgraph *depsgraph)
float DEG_get_ctime(const Depsgraph *graph)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
ID * DEG_get_original_id(ID *id)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#define ID_IS_LINKED(_id)
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ CACHE_FILE_TYPE_INVALID
struct bStretchToConstraint bStretchToConstraint
@ CONSTRAINT_OVERRIDE_LIBRARY_LOCAL
@ CONSTRAINT_BBONE_SHAPE_FULL
struct bFollowTrackConstraint bFollowTrackConstraint
struct bActionConstraint bActionConstraint
@ CONSTRAINT_TAR_CUSTOM_SPACE
@ CONSTRAINT_TYPE_TRACKTO
@ CONSTRAINT_TYPE_CHILDOF
@ CONSTRAINT_TYPE_TRANSFORM
@ CONSTRAINT_TYPE_FOLLOWTRACK
@ CONSTRAINT_TYPE_OBJECTSOLVER
@ CONSTRAINT_TYPE_ARMATURE
@ CONSTRAINT_TYPE_LOCLIKE
@ CONSTRAINT_TYPE_SHRINKWRAP
@ CONSTRAINT_TYPE_ROTLIMIT
@ CONSTRAINT_TYPE_CAMERASOLVER
@ CONSTRAINT_TYPE_ROTLIKE
@ CONSTRAINT_TYPE_SPLINEIK
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_DISTLIMIT
@ CONSTRAINT_TYPE_TRANSLIKE
@ CONSTRAINT_TYPE_LOCLIMIT
@ CONSTRAINT_TYPE_CLAMPTO
@ CONSTRAINT_TYPE_LOCKTRACK
@ CONSTRAINT_TYPE_SIZELIMIT
@ CONSTRAINT_TYPE_FOLLOWPATH
@ CONSTRAINT_TYPE_STRETCHTO
@ CONSTRAINT_TYPE_SIZELIKE
@ CONSTRAINT_TYPE_SAMEVOL
@ CONSTRAINT_TYPE_DAMPTRACK
@ CONSTRAINT_TYPE_TRANSFORM_CACHE
@ CONSTRAINT_OBTYPE_OBJECT
struct bShrinkwrapConstraint bShrinkwrapConstraint
@ CONSTRAINT_ARMATURE_QUATERNION
@ CONSTRAINT_ARMATURE_ENVELOPE
@ CONSTRAINT_ARMATURE_CUR_LOCATION
struct bLocateLikeConstraint bLocateLikeConstraint
struct bChildOfConstraint bChildOfConstraint
@ CAMERASOLVER_ACTIVECLIP
struct bSplineIKConstraint bSplineIKConstraint
@ FOLLOWTRACK_USE_UNDISTORTION
@ FOLLOWTRACK_USE_3D_POSITION
struct bLockTrackConstraint bLockTrackConstraint
@ ACTCON_BONE_USE_OBJECT_ACTION
struct bTransformConstraint bTransformConstraint
@ LIMIT_ROT_LEGACY_BEHAVIOR
struct bSizeLimitConstraint bSizeLimitConstraint
struct bArmatureConstraint bArmatureConstraint
struct bDistLimitConstraint bDistLimitConstraint
#define CON_SHRINKWRAP_PROJECT_CULL_MASK
struct bMinMaxConstraint bMinMaxConstraint
@ TRANS_MIXSCALE_MULTIPLY
@ CONSTRAINT_SPLINEIK_YS_FIT_CURVE
@ CONSTRAINT_SPACE_CUSTOM
@ CONSTRAINT_SPACE_OWNLOCAL
@ CONSTRAINT_SPACE_PARLOCAL
struct bTrackToConstraint bTrackToConstraint
@ ACTCON_MIX_BEFORE_SPLIT
struct bSizeLikeConstraint bSizeLikeConstraint
struct bClampToConstraint bClampToConstraint
struct bSameVolumeConstraint bSameVolumeConstraint
@ CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE
struct bTransLikeConstraint bTransLikeConstraint
struct bLocLimitConstraint bLocLimitConstraint
@ TRANSLIKE_MIX_AFTER_FULL
@ TRANSLIKE_MIX_BEFORE_SPLIT
@ TRANSLIKE_MIX_BEFORE_FULL
@ TRANSLIKE_MIX_AFTER_SPLIT
struct bRotateLikeConstraint bRotateLikeConstraint
@ OBJECTSOLVER_ACTIVECLIP
@ OBJECTSOLVER_SET_INVERSE
@ CON_SHRINKWRAP_PROJECT_INVERT_CULL
@ CON_SHRINKWRAP_PROJECT_OPPOSITE
@ CON_SHRINKWRAP_TRACK_NORMAL
struct bTransformCacheConstraint bTransformCacheConstraint
@ PIVOTCON_FLAG_OFFSET_ABS
@ TRANSLIKE_REMOVE_TARGET_SHEAR
@ STRETCHTOCON_USE_BULGE_MAX
@ STRETCHTOCON_USE_BULGE_MIN
struct bObjectSolverConstraint bObjectSolverConstraint
struct bKinematicConstraint bKinematicConstraint
struct bRotLimitConstraint bRotLimitConstraint
struct bPythonConstraint bPythonConstraint
struct bFollowPathConstraint bFollowPathConstraint
struct bCameraSolverConstraint bCameraSolverConstraint
struct bPivotConstraint bPivotConstraint
struct bDampTrackConstraint bDampTrackConstraint
@ FOLLOWTRACK_FRAME_STRETCH
@ MOD_SHRINKWRAP_TARGET_PROJECT
@ MOD_SHRINKWRAP_NEAREST_VERTEX
@ MOD_SHRINKWRAP_NEAREST_SURFACE
Object is a sort of wrapper for general info.
@ UI_PANEL_DATA_EXPAND_ROOT
@ UI_SUBPANEL_DATA_EXPAND_2
@ UI_SUBPANEL_DATA_EXPAND_1
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Read Guarded memory(de)allocation.
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
btVector3 orth(const btVector3 &v)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint ** constraints
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
local_group_size(16, 16) .push_constant(Type b
static void followpath_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *, bConstraintTarget *ct, float)
static void add_new_constraint_to_list(Object *ob, bPoseChannel *pchan, bConstraint *con)
static void minmax_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void minmax_new_data(void *cdata)
static bConstraint * constraint_find_original_for_update(bConstraintOb *cob, bConstraint *con)
static void stretchto_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void minmax_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void followtrack_fit_frame(FollowTrackContext *context, const int clip_width, const int clip_height, float marker_position[2])
static void samevolume_new_data(void *cdata)
bool BKE_constraint_apply_and_remove_for_pose(Depsgraph *depsgraph, Scene *scene, ListBase *constraints, Object *ob, bConstraint *con, bPoseChannel *pchan)
static float followtrack_distance_from_viewplane_get(FollowTrackContext *context, bConstraintOb *cob)
void BKE_constraint_targets_for_solving_get(Depsgraph *depsgraph, bConstraint *con, bConstraintOb *cob, ListBase *targets, float ctime)
static void pycon_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void damptrack_do_transform(float matrix[4][4], const float tarvec[3], int track_axis)
static int kinematic_get_tars(bConstraint *con, ListBase *list)
static bConstraintTypeInfo CTI_TRANSFORM_CACHE
static void camerasolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *)
static void stretchto_new_data(void *cdata)
bool BKE_constraint_is_nonlocal_in_liboverride(const Object *ob, const bConstraint *con)
void BKE_constraints_copy(ListBase *dst, const ListBase *src, bool do_extern)
static bConstraintTypeInfo CTI_ROTLIKE
bool BKE_constraint_target_uses_bbone(bConstraint *con, bConstraintTarget *ct)
static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void sizelike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void transformcache_new_data(void *cdata)
static int followpath_get_tars(bConstraint *con, ListBase *list)
static void kinematic_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void loclike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *)
static bConstraintTypeInfo CTI_ROTLIMIT
static void followtrack_evaluate_using_3d_position_object(FollowTrackContext *context, bConstraintOb *cob)
static void sizelike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static int loclike_get_tars(bConstraint *con, ListBase *list)
static void transform_new_data(void *cdata)
static void armdef_accumulate_bone(const bConstraintTarget *ct, const bPoseChannel *pchan, const float wco[3], const bool force_envelope, float *r_totweight, float r_sum_mat[4][4], DualQuat *r_sum_dq)
static void transformcache_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void rotlike_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void translike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void transformcache_copy(bConstraint *con, bConstraint *srccon)
bConstraint * BKE_constraint_copy_for_object(Object *ob, bConstraint *src)
static int minmax_get_tars(bConstraint *con, ListBase *list)
static void followpath_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void followtrack_evaluate_using_3d_position_camera(FollowTrackContext *context, bConstraintOb *cob)
static bConstraintTypeInfo CTI_STRETCHTO
bConstraint * BKE_constraint_copy_for_pose(Object *ob, bPoseChannel *pchan, bConstraint *src)
static bConstraint * constraint_list_find_from_target(ListBase *constraints, bConstraintTarget *tgt)
static void objectsolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *)
static bConstraintTypeInfo CTI_TRANSFORM
static void vectomat(const float vec[3], const float target_up[3], short axis, short upflag, short flags, float m[3][3])
static bConstraintTypeInfo CTI_DAMPTRACK
static int pycon_get_tars(bConstraint *con, ListBase *list)
static int stretchto_get_tars(bConstraint *con, ListBase *list)
static void rotlike_new_data(void *cdata)
static void clampto_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, bConstraintTarget *ct, float)
static void followtrack_evaluate_using_3d_position(FollowTrackContext *context, bConstraintOb *cob)
static void childof_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void followpath_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void con_extern_cb(bConstraint *, ID **idpoin, bool, void *)
static bool is_custom_space_needed(bConstraint *con)
static bConstraintTypeInfo CTI_CLAMPTO
static void pivotcon_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static bConstraintTypeInfo CTI_SAMEVOL
static void sizelimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *)
static void splineik_copy(bConstraint *con, bConstraint *srccon)
static void armdef_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, bConstraintTarget *ct, float)
static int damptrack_get_tars(bConstraint *con, ListBase *list)
static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static int basis_cross(int n, int m)
static bConstraintTypeInfo CTI_TRACKTO
static void childof_new_data(void *cdata)
void BKE_constraint_free_data_ex(bConstraint *con, bool do_id_user)
static bConstraintTypeInfo CTI_KINEMATIC
static int splineik_get_tars(bConstraint *con, ListBase *list)
static void samevolume_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *)
static void actcon_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void distlimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void default_get_tarmat_full_bbone(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
void BKE_constraint_unique_name(bConstraint *con, ListBase *list)
static bConstraintTypeInfo CTI_TRANSLIKE
static bConstraintTypeInfo CTI_FOLLOWPATH
static void shrinkwrap_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void loclimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *)
void BKE_constraints_active_set(ListBase *list, bConstraint *con)
static bConstraintTypeInfo CTI_SIZELIKE
static void shrinkwrap_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
bool BKE_constraint_apply_and_remove_for_object(Depsgraph *depsgraph, Scene *scene, ListBase *constraints, Object *ob, bConstraint *con)
static void actcon_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void splineik_new_data(void *cdata)
void BKE_constraints_clear_evalob(bConstraintOb *cob)
static void actcon_get_tarmat(Depsgraph *depsgraph, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
static void pycon_new_data(void *cdata)
static MovieClip * followtrack_tracking_clip_get(bConstraint *con, bConstraintOb *cob)
static void locktrack_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void transform_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static bConstraintTypeInfo CTI_CHILDOF
static void armdef_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void actcon_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void followpath_new_data(void *cdata)
static void pycon_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void transform_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void camerasolver_new_data(void *cdata)
static int translike_get_tars(bConstraint *con, ListBase *list)
static bConstraintTypeInfo CTI_SIZELIMIT
static void armdef_accumulate_matrix(const float obmat[4][4], const float iobmat[4][4], const float basemat[4][4], const float bonemat[4][4], const float pivot[3], const float weight, float r_sum_mat[4][4], DualQuat *r_sum_dq)
void BKE_constraint_target_matrix_get(Depsgraph *depsgraph, Scene *scene, bConstraint *con, int index, short ownertype, void *ownerdata, float mat[4][4], float ctime)
static void clampto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static bConstraintTypeInfo CTI_DISTLIMIT
static bConstraint * add_new_constraint(Object *ob, bPoseChannel *pchan, const char *name, short type)
static bConstraintTypeInfo CTI_CAMERASOLVER
static bConstraintTypeInfo CTI_LOCLIKE
static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void trackto_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void objectsolver_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static bConstraintTypeInfo CTI_LOCLIMIT
void BKE_constraints_solve(Depsgraph *depsgraph, ListBase *conlist, bConstraintOb *cob, float ctime)
static void trackto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void camerasolver_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void armdef_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
bConstraint * BKE_constraints_find_name(ListBase *list, const char *name)
static void followtrack_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static bConstraint * add_new_constraint_internal(const char *name, short type)
static void loclike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void constraint_copy_data_ex(bConstraint *dst, bConstraint *src, const int flag, const bool do_extern)
static bool followtrack_context_init(FollowTrackContext *context, bConstraint *con, bConstraintOb *cob)
void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, bConstraintOb *cob, float mat[4][4], short from, short to, const bool keep_scale)
bConstraint * BKE_constraint_duplicate_ex(bConstraint *src, const int flag, const bool do_extern)
static void con_unlink_refs_cb(bConstraint *, ID **idpoin, bool is_reference, void *)
static void loclike_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static int childof_get_tars(bConstraint *con, ListBase *list)
void BKE_constraint_panel_expand(bConstraint *con)
static void splineik_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, bConstraintTarget *ct, float)
static int actcon_get_tars(bConstraint *con, ListBase *list)
static void shrinkwrap_new_data(void *cdata)
static void objectsolver_new_data(void *cdata)
static void con_fix_copied_refs_cb(bConstraint *, ID **idpoin, bool is_reference, void *)
static void contarget_get_mesh_mat(Object *ob, const char *substring, float mat[4][4])
static void splineik_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void distlimit_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void rotlike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static bConstraintTypeInfo CTI_FOLLOWTRACK
static void armdef_copy(bConstraint *con, bConstraint *srccon)
static bConstraintTypeInfo CTI_SHRINKWRAP
static void kinematic_new_data(void *cdata)
static bConstraintTypeInfo CTI_ARMATURE
static void sizelike_new_data(void *cdata)
void BKE_constraints_copy_ex(ListBase *dst, const ListBase *src, const int flag, bool do_extern)
static void childof_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
bool BKE_constraint_apply_for_pose(Depsgraph *depsgraph, Scene *scene, Object *ob, bPoseChannel *pchan, bConstraint *con)
static int sizelike_get_tars(bConstraint *con, ListBase *list)
static void stretchto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
bConstraint * BKE_constraint_add_for_pose(Object *ob, bPoseChannel *pchan, const char *name, short type)
void BKE_constraints_free_ex(ListBase *list, bool do_id_user)
static int rotlike_get_tars(bConstraint *con, ListBase *list)
static void translike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
bool BKE_constraint_remove(ListBase *list, bConstraint *con)
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(bConstraint *con)
static void constraints_init_typeinfo()
static void pycon_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
static void translike_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void rotlike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void followpath_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void pycon_copy(bConstraint *con, bConstraint *srccon)
static void transformcache_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void locktrack_new_data(void *cdata)
static int locktrack_get_tars(bConstraint *con, ListBase *list)
static void shrinkwrap_evaluate(bConstraint *, bConstraintOb *cob, ListBase *targets)
static void kinematic_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
static void shrinkwrap_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
#define SINGLETARGETNS_GET_TARS(con, datatar, ct, list)
static float clamp_angle(const float angle, const float min, const float max)
void BKE_constraint_custom_object_space_init(bConstraintOb *cob, bConstraint *con)
static int distlimit_get_tars(bConstraint *con, ListBase *list)
static bConstraintTypeInfo CTI_SPLINEIK
static void splineik_free(bConstraint *con)
static int pivotcon_get_tars(bConstraint *con, ListBase *list)
static void trackto_new_data(void *cdata)
void BKE_constraints_id_loop(ListBase *conlist, ConstraintIDFunc func, const int flag, void *userdata)
static void followtrack_undistort_if_needed(FollowTrackContext *context, const int clip_width, const int clip_height, float marker_position[2])
bool BKE_constraint_remove_ex(ListBase *list, Object *ob, bConstraint *con)
bConstraint * BKE_constraints_active_get(ListBase *list)
void BKE_constraint_targets_flush(bConstraint *con, ListBase *targets, bool no_copy)
static float wrap_rad_angle(const float angle)
static void damptrack_new_data(void *cdata)
static void damptrack_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
bConstraintOb * BKE_constraints_make_evalob(Depsgraph *depsgraph, Scene *scene, Object *ob, void *subdata, short datatype)
static Object * followtrack_camera_object_get(bConstraint *con, bConstraintOb *cob)
static void trackto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void damptrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static void followtrack_evaluate_using_2d_position(FollowTrackContext *context, bConstraintOb *cob)
static void constraint_target_to_mat4(Object *ob, const char *substring, bConstraintOb *cob, float mat[4][4], short from, short to, short flag, float headtail)
static void contarget_get_lattice_mat(Object *ob, const char *substring, float mat[4][4])
static bConstraintTypeInfo CTI_MINMAX
static int shrinkwrap_get_tars(bConstraint *con, ListBase *list)
void BKE_constraints_free(ListBase *list)
static void pivotcon_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static bConstraint * constraint_find_original(Object *ob, bPoseChannel *pchan, bConstraint *con, Object **r_orig_ob)
static bConstraintTypeInfo * constraintsTypeInfo[NUM_CONSTRAINT_TYPES]
static void sizelike_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static int armdef_get_tars(bConstraint *con, ListBase *list)
static void pycon_free(bConstraint *con)
static void followtrack_project_to_depth_object_if_needed(FollowTrackContext *context, bConstraintOb *cob)
static void transformcache_free(bConstraint *con)
static void pivotcon_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static MovieTrackingObject * followtrack_tracking_object_get(bConstraint *con, bConstraintOb *cob)
static const float track_dir_vecs[6][3]
static int trackto_get_tars(bConstraint *con, ListBase *list)
#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, no_copy)
static void locktrack_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
int BKE_constraint_targets_get(bConstraint *con, ListBase *r_targets)
static void splineik_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void minmax_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
void BKE_constraint_free_data(bConstraint *con)
const bConstraintTypeInfo * BKE_constraint_typeinfo_from_type(int type)
bConstraint * BKE_constraint_find_from_target(Object *ob, bConstraintTarget *tgt, bPoseChannel **r_pchan)
#define VALID_CONS_TARGET(ct)
static void actcon_new_data(void *cdata)
static void loclike_new_data(void *cdata)
bConstraint * BKE_constraint_add_for_object(Object *ob, const char *name, short type)
static void armdef_free(bConstraint *con)
static void damptrack_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void con_invoke_id_looper(const bConstraintTypeInfo *cti, bConstraint *con, ConstraintIDFunc func, const int flag, void *userdata)
#define SINGLETARGET_GET_TARS(con, datatar, datasubtarget, ct, list)
static bConstraintTypeInfo CTI_LOCKTRACK
void BKE_constraint_blend_write(BlendWriter *writer, ListBase *conlist)
static int transform_get_tars(bConstraint *con, ListBase *list)
void BKE_constraint_blend_read_data(BlendDataReader *reader, ID *id_owner, ListBase *lb)
static bConstraintTypeInfo CTI_OBJECTSOLVER
static bConstraintTypeInfo CTI_PIVOT
bool BKE_constraint_apply_for_object(Depsgraph *depsgraph, Scene *scene, Object *ob, bConstraint *con)
static bConstraintTypeInfo CTI_PYTHON
static bConstraintTypeInfo CTI_ACTION
static int clampto_get_tars(bConstraint *con, ListBase *list)
static void rotlimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *)
static void kinematic_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void distlimit_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
static void clampto_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void followtrack_new_data(void *cdata)
#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, no_copy)
static void childof_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void distlimit_new_data(void *cdata)
static void default_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
static void transform_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
const Depsgraph * depsgraph
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_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_dupallocN)(const void *vmemh)
void USD_get_transform(CacheReader *reader, float r_mat_world[4][4], float time, float scale)
BVHTree_RayCastCallback raycast_callback
MovieTrackingObject * tracking_object
MovieTrackingTrack * track
struct MDeformVert * dvert
ObjectRuntimeHandle * runtime
int32_t action_slot_handle
char action_slot_name[66]
float space_obj_world_matrix[4][4]
struct bPoseChannel * pchan
struct Depsgraph * depsgraph
void(* id_looper)(struct bConstraint *con, ConstraintIDFunc func, void *userdata)
int(* get_constraint_targets)(struct bConstraint *con, struct ListBase *list)
void(* evaluate_constraint)(struct bConstraint *con, struct bConstraintOb *cob, struct ListBase *targets)
void(* flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, bool no_copy)
void(* copy_data)(struct bConstraint *con, struct bConstraint *src)
void(* get_target_matrix)(struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime)
void(* free_data)(struct bConstraint *con)
void(* new_data)(void *cdata)
struct Object * space_object
struct bConstraint * prev
struct bConstraint * next
struct Mat4 * bbone_deform_mats
struct Mat4 * bbone_pose_mats
struct Mat4 * bbone_rest_mats
struct bPoseChannel_Runtime runtime
struct bPoseChannel * orig_pchan