diff options
author | Antonioya <blendergit@gmail.com> | 2018-08-24 12:28:01 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-08-24 12:28:15 +0300 |
commit | 9b41ad288a6edfe5497627ea1154d0f214ba4261 (patch) | |
tree | 5bc3155827ec94e9827afe0582c1fd60e851660a /source/blender/editors | |
parent | c75e74b456facef2491bc283a87c195cfd91a076 (diff) |
Remove annotations lock to axis function
The lock to axis is only used by grease pencil object and can produce weird results in annotations.
This lock to axis function was kept by error when the annotation code was splitted from general grease pencil code.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index b551f3d630b..4f3d487bcf7 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -163,7 +163,6 @@ typedef struct tGPsdata { void *erasercursor; /* radial cursor data for drawing eraser */ short straight[2]; /* 1: line horizontal, 2: line vertical, other: not defined, second element position */ - int lock_axis; /* lock drawing to one axis */ short keymodifier; /* key used for invoking the operator */ } tGPsdata; @@ -301,33 +300,6 @@ static void gp_project_points_to_plane(RegionView3D *rv3d, bGPDstroke *gps, cons } } -/* reproject stroke to plane locked to axis in 3d cursor location */ -static void gp_reproject_toplane(tGPsdata *p, bGPDstroke *gps) -{ - bGPdata *gpd = p->gpd; - float origin[3]; - float cursor[3]; - RegionView3D *rv3d = p->ar->regiondata; - - /* verify the stroke mode is CURSOR 3d space mode */ - if ((gpd->runtime.sbuffer_sflag & GP_STROKE_3DSPACE) == 0) { - return; - } - if ((*p->align_flag & GP_PROJECT_VIEWSPACE) == 0) { - return; - } - if ((*p->align_flag & GP_PROJECT_DEPTH_VIEW) || (*p->align_flag & GP_PROJECT_DEPTH_STROKE)) { - return; - } - - /* get 3d cursor and set origin for locked axis only. Uses axis-1 because the enum for XYZ start with 1 */ - gp_get_3d_reference(p, cursor); - zero_v3(origin); - origin[p->lock_axis - 1] = cursor[p->lock_axis - 1]; - - gp_project_points_to_plane(rv3d, gps, origin, p->lock_axis - 1); -} - /* convert screen-coordinates to buffer-coordinates */ /* XXX this method needs a total overhaul! */ static void gp_stroke_convertcoords(tGPsdata *p, const int mval[2], float out[3], float *depth) @@ -498,10 +470,6 @@ static short gp_stroke_addpoint( /* convert screen-coordinates to appropriate coordinates (and store them) */ gp_stroke_convertcoords(p, &pt->x, &pts->x, NULL); - /* if axis locked, reproject to plane locked (only in 3d space) */ - if (p->lock_axis > GP_LOCKAXIS_NONE) { - gp_reproject_toplane(p, gps); - } /* copy pressure and time */ pts->pressure = pt->pressure; @@ -665,10 +633,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p) /* convert screen-coordinates to appropriate coordinates (and store them) */ gp_stroke_convertcoords(p, &ptc->x, &pt->x, NULL); - /* if axis locked, reproject to plane locked (only in 3d space) */ - if (p->lock_axis > GP_LOCKAXIS_NONE) { - gp_reproject_toplane(p, gps); - } + /* copy pressure and time */ pt->pressure = ptc->pressure; pt->strength = ptc->strength; @@ -684,10 +649,6 @@ static void gp_stroke_newfrombuffer(tGPsdata *p) /* convert screen-coordinates to appropriate coordinates (and store them) */ gp_stroke_convertcoords(p, &ptc->x, &pt->x, NULL); - /* if axis locked, reproject to plane locked (only in 3d space) */ - if (p->lock_axis > GP_LOCKAXIS_NONE) { - gp_reproject_toplane(p, gps); - } /* copy pressure and time */ pt->pressure = ptc->pressure; @@ -702,10 +663,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p) /* convert screen-coordinates to appropriate coordinates (and store them) */ gp_stroke_convertcoords(p, &ptc->x, &pt->x, NULL); - /* if axis locked, reproject to plane locked (only in 3d space) */ - if (p->lock_axis > GP_LOCKAXIS_NONE) { - gp_reproject_toplane(p, gps); - } + /* copy pressure and time */ pt->pressure = ptc->pressure; pt->strength = ptc->strength; @@ -788,11 +746,6 @@ static void gp_stroke_newfrombuffer(tGPsdata *p) pt->time = ptc->time; } - /* if axis locked, reproject to plane locked (only in 3d space) */ - if (p->lock_axis > GP_LOCKAXIS_NONE) { - gp_reproject_toplane(p, gps); - } - if (depth_arr) MEM_freeN(depth_arr); } @@ -1192,9 +1145,6 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p) /* clear out buffer (stored in gp-data), in case something contaminated it */ gp_session_validatebuffer(p); - /* lock axis */ - p->lock_axis = ts->gp_sculpt.lock_axis; - return 1; } |