From dc800154b619de64d2de7dae5f81154af343ccd2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 Mar 2019 15:45:10 +1100 Subject: 3D View: snap cursor to world origin now resets rotation --- source/blender/editors/space_view3d/view3d_snap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_view3d/view3d_snap.c') diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 755f14aea2f..862fc78649f 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -40,6 +40,7 @@ #include "BKE_mball.h" #include "BKE_object.h" #include "BKE_report.h" +#include "BKE_scene.h" #include "BKE_tracking.h" #include "DEG_depsgraph.h" @@ -800,12 +801,15 @@ void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot) /* **************************************************** */ -/** Snaps the 3D cursor location to the origin. */ +/** Snaps the 3D cursor location to the origin and clears cursor rotation. */ static int snap_curs_to_center_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); + float mat3[3][3]; + unit_m3(mat3); zero_v3(scene->cursor.location); + BKE_scene_cursor_mat3_to_rot(&scene->cursor, mat3, false); DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); -- cgit v1.2.3