10#define DNA_DEPRECATED_ALLOW
76#include "RNA_prototypes.hh"
101#define VALID_CONS_TARGET(ct) ((ct) && (ct->tar))
146 cob->
type = datatype;
175 cob->
type = datatype;
207 float delta[4][4], imat[4][4];
210 if (cob ==
nullptr) {
260 const bool keep_scale)
262 float diff_mat[4][4];
266 if (ob ==
nullptr || mat ==
nullptr) {
332 mul_m4_m4m4(mat, ob->object_to_world().ptr(), mat);
527 float imat[3][3], tmat[3][3];
534 if (defgroup == -1) {
538 float vec[3] = {0.0f, 0.0f, 0.0f};
539 float normal[3] = {0.0f, 0.0f, 0.0f};
540 float weightsum = 0.0f;
551 if (dw && dw->
weight > 0.0f) {
559 else if (mesh_eval) {
573 if (dw && dw->
weight > 0.0f) {
597 copy_m3_m4(imat, ob->object_to_world().ptr());
618 mul_v3_m4v3(mat[3], ob->object_to_world().ptr(), vec);
629 const float *co = dl ? dl->
verts :
nullptr;
634 float vec[3] = {0.0f, 0.0f, 0.0f}, tvec[3];
643 if (defgroup == -1) {
653 for (
i = 0;
i < tot_verts;
i++, dv++) {
656 if (dw && dw->
weight > 0.0f) {
658 memcpy(tvec, co ? co : bp->
vec,
sizeof(
float[3]));
679 mul_v3_m4v3(tvec, ob->object_to_world().ptr(), vec);
688 const char *substring,
697 if (substring[0] ==
'\0') {
731 if (headtail < 0.000001f && !(is_bbone && full_bbone)) {
747 interp_m4_m4m4(tempmat, bbone[index].mat, bbone[index + 1].mat, fac);
753 interp_v3_v3v3(loc, bbone[index].mat[3], bbone[index + 1].mat[3], fac);
759 mul_m4_m4m4(mat, ob->object_to_world().ptr(), tempmat);
762 float tempmat[4][4], loc[3];
771 mul_m4_m4m4(mat, ob->object_to_world().ptr(), tempmat);
802 CONSTRAINT_TYPE_CONSTRNAME,
803 sizeof(bConstrNameConstraint),
805 "bConstrNameConstraint",
807 constrname_id_looper,
811 constrname_flush_tars,
812 constrname_get_tarmat,
881#define SINGLETARGET_GET_TARS(con, datatar, datasubtarget, ct, list) \
883 ct = MEM_callocN<bConstraintTarget>("tempConstraintTarget"); \
886 STRNCPY(ct->subtarget, datasubtarget); \
887 ct->space = con->tarspace; \
888 ct->flag = CONSTRAINT_TAR_TEMP; \
891 if ((ct->tar->type == OB_ARMATURE) && (ct->subtarget[0])) { \
892 bPoseChannel *pchan = BKE_pose_channel_find_name(ct->tar->pose, ct->subtarget); \
893 ct->type = CONSTRAINT_OBTYPE_BONE; \
894 ct->rotOrder = (pchan) ? (pchan->rotmode) : int(EULER_ORDER_DEFAULT); \
896 else if (OB_TYPE_SUPPORT_VGROUP(ct->tar->type) && (ct->subtarget[0])) { \
897 ct->type = CONSTRAINT_OBTYPE_VERT; \
898 ct->rotOrder = EULER_ORDER_DEFAULT; \
901 ct->type = CONSTRAINT_OBTYPE_OBJECT; \
902 ct->rotOrder = ct->tar->rotmode; \
906 BLI_addtail(list, ct); \
916#define SINGLETARGETNS_GET_TARS(con, datatar, ct, list) \
918 ct = MEM_callocN<bConstraintTarget>("tempConstraintTarget"); \
921 ct->space = con->tarspace; \
922 ct->flag = CONSTRAINT_TAR_TEMP; \
925 ct->type = CONSTRAINT_OBTYPE_OBJECT; \
927 BLI_addtail(list, ct); \
937#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, no_copy) \
940 bConstraintTarget *ctn = ct->next; \
941 if (no_copy == 0) { \
943 STRNCPY(datasubtarget, ct->subtarget); \
944 con->tarspace = char(ct->space); \
947 BLI_freelinkN(list, ct); \
959#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, no_copy) \
962 bConstraintTarget *ctn = ct->next; \
963 if (no_copy == 0) { \
965 con->tarspace = char(ct->space); \
968 BLI_freelinkN(list, ct); \
996 func(con, (
ID **)&
data->tar,
false, userdata);
1047 float inverse_matrix[4][4];
1055 float loc[3], eul[3],
size[3];
1056 float loco[3], eulo[3], sizeo[3];
1069 loc[0] = loco[0] = 0.0f;
1072 loc[1] = loco[1] = 0.0f;
1075 loc[2] = loco[2] = 0.0f;
1078 eul[0] = eulo[0] = 0.0f;
1081 eul[1] = eulo[1] = 0.0f;
1084 eul[2] = eulo[2] = 0.0f;
1087 size[0] = sizeo[0] = 1.0f;
1090 size[1] = sizeo[1] = 1.0f;
1093 size[2] = sizeo[2] = 1.0f;
1104 if (cob->
pchan !=
nullptr) {
1115 if (orig_con !=
nullptr) {
1126 float orig_cob_matrix[4][4];
1134 cob->
matrix[3][0] = orig_cob_matrix[3][0];
1137 cob->
matrix[3][1] = orig_cob_matrix[3][1];
1140 cob->
matrix[3][2] = orig_cob_matrix[3][2];
1150 "bChildOfConstraint",
1176 func(con, (
ID **)&
data->tar,
false, userdata);
1222 const float target_up[3],
1277 if (axis != upflag) {
1278 right_index = 3 - axis - upflag;
1282 m[right_index][0] = neg * right[0];
1283 m[right_index][1] = neg * right[1];
1284 m[right_index][2] = neg * right[2];
1302 float size[3], vec[3];
1325 std::clamp<short>(
data->reserved1, 0, 5),
1326 std::clamp<short>(
data->reserved2, 0, 2),
1338 "bTrackToConstraint",
1355 data->weight = 1.0f;
1356 data->orientweight = 1.0f;
1357 data->iterations = 500;
1367 func(con, (
ID **)&
data->tar,
false, userdata);
1370 func(con, (
ID **)&
data->poletar,
false, userdata);
1430 if (ob ==
nullptr) {
1448 "bKinematicConstraint",
1468 data->followflag = 0;
1476 func(con, (
ID **)&
data->tar,
false, userdata);
1519 float vec[4], radius;
1528 if (ct->
tar->
runtime->curve_cache ==
nullptr ||
1529 ct->
tar->
runtime->curve_cache->anim_path_accum_length ==
nullptr)
1537 curvetime =
data->offset_fac;
1554 CLAMP(curvetime, 0.0f, 1.0f);
1574 quat, std::clamp<short>(
data->trackflag, 0, 5), std::clamp<short>(
data->upflag, 0, 2));
1579 float tmat[4][4], rmat[4][4];
1635 "bFollowPathConstraint",
1675 N_(
"Limit Location"),
1676 "bLocLimitConstraint",
1695 return ((
b - std::floor(
b)) - 0.5) * (2.0 *
M_PI);
1730 if (min_wrapped < max_wrapped) {
1731 return angle + std::clamp(0.0f, min_wrapped, max_wrapped);
1736 if (max_wrapped >= 0.0 || min_wrapped <= 0.0) {
1741 if (std::fabs(max_wrapped) < std::fabs(min_wrapped)) {
1742 return angle + max_wrapped;
1744 return angle + min_wrapped;
1768 rot_order =
data->euler_order;
1822 N_(
"Limit Rotation"),
1823 "bRotLimitConstraint",
1839 float obsize[3],
size[3];
1879 "bSizeLimitConstraint",
1904 func(con, (
ID **)&
data->tar,
false, userdata);
1939 float offset[3] = {0.0f, 0.0f, 0.0f};
1951 cob->
matrix[3][0] += offset[0];
1959 cob->
matrix[3][1] += offset[1];
1967 cob->
matrix[3][2] += offset[2];
1975 N_(
"Copy Location"),
1976 "bLocateLikeConstraint",
2001 func(con, (
ID **)&
data->tar,
false, userdata);
2036 float loc[3],
size[3], oldrot[3][3], newrot[3][3];
2037 float eul[3], obeul[3], defeul[3];
2045 rot_order =
data->euler_order;
2061 bool legacy_offset =
false;
2063 switch (
data->mix_mode) {
2065 legacy_offset =
true;
2081 if (legacy_offset) {
2094 if (legacy_offset) {
2107 if (legacy_offset) {
2127 switch (
data->mix_mode) {
2152 N_(
"Copy Rotation"),
2153 "bRotateLikeConstraint",
2179 func(con, (
ID **)&
data->tar,
false, userdata);
2214 float obsize[3],
size[3];
2224 if ((
data->flag & all_axes) == all_axes) {
2249 for (
int i = 0;
i < 3;
i++) {
2283 "bSizeLikeConstraint",
2301 func(con, (
ID **)&
data->tar,
false, userdata);
2336 float target_mat[4][4];
2347 switch (
data->mix_mode) {
2388 N_(
"Copy Transforms"),
2389 "bTransLikeConstraint",
2407 data->volume = 1.0f;
2414 float volume =
data->volume;
2415 float fac = 1.0f, total_scale = 1.0f;
2421 switch (
data->mode) {
2423 total_scale = obsize[0] * obsize[1] * obsize[2];
2426 total_scale =
pow3f(obsize[
data->free_axis]);
2429 total_scale = obsize[
data->free_axis];
2433 if (total_scale != 0) {
2434 fac =
sqrtf(volume / total_scale);
2438 switch (
data->free_axis) {
2457 N_(
"Maintain Volume"),
2458 "bSameVolumeConstraint",
2492 *list =
data->targets;
2506 func(con, (
ID **)&ct->tar,
false, userdata);
2523 if (pchan ==
nullptr) {
2533 const float iobmat[4][4],
2534 const float basemat[4][4],
2535 const float bonemat[4][4],
2536 const float pivot[3],
2538 float r_sum_mat[4][4],
2541 if (weight == 0.0f) {
2550 if (r_sum_dq !=
nullptr) {
2551 float basemat_world[4][4];
2570 const bool force_envelope,
2572 float r_sum_mat[4][4],
2575 float iobmat[4][4], co[3];
2577 float weight = ct->
weight;
2593 float basemat[4][4];
2600 if (r_sum_dq !=
nullptr) {
2608 b_bone_mats[index + 1].
mat,
2610 weight * (1.0f -
blend),
2614 if (r_sum_dq !=
nullptr) {
2622 b_bone_mats[index + 2].
mat,
2641 *r_totweight += weight;
2649 float sum_mat[4][4] = {};
2651 float weight = 0.0f;
2661 mul_m4_v3(cob->
ob->object_to_world().ptr(), input_co);
2670 if (ct->weight <= 0.0f) {
2681 if (pchan ==
nullptr || pchan->
bone ==
nullptr) {
2689 if (weight > 0.0f) {
2690 if (pdq !=
nullptr) {
2707 "bArmatureConstraint",
2736 func(con, (
ID **)&
data->tar,
false, userdata);
2739 func(con, (
ID **)&
data->act,
true, userdata);
2790 float tempmat[4][4], vec[3];
2795 if (use_eval_time) {
2796 s =
data->eval_time;
2815 if (
data->type < 10) {
2821 else if (
data->type < 20) {
2824 axis =
data->type - 10;
2829 axis =
data->type - 20;
2838 const float range =
data->max -
data->min;
2839 if ((range == 0.0f) || (
ushort(axis) > 2)) {
2843 s = (vec[axis] -
data->min) / range;
2852 printf(
"do Action Constraint %s - Ob %s Pchan %s\n",
2868 data->action_slot_handle,
2870 &anim_eval_context);
2875 bPose pose = {{
nullptr}};
2891 data->action_slot_handle,
2893 &anim_eval_context);
2904 puts(
"Error: unknown owner type for Action Constraint");
2917 switch (
data->mix_mode) {
2960 "bActionConstraint",
2986 func(con, (
ID **)&
data->tar,
false, userdata);
3021 float vec[3], vec2[3];
3029 switch (
data->lockflag) {
3032 switch (
data->trackflag) {
3100 switch (
data->trackflag) {
3168 switch (
data->trackflag) {
3244 totmat[0][0] = tmpmat[0][0];
3245 totmat[0][1] = tmpmat[0][1];
3246 totmat[0][2] = tmpmat[0][2];
3247 totmat[1][0] = tmpmat[1][0];
3248 totmat[1][1] = tmpmat[1][1];
3249 totmat[1][2] = tmpmat[1][2];
3250 totmat[2][0] = tmpmat[2][0];
3251 totmat[2][1] = tmpmat[2][1];
3252 totmat[2][2] = tmpmat[2][2];
3276 "bLockTrackConstraint",
3301 func(con, (
ID **)&
data->tar,
false, userdata);
3337 float dvec[3], dist, sfac = 1.0f;
3338 short clamp_surf = 0;
3344 if (
data->dist == 0) {
3350 if (orig_con !=
nullptr) {
3360 if (dist <= data->dist) {
3363 sfac =
data->dist / dist;
3368 if (dist <= (
data->dist +
data->soft)) {
3375 if (dist >=
data->dist) {
3378 sfac =
data->dist / dist;
3384 if (dist >= (
data->dist -
data->soft)) {
3398 sfac =
data->dist / dist;
3417 N_(
"Limit Distance"),
3418 "bDistLimitConstraint",
3437 data->orglength = 0.0;
3439 data->bulge_max = 1.0f;
3440 data->bulge_min = 1.0f;
3448 func(con, (
ID **)&
data->tar,
false, userdata);
3484 float size[3], scale[3], vec[3], xx[3], zz[3],
orth[3];
3512 if (
data->orglength == 0) {
3513 data->orglength = dist;
3518 if (orig_con !=
nullptr) {
3525 scale[1] = dist /
data->orglength;
3531 float bulge_max =
max_ff(
data->bulge_max, 1.0f);
3532 float hard =
min_ff(bulge, bulge_max);
3534 float range = bulge_max - 1.0f;
3535 float scale_fac = (range > 0.0f) ? 1.0f / range : 0.0f;
3536 float soft = 1.0f + range *
atanf((bulge - 1.0f) * scale_fac) / float(
M_PI_2);
3543 float bulge_min = std::clamp(
data->bulge_min, 0.0f, 1.0f);
3544 float hard =
max_ff(bulge, bulge_min);
3546 float range = 1.0f - bulge_min;
3547 float scale_fac = (range > 0.0f) ? 1.0f / range : 0.0f;
3548 float soft = 1.0f - range *
atanf((1.0f - bulge) * scale_fac) / float(
M_PI_2);
3554 switch (
data->volmode) {
3557 scale[0] =
sqrtf(bulge);
3558 scale[2] = scale[0];
3580 switch (
data->plane) {
3627 "bStretchToConstraint",
3645 data->offset = 0.0f;
3654 func(con, (
ID **)&
data->tar,
false, userdata);
3690 float obmat[4][4], imat[4][4], tarmat[4][4], tmat[4][4];
3705 switch (
data->minmaxflag) {
3707 val1 = tarmat[3][2];
3708 val2 = obmat[3][2] -
data->offset;
3712 val1 = tarmat[3][1];
3713 val2 = obmat[3][1] -
data->offset;
3717 val1 = tarmat[3][0];
3718 val2 = obmat[3][0] -
data->offset;
3722 val2 = tarmat[3][2];
3723 val1 = obmat[3][2] -
data->offset;
3727 val2 = tarmat[3][1];
3728 val1 = obmat[3][1] -
data->offset;
3732 val2 = tarmat[3][0];
3733 val1 = obmat[3][0] -
data->offset;
3741 obmat[3][index] = tarmat[3][index] +
data->offset;
3758 "bMinMaxConstraint",
3776 func(con, (
ID **)&
data->tar,
false, userdata);
3826 float obmat[4][4], ownLoc[3];
3827 float curveMin[3], curveMax[3];
3828 float targetMatrix[4][4];
3841 if (
data->tar->runtime->curve_cache &&
data->tar->runtime->curve_cache->anim_path_accum_length)
3843 float vec[4], totmat[4][4];
3868 clamp_axis =
data->flag - 1;
3874 float len = (curveMax[clamp_axis] - curveMin[clamp_axis]);
3880 if (ownLoc[clamp_axis] < curveMin[clamp_axis]) {
3882 offset = curveMin[clamp_axis] -
3883 ceilf((curveMin[clamp_axis] - ownLoc[clamp_axis]) /
len) *
len;
3887 curvetime = (ownLoc[clamp_axis] - offset) / (
len);
3889 else if (ownLoc[clamp_axis] > curveMax[clamp_axis]) {
3891 offset = curveMax[clamp_axis] +
3892 int((ownLoc[clamp_axis] - curveMax[clamp_axis]) /
len) *
len;
3896 curvetime = (ownLoc[clamp_axis] - offset) / (
len);
3900 curvetime = (ownLoc[clamp_axis] - curveMin[clamp_axis]) / (
len);
3910 if (ownLoc[clamp_axis] <= curveMin[clamp_axis]) {
3913 else if (ownLoc[clamp_axis] >= curveMax[clamp_axis]) {
3916 else if (
IS_EQF((curveMax[clamp_axis] - curveMin[clamp_axis]), 0.0f) ==
false) {
3917 curvetime = (ownLoc[clamp_axis] - curveMin[clamp_axis]) /
3918 (curveMax[clamp_axis] - curveMin[clamp_axis]);
3930 mul_m4_m4m4(targetMatrix, ct->
tar->object_to_world().ptr(), totmat);
3943 "bClampToConstraint",
3964 for (
int i = 0;
i < 3;
i++) {
3965 data->from_min_scale[
i] =
data->from_max_scale[
i] = 1.0f;
3966 data->to_min_scale[
i] =
data->to_max_scale[
i] = 1.0f;
3975 func(con, (
ID **)&
data->tar,
false, userdata);
4011 float *from_min, *from_max, *to_min, *to_max;
4012 float loc[3],
rot[3][3], oldeul[3],
size[3];
4013 float newloc[3], newrot[3][3], neweul[3], newsize[3];
4014 float dbuf[4], sval[3];
4015 float *
const dvec = dbuf + 1;
4018 switch (
data->from) {
4029 from_min =
data->from_min_scale;
4030 from_max =
data->from_max_scale;
4035 from_min =
data->from_min_rot;
4036 from_max =
data->from_max_rot;
4041 from_min =
data->from_min;
4042 from_max =
data->from_max;
4050 rot_order =
data->to_euler_order;
4058 for (
int i = 0;
i < 3;
i++) {
4059 if (from_max[
i] - from_min[
i]) {
4060 sval[
i] = (dvec[
i] - from_min[
i]) / (from_max[
i] - from_min[
i]);
4069 for (
int i = 0;
i < 3;
i++) {
4070 CLAMP(dvec[
i], from_min[
i], from_max[
i]);
4071 if (from_max[
i] - from_min[
i]) {
4072 sval[
i] = (dvec[
i] - from_min[
i]) / (from_max[
i] - from_min[
i]);
4083 to_min =
data->to_min_scale;
4084 to_max =
data->to_max_scale;
4085 for (
int i = 0;
i < 3;
i++) {
4086 newsize[
i] = to_min[
i] + (sval[int(
data->map[
i])] * (to_max[
i] - to_min[
i]));
4088 switch (
data->mix_mode_scale) {
4099 to_min =
data->to_min_rot;
4100 to_max =
data->to_max_rot;
4101 for (
int i = 0;
i < 3;
i++) {
4102 neweul[
i] = to_min[
i] + (sval[int(
data->map[
i])] * (to_max[
i] - to_min[
i]));
4104 switch (
data->mix_mode_rot) {
4126 to_min =
data->to_min;
4127 to_max =
data->to_max;
4128 for (
int i = 0;
i < 3;
i++) {
4129 newloc[
i] = (to_min[
i] + (sval[int(
data->map[
i])] * (to_max[
i] - to_min[
i])));
4131 switch (
data->mix_mode_loc) {
4151 N_(
"Transformation"),
4152 "bTransformConstraint",
4170 func(con, (
ID **)&
data->target,
false, userdata);
4218 float co[3] = {0.0f, 0.0f, 0.0f};
4219 bool track_normal =
false;
4220 float track_no[3] = {0.0f, 0.0f, 0.0f};
4251 if (nearest.
index < 0) {
4257 if (do_track_normal) {
4258 track_normal =
true;
4260 &
tree,
nullptr, nearest.
index, nearest.
co, nearest.
no, track_no);
4279 co, co, nearest.
co, (dist - scon->
dist) / dist);
4290 float no[3] = {0.0f, 0.0f, 0.0f};
4339 if (hit.
index < 0) {
4344 if (do_track_normal) {
4345 track_normal =
true;
4389 "bShrinkwrapConstraint",
4414 func(con, (
ID **)&
data->tar,
false, userdata);
4478 float rmat[3][3], tmat[4][4];
4513 if (
norm < FLT_EPSILON) {
4534 else if (
norm < 0.1f) {
4556 "bDampTrackConstraint",
4592 data->bulge_max = 1.0f;
4593 data->bulge_min = 1.0f;
4604 func(con, (
ID **)&
data->tar,
false, userdata);
4650 "bSplineIKConstraint",
4668 func(con, (
ID **)&
data->tar,
false, userdata);
4702 float pivot[3], vec[3];
4706 float axis[3],
angle;
4708 const int rot_axis = std::clamp(
4722 if (
rot[rot_axis] > 0.0f) {
4796 data->clip =
nullptr;
4804 func(con, (
ID **)&
data->clip,
true, userdata);
4805 func(con, (
ID **)&
data->camera,
false, userdata);
4806 func(con, (
ID **)&
data->depth_ob,
false, userdata);
4827 if (
data->object[0]) {
4837 if (
data->camera ==
nullptr) {
4842 return data->camera;
4870 context->flag =
data->flag;
4871 context->frame_method =
data->frame_method;
4874 context->scene = cob->
scene;
4878 if (context->clip ==
nullptr || context->camera_object ==
nullptr) {
4881 context->depth_object =
data->depth_ob;
4883 context->tracking = &context->clip->tracking;
4885 if (context->tracking_object ==
nullptr) {
4890 if (context->track ==
nullptr) {
4894 context->depsgraph_time =
DEG_get_ctime(context->depsgraph);
4896 context->depsgraph_time);
4904 Object *camera_object = context->camera_object;
4914 float camera_obmat[4][4];
4915 copy_m4_m4(camera_obmat, camera_object->object_to_world().ptr());
4918 float reconstructed_camera_mat[4][4];
4920 tracking, tracking_object, context->clip_frame, reconstructed_camera_mat);
4921 float reconstructed_camera_mat_inv[4][4];
4922 invert_m4_m4(reconstructed_camera_mat_inv, reconstructed_camera_mat);
4931 Object *camera_object = context->camera_object;
4938 float reconstructed_camera_mat[4][4];
4962 const int clip_width,
4963 const int clip_height,
4964 float marker_position[2])
4971 marker_position[0] *= clip_width;
4972 marker_position[1] *= clip_height;
4975 context->tracking, clip_width, clip_height, marker_position, marker_position);
4978 marker_position[0] /= clip_width;
4979 marker_position[1] /= clip_height;
4984 const int clip_width,
4985 const int clip_height,
4986 float marker_position[2])
4992 Scene *scene = context->scene;
4996 const float w_src = clip_width * clip->
aspx;
4997 const float h_src = clip_height * clip->
aspy;
4999 const float w_dst = scene->
r.
xsch * scene->
r.
xasp;
5000 const float h_dst = scene->
r.
ysch * scene->
r.
yasp;
5002 const float asp_src = w_src / h_src;
5003 const float asp_dst = w_dst / h_dst;
5005 if (
fabsf(asp_src - asp_dst) < FLT_EPSILON) {
5011 float div = asp_src / asp_dst;
5012 float cent = float(clip_width) / 2.0f;
5014 marker_position[0] = (((marker_position[0] * clip_width - cent) * div) + cent) / clip_width;
5018 float div = asp_dst / asp_src;
5019 float cent = float(clip_height) / 2.0f;
5021 marker_position[1] = (((marker_position[1] * clip_height - cent) * div) + cent) / clip_height;
5030 Object *camera_object = context->camera_object;
5032 float camera_matrix[4][4];
5035 const float z_axis[3] = {0.0f, 0.0f, 1.0f};
5038 float camera_axis[3];
5046 float projection[3];
5049 return len_v3(projection);
5056 if (context->depth_object ==
nullptr) {
5060 Object *depth_object = context->depth_object;
5062 if (depth_mesh ==
nullptr) {
5066 float depth_object_mat_inv[4][4];
5067 invert_m4_m4(depth_object_mat_inv, depth_object->object_to_world().ptr());
5069 float ray_start[3], ray_end[3];
5071 ray_start, depth_object_mat_inv, context->camera_object->object_to_world().location());
5074 float ray_direction[3];
5099 Scene *scene = context->scene;
5102 Object *camera_object = context->camera_object;
5103 const float clip_frame = context->clip_frame;
5107 if (object_depth < FLT_EPSILON) {
5111 int clip_width, clip_height;
5114 float marker_position[2];
5127 vec[0] =
params.ortho_scale * (marker_position[0] - 0.5f +
params.shiftx);
5128 vec[1] =
params.ortho_scale * (marker_position[1] - 0.5f +
params.shifty);
5129 vec[2] = -object_depth;
5131 if (aspect > 1.0f) {
5139 mul_v3_m4v3(disp, camera_object->object_to_world().ptr(), vec);
5141 copy_m4_m4(rmat, camera_object->object_to_world().ptr());
5148 const float d = (object_depth *
params.sensor_x) / (2.0f *
params.lens);
5151 vec[0] = d * (2.0f * (marker_position[0] +
params.shiftx) - 1.0f);
5152 vec[1] = d * (2.0f * (marker_position[1] +
params.shifty) - 1.0f);
5153 vec[2] = -object_depth;
5155 if (aspect > 1.0f) {
5163 mul_v3_m4v3(disp, camera_object->object_to_world().ptr(), vec);
5166 copy_m4_m4(rmat, camera_object->object_to_world().ptr());
5196 "bFollowTrackConstraint",
5213 data->clip =
nullptr;
5221 func(con, (
ID **)&
data->clip,
true, userdata);
5236 float mat[4][4], obmat[4][4];
5253 N_(
"Camera Solver"),
5254 "bCameraSolverConstraint",
5271 data->clip =
nullptr;
5280 func(con, (
ID **)&
data->clip,
false, userdata);
5281 func(con, (
ID **)&
data->camera,
false, userdata);
5295 if (!camob || !clip) {
5301 if (!tracking_object) {
5305 float mat[4][4], obmat[4][4], imat[4][4], parmat[4][4];
5312 mul_m4_m4m4(parmat, camob->object_to_world().ptr(), imat);
5325 if (orig_con !=
nullptr) {
5339 N_(
"Object Solver"),
5340 "bObjectSolverConstraint",
5356 func(con, (
ID **)&
data->cache_file,
true, userdata);
5361#if defined(WITH_ALEMBIC) || defined(WITH_USD)
5384 switch (cache_file->
type) {
5423 data->reader_object_path[0] =
'\0';
5431 data->cache_file =
nullptr;
5437 N_(
"Transform Cache"),
5438 "bTransformCacheConstraint",
5508 CLOG_WARN(&
LOG,
"No valid constraint type-info data available. Type = %i", type);
5538 if (*idpoin && is_reference) {
5557 func(con,
reinterpret_cast<ID **
>(&con->ipo),
false, userdata);
5619 const short type = con->
type;
5649 ListBase single_con = {new_con, new_con};
5703 single_con.
first = new_con;
5704 single_con.
last = new_con;
5760 const char *newName;
5785 newName = (name && name[0]) ? name :
DATA_(cti->
name);
5790 newName = (name && name[0]) ? name :
DATA_(
"Const");
5876 if (pchan ==
nullptr) {
5927 if ((*idpoin) && (is_reference)) {
5936 const bool do_extern)
5973 if (pchan ==
nullptr) {
5999 srccon = srccon->
next, con = con->
next)
6041 if (con_iter == con) {
6072 if (r_pchan !=
nullptr) {
6082 if (ob->
pose !=
nullptr) {
6087 if (r_pchan !=
nullptr) {
6107 if (
ELEM(orig_ob,
nullptr, ob)) {
6114 if (pchan !=
nullptr) {
6117 if (orig_pchan ==
nullptr) {
6137 if (r_orig_ob !=
nullptr) {
6138 *r_orig_ob = orig_ob;
6155 Object *orig_ob =
nullptr;
6158 if (orig_con !=
nullptr) {
6240 ListBase targets = {
nullptr,
nullptr};
6247 cob->
type = ownertype;
6250 switch (ownertype) {
6254 cob->
pchan =
nullptr;
6372 if (cob ==
nullptr) {
6379 ListBase targets = {
nullptr,
nullptr};
6382 if (cti ==
nullptr) {
6393 if (con->enforce == 0.0f) {
6440 float solution[4][4];
6453 if (cti && con->data) {
6458 switch (con->type) {
6496 con->data =
nullptr;
6501 if (con->data ==
nullptr) {
6510 switch (con->type) {
6527 con->lin_error = 0.0f;
6528 con->rot_error = 0.0f;
6536 data->reader =
nullptr;
6537 data->reader_object_path[0] =
'\0';
void ABC_get_transform(struct CacheReader *reader, float r_mat_world[4][4], double time, float scale)
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
bool BKE_animdata_drivers_remove_for_rna_struct(struct ID &owner_id, struct StructRNA &type, void *data)
void BKE_pchan_bbone_deform_segment_index(const bPoseChannel *pchan, const float *co, int *r_index, float *r_blend_next)
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_bone_to_pose(const bPoseChannel *pchan, const float inmat[4][4], float outmat[4][4])
void BKE_armature_mat_pose_to_bone(const 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)
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])
@ LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void id_lib_extern(ID *id)
@ 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])
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)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) 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 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 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 unit_m4(float m[4][4])
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 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
char * STRNCPY(char(&dst)[N], const char *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_write_float_array(BlendWriter *writer, int64_t num, const float *data_ptr)
void BLO_write_struct_by_name(BlendWriter *writer, const char *struct_name, const void *data_ptr)
void BLO_read_float_array(BlendDataReader *reader, int64_t array_size, float **ptr_p)
#define BLO_write_struct(writer, struct_name, data_ptr)
void * BLO_read_struct_by_name_array(BlendDataReader *reader, const char *struct_name, int64_t items_num, const void *old_address)
#define BLO_read_struct_list(reader, struct_name, list)
#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)
T * DEG_get_original(T *id)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ CACHE_FILE_TYPE_INVALID
@ CONSTRAINT_OVERRIDE_LIBRARY_LOCAL
@ CONSTRAINT_BBONE_SHAPE_FULL
@ 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
@ CONSTRAINT_ARMATURE_QUATERNION
@ CONSTRAINT_ARMATURE_ENVELOPE
@ CONSTRAINT_ARMATURE_CUR_LOCATION
@ CAMERASOLVER_ACTIVECLIP
@ FOLLOWTRACK_USE_UNDISTORTION
@ FOLLOWTRACK_USE_3D_POSITION
@ ACTCON_BONE_USE_OBJECT_ACTION
@ LIMIT_ROT_LEGACY_BEHAVIOR
#define CON_SHRINKWRAP_PROJECT_CULL_MASK
@ TRANS_MIXSCALE_MULTIPLY
@ CONSTRAINT_SPLINEIK_YS_FIT_CURVE
@ CONSTRAINT_SPACE_CUSTOM
@ CONSTRAINT_SPACE_OWNLOCAL
@ CONSTRAINT_SPACE_PARLOCAL
@ ACTCON_MIX_BEFORE_SPLIT
@ CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE
@ TRANSLIKE_MIX_AFTER_FULL
@ TRANSLIKE_MIX_BEFORE_SPLIT
@ TRANSLIKE_MIX_BEFORE_FULL
@ TRANSLIKE_MIX_AFTER_SPLIT
@ OBJECTSOLVER_ACTIVECLIP
@ OBJECTSOLVER_SET_INVERSE
@ CON_SHRINKWRAP_PROJECT_INVERT_CULL
@ CON_SHRINKWRAP_PROJECT_OPPOSITE
@ CON_SHRINKWRAP_TRACK_NORMAL
@ PIVOTCON_FLAG_OFFSET_ABS
@ TRANSLIKE_REMOVE_TARGET_SHEAR
@ STRETCHTOCON_USE_BULGE_MAX
@ STRETCHTOCON_USE_BULGE_MIN
@ 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)
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMVert * v
BPy_StructRNA * depsgraph
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
btVector3 orth(const btVector3 &v)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
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.
constexpr IndexRange index_range() const
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 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 bool splineik_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, bConstraintTarget *ct, float)
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)
static bool default_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
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 bool actcon_get_tarmat(Depsgraph *depsgraph, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
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 bool armdef_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, bConstraintTarget *ct, float)
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 stretchto_get_tars(bConstraint *con, ListBase *list)
static void rotlike_new_data(void *cdata)
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 bool kinematic_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
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 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)
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 bool clampto_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, 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 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 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 bool default_get_tarmat_full_bbone(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
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 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)
static bool constraint_remove(ListBase *list, bConstraint *con)
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(bConstraint *con)
static void constraints_init_typeinfo()
static void translike_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets)
static bool followpath_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *, bConstraintTarget *ct, float)
static void rotlike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void followpath_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
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 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 void unit_ct_matrix_nullsafe(bConstraintTarget *ct)
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 bool shrinkwrap_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
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 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_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 transform_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
#define ID_IS_LINKED(_id)
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
void USD_get_transform(CacheReader *reader, float r_mat_world[4][4], float time, float scale)
T safe_divide(const T &a, const T &b)
VecBase< float, 3 > cross_high_precision(const VecBase< float, 3 > &a, const VecBase< float, 3 > &b)
MovieTrackingObject * tracking_object
MovieTrackingTrack * track
struct MDeformVert * dvert
struct MovieTracking tracking
ObjectRuntimeHandle * runtime
int32_t action_slot_handle
char last_slot_identifier[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)
bool(* get_target_matrix)(struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime)
void(* copy_data)(struct bConstraint *con, struct bConstraint *src)
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
BVHTree_RayCastCallback raycast_callback
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)