Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/constraint.c
| Show First 20 Lines • Show All 1,105 Lines • ▼ Show 20 Lines | if (!(data->flag & CHILDOF_LOCZ)) { | ||||
| cob->matrix[3][2] = orig_cob_matrix[3][2]; | cob->matrix[3][2] = orig_cob_matrix[3][2]; | ||||
| } | } | ||||
| } | } | ||||
| /* XXX NOTE: con->flag should be CONSTRAINT_SPACEONCE for bone-childof, patched in `readfile.c`. */ | /* XXX NOTE: con->flag should be CONSTRAINT_SPACEONCE for bone-childof, patched in `readfile.c`. */ | ||||
| static bConstraintTypeInfo CTI_CHILDOF = { | static bConstraintTypeInfo CTI_CHILDOF = { | ||||
| CONSTRAINT_TYPE_CHILDOF, /* type */ | CONSTRAINT_TYPE_CHILDOF, /* type */ | ||||
| sizeof(bChildOfConstraint), /* size */ | sizeof(bChildOfConstraint), /* size */ | ||||
| "Child Of", /* name */ | N_("Child Of"), /* name */ | ||||
| "bChildOfConstraint", /* struct name */ | "bChildOfConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| childof_id_looper, /* id looper */ | childof_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| childof_new_data, /* new data */ | childof_new_data, /* new data */ | ||||
| childof_get_tars, /* get constraint targets */ | childof_get_tars, /* get constraint targets */ | ||||
| childof_flush_tars, /* flush constraint targets */ | childof_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get a target matrix */ | default_get_tarmat, /* get a target matrix */ | ||||
| ▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | if (VALID_CONS_TARGET(ct)) { | ||||
| mul_m4_m3m4(cob->matrix, totmat, cob->matrix); | mul_m4_m3m4(cob->matrix, totmat, cob->matrix); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_TRACKTO = { | static bConstraintTypeInfo CTI_TRACKTO = { | ||||
| CONSTRAINT_TYPE_TRACKTO, /* type */ | CONSTRAINT_TYPE_TRACKTO, /* type */ | ||||
| sizeof(bTrackToConstraint), /* size */ | sizeof(bTrackToConstraint), /* size */ | ||||
| "Track To", /* name */ | N_("Track To"), /* name */ | ||||
| "bTrackToConstraint", /* struct name */ | "bTrackToConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| trackto_id_looper, /* id looper */ | trackto_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| trackto_new_data, /* new data */ | trackto_new_data, /* new data */ | ||||
| trackto_get_tars, /* get constraint targets */ | trackto_get_tars, /* get constraint targets */ | ||||
| trackto_flush_tars, /* flush constraint targets */ | trackto_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get target matrix */ | default_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | else { | ||||
| unit_m4(ct->matrix); | unit_m4(ct->matrix); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_KINEMATIC = { | static bConstraintTypeInfo CTI_KINEMATIC = { | ||||
| CONSTRAINT_TYPE_KINEMATIC, /* type */ | CONSTRAINT_TYPE_KINEMATIC, /* type */ | ||||
| sizeof(bKinematicConstraint), /* size */ | sizeof(bKinematicConstraint), /* size */ | ||||
| "IK", /* name */ | N_("IK"), /* name */ | ||||
| "bKinematicConstraint", /* struct name */ | "bKinematicConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| kinematic_id_looper, /* id looper */ | kinematic_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| kinematic_new_data, /* new data */ | kinematic_new_data, /* new data */ | ||||
| kinematic_get_tars, /* get constraint targets */ | kinematic_get_tars, /* get constraint targets */ | ||||
| kinematic_flush_tars, /* flush constraint targets */ | kinematic_flush_tars, /* flush constraint targets */ | ||||
| kinematic_get_tarmat, /* get target matrix */ | kinematic_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | if ((data->followflag & FOLLOWPATH_RADIUS) == 0) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_FOLLOWPATH = { | static bConstraintTypeInfo CTI_FOLLOWPATH = { | ||||
| CONSTRAINT_TYPE_FOLLOWPATH, /* type */ | CONSTRAINT_TYPE_FOLLOWPATH, /* type */ | ||||
| sizeof(bFollowPathConstraint), /* size */ | sizeof(bFollowPathConstraint), /* size */ | ||||
| "Follow Path", /* name */ | N_("Follow Path"), /* name */ | ||||
| "bFollowPathConstraint", /* struct name */ | "bFollowPathConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| followpath_id_looper, /* id looper */ | followpath_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| followpath_new_data, /* new data */ | followpath_new_data, /* new data */ | ||||
| followpath_get_tars, /* get constraint targets */ | followpath_get_tars, /* get constraint targets */ | ||||
| followpath_flush_tars, /* flush constraint targets */ | followpath_flush_tars, /* flush constraint targets */ | ||||
| followpath_get_tarmat, /* get target matrix */ | followpath_get_tarmat, /* get target matrix */ | ||||
| Show All 36 Lines | if (cob->matrix[3][2] > data->zmax) { | ||||
| cob->matrix[3][2] = data->zmax; | cob->matrix[3][2] = data->zmax; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_LOCLIMIT = { | static bConstraintTypeInfo CTI_LOCLIMIT = { | ||||
| CONSTRAINT_TYPE_LOCLIMIT, /* type */ | CONSTRAINT_TYPE_LOCLIMIT, /* type */ | ||||
| sizeof(bLocLimitConstraint), /* size */ | sizeof(bLocLimitConstraint), /* size */ | ||||
| "Limit Location", /* name */ | N_("Limit Location"), /* name */ | ||||
| "bLocLimitConstraint", /* struct name */ | "bLocLimitConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| NULL, /* id looper */ | NULL, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| NULL, /* new data */ | NULL, /* new data */ | ||||
| NULL, /* get constraint targets */ | NULL, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| NULL, /* get target matrix */ | NULL, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | static void rotlimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) | ||||
| } | } | ||||
| loc_eulO_size_to_mat4(cob->matrix, loc, eul, size, rot_order); | loc_eulO_size_to_mat4(cob->matrix, loc, eul, size, rot_order); | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_ROTLIMIT = { | static bConstraintTypeInfo CTI_ROTLIMIT = { | ||||
| CONSTRAINT_TYPE_ROTLIMIT, /* type */ | CONSTRAINT_TYPE_ROTLIMIT, /* type */ | ||||
| sizeof(bRotLimitConstraint), /* size */ | sizeof(bRotLimitConstraint), /* size */ | ||||
| "Limit Rotation", /* name */ | N_("Limit Rotation"), /* name */ | ||||
| "bRotLimitConstraint", /* struct name */ | "bRotLimitConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| NULL, /* id looper */ | NULL, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| NULL, /* new data */ | NULL, /* new data */ | ||||
| NULL, /* get constraint targets */ | NULL, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| NULL, /* get target matrix */ | NULL, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | static void sizelimit_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) | ||||
| if (obsize[2]) { | if (obsize[2]) { | ||||
| mul_v3_fl(cob->matrix[2], size[2] / obsize[2]); | mul_v3_fl(cob->matrix[2], size[2] / obsize[2]); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_SIZELIMIT = { | static bConstraintTypeInfo CTI_SIZELIMIT = { | ||||
| CONSTRAINT_TYPE_SIZELIMIT, /* type */ | CONSTRAINT_TYPE_SIZELIMIT, /* type */ | ||||
| sizeof(bSizeLimitConstraint), /* size */ | sizeof(bSizeLimitConstraint), /* size */ | ||||
| "Limit Scale", /* name */ | N_("Limit Scale"), /* name */ | ||||
| "bSizeLimitConstraint", /* struct name */ | "bSizeLimitConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| NULL, /* id looper */ | NULL, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| NULL, /* new data */ | NULL, /* new data */ | ||||
| NULL, /* get constraint targets */ | NULL, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| NULL, /* get target matrix */ | NULL, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | if (data->flag & LOCLIKE_Z) { | ||||
| cob->matrix[3][2] += offset[2]; | cob->matrix[3][2] += offset[2]; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_LOCLIKE = { | static bConstraintTypeInfo CTI_LOCLIKE = { | ||||
| CONSTRAINT_TYPE_LOCLIKE, /* type */ | CONSTRAINT_TYPE_LOCLIKE, /* type */ | ||||
| sizeof(bLocateLikeConstraint), /* size */ | sizeof(bLocateLikeConstraint), /* size */ | ||||
| "Copy Location", /* name */ | N_("Copy Location"), /* name */ | ||||
| "bLocateLikeConstraint", /* struct name */ | "bLocateLikeConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| loclike_id_looper, /* id looper */ | loclike_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| loclike_new_data, /* new data */ | loclike_new_data, /* new data */ | ||||
| loclike_get_tars, /* get constraint targets */ | loclike_get_tars, /* get constraint targets */ | ||||
| loclike_flush_tars, /* flush constraint targets */ | loclike_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get target matrix */ | default_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | if (VALID_CONS_TARGET(ct)) { | ||||
| loc_rot_size_to_mat4(cob->matrix, loc, newrot, size); | loc_rot_size_to_mat4(cob->matrix, loc, newrot, size); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_ROTLIKE = { | static bConstraintTypeInfo CTI_ROTLIKE = { | ||||
| CONSTRAINT_TYPE_ROTLIKE, /* type */ | CONSTRAINT_TYPE_ROTLIKE, /* type */ | ||||
| sizeof(bRotateLikeConstraint), /* size */ | sizeof(bRotateLikeConstraint), /* size */ | ||||
| "Copy Rotation", /* name */ | N_("Copy Rotation"), /* name */ | ||||
| "bRotateLikeConstraint", /* struct name */ | "bRotateLikeConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| rotlike_id_looper, /* id looper */ | rotlike_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| rotlike_new_data, /* new data */ | rotlike_new_data, /* new data */ | ||||
| rotlike_get_tars, /* get constraint targets */ | rotlike_get_tars, /* get constraint targets */ | ||||
| rotlike_flush_tars, /* flush constraint targets */ | rotlike_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get target matrix */ | default_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | if ((data->flag & (SIZELIKE_Z | SIZELIKE_UNIFORM)) && (obsize[2] != 0)) { | ||||
| mul_v3_fl(cob->matrix[2], size[2] / obsize[2]); | mul_v3_fl(cob->matrix[2], size[2] / obsize[2]); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_SIZELIKE = { | static bConstraintTypeInfo CTI_SIZELIKE = { | ||||
| CONSTRAINT_TYPE_SIZELIKE, /* type */ | CONSTRAINT_TYPE_SIZELIKE, /* type */ | ||||
| sizeof(bSizeLikeConstraint), /* size */ | sizeof(bSizeLikeConstraint), /* size */ | ||||
| "Copy Scale", /* name */ | N_("Copy Scale"), /* name */ | ||||
| "bSizeLikeConstraint", /* struct name */ | "bSizeLikeConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| sizelike_id_looper, /* id looper */ | sizelike_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| sizelike_new_data, /* new data */ | sizelike_new_data, /* new data */ | ||||
| sizelike_get_tars, /* get constraint targets */ | sizelike_get_tars, /* get constraint targets */ | ||||
| sizelike_flush_tars, /* flush constraint targets */ | sizelike_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get target matrix */ | default_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | switch (data->mix_mode) { | ||||
| BLI_assert_msg(0, "Unknown Copy Transforms mix mode"); | BLI_assert_msg(0, "Unknown Copy Transforms mix mode"); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_TRANSLIKE = { | static bConstraintTypeInfo CTI_TRANSLIKE = { | ||||
| CONSTRAINT_TYPE_TRANSLIKE, /* type */ | CONSTRAINT_TYPE_TRANSLIKE, /* type */ | ||||
| sizeof(bTransLikeConstraint), /* size */ | sizeof(bTransLikeConstraint), /* size */ | ||||
| "Copy Transforms", /* name */ | N_("Copy Transforms"), /* name */ | ||||
| "bTransLikeConstraint", /* struct name */ | "bTransLikeConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| translike_id_looper, /* id looper */ | translike_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| NULL, /* new data */ | NULL, /* new data */ | ||||
| translike_get_tars, /* get constraint targets */ | translike_get_tars, /* get constraint targets */ | ||||
| translike_flush_tars, /* flush constraint targets */ | translike_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat_full_bbone, /* get target matrix */ | default_get_tarmat_full_bbone, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | case SAMEVOL_Z: | ||||
| mul_v3_fl(cob->matrix[1], fac); | mul_v3_fl(cob->matrix[1], fac); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_SAMEVOL = { | static bConstraintTypeInfo CTI_SAMEVOL = { | ||||
| CONSTRAINT_TYPE_SAMEVOL, /* type */ | CONSTRAINT_TYPE_SAMEVOL, /* type */ | ||||
| sizeof(bSameVolumeConstraint), /* size */ | sizeof(bSameVolumeConstraint), /* size */ | ||||
| "Maintain Volume", /* name */ | N_("Maintain Volume"), /* name */ | ||||
| "bSameVolumeConstraint", /* struct name */ | "bSameVolumeConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| NULL, /* id looper */ | NULL, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| samevolume_new_data, /* new data */ | samevolume_new_data, /* new data */ | ||||
| NULL, /* get constraint targets */ | NULL, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| NULL, /* get target matrix */ | NULL, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | #else | ||||
| /* Now, run the actual 'constraint' function, which should only access the matrices */ | /* Now, run the actual 'constraint' function, which should only access the matrices */ | ||||
| BPY_pyconstraint_exec(data, cob, targets); | BPY_pyconstraint_exec(data, cob, targets); | ||||
| #endif /* WITH_PYTHON */ | #endif /* WITH_PYTHON */ | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_PYTHON = { | static bConstraintTypeInfo CTI_PYTHON = { | ||||
| CONSTRAINT_TYPE_PYTHON, /* type */ | CONSTRAINT_TYPE_PYTHON, /* type */ | ||||
| sizeof(bPythonConstraint), /* size */ | sizeof(bPythonConstraint), /* size */ | ||||
| "Script", /* name */ | N_("Script"), /* name */ | ||||
| "bPythonConstraint", /* struct name */ | "bPythonConstraint", /* struct name */ | ||||
| pycon_free, /* free data */ | pycon_free, /* free data */ | ||||
| pycon_id_looper, /* id looper */ | pycon_id_looper, /* id looper */ | ||||
| pycon_copy, /* copy data */ | pycon_copy, /* copy data */ | ||||
| pycon_new_data, /* new data */ | pycon_new_data, /* new data */ | ||||
| pycon_get_tars, /* get constraint targets */ | pycon_get_tars, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| pycon_get_tarmat, /* get target matrix */ | pycon_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | if (weight > 0.0f) { | ||||
| /* Apply the transform to the result matrix. */ | /* Apply the transform to the result matrix. */ | ||||
| mul_m4_m4m4(cob->matrix, sum_mat, cob->matrix); | mul_m4_m4m4(cob->matrix, sum_mat, cob->matrix); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_ARMATURE = { | static bConstraintTypeInfo CTI_ARMATURE = { | ||||
| CONSTRAINT_TYPE_ARMATURE, /* type */ | CONSTRAINT_TYPE_ARMATURE, /* type */ | ||||
| sizeof(bArmatureConstraint), /* size */ | sizeof(bArmatureConstraint), /* size */ | ||||
| "Armature", /* name */ | N_("Armature"), /* name */ | ||||
| "bArmatureConstraint", /* struct name */ | "bArmatureConstraint", /* struct name */ | ||||
| armdef_free, /* free data */ | armdef_free, /* free data */ | ||||
| armdef_id_looper, /* id looper */ | armdef_id_looper, /* id looper */ | ||||
| armdef_copy, /* copy data */ | armdef_copy, /* copy data */ | ||||
| NULL, /* new data */ | NULL, /* new data */ | ||||
| armdef_get_tars, /* get constraint targets */ | armdef_get_tars, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| armdef_get_tarmat, /* get target matrix */ | armdef_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | switch (data->mix_mode) { | ||||
| BLI_assert_msg(0, "Unknown Action mix mode"); | BLI_assert_msg(0, "Unknown Action mix mode"); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_ACTION = { | static bConstraintTypeInfo CTI_ACTION = { | ||||
| CONSTRAINT_TYPE_ACTION, /* type */ | CONSTRAINT_TYPE_ACTION, /* type */ | ||||
| sizeof(bActionConstraint), /* size */ | sizeof(bActionConstraint), /* size */ | ||||
| "Action", /* name */ | N_("Action"), /* name */ | ||||
| "bActionConstraint", /* struct name */ | "bActionConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| actcon_id_looper, /* id looper */ | actcon_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| actcon_new_data, /* new data */ | actcon_new_data, /* new data */ | ||||
| actcon_get_tars, /* get constraint targets */ | actcon_get_tars, /* get constraint targets */ | ||||
| actcon_flush_tars, /* flush constraint targets */ | actcon_flush_tars, /* flush constraint targets */ | ||||
| actcon_get_tarmat, /* get target matrix */ | actcon_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | if (VALID_CONS_TARGET(ct)) { | ||||
| /* apply out transformation to the object */ | /* apply out transformation to the object */ | ||||
| mul_m4_m3m4(cob->matrix, totmat, cob->matrix); | mul_m4_m3m4(cob->matrix, totmat, cob->matrix); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_LOCKTRACK = { | static bConstraintTypeInfo CTI_LOCKTRACK = { | ||||
| CONSTRAINT_TYPE_LOCKTRACK, /* type */ | CONSTRAINT_TYPE_LOCKTRACK, /* type */ | ||||
| sizeof(bLockTrackConstraint), /* size */ | sizeof(bLockTrackConstraint), /* size */ | ||||
| "Locked Track", /* name */ | N_("Locked Track"), /* name */ | ||||
| "bLockTrackConstraint", /* struct name */ | "bLockTrackConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| locktrack_id_looper, /* id looper */ | locktrack_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| locktrack_new_data, /* new data */ | locktrack_new_data, /* new data */ | ||||
| locktrack_get_tars, /* get constraint targets */ | locktrack_get_tars, /* get constraint targets */ | ||||
| locktrack_flush_tars, /* flush constraint targets */ | locktrack_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get target matrix */ | default_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | if (clamp_surf) { | ||||
| copy_v3_v3(cob->matrix[3], dvec); | copy_v3_v3(cob->matrix[3], dvec); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_DISTLIMIT = { | static bConstraintTypeInfo CTI_DISTLIMIT = { | ||||
| CONSTRAINT_TYPE_DISTLIMIT, /* type */ | CONSTRAINT_TYPE_DISTLIMIT, /* type */ | ||||
| sizeof(bDistLimitConstraint), /* size */ | sizeof(bDistLimitConstraint), /* size */ | ||||
| "Limit Distance", /* name */ | N_("Limit Distance"), /* name */ | ||||
| "bDistLimitConstraint", /* struct name */ | "bDistLimitConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| distlimit_id_looper, /* id looper */ | distlimit_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| distlimit_new_data, /* new data */ | distlimit_new_data, /* new data */ | ||||
| distlimit_get_tars, /* get constraint targets */ | distlimit_get_tars, /* get constraint targets */ | ||||
| distlimit_flush_tars, /* flush constraint targets */ | distlimit_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get a target matrix */ | default_get_tarmat, /* get a target matrix */ | ||||
| ▲ Show 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | if (VALID_CONS_TARGET(ct)) { | ||||
| rescale_m4(cob->matrix, size); | rescale_m4(cob->matrix, size); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_STRETCHTO = { | static bConstraintTypeInfo CTI_STRETCHTO = { | ||||
| CONSTRAINT_TYPE_STRETCHTO, /* type */ | CONSTRAINT_TYPE_STRETCHTO, /* type */ | ||||
| sizeof(bStretchToConstraint), /* size */ | sizeof(bStretchToConstraint), /* size */ | ||||
| "Stretch To", /* name */ | N_("Stretch To"), /* name */ | ||||
| "bStretchToConstraint", /* struct name */ | "bStretchToConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| stretchto_id_looper, /* id looper */ | stretchto_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| stretchto_new_data, /* new data */ | stretchto_new_data, /* new data */ | ||||
| stretchto_get_tars, /* get constraint targets */ | stretchto_get_tars, /* get constraint targets */ | ||||
| stretchto_flush_tars, /* flush constraint targets */ | stretchto_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get target matrix */ | default_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | if (val1 > val2) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_MINMAX = { | static bConstraintTypeInfo CTI_MINMAX = { | ||||
| CONSTRAINT_TYPE_MINMAX, /* type */ | CONSTRAINT_TYPE_MINMAX, /* type */ | ||||
| sizeof(bMinMaxConstraint), /* size */ | sizeof(bMinMaxConstraint), /* size */ | ||||
| "Floor", /* name */ | N_("Floor"), /* name */ | ||||
| "bMinMaxConstraint", /* struct name */ | "bMinMaxConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| minmax_id_looper, /* id looper */ | minmax_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| minmax_new_data, /* new data */ | minmax_new_data, /* new data */ | ||||
| minmax_get_tars, /* get constraint targets */ | minmax_get_tars, /* get constraint targets */ | ||||
| minmax_flush_tars, /* flush constraint targets */ | minmax_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get target matrix */ | default_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | if (VALID_CONS_TARGET(ct) && (ct->tar->type == OB_CURVES_LEGACY)) { | ||||
| /* obtain final object position */ | /* obtain final object position */ | ||||
| copy_v3_v3(cob->matrix[3], targetMatrix[3]); | copy_v3_v3(cob->matrix[3], targetMatrix[3]); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_CLAMPTO = { | static bConstraintTypeInfo CTI_CLAMPTO = { | ||||
| CONSTRAINT_TYPE_CLAMPTO, /* type */ | CONSTRAINT_TYPE_CLAMPTO, /* type */ | ||||
| sizeof(bClampToConstraint), /* size */ | sizeof(bClampToConstraint), /* size */ | ||||
| "Clamp To", /* name */ | N_("Clamp To"), /* name */ | ||||
| "bClampToConstraint", /* struct name */ | "bClampToConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| clampto_id_looper, /* id looper */ | clampto_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| NULL, /* new data */ | NULL, /* new data */ | ||||
| clampto_get_tars, /* get constraint targets */ | clampto_get_tars, /* get constraint targets */ | ||||
| clampto_flush_tars, /* flush constraint targets */ | clampto_flush_tars, /* flush constraint targets */ | ||||
| clampto_get_tarmat, /* get target matrix */ | clampto_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | if (VALID_CONS_TARGET(ct)) { | ||||
| /* apply to matrix */ | /* apply to matrix */ | ||||
| loc_rot_size_to_mat4(cob->matrix, loc, rot, size); | loc_rot_size_to_mat4(cob->matrix, loc, rot, size); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_TRANSFORM = { | static bConstraintTypeInfo CTI_TRANSFORM = { | ||||
| CONSTRAINT_TYPE_TRANSFORM, /* type */ | CONSTRAINT_TYPE_TRANSFORM, /* type */ | ||||
| sizeof(bTransformConstraint), /* size */ | sizeof(bTransformConstraint), /* size */ | ||||
| "Transformation", /* name */ | N_("Transformation"), /* name */ | ||||
| "bTransformConstraint", /* struct name */ | "bTransformConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| transform_id_looper, /* id looper */ | transform_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| transform_new_data, /* new data */ | transform_new_data, /* new data */ | ||||
| transform_get_tars, /* get constraint targets */ | transform_get_tars, /* get constraint targets */ | ||||
| transform_flush_tars, /* flush constraint targets */ | transform_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get a target matrix */ | default_get_tarmat, /* get a target matrix */ | ||||
| ▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | static void shrinkwrap_evaluate(bConstraint *UNUSED(con), bConstraintOb *cob, ListBase *targets) | ||||
| if (VALID_CONS_TARGET(ct)) { | if (VALID_CONS_TARGET(ct)) { | ||||
| copy_m4_m4(cob->matrix, ct->matrix); | copy_m4_m4(cob->matrix, ct->matrix); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_SHRINKWRAP = { | static bConstraintTypeInfo CTI_SHRINKWRAP = { | ||||
| CONSTRAINT_TYPE_SHRINKWRAP, /* type */ | CONSTRAINT_TYPE_SHRINKWRAP, /* type */ | ||||
| sizeof(bShrinkwrapConstraint), /* size */ | sizeof(bShrinkwrapConstraint), /* size */ | ||||
| "Shrinkwrap", /* name */ | N_("Shrinkwrap"), /* name */ | ||||
| "bShrinkwrapConstraint", /* struct name */ | "bShrinkwrapConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| shrinkwrap_id_looper, /* id looper */ | shrinkwrap_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| shrinkwrap_new_data, /* new data */ | shrinkwrap_new_data, /* new data */ | ||||
| shrinkwrap_get_tars, /* get constraint targets */ | shrinkwrap_get_tars, /* get constraint targets */ | ||||
| shrinkwrap_flush_tars, /* flush constraint targets */ | shrinkwrap_flush_tars, /* flush constraint targets */ | ||||
| shrinkwrap_get_tarmat, /* get a target matrix */ | shrinkwrap_get_tarmat, /* get a target matrix */ | ||||
| ▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | if (normalize_v3_v3(tarvec, tarvec_in) != 0.0f) { | ||||
| copy_m4_m4(matrix, tmat); | copy_m4_m4(matrix, tmat); | ||||
| copy_v3_v3(matrix[3], obloc); | copy_v3_v3(matrix[3], obloc); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_DAMPTRACK = { | static bConstraintTypeInfo CTI_DAMPTRACK = { | ||||
| CONSTRAINT_TYPE_DAMPTRACK, /* type */ | CONSTRAINT_TYPE_DAMPTRACK, /* type */ | ||||
| sizeof(bDampTrackConstraint), /* size */ | sizeof(bDampTrackConstraint), /* size */ | ||||
| "Damped Track", /* name */ | N_("Damped Track"), /* name */ | ||||
| "bDampTrackConstraint", /* struct name */ | "bDampTrackConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| damptrack_id_looper, /* id looper */ | damptrack_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| damptrack_new_data, /* new data */ | damptrack_new_data, /* new data */ | ||||
| damptrack_get_tars, /* get constraint targets */ | damptrack_get_tars, /* get constraint targets */ | ||||
| damptrack_flush_tars, /* flush constraint targets */ | damptrack_flush_tars, /* flush constraint targets */ | ||||
| default_get_tarmat, /* get target matrix */ | default_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | static void splineik_get_tarmat(struct Depsgraph *UNUSED(depsgraph), | ||||
| if (ct) { | if (ct) { | ||||
| unit_m4(ct->matrix); | unit_m4(ct->matrix); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_SPLINEIK = { | static bConstraintTypeInfo CTI_SPLINEIK = { | ||||
| CONSTRAINT_TYPE_SPLINEIK, /* type */ | CONSTRAINT_TYPE_SPLINEIK, /* type */ | ||||
| sizeof(bSplineIKConstraint), /* size */ | sizeof(bSplineIKConstraint), /* size */ | ||||
| "Spline IK", /* name */ | N_("Spline IK"), /* name */ | ||||
| "bSplineIKConstraint", /* struct name */ | "bSplineIKConstraint", /* struct name */ | ||||
| splineik_free, /* free data */ | splineik_free, /* free data */ | ||||
| splineik_id_looper, /* id looper */ | splineik_id_looper, /* id looper */ | ||||
| splineik_copy, /* copy data */ | splineik_copy, /* copy data */ | ||||
| splineik_new_data, /* new data */ | splineik_new_data, /* new data */ | ||||
| splineik_get_tars, /* get constraint targets */ | splineik_get_tars, /* get constraint targets */ | ||||
| splineik_flush_tars, /* flush constraint targets */ | splineik_flush_tars, /* flush constraint targets */ | ||||
| splineik_get_tarmat, /* get target matrix */ | splineik_get_tarmat, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | static void pivotcon_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *targets) | ||||
| mul_m3_v3(rotMat, vec); | mul_m3_v3(rotMat, vec); | ||||
| /* 3. make the rotation in terms of the pivot now */ | /* 3. make the rotation in terms of the pivot now */ | ||||
| add_v3_v3v3(cob->matrix[3], pivot, vec); | add_v3_v3v3(cob->matrix[3], pivot, vec); | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_PIVOT = { | static bConstraintTypeInfo CTI_PIVOT = { | ||||
| CONSTRAINT_TYPE_PIVOT, /* type */ | CONSTRAINT_TYPE_PIVOT, /* type */ | ||||
| sizeof(bPivotConstraint), /* size */ | sizeof(bPivotConstraint), /* size */ | ||||
| "Pivot", /* name */ | N_("Pivot"), /* name */ | ||||
| "bPivotConstraint", /* struct name */ | "bPivotConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| pivotcon_id_looper, /* id looper */ | pivotcon_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| NULL, | NULL, | ||||
| /* new data */ /* XXX: might be needed to get 'normal' pivot behavior... */ | /* new data */ /* XXX: might be needed to get 'normal' pivot behavior... */ | ||||
| pivotcon_get_tars, /* get constraint targets */ | pivotcon_get_tars, /* get constraint targets */ | ||||
| pivotcon_flush_tars, /* flush constraint targets */ | pivotcon_flush_tars, /* flush constraint targets */ | ||||
| ▲ Show 20 Lines • Show All 404 Lines • ▼ Show 20 Lines | static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) | ||||
| } | } | ||||
| followtrack_evaluate_using_2d_position(&context, cob); | followtrack_evaluate_using_2d_position(&context, cob); | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_FOLLOWTRACK = { | static bConstraintTypeInfo CTI_FOLLOWTRACK = { | ||||
| CONSTRAINT_TYPE_FOLLOWTRACK, /* type */ | CONSTRAINT_TYPE_FOLLOWTRACK, /* type */ | ||||
| sizeof(bFollowTrackConstraint), /* size */ | sizeof(bFollowTrackConstraint), /* size */ | ||||
| "Follow Track", /* name */ | N_("Follow Track"), /* name */ | ||||
| "bFollowTrackConstraint", /* struct name */ | "bFollowTrackConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| followtrack_id_looper, /* id looper */ | followtrack_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| followtrack_new_data, /* new data */ | followtrack_new_data, /* new data */ | ||||
| NULL, /* get constraint targets */ | NULL, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| NULL, /* get target matrix */ | NULL, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (clip) { | ||||
| mul_m4_m4m4(cob->matrix, obmat, mat); | mul_m4_m4m4(cob->matrix, obmat, mat); | ||||
| } | } | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_CAMERASOLVER = { | static bConstraintTypeInfo CTI_CAMERASOLVER = { | ||||
| CONSTRAINT_TYPE_CAMERASOLVER, /* type */ | CONSTRAINT_TYPE_CAMERASOLVER, /* type */ | ||||
| sizeof(bCameraSolverConstraint), /* size */ | sizeof(bCameraSolverConstraint), /* size */ | ||||
| "Camera Solver", /* name */ | N_("Camera Solver"), /* name */ | ||||
| "bCameraSolverConstraint", /* struct name */ | "bCameraSolverConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| camerasolver_id_looper, /* id looper */ | camerasolver_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| camerasolver_new_data, /* new data */ | camerasolver_new_data, /* new data */ | ||||
| NULL, /* get constraint targets */ | NULL, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| NULL, /* get target matrix */ | NULL, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | static void objectsolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets)) | ||||
| } | } | ||||
| mul_m4_series(cob->matrix, parmat, data->invmat, obmat); | mul_m4_series(cob->matrix, parmat, data->invmat, obmat); | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_OBJECTSOLVER = { | static bConstraintTypeInfo CTI_OBJECTSOLVER = { | ||||
| CONSTRAINT_TYPE_OBJECTSOLVER, /* type */ | CONSTRAINT_TYPE_OBJECTSOLVER, /* type */ | ||||
| sizeof(bObjectSolverConstraint), /* size */ | sizeof(bObjectSolverConstraint), /* size */ | ||||
| "Object Solver", /* name */ | N_("Object Solver"), /* name */ | ||||
| "bObjectSolverConstraint", /* struct name */ | "bObjectSolverConstraint", /* struct name */ | ||||
| NULL, /* free data */ | NULL, /* free data */ | ||||
| objectsolver_id_looper, /* id looper */ | objectsolver_id_looper, /* id looper */ | ||||
| NULL, /* copy data */ | NULL, /* copy data */ | ||||
| objectsolver_new_data, /* new data */ | objectsolver_new_data, /* new data */ | ||||
| NULL, /* get constraint targets */ | NULL, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| NULL, /* get target matrix */ | NULL, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | static void transformcache_new_data(void *cdata) | ||||
| bTransformCacheConstraint *data = (bTransformCacheConstraint *)cdata; | bTransformCacheConstraint *data = (bTransformCacheConstraint *)cdata; | ||||
| data->cache_file = NULL; | data->cache_file = NULL; | ||||
| } | } | ||||
| static bConstraintTypeInfo CTI_TRANSFORM_CACHE = { | static bConstraintTypeInfo CTI_TRANSFORM_CACHE = { | ||||
| CONSTRAINT_TYPE_TRANSFORM_CACHE, /* type */ | CONSTRAINT_TYPE_TRANSFORM_CACHE, /* type */ | ||||
| sizeof(bTransformCacheConstraint), /* size */ | sizeof(bTransformCacheConstraint), /* size */ | ||||
| "Transform Cache", /* name */ | N_("Transform Cache"), /* name */ | ||||
| "bTransformCacheConstraint", /* struct name */ | "bTransformCacheConstraint", /* struct name */ | ||||
| transformcache_free, /* free data */ | transformcache_free, /* free data */ | ||||
| transformcache_id_looper, /* id looper */ | transformcache_id_looper, /* id looper */ | ||||
| transformcache_copy, /* copy data */ | transformcache_copy, /* copy data */ | ||||
| transformcache_new_data, /* new data */ | transformcache_new_data, /* new data */ | ||||
| NULL, /* get constraint targets */ | NULL, /* get constraint targets */ | ||||
| NULL, /* flush constraint targets */ | NULL, /* flush constraint targets */ | ||||
| NULL, /* get target matrix */ | NULL, /* get target matrix */ | ||||
| ▲ Show 20 Lines • Show All 1,168 Lines • Show Last 20 Lines | |||||