Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-05-04 15:41:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-04 16:18:27 +0300
commit844a17a3d9d2ec06912f505e8a1282f278a7ea8d (patch)
treefd112d4d8927d2a3f7630c692917c13c16db74d2 /source/blender/editors/transform/transform_constraints.c
parent90e61275d34dff6a40ecdf8debe4ee33c678bf9f (diff)
Transform: use bool when local matrix is needed
Existing code checked pose/edit mode to check for transforming in an objects local space. This added many similar checks all over the code, which leads to confusion. Multi-edit caused a regression in UV transform since where UV's had the object matrix applied by accident. Now there is a boolean to use a local matrix, this allows for any mode to have a 4x4 matrix applied w/o adding mode specific checks everywhere.
Diffstat (limited to 'source/blender/editors/transform/transform_constraints.c')
-rw-r--r--source/blender/editors/transform/transform_constraints.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index bc9d0f19389..bd03c0cedba 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -430,7 +430,7 @@ static void applyObjectConstraintVec(
mul_m3_v3(td->axismtx, out);
if (t->flag & T_EDIT) {
- mul_m3_v3(tc->obedit_mat, out);
+ mul_m3_v3(tc->mat3_unit, out);
}
}
}
@@ -486,7 +486,7 @@ static void applyObjectConstraintSize(
mul_m3_m3m3(tmat, smat, imat);
if (t->flag & T_EDIT) {
- mul_m3_m3m3(smat, tc->obedit_mat, smat);
+ mul_m3_m3m3(smat, tc->mat3_unit, smat);
}
mul_m3_m3m3(smat, td->axismtx, tmat);
}
@@ -562,7 +562,7 @@ static void applyObjectConstraintRot(
}
if (t->flag & T_EDIT) {
- mul_m3_m3m3(tmp_axismtx, tc->obedit_mat, td->axismtx);
+ mul_m3_m3m3(tmp_axismtx, tc->mat3_unit, td->axismtx);
axismtx = tmp_axismtx;
}
else {
@@ -616,7 +616,7 @@ void setAxisMatrixConstraint(TransInfo *t, int mode, const char text[])
if (t->data_len_all == 1) {
float axismtx[3][3];
if (t->flag & T_EDIT) {
- mul_m3_m3m3(axismtx, tc->obedit_mat, tc->data->axismtx);
+ mul_m3_m3m3(axismtx, tc->mat3_unit, tc->data->axismtx);
}
else {
copy_m3_m3(axismtx, tc->data->axismtx);
@@ -646,7 +646,7 @@ void setLocalConstraint(TransInfo *t, int mode, const char text[])
if (t->flag & T_EDIT) {
/* Use the active (first) edit object. */
TransDataContainer *tc = t->data_container;
- setConstraint(t, tc->obedit_mat, mode, text);
+ setConstraint(t, tc->mat3_unit, mode, text);
}
else {
setAxisMatrixConstraint(t, mode, text);
@@ -872,13 +872,13 @@ static void drawObjectConstraint(TransInfo *t)
axismtx = td->axismtx;
}
else if (t->flag & T_EDIT) {
- mul_v3_m4v3(co, tc->obedit->obmat, td->center);
+ mul_v3_m4v3(co, tc->mat, td->center);
- mul_m3_m3m3(tmp_axismtx, tc->obedit_mat, td->axismtx);
+ mul_m3_m3m3(tmp_axismtx, tc->mat3_unit, td->axismtx);
axismtx = tmp_axismtx;
}
else if (t->flag & T_POSE) {
- mul_v3_m4v3(co, tc->poseobj->obmat, td->center);
+ mul_v3_m4v3(co, tc->mat, td->center);
axismtx = td->axismtx;
}
else {