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>2019-03-20 07:45:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-20 07:45:10 +0300
commitdc800154b619de64d2de7dae5f81154af343ccd2 (patch)
tree8483e67cd118b1ffbcb3bbe9ea82219f532f5898 /source/blender/editors/space_view3d/view3d_snap.c
parentfe7c7d2820f84b815eec5d9c322c7192f33b04b8 (diff)
3D View: snap cursor to world origin now resets rotation
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_snap.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c6
1 files changed, 5 insertions, 1 deletions
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);