From a48186c5d74b3d353c5c65cd4a930dd98cc9a603 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 8 May 2018 14:18:09 +0200 Subject: Orientation for 3D cursor Currently set when setting the cursor location, optionally used as an orientation type. Intended for use by tools too. See: D3208 --- source/blender/editors/gpencil/gpencil_brush.c | 4 ++-- source/blender/editors/gpencil/gpencil_convert.c | 2 +- source/blender/editors/gpencil/gpencil_edit.c | 4 ++-- source/blender/editors/gpencil/gpencil_paint.c | 2 +- source/blender/editors/gpencil/gpencil_utils.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 533ab21dbb6..1cb882e9a43 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -404,7 +404,7 @@ static void gp_brush_grab_calc_dvec(tGP_BrushEditData *gso) if (gso->sa->spacetype == SPACE_VIEW3D) { View3D *v3d = gso->sa->spacedata.first; RegionView3D *rv3d = gso->ar->regiondata; - float *rvec = ED_view3d_cursor3d_get(gso->scene, v3d); + float *rvec = ED_view3d_cursor3d_get(gso->scene, v3d)->location; float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL); float mval_f[2]; @@ -504,7 +504,7 @@ static void gp_brush_calc_midpoint(tGP_BrushEditData *gso) */ View3D *v3d = gso->sa->spacedata.first; RegionView3D *rv3d = gso->ar->regiondata; - float *rvec = ED_view3d_cursor3d_get(gso->scene, v3d); + float *rvec = ED_view3d_cursor3d_get(gso->scene, v3d)->location; float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL); float mval_f[2] = {UNPACK2(gso->mval)}; diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 19663b66f92..6dfe17f227a 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -176,7 +176,7 @@ static void gp_strokepoint_convertcoords( copy_v3_v3(p3d, &pt->x); } else { - const float *fp = ED_view3d_cursor3d_get(scene, v3d); + const float *fp = ED_view3d_cursor3d_get(scene, v3d)->location; float mvalf[2]; /* get screen coordinate */ diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 4f9abff292a..d8cbbb16542 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1464,7 +1464,7 @@ static int gp_snap_to_cursor(bContext *C, wmOperator *op) View3D *v3d = CTX_wm_view3d(C); const bool use_offset = RNA_boolean_get(op->ptr, "use_offset"); - const float *cursor_global = ED_view3d_cursor3d_get(scene, v3d); + const float *cursor_global = ED_view3d_cursor3d_get(scene, v3d)->location; for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { /* only editable and visible layers are considered */ @@ -1551,7 +1551,7 @@ static int gp_snap_cursor_to_sel(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); - float *cursor = ED_view3d_cursor3d_get(scene, v3d); + float *cursor = ED_view3d_cursor3d_get(scene, v3d)->location; float centroid[3] = {0.0f}; float min[3], max[3]; size_t count = 0; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index ccd47463a9c..3f3349a752c 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -236,7 +236,7 @@ static bool gpencil_project_check(tGPsdata *p) static void gp_get_3d_reference(tGPsdata *p, float vec[3]) { View3D *v3d = p->sa->spacedata.first; - const float *fp = ED_view3d_cursor3d_get(p->scene, v3d); + const float *fp = ED_view3d_cursor3d_get(p->scene, v3d)->location; /* the reference point used depends on the owner... */ #if 0 /* XXX: disabled for now, since we can't draw relative to the owner yet */ diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index d7e5b5a92aa..babe68ba439 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -745,7 +745,7 @@ bool gp_point_xy_to_3d(GP_SpaceConversion *gsc, Scene *scene, const float screen { View3D *v3d = gsc->sa->spacedata.first; RegionView3D *rv3d = gsc->ar->regiondata; - float *rvec = ED_view3d_cursor3d_get(scene, v3d); + float *rvec = ED_view3d_cursor3d_get(scene, v3d)->location; float ref[3] = {rvec[0], rvec[1], rvec[2]}; float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL); -- cgit v1.2.3