Fix orientation change in Redo

Some transform redo operations require contraint to be enabled.
Issue introduced in rBc57e4418bb85.
This commit is contained in:
Germano Cavalcante 2020-04-30 08:52:38 -03:00
parent 41b45d9159
commit ea77584d36
Notes: blender-bot 2023-02-14 05:52:32 +01:00
Referenced by issue #78424, Individual Origins + Normal = Broken Again (works in 2.90, broken in 2.83 LTS)
1 changed files with 9 additions and 10 deletions

View File

@ -1746,11 +1746,9 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
}
if ((prop = RNA_struct_find_property(op->ptr, "constraint_axis"))) {
if (t->con.mode & CON_APPLY) {
bool constraint_axis[3] = {false, false, false};
if (t->idx_max == 0) {
/* Only set if needed, so we can hide in the UI when nothing is set.
* See 'transform_poll_property'. */
bool constraint_axis[3] = {false, false, false};
if (t->idx_max == 0) {
if (t->con.mode & CON_APPLY) {
if (t->con.mode & CON_AXIS0) {
constraint_axis[0] = true;
}
@ -1760,16 +1758,17 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
if (t->con.mode & CON_AXIS2) {
constraint_axis[2] = true;
}
RNA_property_boolean_set_array(op->ptr, prop, constraint_axis);
}
else {
constraint_axis[0] = true;
constraint_axis[1] = true;
constraint_axis[2] = true;
RNA_property_unset(op->ptr, prop);
}
RNA_property_boolean_set_array(op->ptr, prop, constraint_axis);
}
else {
RNA_property_unset(op->ptr, prop);
constraint_axis[0] = true;
constraint_axis[1] = true;
constraint_axis[2] = true;
RNA_property_boolean_set_array(op->ptr, prop, constraint_axis);
}
}