Fix T82777: Some transform modes using incorrect default orientation

Some modes were always using `"Global"` orientation as the default.
This commit is contained in:
Germano Cavalcante 2020-11-18 09:33:54 -03:00
parent 957f14a689
commit 20f8130d6f
Notes: blender-bot 2023-02-14 08:29:54 +01:00
Referenced by issue #85227, Align to Transform Orientation Not Working
Referenced by issue #83654, align to transform orientation does not work
Referenced by issue #83216, Potential candidates for corrective releases
Referenced by issue #82777, Current transform orientation not taken into account when using 'Align to transform orientation' AGAIN
1 changed files with 3 additions and 2 deletions

View File

@ -506,7 +506,6 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
short orient_types[3];
float custom_matrix[3][3];
short orient_type_default = V3D_ORIENT_GLOBAL;
short orient_type_scene = V3D_ORIENT_GLOBAL;
short orient_type_set = V3D_ORIENT_GLOBAL;
short orient_type_matrix_set = -1;
@ -520,6 +519,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
}
short orient_type_default = orient_type_scene;
if (op && (prop = RNA_struct_find_property(op->ptr, "orient_axis_ortho"))) {
t->orient_axis_ortho = RNA_property_enum_get(op->ptr, prop);
}
@ -535,7 +536,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
orient_type_default = orient_type_set;
}
else if (t->con.mode & CON_APPLY) {
orient_type_set = orient_type_default = orient_type_scene;
orient_type_set = orient_type_scene;
}
else {
if (orient_type_set == orient_type_scene) {