Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/armature_add.c
| Show First 20 Lines • Show All 575 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void updateDuplicateLocRotConstraintSettings(Object *ob, | static void updateDuplicateLocRotConstraintSettings(Object *ob, | ||||
| bPoseChannel *pchan, | bPoseChannel *pchan, | ||||
| bConstraint *curcon) | bConstraint *curcon) | ||||
| { | { | ||||
| /* This code assumes that bRotLimitConstraint and bLocLimitConstraint have the same fields in | /* This code assumes that bRotLimitConstraint and bLocLimitConstraint have the same fields in | ||||
| * the same memory locations. */ | * the same memory locations. */ | ||||
| BLI_assert(sizeof(bLocLimitConstraint) == sizeof(bRotLimitConstraint)); | |||||
| bRotLimitConstraint *limit = (bRotLimitConstraint *)curcon->data; | bRotLimitConstraint *limit = (bRotLimitConstraint *)curcon->data; | ||||
| float local_mat[4][4], imat[4][4]; | float local_mat[4][4], imat[4][4]; | ||||
| float min_vec[3], max_vec[3]; | float min_vec[3], max_vec[3]; | ||||
| min_vec[0] = limit->xmin; | min_vec[0] = limit->xmin; | ||||
| min_vec[1] = limit->ymin; | min_vec[1] = limit->ymin; | ||||
| min_vec[2] = limit->zmin; | min_vec[2] = limit->zmin; | ||||
| ▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | case TRANS_ROTATION: | ||||
| (trans->from == TRANS_ROTATION && trans->map[i] == Z)) { | (trans->from == TRANS_ROTATION && trans->map[i] == Z)) { | ||||
| /* X Loc to X/Z Rot: Flipped | /* X Loc to X/Z Rot: Flipped | ||||
| * Y Rot to X/Z Rot: Flipped | * Y Rot to X/Z Rot: Flipped | ||||
| * Z Rot to X/Y/Z rot: Flipped */ | * Z Rot to X/Y/Z rot: Flipped */ | ||||
| trans->to_max_rot[i] = trans->to_min_rot[i]; | trans->to_max_rot[i] = trans->to_min_rot[i]; | ||||
| trans->to_min_rot[i] = temp_vec[i]; | trans->to_min_rot[i] = temp_vec[i]; | ||||
| } | } | ||||
| } | } | ||||
| if (trans->from == TRANS_ROTATION && trans->map[1] == Y) { | |||||
| /* Y Rot to Y Rot: Flip and invert */ | |||||
| trans->to_max_rot[1] = -trans->to_min_rot[1]; | |||||
| trans->to_min_rot[1] = -temp_vec[1]; | |||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| /* convert back to the settings space */ | /* convert back to the settings space */ | ||||
| mul_m4_v3(imat, trans->to_min); | mul_m4_v3(imat, trans->to_min); | ||||
| mul_m4_v3(imat, trans->to_max); | mul_m4_v3(imat, trans->to_max); | ||||
| mul_m4_v3(imat_rot, trans->to_min_rot); | mul_m4_v3(imat_rot, trans->to_min_rot); | ||||
| mul_m4_v3(imat_rot, trans->to_max_rot); | mul_m4_v3(imat_rot, trans->to_max_rot); | ||||
| mul_m4_v3(imat, trans->to_min_scale); | mul_m4_v3(imat, trans->to_min_scale); | ||||
| ▲ Show 20 Lines • Show All 913 Lines • Show Last 20 Lines | |||||