Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-09-26 06:30:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-26 06:30:15 +0300
commitbd79ea03cb80e9d614d726f5c55c0c8d5cebe307 (patch)
tree6fb3fe6d1901dbc165669ff8aefa76ca32d782b0 /source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
parent12cfa134700fbec068412bff8eaeec34160d9764 (diff)
Correct error in last commit
Didn't account for non-identity orientation.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c')
-rw-r--r--source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
index 5efc7b16e4c..002620b2b60 100644
--- a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
+++ b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
@@ -473,6 +473,15 @@ static void gizmo_spin_exec(GizmoGroupData_SpinRedo *ggd)
}
}
+static void gizmo_mesh_spin_redo_update_orient_axis(GizmoGroupData_SpinRedo *ggd, const float plane_no[3])
+{
+ float mat[3][3];
+ rotation_between_vecs_to_mat3(mat, ggd->data.orient_mat[2], plane_no);
+ mul_m3_m3m3(ggd->data.orient_mat, mat, ggd->data.orient_mat);
+ /* Not needed, just set for numeric stability. */
+ copy_v3_v3(ggd->data.orient_mat[2], plane_no);
+}
+
static void gizmo_mesh_spin_redo_update_from_op(GizmoGroupData_SpinRedo *ggd)
{
wmOperator *op = ggd->data.op;
@@ -491,11 +500,7 @@ static void gizmo_mesh_spin_redo_update_from_op(GizmoGroupData_SpinRedo *ggd)
copy_v3_v3(ggd->prev.plane_no, plane_no);
if (is_plane_no_eq == false) {
- float mat[3][3];
- rotation_between_vecs_to_mat3(mat, ggd->data.orient_mat[2], plane_no);
- mul_m3_m3m3(ggd->data.orient_mat, mat, ggd->data.orient_mat);
- /* Not needed, just set for numeric stability. */
- copy_v3_v3(ggd->data.orient_mat[2], plane_no);
+ gizmo_mesh_spin_redo_update_orient_axis(ggd, plane_no);
}
for (int i = 0; i < 2; i++) {
@@ -844,6 +849,9 @@ static void gizmo_mesh_spin_redo_setup(const bContext *C, wmGizmoGroup *gzgroup)
float plane_co[3], plane_no[3];
RNA_property_float_get_array(op->ptr, ggd->data.prop_axis_co, plane_co);
RNA_property_float_get_array(op->ptr, ggd->data.prop_axis_no, plane_no);
+
+ gizmo_mesh_spin_redo_update_orient_axis(ggd, plane_no);
+
float cursor_co[3];
const int mval[2] = {event->x - ar->winrct.xmin, event->y - ar->winrct.ymin};
float plane[4];