Fix T93290: Rotation without contraint after extrude has wrong axis

The default orientation of the mode was being indicated as overridden,
although the one of constraint was used.
This commit is contained in:
Germano Cavalcante 2021-11-26 10:45:28 -03:00 committed by Philipp Oeser
parent f3ba6ac182
commit 5e2dc507e7
Notes: blender-bot 2023-02-13 17:03:55 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #93290, Rotation Chooses Wrong Axis
3 changed files with 20 additions and 14 deletions

View File

@ -598,7 +598,7 @@ typedef struct TransInfo {
* mouse button then.) */
bool is_launch_event_tweak;
bool is_orient_set;
bool is_orient_default_overwrite;
struct {
short type;

View File

@ -451,25 +451,31 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
}
orient_type_default = orient_type_scene;
if (orient_type_set != -1) {
orient_type_default = orient_type_set;
t->is_orient_set = true;
if (!(t->con.mode & CON_APPLY)) {
/* Only overwrite default if not constrained. */
orient_type_default = orient_type_set;
t->is_orient_default_overwrite = true;
}
}
else if (orient_type_matrix_set != -1) {
orient_type_default = orient_type_set = orient_type_matrix_set;
t->is_orient_set = true;
orient_type_set = orient_type_matrix_set;
if (!(t->con.mode & CON_APPLY)) {
/* Only overwrite default if not constrained. */
orient_type_default = orient_type_set;
t->is_orient_default_overwrite = true;
}
}
else if (t->con.mode & CON_APPLY) {
orient_type_default = orient_type_set = orient_type_scene;
orient_type_set = orient_type_scene;
}
else if (orient_type_scene == V3D_ORIENT_GLOBAL) {
orient_type_set = V3D_ORIENT_LOCAL;
}
else {
orient_type_default = orient_type_scene;
if (orient_type_scene == V3D_ORIENT_GLOBAL) {
orient_type_set = V3D_ORIENT_LOCAL;
}
else {
orient_type_set = V3D_ORIENT_GLOBAL;
}
orient_type_set = V3D_ORIENT_GLOBAL;
}
BLI_assert(!ELEM(-1, orient_type_default, orient_type_set));

View File

@ -1285,7 +1285,7 @@ void transform_mode_default_modal_orientation_set(TransInfo *t, int type)
/* Currently only these types are supported. */
BLI_assert(ELEM(type, V3D_ORIENT_GLOBAL, V3D_ORIENT_VIEW));
if (t->is_orient_set) {
if (t->is_orient_default_overwrite) {
return;
}