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:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-02-01 17:16:49 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-02-01 17:16:58 +0300
commita69983f30e3fd342a605910fa81ae72c25869ff0 (patch)
treef6796eefa577f4498db5828b946015a85485f254 /source/blender
parent9e9ebaba8dce88c739dd57540e1a61f06f29dee4 (diff)
Fix T85229: Transform operator saving a different orientation than the chosen one
Some orientations are not possible to be calculated for certain scenes. In these cases, others are chosen and informed by the operator. However, the user may prefer that the chosen one be displayed (even if it is not actually used). This corresponds to older versions of Blender.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/transform/transform_orientations.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 3b39f4d06ad..6d1bb9cc0de 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -521,23 +521,19 @@ short ED_transform_calc_orientation_from_type_ex(const bContext *C,
const int pivot_point)
{
switch (orientation_type) {
- case V3D_ORIENT_GLOBAL: {
- unit_m3(r_mat);
- return V3D_ORIENT_GLOBAL;
- }
case V3D_ORIENT_GIMBAL: {
if (ob && gimbal_axis(ob, r_mat)) {
- return V3D_ORIENT_GIMBAL;
+ break;
}
- /* if not gimbal, fall through to normal */
+ /* If not gimbal, fall through to normal. */
ATTR_FALLTHROUGH;
}
case V3D_ORIENT_NORMAL: {
if (obedit || (ob && ob->mode & OB_MODE_POSE)) {
ED_getTransformOrientationMatrix(C, ob, obedit, pivot_point, r_mat);
- return V3D_ORIENT_NORMAL;
+ break;
}
- /* no break we define 'normal' as 'local' in Object mode */
+ /* No break we define 'normal' as 'local' in Object mode. */
ATTR_FALLTHROUGH;
}
case V3D_ORIENT_LOCAL: {
@@ -552,10 +548,14 @@ short ED_transform_calc_orientation_from_type_ex(const bContext *C,
else {
transform_orientations_create_from_axis(r_mat, UNPACK3(ob->obmat));
}
- return V3D_ORIENT_LOCAL;
+ break;
}
+ /* If not local, fall through to global. */
+ ATTR_FALLTHROUGH;
+ }
+ case V3D_ORIENT_GLOBAL: {
unit_m3(r_mat);
- return V3D_ORIENT_GLOBAL;
+ break;
}
case V3D_ORIENT_VIEW: {
if (rv3d != NULL) {
@@ -565,11 +565,11 @@ short ED_transform_calc_orientation_from_type_ex(const bContext *C,
else {
unit_m3(r_mat);
}
- return V3D_ORIENT_VIEW;
+ break;
}
case V3D_ORIENT_CURSOR: {
BKE_scene_cursor_rot_to_mat3(&scene->cursor, r_mat);
- return V3D_ORIENT_CURSOR;
+ break;
}
case V3D_ORIENT_CUSTOM_MATRIX: {
/* Do nothing. */;