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.h
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.h')
-rw-r--r--source/blender/editors/transform/transform.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 19e023b467d..358be8f9e29 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -423,8 +423,20 @@ typedef struct TransDataContainer {
TransData2D *data_2d;
struct Object *obedit;
- /** Normalized editmode matrix ('T_EDIT' only). */
- float obedit_mat[3][3];
+
+ /**
+ * Use when #T_LOCAL_MATRIX is set.
+ * Typically: 'obedit->obmat' or 'poseobj->obmat', but may be used elsewhere too.
+ */
+ bool use_local_mat;
+ float mat[4][4];
+ float imat[4][4];
+ /** 3x3 copies of matrices above. */
+ float mat3[3][3];
+ float imat3[3][3];
+
+ /** Normalized 'mat3' */
+ float mat3_unit[3][3];
/** if 't->flag & T_POSE', this denotes pose object */
struct Object *poseobj;
@@ -545,7 +557,10 @@ typedef struct TransInfo {
#define T_CAMERA (1 << 4)
// trans on points, having no rotation/scale
#define T_POINTS (1 << 6)
-/* empty slot - (1 << 7) */
+/**
+ * Apply matrix #TransDataContainer.matrix, this avoids having to have duplicate check all over
+ * that happen to apply to spesiifc modes (edit & pose for eg). */
+#define T_LOCAL_MATRIX (1 << 7)
/* restrictions flags */
#define T_ALL_RESTRICTIONS ((1 << 8)|(1 << 9)|(1 << 10))