10#define DNA_DEPRECATED_ALLOW
83#include "RNA_prototypes.hh"
110#define VALID_CONS_TARGET(ct) ((ct) && ((ct)->tar))
138 Depsgraph *depsgraph,
Scene *scene,
Object *ob,
void *subdata,
short datatype)
155 cob->
type = datatype;
185 cob->
type = datatype;
217 float delta[4][4], imat[4][4];
220 if (cob ==
nullptr) {
270 const bool keep_scale)
272 float diff_mat[4][4];
276 if (ob ==
nullptr || mat ==
nullptr) {
286 Bone *pchan_bone = pchan->bone_get(*ob);
344 mul_m4_m4m4(mat, ob->object_to_world().ptr(), mat);
361 if (cob && cob->
pchan) {
362 if (
Bone *cob_bone = cob->
pchan->bone_get(*cob->
ob)) {
396 if (cob && cob->
pchan) {
397 if (
Bone *cob_bone = cob->
pchan->bone_get(*cob->
ob)) {
542 float imat[3][3], tmat[3][3];
549 if (defgroup == -1) {
553 float vec[3] = {0.0f, 0.0f, 0.0f};
554 float normal[3] = {0.0f, 0.0f, 0.0f};
555 float weightsum = 0.0f;
566 if (dw && dw->
weight > 0.0f) {
574 else if (mesh_eval) {
575 const Span<float3> positions = mesh_eval->vert_positions();
576 const Span<float3> vert_normals = mesh_eval->vert_normals();
585 if (dw && dw->
weight > 0.0f) {
609 copy_m3_m4(imat, ob->object_to_world().ptr());
630 mul_v3_m4v3(mat[3], ob->object_to_world().ptr(), vec);
641 const float *co = dl ? dl->
verts :
nullptr;
646 float vec[3] = {0.0f, 0.0f, 0.0f}, tvec[3];
655 if (defgroup == -1) {
665 for (i = 0; i < tot_verts; i++, dv++) {
668 if (dw && dw->
weight > 0.0f) {
670 memcpy(tvec, co ? co : bp->
vec,
sizeof(
float[3]));
691 mul_v3_m4v3(tvec, ob->object_to_world().ptr(), vec);
700 const char *substring,
709 if (substring[0] ==
'\0') {
739 Bone *bone = pchan->bone_get(*ob);
743 if (headtail < 0.000001f && !(is_bbone && full_bbone)) {
771 mul_m4_m4m4(mat, ob->object_to_world().ptr(), tempmat);
774 float tempmat[4][4], loc[3];
783 mul_m4_m4m4(mat, ob->object_to_world().ptr(), tempmat);
813static bConstraintTypeInfo CTI_CONSTRNAME = {
814 CONSTRAINT_TYPE_CONSTRNAME,
815 sizeof(bConstrNameConstraint),
817 "bConstrNameConstraint",
819 constrname_id_looper,
823 constrname_flush_tars,
824 constrname_get_tarmat,
893#define SINGLETARGET_GET_TARS(con, datatar, datasubtarget, ct, list) \
895 ct = MEM_new<bConstraintTarget>("tempConstraintTarget"); \
898 STRNCPY_UTF8(ct->subtarget, datasubtarget); \
899 ct->space = con->tarspace; \
900 ct->flag = CONSTRAINT_TAR_TEMP; \
903 if ((ct->tar->type == OB_ARMATURE) && (ct->subtarget[0])) { \
904 bPoseChannel *pchan = BKE_pose_channel_find_name(ct->tar->pose, ct->subtarget); \
905 ct->type = CONSTRAINT_OBTYPE_BONE; \
906 ct->rotOrder = (pchan) ? (pchan->rotmode) : int(EULER_ORDER_DEFAULT); \
908 else if (OB_TYPE_SUPPORT_VGROUP(ct->tar->type) && (ct->subtarget[0])) { \
909 ct->type = CONSTRAINT_OBTYPE_VERT; \
910 ct->rotOrder = EULER_ORDER_DEFAULT; \
913 ct->type = CONSTRAINT_OBTYPE_OBJECT; \
914 ct->rotOrder = ct->tar->rotmode; \
918 BLI_addtail(list, ct); \
928#define SINGLETARGETNS_GET_TARS(con, datatar, ct, list) \
930 ct = MEM_new<bConstraintTarget>("tempConstraintTarget"); \
933 ct->space = con->tarspace; \
934 ct->flag = CONSTRAINT_TAR_TEMP; \
937 ct->type = CONSTRAINT_OBTYPE_OBJECT; \
939 BLI_addtail(list, ct); \
949#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, no_copy) \
952 bConstraintTarget *ctn = ct->next; \
953 if (no_copy == 0) { \
955 STRNCPY_UTF8(datasubtarget, ct->subtarget); \
956 con->tarspace = ct->space; \
959 BLI_freelinkN(list, ct); \
971#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, no_copy) \
974 bConstraintTarget *ctn = ct->next; \
975 if (no_copy == 0) { \
977 con->tarspace = ct->space; \
980 BLI_freelinkN(list, ct); \
1008 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
1039 ListBaseT<bConstraintTarget> *targets)
1061 float inverse_matrix[4][4];
1069 float loc[3], eul[3], size[3];
1070 float loco[3], eulo[3], sizeo[3];
1083 loc[0] = loco[0] = 0.0f;
1086 loc[1] = loco[1] = 0.0f;
1089 loc[2] = loco[2] = 0.0f;
1092 eul[0] = eulo[0] = 0.0f;
1095 eul[1] = eulo[1] = 0.0f;
1098 eul[2] = eulo[2] = 0.0f;
1101 size[0] = sizeo[0] = 1.0f;
1104 size[1] = sizeo[1] = 1.0f;
1107 size[2] = sizeo[2] = 1.0f;
1118 if (cob->
pchan !=
nullptr) {
1129 if (orig_con !=
nullptr) {
1140 float orig_cob_matrix[4][4];
1148 cob->
matrix[3][0] = orig_cob_matrix[3][0];
1151 cob->
matrix[3][1] = orig_cob_matrix[3][1];
1154 cob->
matrix[3][2] = orig_cob_matrix[3][2];
1164 "bChildOfConstraint",
1190 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
1236 const float target_up[3],
1291 if (axis != upflag) {
1292 right_index = 3 - axis - upflag;
1296 m[right_index][0] = neg * right[0];
1297 m[right_index][1] = neg * right[1];
1298 m[right_index][2] = neg * right[2];
1312 ListBaseT<bConstraintTarget> *targets)
1318 float size[3], vec[3];
1326 cob->
matrix[0][0] = size[0];
1330 cob->
matrix[1][1] = size[1];
1334 cob->
matrix[2][2] = size[2];
1341 std::clamp<short>(
data->reserved1, 0, 5),
1342 std::clamp<short>(
data->reserved2, 0, 2),
1354 "bTrackToConstraint",
1371 data->weight = 1.0f;
1372 data->orientweight = 1.0f;
1373 data->iterations = 500;
1383 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
1386 func(con,
reinterpret_cast<ID **
>(&
data->poletar),
false, userdata);
1406 ListBaseT<bConstraintTarget> *
list,
1448 if (ob ==
nullptr) {
1466 "bKinematicConstraint",
1494 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
1513 ListBaseT<bConstraintTarget> *
list,
1539 float vec[4], radius;
1557 curvetime =
data->offset_fac;
1574 CLAMP(curvetime, 0.0f, 1.0f);
1594 quat, std::clamp<short>(
data->trackflag, 0, 5), std::clamp<short>(
data->upflag, 0, 2));
1599 float tmat[4][4], rmat[4][4];
1613 ListBaseT<bConstraintTarget> *targets)
1657 "bFollowPathConstraint",
1672 ListBaseT<bConstraintTarget> * )
1699 N_(
"Limit Location"),
1700 "bLocLimitConstraint",
1719 return ((
b - std::floor(
b)) - 0.5) * (2.0 *
M_PI);
1754 if (min_wrapped < max_wrapped) {
1755 return angle + std::clamp(0.0f, min_wrapped, max_wrapped);
1760 if (max_wrapped >= 0.0 || min_wrapped <= 0.0) {
1765 if (std::fabs(max_wrapped) < std::fabs(min_wrapped)) {
1766 return angle + max_wrapped;
1768 return angle + min_wrapped;
1773 ListBaseT<bConstraintTarget> * )
1794 rot_order =
data->euler_order;
1848 N_(
"Limit Rotation"),
1849 "bRotLimitConstraint",
1864 ListBaseT<bConstraintTarget> * )
1867 float obsize[3], size[3];
1874 size[0] = std::max(size[0],
data->xmin);
1877 size[0] = std::min(size[0],
data->xmax);
1880 size[1] = std::max(size[1],
data->ymin);
1883 size[1] = std::min(size[1],
data->ymax);
1886 size[2] = std::max(size[2],
data->zmin);
1889 size[2] = std::min(size[2],
data->zmax);
1907 "bSizeLimitConstraint",
1932 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
1963 ListBaseT<bConstraintTarget> *targets)
1969 float offset[3] = {0.0f, 0.0f, 0.0f};
1981 cob->
matrix[3][0] += offset[0];
1989 cob->
matrix[3][1] += offset[1];
1997 cob->
matrix[3][2] += offset[2];
2005 N_(
"Copy Location"),
2006 "bLocateLikeConstraint",
2031 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
2062 ListBaseT<bConstraintTarget> *targets)
2068 float loc[3], size[3], oldrot[3][3], newrot[3][3];
2069 float eul[3], obeul[3], defeul[3];
2077 rot_order =
data->euler_order;
2093 bool legacy_offset =
false;
2095 switch (
data->mix_mode) {
2097 legacy_offset =
true;
2113 if (legacy_offset) {
2126 if (legacy_offset) {
2139 if (legacy_offset) {
2159 switch (
data->mix_mode) {
2184 N_(
"Copy Rotation"),
2185 "bRotateLikeConstraint",
2211 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
2242 ListBaseT<bConstraintTarget> *targets)
2248 float obsize[3], size[3];
2258 if ((
data->flag & all_axes) == all_axes) {
2283 for (
int i = 0; i < 3; i++) {
2284 size[i] =
powf(size[i],
data->power);
2317 "bSizeLikeConstraint",
2335 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
2354 ListBaseT<bConstraintTarget> *
list,
2368 ListBaseT<bConstraintTarget> *targets)
2374 float target_mat[4][4];
2385 switch (
data->mix_mode) {
2426 N_(
"Copy Transforms"),
2427 "bTransLikeConstraint",
2445 data->volume = 1.0f;
2450 ListBaseT<bConstraintTarget> * )
2454 float volume =
data->volume;
2455 float fac = 1.0f, total_scale = 1.0f;
2461 switch (
data->mode) {
2463 total_scale = obsize[0] * obsize[1] * obsize[2];
2466 total_scale =
pow3f(obsize[
data->free_axis]);
2469 total_scale = obsize[
data->free_axis];
2473 if (total_scale != 0) {
2474 fac =
sqrtf(volume / total_scale);
2478 switch (
data->free_axis) {
2497 N_(
"Maintain Volume"),
2498 "bSameVolumeConstraint",
2516 data->targets.free_no_destruct();
2534 return data->targets.count();
2546 func(con,
reinterpret_cast<ID **
>(&ct.
tar),
false, userdata);
2563 if (pchan ==
nullptr) {
2573 const float iobmat[4][4],
2574 const float basemat[4][4],
2575 const float bonemat[4][4],
2576 const float pivot[3],
2578 float r_sum_mat[4][4],
2581 if (weight == 0.0f) {
2590 if (r_sum_dq !=
nullptr) {
2591 float basemat_world[4][4];
2610 const bool force_envelope,
2612 float r_sum_mat[4][4],
2615 float iobmat[4][4], co[3];
2618 float weight = ct->
weight;
2634 float basemat[4][4];
2641 if (r_sum_dq !=
nullptr) {
2651 weight * (1.0f - blend),
2655 if (r_sum_dq !=
nullptr) {
2682 *r_totweight += weight;
2687 ListBaseT<bConstraintTarget> *targets)
2692 float sum_mat[4][4] = {};
2694 float weight = 0.0f;
2704 mul_m4_v3(cob->
ob->object_to_world().ptr(), input_co);
2713 if (ct.weight <= 0.0f) {
2723 if (pchan ==
nullptr) {
2726 Bone *pchan_bone = pchan->bone_get(*ct.tar);
2732 &ct, {pchan, pchan_bone}, input_co, use_envelopes, &weight, sum_mat, pdq);
2736 if (weight > 0.0f) {
2737 if (pdq !=
nullptr) {
2754 "bArmatureConstraint",
2783 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
2786 func(con,
reinterpret_cast<ID **
>(&
data->act),
true, userdata);
2837 float tempmat[4][4], vec[3];
2842 if (use_eval_time) {
2843 s =
data->eval_time;
2862 if (
data->type < 10) {
2868 else if (
data->type < 20) {
2871 axis =
data->type - 10;
2876 axis =
data->type - 20;
2885 const float range =
data->max -
data->min;
2886 if ((range == 0.0f) || (
ushort(axis) > 2)) {
2890 s = (vec[axis] -
data->min) / range;
2899 printf(
"do Action Constraint %s - Ob %s Pchan %s\n",
2915 data->action_slot_handle,
2917 &anim_eval_context);
2923 pose.runtime = MEM_new<bke::bPoseRuntime>(__func__);
2939 data->action_slot_handle,
2941 &anim_eval_context);
2946 Bone *pchan_bone = pchan->bone_get(*cob->
ob);
2955 puts(
"Error: unknown owner type for Action Constraint");
2964 ListBaseT<bConstraintTarget> *targets)
2970 switch (
data->mix_mode) {
3013 "bActionConstraint",
3039 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
3058 ListBaseT<bConstraintTarget> *
list,
3072 ListBaseT<bConstraintTarget> *targets)
3078 float vec[3], vec2[3];
3086 switch (
data->lockflag) {
3089 switch (
data->trackflag) {
3157 switch (
data->trackflag) {
3225 switch (
data->trackflag) {
3301 totmat[0][0] = tmpmat[0][0];
3302 totmat[0][1] = tmpmat[0][1];
3303 totmat[0][2] = tmpmat[0][2];
3304 totmat[1][0] = tmpmat[1][0];
3305 totmat[1][1] = tmpmat[1][1];
3306 totmat[1][2] = tmpmat[1][2];
3307 totmat[2][0] = tmpmat[2][0];
3308 totmat[2][1] = tmpmat[2][1];
3309 totmat[2][2] = tmpmat[2][2];
3333 "bLockTrackConstraint",
3358 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
3377 ListBaseT<bConstraintTarget> *
list,
3391 ListBaseT<bConstraintTarget> *targets)
3398 float dvec[3], dist, sfac = 1.0f;
3399 short clamp_surf = 0;
3405 if (
data->dist == 0) {
3411 if (orig_con !=
nullptr) {
3421 if (dist <= data->dist) {
3424 sfac =
data->dist / dist;
3429 if (dist <= (
data->dist +
data->soft)) {
3436 if (dist >=
data->dist) {
3439 sfac =
data->dist / dist;
3445 if (dist >= (
data->dist -
data->soft)) {
3459 sfac =
data->dist / dist;
3478 N_(
"Limit Distance"),
3479 "bDistLimitConstraint",
3498 data->orglength = 0.0;
3500 data->bulge_max = 1.0f;
3501 data->bulge_min = 1.0f;
3509 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
3528 ListBaseT<bConstraintTarget> *
list,
3542 ListBaseT<bConstraintTarget> *targets)
3549 float size[3],
scale[3], vec[3], xx[3], zz[3],
orth[3];
3577 if (
data->orglength == 0) {
3578 data->orglength = dist;
3583 if (orig_con !=
nullptr) {
3596 float bulge_max =
max_ff(
data->bulge_max, 1.0f);
3597 float hard =
min_ff(bulge, bulge_max);
3599 float range = bulge_max - 1.0f;
3600 float scale_fac = (range > 0.0f) ? 1.0f / range : 0.0f;
3601 float soft = 1.0f + range *
atanf((bulge - 1.0f) * scale_fac) /
float(
M_PI_2);
3608 float bulge_min = std::clamp(
data->bulge_min, 0.0f, 1.0f);
3609 float hard =
max_ff(bulge, bulge_min);
3611 float range = 1.0f - bulge_min;
3612 float scale_fac = (range > 0.0f) ? 1.0f / range : 0.0f;
3613 float soft = 1.0f - range *
atanf((1.0f - bulge) * scale_fac) /
float(
M_PI_2);
3619 switch (
data->volmode) {
3645 switch (
data->plane) {
3692 "bStretchToConstraint",
3710 data->offset = 0.0f;
3719 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
3750 ListBaseT<bConstraintTarget> *targets)
3757 float obmat[4][4], imat[4][4], tarmat[4][4], tmat[4][4];
3772 switch (
data->minmaxflag) {
3774 val1 = tarmat[3][2];
3775 val2 = obmat[3][2] -
data->offset;
3779 val1 = tarmat[3][1];
3780 val2 = obmat[3][1] -
data->offset;
3784 val1 = tarmat[3][0];
3785 val2 = obmat[3][0] -
data->offset;
3789 val2 = tarmat[3][2];
3790 val1 = obmat[3][2] -
data->offset;
3794 val2 = tarmat[3][1];
3795 val1 = obmat[3][1] -
data->offset;
3799 val2 = tarmat[3][0];
3800 val1 = obmat[3][0] -
data->offset;
3825 "bMinMaxConstraint",
3843 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
3887 ListBaseT<bConstraintTarget> *targets)
3894 float obmat[4][4], ownLoc[3];
3895 float curveMin[3], curveMax[3];
3896 float targetMatrix[4][4];
3909 if (
data->tar->runtime->curve_cache &&
data->tar->runtime->curve_cache->anim_path_accum_length)
3911 float vec[4], totmat[4][4];
3925 if ((size[2] > size[0]) && (size[2] > size[1])) {
3928 else if ((size[1] > size[0]) && (size[1] > size[2])) {
3936 clamp_axis =
data->flag - 1;
3942 float len = (curveMax[clamp_axis] - curveMin[clamp_axis]);
3948 if (ownLoc[clamp_axis] < curveMin[clamp_axis]) {
3950 offset = curveMin[clamp_axis] -
3951 ceilf((curveMin[clamp_axis] - ownLoc[clamp_axis]) /
len) *
len;
3955 curvetime = (ownLoc[clamp_axis] - offset) / (
len);
3957 else if (ownLoc[clamp_axis] > curveMax[clamp_axis]) {
3959 offset = curveMax[clamp_axis] +
3960 int((ownLoc[clamp_axis] - curveMax[clamp_axis]) /
len) *
len;
3964 curvetime = (ownLoc[clamp_axis] - offset) / (
len);
3968 curvetime = (ownLoc[clamp_axis] - curveMin[clamp_axis]) / (
len);
3978 if (ownLoc[clamp_axis] <= curveMin[clamp_axis]) {
3981 else if (ownLoc[clamp_axis] >= curveMax[clamp_axis]) {
3984 else if (
IS_EQF((curveMax[clamp_axis] - curveMin[clamp_axis]), 0.0f) ==
false) {
3985 curvetime = (ownLoc[clamp_axis] - curveMin[clamp_axis]) /
3986 (curveMax[clamp_axis] - curveMin[clamp_axis]);
3998 mul_m4_m4m4(targetMatrix, ct->
tar->object_to_world().ptr(), totmat);
4011 "bClampToConstraint",
4032 for (
int i = 0; i < 3; i++) {
4033 data->from_min_scale[i] =
data->from_max_scale[i] = 1.0f;
4034 data->to_min_scale[i] =
data->to_max_scale[i] = 1.0f;
4043 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
4062 ListBaseT<bConstraintTarget> *
list,
4076 ListBaseT<bConstraintTarget> *targets)
4083 float *from_min, *from_max, *to_min, *to_max;
4084 float loc[3],
rot[3][3], oldeul[3], size[3];
4085 float newloc[3], newrot[3][3], neweul[3], newsize[3];
4086 float dbuf[4], sval[3];
4087 float *
const dvec = dbuf + 1;
4090 switch (
data->from) {
4101 from_min =
data->from_min_scale;
4102 from_max =
data->from_max_scale;
4107 from_min =
data->from_min_rot;
4108 from_max =
data->from_max_rot;
4113 from_min =
data->from_min;
4114 from_max =
data->from_max;
4122 rot_order =
data->to_euler_order;
4130 for (
int i = 0; i < 3; i++) {
4131 if (from_max[i] - from_min[i]) {
4132 sval[i] = (dvec[i] - from_min[i]) / (from_max[i] - from_min[i]);
4141 for (
int i = 0; i < 3; i++) {
4142 CLAMP(dvec[i], from_min[i], from_max[i]);
4143 if (from_max[i] - from_min[i]) {
4144 sval[i] = (dvec[i] - from_min[i]) / (from_max[i] - from_min[i]);
4155 to_min =
data->to_min_scale;
4156 to_max =
data->to_max_scale;
4157 for (
int i = 0; i < 3; i++) {
4158 newsize[i] = to_min[i] + (sval[int(
data->map[i])] * (to_max[i] - to_min[i]));
4160 switch (
data->mix_mode_scale) {
4171 to_min =
data->to_min_rot;
4172 to_max =
data->to_max_rot;
4173 for (
int i = 0; i < 3; i++) {
4174 neweul[i] = to_min[i] + (sval[int(
data->map[i])] * (to_max[i] - to_min[i]));
4176 switch (
data->mix_mode_rot) {
4198 to_min =
data->to_min;
4199 to_max =
data->to_max;
4200 for (
int i = 0; i < 3; i++) {
4201 newloc[i] = (to_min[i] + (sval[int(
data->map[i])] * (to_max[i] - to_min[i])));
4203 switch (
data->mix_mode_loc) {
4223 N_(
"Transformation"),
4224 "bTransformConstraint",
4242 func(con,
reinterpret_cast<ID **
>(&
data->target),
false, userdata);
4268 ListBaseT<bConstraintTarget> *
list,
4292 float co[3] = {0.0f, 0.0f, 0.0f};
4293 bool track_normal =
false;
4294 float track_no[3] = {0.0f, 0.0f, 0.0f};
4325 if (nearest.
index < 0) {
4331 if (do_track_normal) {
4332 track_normal =
true;
4334 &tree,
nullptr, nearest.
index, nearest.
co, nearest.
no, track_no);
4353 co, co, nearest.
co, (dist - scon->
dist) / dist);
4364 float no[3] = {0.0f, 0.0f, 0.0f};
4413 if (hit.
index < 0) {
4418 if (do_track_normal) {
4419 track_normal =
true;
4451 ListBaseT<bConstraintTarget> *targets)
4465 "bShrinkwrapConstraint",
4490 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
4509 ListBaseT<bConstraintTarget> *
list,
4533 ListBaseT<bConstraintTarget> *targets)
4557 float rmat[3][3], tmat[4][4];
4613 else if (
norm < 0.1f) {
4635 "bDampTrackConstraint",
4653 MEM_SAFE_DELETE(
data->points);
4671 data->bulge_max = 1.0f;
4672 data->bulge_min = 1.0f;
4683 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
4729 "bSplineIKConstraint",
4747 func(con,
reinterpret_cast<ID **
>(&
data->tar),
false, userdata);
4778 ListBaseT<bConstraintTarget> *targets)
4783 float pivot[3], vec[3];
4787 float axis[3],
angle;
4789 const int rot_axis = std::clamp(
4803 if (
rot[rot_axis] > 0.0f) {
4877 data->clip =
nullptr;
4885 func(con,
reinterpret_cast<ID **
>(&
data->clip),
true, userdata);
4886 func(con,
reinterpret_cast<ID **
>(&
data->camera),
false, userdata);
4887 func(con,
reinterpret_cast<ID **
>(&
data->depth_ob),
false, userdata);
4908 if (
data->object[0]) {
4918 if (
data->camera ==
nullptr) {
4923 return data->camera;
4951 context->flag =
data->flag;
4952 context->frame_method =
data->frame_method;
4955 context->scene = cob->
scene;
4959 if (context->clip ==
nullptr || context->camera_object ==
nullptr) {
4962 context->depth_object =
data->depth_ob;
4964 context->tracking = &context->clip->tracking;
4966 if (context->tracking_object ==
nullptr) {
4971 if (context->track ==
nullptr) {
4975 context->depsgraph_time =
DEG_get_ctime(context->depsgraph);
4977 context->depsgraph_time);
4985 Object *camera_object = context->camera_object;
4995 float camera_obmat[4][4];
4996 copy_m4_m4(camera_obmat, camera_object->object_to_world().ptr());
4999 float reconstructed_camera_mat[4][4];
5001 tracking, tracking_object, context->clip_frame, reconstructed_camera_mat);
5002 float reconstructed_camera_mat_inv[4][4];
5003 invert_m4_m4(reconstructed_camera_mat_inv, reconstructed_camera_mat);
5012 Object *camera_object = context->camera_object;
5019 float reconstructed_camera_mat[4][4];
5043 const int clip_width,
5044 const int clip_height,
5045 float marker_position[2])
5052 marker_position[0] *= clip_width;
5053 marker_position[1] *= clip_height;
5056 context->tracking, clip_width, clip_height, marker_position, marker_position);
5059 marker_position[0] /= clip_width;
5060 marker_position[1] /= clip_height;
5065 const int clip_width,
5066 const int clip_height,
5067 float marker_position[2])
5073 Scene *scene = context->scene;
5077 const float w_src = clip_width * clip->
aspx;
5078 const float h_src = clip_height * clip->
aspy;
5080 const float w_dst = scene->
r.
xsch * scene->
r.
xasp;
5081 const float h_dst = scene->
r.
ysch * scene->
r.
yasp;
5083 const float asp_src = w_src / h_src;
5084 const float asp_dst = w_dst / h_dst;
5092 float div = asp_src / asp_dst;
5093 float cent =
float(clip_width) / 2.0f;
5095 marker_position[0] = (((marker_position[0] * clip_width - cent) * div) + cent) / clip_width;
5099 float div = asp_dst / asp_src;
5100 float cent =
float(clip_height) / 2.0f;
5102 marker_position[1] = (((marker_position[1] * clip_height - cent) * div) + cent) / clip_height;
5111 Object *camera_object = context->camera_object;
5113 float camera_matrix[4][4];
5116 const float z_axis[3] = {0.0f, 0.0f, 1.0f};
5119 float camera_axis[3];
5127 float projection[3];
5130 return len_v3(projection);
5137 if (context->depth_object ==
nullptr) {
5141 Object *depth_object = context->depth_object;
5143 if (depth_mesh ==
nullptr) {
5147 float depth_object_mat_inv[4][4];
5148 invert_m4_m4(depth_object_mat_inv, depth_object->object_to_world().ptr());
5150 float ray_start[3], ray_end[3];
5152 ray_start, depth_object_mat_inv, context->camera_object->object_to_world().location());
5155 float ray_direction[3];
5169 const std::optional<bke::bvh::RayHit> hit = tree.
ray_intersect(ray);
5171 mul_v3_m4v3(cob->
matrix[3], depth_object->object_to_world().ptr(), hit->position(ray));
5177 Scene *scene = context->scene;
5180 Object *camera_object = context->camera_object;
5181 const float clip_frame = context->clip_frame;
5189 int clip_width, clip_height;
5194 float marker_position[2];
5209 vec[2] = -object_depth;
5211 if (aspect > 1.0f) {
5219 mul_v3_m4v3(disp, camera_object->object_to_world().ptr(), vec);
5221 copy_m4_m4(rmat, camera_object->object_to_world().ptr());
5228 const float d = (object_depth * params.
sensor_x) / (2.0f * params.
lens);
5231 vec[0] = d * (2.0f * (marker_position[0] + params.
shiftx) - 1.0f);
5232 vec[1] = d * (2.0f * (marker_position[1] + params.
shifty) - 1.0f);
5233 vec[2] = -object_depth;
5235 if (aspect > 1.0f) {
5243 mul_v3_m4v3(disp, camera_object->object_to_world().ptr(), vec);
5246 copy_m4_m4(rmat, camera_object->object_to_world().ptr());
5258 ListBaseT<bConstraintTarget> * )
5278 "bFollowTrackConstraint",
5295 data->clip =
nullptr;
5303 func(con,
reinterpret_cast<ID **
>(&
data->clip),
true, userdata);
5308 ListBaseT<bConstraintTarget> * )
5320 float mat[4][4], obmat[4][4];
5337 N_(
"Camera Solver"),
5338 "bCameraSolverConstraint",
5355 data->clip =
nullptr;
5364 func(con,
reinterpret_cast<ID **
>(&
data->clip),
false, userdata);
5365 func(con,
reinterpret_cast<ID **
>(&
data->camera),
false, userdata);
5370 ListBaseT<bConstraintTarget> * )
5381 if (!camob || !clip) {
5387 if (!tracking_object) {
5391 float mat[4][4], obmat[4][4], imat[4][4], parmat[4][4];
5398 mul_m4_m4m4(parmat, camob->object_to_world().ptr(), imat);
5411 if (orig_con !=
nullptr) {
5425 N_(
"Object Solver"),
5426 "bObjectSolverConstraint",
5442 func(con,
reinterpret_cast<ID **
>(&
data->cache_file),
true, userdata);
5447 ListBaseT<bConstraintTarget> *targets)
5449#if defined(WITH_ALEMBIC) || defined(WITH_USD)
5461 cache_file,
double(frame), scene->frames_per_second());
5468 switch (cache_file->
type) {
5478 data->reader, mat, time * scene->frames_per_second(), cache_file->
scale);
5509 data->reader_object_path[0] =
'\0';
5517 data->cache_file =
nullptr;
5523 N_(
"Transform Cache"),
5524 "bTransformCacheConstraint",
5559 switch (data_type) {
5575 switch (data_type) {
5594 return component->attribute_domain_size(domain) != 0;
5612 return geometry.get_component(src_type);
5622 MEM_SAFE_DELETE(
data->attribute_name);
5628 func(con,
reinterpret_cast<ID **
>(&
data->target),
false, userdata);
5647 if (!con || !
list) {
5659 ListBaseT<bConstraintTarget> *
list,
5662 if (!con || !
list) {
5693 if (component ==
nullptr) {
5697 const std::optional<bke::AttributeAccessor> optional_attributes = component->
attributes();
5698 if (!optional_attributes.has_value()) {
5725 ListBaseT<bConstraintTarget> *targets)
5736 float target_mat[4][4];
5744 float prev_location[3];
5745 float prev_rotation[3][3];
5749 float next_location[3];
5750 float next_rotation[3][3];
5754 switch (
data->data_type) {
5781 switch (
data->mix_mode) {
5801 if (
data->apply_target_transform) {
5809 N_(
"Geometry Attribute"),
5810 "bGeometryAttributeConstraint",
5881 CLOG_WARN(&
LOG,
"No valid constraint type-info data available. Type = %i", type);
5911 if (*idpoin && is_reference) {
5932 func(con,
reinterpret_cast<ID **
>(&con->
space_object),
false, userdata);
5970 list->free_no_destruct();
5993 const short type = con->
type;
6023 ListBaseT<bConstraint> single_con = {new_con, new_con};
6076 ListBaseT<bConstraint> single_con;
6077 single_con.first_ = new_con;
6078 single_con.last_ = new_con;
6096 Bone *pchan_bone = pchan->bone_get(*ob);
6133 bConstraint *con = MEM_new<bConstraint>(
"Constraint");
6135 const char *newName;
6160 newName = (name && name[0]) ? name :
DATA_(cti->
name);
6165 newName = (name && name[0]) ? name :
DATA_(
"Const");
6178 ListBaseT<bConstraint> *
list;
6253 if (pchan ==
nullptr) {
6304 if ((*idpoin) && (is_reference)) {
6313 const bool do_extern)
6350 if (pchan ==
nullptr) {
6367 const ListBaseT<bConstraint> *src,
6373 dst->clear_no_delete();
6376 for (con = dst->first(), srccon = src->first(); con && srccon;
6377 srccon = srccon->
next, con = con->
next)
6387 const ListBaseT<bConstraint> *src,
6421 if (&con_iter == con) {
6457 ListBaseT<bConstraintTarget> *targets =
nullptr;
6475 if (r_pchan !=
nullptr) {
6485 if (ob->
pose !=
nullptr) {
6490 if (r_pchan !=
nullptr) {
6510 if (
ELEM(orig_ob,
nullptr, ob)) {
6515 ListBaseT<bConstraint> *
constraints, *orig_constraints;
6517 if (pchan !=
nullptr) {
6520 if (orig_pchan ==
nullptr) {
6540 if (r_orig_ob !=
nullptr) {
6541 *r_orig_ob = orig_ob;
6558 Object *orig_ob =
nullptr;
6561 if (orig_con !=
nullptr) {
6578 r_targets->clear_no_delete();
6606 ListBaseT<bConstraintTarget> *targets,
6645 ListBaseT<bConstraintTarget> targets = {
nullptr,
nullptr};
6652 cob->
type = ownertype;
6655 switch (ownertype) {
6658 cob->
ob =
static_cast<Object *
>(ownerdata);
6659 cob->
pchan =
nullptr;
6706 ListBaseT<bConstraintTarget> *targets,
6761 ListBaseT<bConstraint> *conlist,
6769 if (cob ==
nullptr) {
6776 ListBaseT<bConstraintTarget> targets = {
nullptr,
nullptr};
6779 if (cti ==
nullptr) {
6833 float solution[4][4];
6846 if (cti && con.data) {
6888 ListBaseT<bConstraint> *lb)
6904 if (con.data ==
nullptr) {
6934 con.lin_error = 0.0f;
6935 con.rot_error = 0.0f;
6943 data->reader =
nullptr;
6944 data->reader_object_path[0] =
'\0';
Blender kernel action and pose functionality.
Camera data-block and utility functions.
display list (or rather multi purpose list) stuff.
General operations, lookup, etc. for blender objects.
#define BUFFER_FOR_CPP_TYPE_VALUE(type, variable_name)
#define BVH_RAYCAST_DIST_MAX
#define mul_m4_series(...)
#define STRNCPY_UTF8(dst, src)
#define BLO_read_struct_list(reader, struct_name, list)
#define CLOG_WARN(clg_ref,...)
#define ID_IS_LINKED(_id)
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define CON_SHRINKWRAP_PROJECT_CULL_MASK
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
#define INIT_MINMAX(min, max)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
#define BM_ITER_MESH(ele, iter, bm, itype)
btVector3 orth(const btVector3 &v)
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint ** constraints
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void destruct(void *ptr) const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
GAttributeReader lookup(const StringRef name) const
virtual std::optional< AttributeAccessor > attributes() const
std::optional< RayHit > ray_intersect(const Ray &ray) const
#define SINGLETARGETNS_GET_TARS(con, datatar, ct, list)
#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, no_copy)
#define VALID_CONS_TARGET(ct)
#define SINGLETARGET_GET_TARS(con, datatar, datasubtarget, ct, list)
#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, no_copy)
float3x3 scale(float3x3 mat, float2 scale)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
PChanBoneT< bPoseChannel, Bone > PChanBone
GeometrySet object_get_evaluated_geometry_set(const Object &object, bool apply_subdiv=true)
void USD_get_transform(CacheReader *reader, float4x4 &r_mat_world, float time, float scale)
QuaternionBase< float > Quaternion
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)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
@ CONSTRAINT_TAR_CUSTOM_SPACE
MINLINE float min_ff(float a, float b)
void BKE_constraints_free(ListBaseT< bConstraint > *list)
static void contarget_get_mesh_mat(Object *ob, const char *substring, float mat[4][4])
bPoseChannel * BKE_pose_channel_ensure(bPose *pose, const char *name) ATTR_NONNULL(2)
static bConstraintTypeInfo CTI_STRETCHTO
static void samevolume_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static void stretchto_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static bConstraintTypeInfo CTI_LOCLIMIT
static int rotlike_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
void BKE_constraint_free_data(struct bConstraint *con)
MINLINE void negate_v3_v3(float r[3], const float a[3])
void BKE_constraints_copy_ex(ListBaseT< bConstraint > *dst, const ListBaseT< bConstraint > *src, int flag, bool do_extern)
bool BKE_constraint_apply_for_pose(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, struct bConstraint *con)
static bool geometry_attribute_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *, bConstraintTarget *ct, float)
void mul_m4_m4m4_split_channels(float R[4][4], const float A[4][4], const float B[4][4])
void mul_m3_v3(const float M[3][3], float r[3])
void id_lib_extern(ID *id, bool enforce_fix=false)
static void shrinkwrap_new_data(void *cdata)
void BKE_pchan_calc_mat(bke::PChanBone pchanbone)
static void rotlike_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void translike_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
@ UI_SUBPANEL_DATA_EXPAND_2
@ UI_SUBPANEL_DATA_EXPAND_1
@ UI_PANEL_DATA_EXPAND_ROOT
static void distlimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void sizelike_new_data(void *cdata)
static void shrinkwrap_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], const float wmat[4][4])
void ABC_get_transform(struct CacheReader *reader, float r_mat_world[4][4], double time, float scale)
static void pivotcon_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
char * STRNCPY(char(&dst)[N], const char *src)
void * CustomData_bmesh_get(const CustomData *data, void *block, eCustomDataType type)
static MovieTrackingObject * followtrack_tracking_object_get(bConstraint *con, bConstraintOb *cob)
struct bConstraint * BKE_constraint_add_for_pose(struct Object *ob, struct bPoseChannel *pchan, const char *name, eBConstraint_Types type)
@ CON_ATTRIBUTE_4X4MATRIX
@ CON_ATTRIBUTE_QUATERNION
static bConstraintTypeInfo CTI_LOCLIKE
static bConstraintTypeInfo CTI_SIZELIMIT
void BKE_movieclip_get_size(MovieClip *clip, const MovieClipUser *user, int *r_width, int *r_height)
static bConstraintTypeInfo CTI_CHILDOF
static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *)
static void rotlike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
void BKE_tracking_marker_get_subframe_position(MovieTrackingTrack *track, float framenr, float pos[2])
static void sizelike_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void loclimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *)
static int minmax_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
static void actcon_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
@ LIMIT_ROT_LEGACY_BEHAVIOR
MINLINE void copy_v3_v3(float r[3], const float a[3])
static void rotlike_new_data(void *cdata)
static void con_extern_cb(bConstraint *, ID **idpoin, bool, void *)
void * BLO_read_struct_by_name_array(BlendDataReader *reader, StringRef struct_name, int64_t items_num, const void *old_address)
void mul_m4_fl(float R[4][4], float f)
void BKE_constraint_targets_flush(struct bConstraint *con, ListBaseT< bConstraintTarget > *targets, bool no_copy)
const bConstraintTypeInfo * BKE_constraint_typeinfo_from_type(int type)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
static void transform_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static const bke::GeometryComponent * find_source_component(const bke::GeometrySet &geometry, const bke::AttrDomain domain)
static MovieClip * followtrack_tracking_clip_get(bConstraint *con, bConstraintOb *cob)
static void constraint_copy_data_ex(bConstraint *dst, bConstraint *src, const int flag, const bool do_extern)
void mat3_normalized_to_axis_angle(float axis[3], float *angle, const float mat[3][3])
bool DEG_is_active(const Depsgraph *depsgraph)
static bConstraintTypeInfo CTI_KINEMATIC
@ CONSTRAINT_TYPE_FOLLOWTRACK
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_ROTLIMIT
@ CONSTRAINT_TYPE_SHRINKWRAP
@ CONSTRAINT_TYPE_SAMEVOL
@ CONSTRAINT_TYPE_SIZELIMIT
@ CONSTRAINT_TYPE_SPLINEIK
@ CONSTRAINT_TYPE_TRANSFORM
@ CONSTRAINT_TYPE_CAMERASOLVER
@ CONSTRAINT_TYPE_FOLLOWPATH
@ CONSTRAINT_TYPE_DAMPTRACK
@ CONSTRAINT_TYPE_LOCLIMIT
@ CONSTRAINT_TYPE_STRETCHTO
@ CONSTRAINT_TYPE_TRACKTO
@ CONSTRAINT_TYPE_GEOMETRY_ATTRIBUTE
@ CONSTRAINT_TYPE_ROTLIKE
@ CONSTRAINT_TYPE_LOCKTRACK
@ CONSTRAINT_TYPE_DISTLIMIT
@ CONSTRAINT_TYPE_ARMATURE
@ CONSTRAINT_TYPE_CLAMPTO
@ CONSTRAINT_TYPE_OBJECTSOLVER
@ CONSTRAINT_TYPE_CHILDOF
@ CONSTRAINT_TYPE_LOCLIKE
@ CONSTRAINT_TYPE_TRANSFORM_CACHE
@ CONSTRAINT_TYPE_SIZELIKE
@ CONSTRAINT_TYPE_TRANSLIKE
void BKE_constraints_solve(struct Depsgraph *depsgraph, ListBaseT< bConstraint > *conlist, struct bConstraintOb *cob, float ctime)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
@ CON_ATTRIBUTE_MIX_REPLACE
@ CON_ATTRIBUTE_MIX_AFTER_SPLIT
@ CON_ATTRIBUTE_MIX_AFTER_FULL
@ CON_ATTRIBUTE_MIX_BEFORE_SPLIT
@ CON_ATTRIBUTE_MIX_BEFORE_FULL
void copy_m3_m3(float m1[3][3], const float m2[3][3])
static void splineik_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void locktrack_new_data(void *cdata)
static bool followpath_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *, bConstraintTarget *ct, float)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
void BKE_pose_free_data(bPose *pose) ATTR_NONNULL(1)
static bool clampto_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, bConstraintTarget *ct, float)
bool BKE_shrinkwrap_project_normal(char options, const float vert[3], const float dir[3], const SpaceTransform *transf, ShrinkwrapTreeData *tree, BVHTreeRayHit *hit)
static void followpath_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void pivotcon_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
void BKE_constraint_free_data_ex(struct bConstraint *con, bool do_id_user)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
@ ACTCON_BONE_USE_OBJECT_ACTION
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)
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
static void translike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static bool default_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
struct bConstraintOb * BKE_constraints_make_evalob(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, void *subdata, short datatype)
static int kinematic_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
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])
@ CON_ATTRIBUTE_DOMAIN_FACE_CORNER
@ CON_ATTRIBUTE_DOMAIN_INSTANCE
@ CON_ATTRIBUTE_DOMAIN_POINT
@ CON_ATTRIBUTE_DOMAIN_CURVE
@ CON_ATTRIBUTE_DOMAIN_EDGE
@ CON_ATTRIBUTE_DOMAIN_FACE
void(*) ConstraintIDFunc(struct bConstraint *con, struct ID **idpoin, bool is_reference, void *userdata)
void normalize_m3(float R[3][3]) ATTR_NONNULL()
static void transformcache_new_data(void *cdata)
void BLI_space_transform_from_matrices(struct SpaceTransform *data, const float local[4][4], const float target[4][4])
static void followtrack_undistort_if_needed(FollowTrackContext *context, const int clip_width, const int clip_height, float marker_position[2])
struct bConstraint * BKE_constraint_copy_for_object(struct Object *ob, struct bConstraint *src)
static bool followtrack_context_init(FollowTrackContext *context, bConstraint *con, bConstraintOb *cob)
void BKE_pchan_bbone_deform_clamp_segment_index(const Bone &bone, float head_tail, int *r_index, float *r_blend_next)
static bool component_is_available(const bke::GeometrySet &geometry, const bke::GeometryComponent::Type type, const bke::AttrDomain domain)
static void followpath_new_data(void *cdata)
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
static void con_invoke_id_looper(const bConstraintTypeInfo *cti, bConstraint *con, ConstraintIDFunc func, const int, void *userdata)
static bConstraintTypeInfo * constraintsTypeInfo[NUM_CONSTRAINT_TYPES]
void add_weighted_dq_dq_pivot(DualQuat *dq_sum, const DualQuat *dq, const float pivot[3], float weight, bool compute_scale_matrix)
void interp_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4], float t)
bool BKE_constraint_apply_for_object(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct bConstraint *con)
static void locktrack_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
static void armdef_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void armdef_copy(bConstraint *con, bConstraint *srccon)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BKE_shrinkwrap_free_tree(ShrinkwrapTreeData *data)
@ CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE
void BLI_space_transform_invert(const struct SpaceTransform *data, float co[3])
@ STRETCHTOCON_USE_BULGE_MIN
@ STRETCHTOCON_USE_BULGE_MAX
static bool armdef_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, bConstraintTarget *ct, float)
void mul_v3_mat3_m4v3(float r[3], const float mat[4][4], const float vec[3])
static void geometry_attribute_new_data(void *cdata)
static void actcon_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
void mat4_to_eul(float eul[3], const float mat[4][4])
void BKE_mesh_wrapper_ensure_mdata(Mesh *mesh)
static void geometry_attribute_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, const bool no_copy)
MINLINE void add_v3_fl(float r[3], float f)
bool is_negative_m4(const float mat[4][4])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
static void transformcache_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void distlimit_new_data(void *cdata)
DispList * BKE_displist_find(ListBaseT< DispList > *lb, int type)
bool invert_m4(float mat[4][4])
static void followpath_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
void translate_m4(float mat[4][4], float Tx, float Ty, float Tz)
@ TRANS_MIXSCALE_MULTIPLY
static bool actcon_get_tarmat(Depsgraph *depsgraph, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
@ CACHE_FILE_TYPE_INVALID
ATTR_WARN_UNUSED_RESULT const BMVert * v
static bConstraintTypeInfo CTI_TRANSLIKE
static void clampto_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
MatBase< float, 4, 4 > float4x4
static void value_attribute_to_matrix(float r_matrix[4][4], const GPointer value, const Attribute_Data_Type data_type)
struct bConstraint * BKE_constraint_add_for_object(struct Object *ob, const char *name, eBConstraint_Types type)
struct bConstraint * BKE_constraint_find_from_target(struct Object *ob, struct bConstraintTarget *tgt, struct bPoseChannel **r_pchan)
void BIK_clear_data(struct bPose *pose)
static void objectsolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *)
static bke::AttrType type_value_to_attribute(const Attribute_Data_Type data_type)
static void armdef_free(bConstraint *con)
static void contarget_get_lattice_mat(Object *ob, const char *substring, float mat[4][4])
@ OBJECTSOLVER_ACTIVECLIP
@ OBJECTSOLVER_SET_INVERSE
struct bConstraint * BKE_constraint_copy_for_pose(struct Object *ob, struct bPoseChannel *pchan, struct bConstraint *src)
@ CONSTRAINT_SPACE_OWNLOCAL
@ CONSTRAINT_SPACE_PARLOCAL
@ CONSTRAINT_SPACE_CUSTOM
static int childof_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
void BKE_armature_mat_bone_to_pose(bke::PChanBoneConst pchanbone, const float inmat[4][4], float outmat[4][4])
void MEM_delete_void(void *vmemh)
MINLINE float pow3f(float x)
@ CAMERASOLVER_ACTIVECLIP
static int shrinkwrap_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
@ LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG
static void sizelimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *)
static void childof_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
static void geometry_attribute_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
void BKE_shrinkwrap_find_nearest_surface(ShrinkwrapTreeData *tree, BVHTreeNearest *nearest, float co[3], int type)
MINLINE void mul_v3_fl(float r[3], float f)
AnimationEvalContext BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
static bConstraintTypeInfo CTI_DAMPTRACK
void normalize_m4(float R[4][4]) ATTR_NONNULL()
@ PIVOTCON_FLAG_OFFSET_ABS
float distfactor_to_bone(const float3 &position, const float3 &head, const float3 &tail, float radius_head, float radius_tail, float falloff_distance)
static void stretchto_new_data(void *cdata)
static void damptrack_do_transform(float matrix[4][4], const float tarvec[3], int track_axis)
void mul_m4_m4m4_aligned_scale(float R[4][4], const float A[4][4], const float B[4][4])
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
static bConstraintTypeInfo CTI_MINMAX
VecBase< float, 4 > float4
void eulO_to_mat3(float M[3][3], const float e[3], short order)
static void transform_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void minmax_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static Object * followtrack_camera_object_get(bConstraint *con, bConstraintOb *cob)
static int transform_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
@ FOLLOWTRACK_FRAME_STRETCH
void mul_m4_v3(const float M[4][4], float r[3])
static void add_new_constraint_to_list(Object *ob, bPoseChannel *pchan, bConstraint *con)
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
static bConstraintTypeInfo CTI_PIVOT
void normalize_dq(DualQuat *dq, float totweight)
static void kinematic_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(struct bConstraint *con)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static void trackto_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
void BKE_constraint_unique_name(struct bConstraint *con, ListBaseT< bConstraint > *list)
void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, int32_t action_slot_handle, const char groupname[], const AnimationEvalContext *anim_eval_context) ATTR_NONNULL(1
static const float track_dir_vecs[6][3]
void BLI_uniquename(const ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
static void camerasolver_new_data(void *cdata)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BKE_constraint_mat_convertspace(struct Object *ob, struct bPoseChannel *pchan, struct bConstraintOb *cob, float mat[4][4], short from, short to, bool keep_scale)
static bConstraintTypeInfo CTI_FOLLOWTRACK
static int basis_cross(int n, int m)
static int loclike_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
static void geometry_attribute_free_data(bConstraint *con)
static void stretchto_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
void * MEM_dupalloc_void(const void *vmemh) ATTR_WARN_UNUSED_RESULT
static void childof_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
void BKE_constraint_custom_object_space_init(struct bConstraintOb *cob, struct bConstraint *con)
static void camerasolver_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
MINLINE void mul_v3_v3(float r[3], const float a[3])
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static void minmax_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
void transpose_m3(float R[3][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])
void BKE_tracking_undistort_v2(MovieTracking *tracking, int image_width, int image_height, const float co[2], float r_co[2])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
static void followtrack_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
void BKE_armature_mat_pose_to_bone(bke::PChanBoneConst pchanbone, const float inmat[4][4], float outmat[4][4])
static void followtrack_evaluate_using_2d_position(FollowTrackContext *context, bConstraintOb *cob)
static void damptrack_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
bool BKE_constraint_has_influence(const struct bConstraint *con)
void BKE_pchan_bbone_deform_segment_index(bke::PChanBoneConst pchanbone, const float *co, int *r_index, float *r_blend_next)
static void followtrack_evaluate_using_3d_position_camera(FollowTrackContext *context, bConstraintOb *cob)
void BKE_object_to_mat4(const Object *ob, float r_mat[4][4])
void DEG_id_tag_update(ID *id, unsigned int flags)
float BKE_scene_frame_get(const Scene *scene)
static bConstraintTypeInfo CTI_SIZELIKE
static void con_fix_copied_refs_cb(bConstraint *, ID **idpoin, bool is_reference, void *)
static bConstraint * constraint_find_original(Object *ob, bPoseChannel *pchan, bConstraint *con, Object **r_orig_ob)
static int distlimit_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
BMesh const char void * data
static bConstraintTypeInfo CTI_FOLLOWPATH
void BKE_constraints_copy(ListBaseT< bConstraint > *dst, const ListBaseT< bConstraint > *src, bool do_extern)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
MovieTrackingTrack * BKE_tracking_object_find_track_with_name(MovieTrackingObject *tracking_object, const char *name)
static bConstraintTypeInfo CTI_CAMERASOLVER
bool BKE_constraint_is_nonlocal_in_liboverride(const struct Object *ob, const struct bConstraint *con)
static bConstraintTypeInfo CTI_ROTLIKE
static int trackto_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
static void camerasolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *)
void BKE_tracking_camera_get_reconstructed_interpolate(MovieTracking *tracking, MovieTrackingObject *tracking_object, float framenr, float mat[4][4])
static int splineik_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
void BKE_pchan_apply_mat4(bPoseChannel *pchan, const float mat[4][4], bool use_compat)
@ CONSTRAINT_SPLINEIK_YS_FIT_CURVE
MovieTrackingObject * BKE_tracking_object_get_camera(const MovieTracking *tracking)
void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob)
static void kinematic_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
static void kinematic_new_data(void *cdata)
struct bConstraint * BKE_constraint_duplicate_ex(struct bConstraint *src, int flag, bool do_extern)
static void geometry_attribute_copy_data(bConstraint *con, bConstraint *srccon)
void BKE_object_where_is_calc_mat4(const Object *ob, float r_obmat[4][4])
static float wrap_rad_angle(const float angle)
@ CONSTRAINT_ARMATURE_ENVELOPE
@ CONSTRAINT_ARMATURE_QUATERNION
@ CONSTRAINT_ARMATURE_CUR_LOCATION
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void armdef_accumulate_bone(const bConstraintTarget *ct, const bke::PChanBone pchanbone, const float wco[3], const bool force_envelope, float *r_totweight, float r_sum_mat[4][4], DualQuat *r_sum_dq)
bool BKE_constraint_apply_and_remove_for_pose(struct Depsgraph *depsgraph, struct Scene *scene, ListBaseT< bConstraint > *constraints, struct Object *ob, struct bConstraint *con, struct bPoseChannel *pchan)
static void trackto_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
@ TRANSLIKE_REMOVE_TARGET_SHEAR
static bConstraint * constraint_find_original_for_update(bConstraintOb *cob, bConstraint *con)
static bConstraintTypeInfo CTI_TRACKTO
static bConstraintTypeInfo CTI_TRANSFORM
static void trackto_new_data(void *cdata)
static int followpath_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
int BKE_object_defgroup_name_index(const Object *ob, StringRef name)
MINLINE void negate_v3(float r[3])
static int clampto_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
void mat4_to_compatible_eulO(float eul[3], const float oldrot[3], short order, const float mat[4][4])
void loc_eulO_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3], short order)
static void locktrack_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 int translike_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
int BKE_constraint_targets_get(struct bConstraint *con, ListBaseT< bConstraintTarget > *r_targets)
void unit_m4(float m[4][4])
static void clampto_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
bool BKE_constraint_remove_ex(ListBaseT< bConstraint > *list, struct Object *ob, struct bConstraint *con)
static void sizelike_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
bool BKE_constraint_target_uses_bbone(struct bConstraint *con, struct bConstraintTarget *ct)
struct bConstraint * BKE_constraints_active_get(ListBaseT< bConstraint > *list)
static void loclike_new_data(void *cdata)
static int sizelike_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
static void pivotcon_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
@ ACTCON_MIX_BEFORE_SPLIT
void normalize_m4_ex(float R[4][4], float r_scale[3]) ATTR_NONNULL()
static void distlimit_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
static float clamp_angle(const float angle, const float min, const float max)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
static void damptrack_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
static int geometry_attribute_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
void mat4_to_eulO(float eul[3], short order, const float m[4][4])
MINLINE void zero_v3(float r[3])
void quat_apply_track(float quat[4], short axis, short upflag)
static void rotlimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *)
static bool splineik_get_tarmat(Depsgraph *, bConstraint *, bConstraintOb *, bConstraintTarget *ct, float)
static bConstraintTypeInfo CTI_LOCKTRACK
static bConstraintTypeInfo CTI_TRANSFORM_CACHE
void BKE_constraint_blend_read_data(struct BlendDataReader *reader, struct ID *id_owner, ListBaseT< bConstraint > *lb)
static bConstraintTypeInfo CTI_SAMEVOL
@ MOD_SHRINKWRAP_NEAREST_VERTEX
@ MOD_SHRINKWRAP_NEAREST_SURFACE
@ MOD_SHRINKWRAP_TARGET_PROJECT
static bool constraint_remove(ListBaseT< bConstraint > *list, bConstraint *con)
void BKE_constraint_targets_for_solving_get(struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *ob, ListBaseT< bConstraintTarget > *targets, float ctime)
static void loclike_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
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])
static void sizelike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void translike_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
void loc_rot_size_to_mat4(float R[4][4], const float loc[3], const float rot[3][3], const float size[3])
static void loclike_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void splineik_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
static void minmax_new_data(void *cdata)
static void transformcache_copy(bConstraint *con, bConstraint *srccon)
void BKE_movieclip_user_set_frame(MovieClipUser *user, int framenr)
void mul_mat3_m4_v3(const float mat[4][4], float r[3])
static bool shrinkwrap_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
static void splineik_free(bConstraint *con)
MINLINE float normalize_v3_v3(float r[3], const float a[3])
void mat4_to_size(float size[3], const float M[4][4])
void BLO_read_array_and_validate_size(BlendDataReader *reader, T **ptr_p, SizeT *array_size, const int elems=1)
void mat4_to_dquat(DualQuat *dq, const float basemat[4][4], const float mat[4][4])
float BKE_movieclip_remap_scene_to_clip_frame(const MovieClip *clip, float framenr)
static void splineik_copy(bConstraint *con, bConstraint *srccon)
static bConstraintTypeInfo CTI_ATTRIBUTE
static void transformcache_free(bConstraint *con)
void invert_m4_m4_safe(float inverse[4][4], const float mat[4][4])
static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void childof_new_data(void *cdata)
MINLINE float normalize_v3(float n[3])
static void trackto_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
MINLINE void add_v3_v3(float r[3], const float a[3])
static void followtrack_evaluate_using_3d_position_object(FollowTrackContext *context, bConstraintOb *cob)
static void transformcache_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void loclike_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
static void transform_new_data(void *cdata)
static void actcon_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static bConstraintTypeInfo CTI_ARMATURE
T * DEG_get_original(T *id)
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)
static int armdef_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
void unit_m3(float m[3][3])
static bConstraintTypeInfo CTI_ACTION
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
MINLINE void copy_v3_fl(float r[3], float f)
static bool default_get_tarmat_full_bbone(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
static int stretchto_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
static void shrinkwrap_evaluate(bConstraint *, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static void childof_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
void BKE_constraints_clear_evalob(struct 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 samevolume_new_data(void *cdata)
double BKE_cachefile_time_offset(const CacheFile *cache_file, double time, double fps)
@ CON_SHRINKWRAP_PROJECT_OPPOSITE
@ CON_SHRINKWRAP_TRACK_NORMAL
@ CON_SHRINKWRAP_PROJECT_INVERT_CULL
MINLINE float max_ff(float a, float b)
static void distlimit_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
static int damptrack_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
void dquat_to_mat4(float R[4][4], const DualQuat *dq)
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
static void geometry_attribute_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
void BKE_constraints_active_set(ListBaseT< bConstraint > *list, struct bConstraint *con)
static bke::AttrDomain domain_value_to_attribute(const Attribute_Domain domain)
static void objectsolver_new_data(void *cdata)
void rescale_m4(float mat[4][4], const float scale[3])
static void followpath_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
MINLINE float square_f(float a)
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
MINLINE float interpf(float target, float origin, float t)
static void con_unlink_refs_cb(bConstraint *, ID **idpoin, bool is_reference, void *)
@ CONSTRAINT_OBTYPE_OBJECT
void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph, struct Scene *scene, struct bConstraint *con, int index, short ownertype, void *ownerdata, float mat[4][4], float ctime)
MovieTrackingObject * BKE_tracking_object_get_named(MovieTracking *tracking, const char *name)
static int locktrack_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
char * BLI_strdup_null(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_MALLOC
void BKE_tracking_get_camera_object_matrix(const Object *camera_object, float mat[4][4])
static void damptrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
std::optional< Bounds< float3 > > BKE_object_boundbox_get(const Object *ob)
static bConstraintTypeInfo CTI_CLAMPTO
static void damptrack_new_data(void *cdata)
void BKE_constraints_free_ex(ListBaseT< bConstraint > *list, bool do_id_user)
void BKE_constraints_id_loop(ListBaseT< bConstraint > *list, ConstraintIDFunc func, const int flag, void *userdata)
static void objectsolver_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdata)
bool BKE_animdata_drivers_remove_for_rna_struct(ID &owner_id, struct StructRNA &type, void *data)
void BLI_space_transform_apply(const struct SpaceTransform *data, float co[3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
struct bConstraint * BKE_constraints_find_name(ListBaseT< bConstraint > *list, const char *name)
void compatible_eul(float eul[3], const float oldrot[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
VecBase< float, 3 > float3
void scale_m4_fl(float R[4][4], float scale)
static void vectomat(const float vec[3], const float target_up[3], short axis, short upflag, short flags, float m[3][3])
void BKE_constraint_panel_expand(struct bConstraint *con)
@ TRANSLIKE_MIX_BEFORE_SPLIT
@ TRANSLIKE_MIX_BEFORE_FULL
@ TRANSLIKE_MIX_AFTER_SPLIT
@ TRANSLIKE_MIX_AFTER_FULL
void BKE_camera_params_init(CameraParams *params)
float mat4_to_volume_scale(const float mat[4][4])
static bConstraintTypeInfo CTI_SHRINKWRAP
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
static void shrinkwrap_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
static bConstraint * add_new_constraint(Object *ob, bPoseChannel *pchan, const char *name, eBConstraint_Types type)
static void followtrack_evaluate_using_3d_position(FollowTrackContext *context, bConstraintOb *cob)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
void mat3_to_eulO(float eul[3], short order, const float m[3][3])
static void unit_ct_matrix_nullsafe(bConstraintTarget *ct)
static void constraints_init_typeinfo()
void madd_m4_m4m4fl(float R[4][4], const float A[4][4], const float B[4][4], float f)
static void splineik_new_data(void *cdata)
static bool is_custom_space_needed(bConstraint *con)
void axis_angle_normalized_to_mat3(float R[3][3], const float axis[3], float angle)
static float followtrack_distance_from_viewplane_get(FollowTrackContext *context, bConstraintOb *cob)
void BKE_constraint_blend_write(struct BlendWriter *writer, ListBaseT< bConstraint > *conlist)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
float DEG_get_ctime(const Depsgraph *graph)
static void transform_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
static void actcon_new_data(void *cdata)
static bConstraint * constraint_list_find_from_target(ListBaseT< bConstraint > *constraints, bConstraintTarget *tgt)
static bConstraintTypeInfo CTI_SPLINEIK
static bConstraintTypeInfo CTI_DISTLIMIT
static int pivotcon_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
void BKE_cachefile_reader_free(CacheFile *cache_file, CacheReader **reader)
void orthogonalize_m4_stable(float R[4][4], int axis, bool normalize)
float determinant_m3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
static void minmax_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
void BKE_cachefile_reader_open(CacheFile *cache_file, CacheReader **reader, Object *object, const char *object_path)
static void armdef_evaluate(bConstraint *con, bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
static bool kinematic_get_tarmat(Depsgraph *, bConstraint *con, bConstraintOb *cob, bConstraintTarget *ct, float)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void mul_m4_m3m4(float R[4][4], const float A[3][3], const float B[4][4])
@ CONSTRAINT_BBONE_SHAPE_FULL
@ CONSTRAINT_OVERRIDE_LIBRARY_LOCAL
MDeformWeight * BKE_defvert_find_index(const MDeformVert *dv, int defgroup)
void quat_to_mat4(float m[4][4], const float q[4])
void BLI_space_transform_invert_normal(const struct SpaceTransform *data, float no[3])
@ FOLLOWTRACK_USE_3D_POSITION
@ FOLLOWTRACK_USE_UNDISTORTION
static bConstraint * add_new_constraint_internal(const char *name, eBConstraint_Types type)
static int actcon_get_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list)
Mesh * BKE_object_get_evaluated_mesh(const Object *object_eval)
bool BKE_shrinkwrap_init_tree(ShrinkwrapTreeData *data, Mesh *mesh, int shrinkType, int shrinkMode, bool force_normals)
MINLINE float clamp_f(float value, float min, float max)
static bConstraintTypeInfo CTI_ROTLIMIT
static void followtrack_project_to_depth_object_if_needed(FollowTrackContext *context, bConstraintOb *cob)
static void followtrack_new_data(void *cdata)
static void rotlike_flush_tars(bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
static bConstraintTypeInfo CTI_OBJECTSOLVER
void rotate_eulO(float beul[3], short order, char axis, float angle)
bool BKE_constraint_apply_and_remove_for_object(struct Depsgraph *depsgraph, struct Scene *scene, ListBaseT< bConstraint > *constraints, struct Object *ob, struct bConstraint *con)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
void write_string(const char *data)
void write_struct_by_name(const char *struct_name, const void *data, BlendStructWriterFn fn=nullptr)
void write_float_array(int64_t num, const float *data)
void write_struct(const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
const float * anim_path_accum_length
ListBaseT< DispList > disp
MovieTrackingTrack * track
MovieTrackingObject * tracking_object
struct MDeformVert * dvert
const c_style_mat & ptr() const
struct MovieTracking tracking
bke::ObjectRuntime * runtime
ListBaseT< bConstraint > constraints
char last_slot_identifier[258]
int32_t action_slot_handle
ListBaseT< bConstraintTarget > targets
struct bPoseChannel * pchan
float space_obj_world_matrix[4][4]
struct Depsgraph * depsgraph
struct Bone * pchan_armbone
eBConstraint_SpaceTypes space
eConstraintTargetFlag flag
void(*) new_data(void *cdata)
void(*) copy_data(struct bConstraint *con, struct bConstraint *src)
void(*) flush_constraint_targets(struct bConstraint *con, ListBaseT< bConstraintTarget > *list, bool no_copy)
bool(*) get_target_matrix(struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime)
void(*) free_data(struct bConstraint *con)
void(*) id_looper(struct bConstraint *con, ConstraintIDFunc func, void *userdata)
int(*) get_constraint_targets(struct bConstraint *con, ListBaseT< bConstraintTarget > *list)
void(*) evaluate_constraint(struct bConstraint *con, struct bConstraintOb *cob, ListBaseT< bConstraintTarget > *targets)
eBConstraint_SpaceTypes ownspace
struct Object * space_object
struct bConstraint * prev
struct bConstraint * next
eBConstraint_SpaceTypes tarspace
Attribute_Data_Type data_type
struct Mat4 * bbone_rest_mats
struct Mat4 * bbone_pose_mats
struct Mat4 * bbone_deform_mats
struct bPoseChannel_Runtime runtime
ListBaseT< struct bConstraint > constraints
struct bPoseChannel * orig_pchan
ListBaseT< bPoseChannel > chanbase