diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-21 03:42:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-21 03:45:16 +0300 |
commit | 04d09014e9e8d4e1cc2539634b450668aa1c01be (patch) | |
tree | 5388cdc2de86fa4e57e95566fb4f7c38ecee50bc /source/blender/editors/transform/transform_gizmo_extrude_3d.c | |
parent | b6918eaf2346042b40648e05a886dee198e86928 (diff) |
Gizmo: set the extrude transform constraint matrix
Diffstat (limited to 'source/blender/editors/transform/transform_gizmo_extrude_3d.c')
-rw-r--r-- | source/blender/editors/transform/transform_gizmo_extrude_3d.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_extrude_3d.c b/source/blender/editors/transform/transform_gizmo_extrude_3d.c index 8a596d5e613..b9693669d18 100644 --- a/source/blender/editors/transform/transform_gizmo_extrude_3d.c +++ b/source/blender/editors/transform/transform_gizmo_extrude_3d.c @@ -267,6 +267,14 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup) RNA_float_get_array(op_transform->ptr, "constraint_matrix", &redo.constraint_matrix[0][0]); RNA_boolean_get_array(op_transform->ptr, "constraint_axis", redo.constraint_axis); RNA_float_get_array(op_transform->ptr, "value", redo.value); + + /* Set properties for redo. */ + wmGizmoOpElem *gzop = WM_gizmo_operator_get(ggd->adjust, 0); + PointerRNA macroptr = RNA_pointer_get(&gzop->ptr, "TRANSFORM_OT_translate"); + RNA_float_set_array(¯optr, "constraint_matrix", &redo.constraint_matrix[0][0]); + RNA_boolean_set_array(¯optr, "constraint_axis", redo.constraint_axis); + RNA_float_set_array(¯optr, "value", redo.value); + for (int i = 0; i < 3; i++) { if (redo.constraint_axis[i]) { redo.is_flip = redo.value[i] < 0.0f; @@ -283,14 +291,6 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup) if (redo.is_flip) { negate_v3(ggd->adjust->matrix_basis[2]); } - - /* Set redo properties. */ - bool constraint[3] = {0, 0, 0}; - constraint[ggd->adjust_axis] = true; - wmGizmoOpElem *gzop = WM_gizmo_operator_get(ggd->adjust, 0); - PointerRNA macroptr = RNA_pointer_get(&gzop->ptr, "TRANSFORM_OT_translate"); - RNA_boolean_set_array(¯optr, "constraint_axis", constraint); - RNA_float_set_array(¯optr, "value", redo.value); } /* Location. */ |