Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform.c
| Context not available. | |||||
| if ((prop = RNA_struct_find_property(op->ptr, "orient_matrix"))) { | if ((prop = RNA_struct_find_property(op->ptr, "orient_matrix"))) { | ||||
| if (t->flag & T_MODAL) { | if (t->flag & T_MODAL) { | ||||
| if (orientation != V3D_ORIENT_CUSTOM_MATRIX) { | if (orientation != V3D_ORIENT_CUSTOM_MATRIX) { | ||||
| if (t->flag & T_MODAL) { | RNA_enum_set(op->ptr, "orient_matrix_type", orientation); | ||||
| RNA_enum_set(op->ptr, "orient_matrix_type", orientation); | RNA_float_set_array(op->ptr, "orient_matrix", &t->orient_matrix[0][0]); | ||||
| } | |||||
| } | } | ||||
| if (t->con.mode & CON_APPLY) { | else if (t->con.mode & CON_APPLY) { | ||||
| RNA_float_set_array(op->ptr, "orient_matrix", &t->con.mtx[0][0]); | RNA_float_set_array(op->ptr, "orient_matrix", &t->con.mtx[0][0]); | ||||
| } | } | ||||
| else if (use_orient_axis) { | else if (use_orient_axis) { | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* So we can adjust in non global orientation. */ | /* The rotation operator uses con.mode to determine the rotation axis */ | ||||
| if (t->orientation.user != V3D_ORIENT_GLOBAL) { | if (ELEM(t->mode, TFM_ROTATION, TFM_NORMAL_ROTATION) && | ||||
| ((prop = RNA_struct_find_property(op->ptr, "constraint_axis")) && | |||||
| RNA_property_is_set(op->ptr, prop))) { | |||||
| t->con.mode |= CON_APPLY; | |||||
| switch (t->orient_axis) { | |||||
| case 0: | |||||
| /* X-axis */ | |||||
| t->con.mode |= CON_AXIS0; | |||||
| break; | |||||
| case 1: | |||||
| /* Y-axis */ | |||||
| t->con.mode |= CON_AXIS1; | |||||
| break; | |||||
| default: | |||||
| /* Z-axis */ | |||||
| t->con.mode |= CON_AXIS2; | |||||
| break; | |||||
| } | |||||
| setUserConstraint(t, t->orientation.user, t->con.mode, "%s"); | |||||
| } | |||||
| else if (t->orientation.user != V3D_ORIENT_GLOBAL) { | |||||
| /* So we can adjust in non global orientation. */ | |||||
| t->con.mode |= CON_APPLY | CON_AXIS0 | CON_AXIS1 | CON_AXIS2; | t->con.mode |= CON_APPLY | CON_AXIS0 | CON_AXIS1 | CON_AXIS2; | ||||
| setUserConstraint(t, t->orientation.user, t->con.mode, "%s"); | setUserConstraint(t, t->orientation.user, t->con.mode, "%s"); | ||||
| } | } | ||||
| Context not available. | |||||