diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-12-11 05:55:03 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-12-11 05:55:03 +0300 |
commit | ca8184c6cceb727f46e6175f4dc835c112b225c2 (patch) | |
tree | c14a8dfd07ea090a1d672e5474c90c0fefab8f5e | |
parent | 5368505ef32b39c1c12e1090bf69f25de78f959f (diff) |
Fix: Grease Pencil eraser would operate on strokes that were not valid for the current context
For example, if a GP datablock was shared between two different types of editors
(e.g. 3D and Sequencer Preview), even the non-valid (and invisible) strokes would
get affected.
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index c45fe1b4558..04e9a777a46 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -965,7 +965,13 @@ static void gp_stroke_doeraser(tGPsdata *p) /* loop over strokes, checking segments for intersections */ for (gps = gpf->strokes.first; gps; gps = gpn) { gpn = gps->next; - gp_stroke_eraser_dostroke(p, p->mval, p->mvalo, p->radius, &rect, gpf, gps); + + /* Not all strokes in the datablock may be valid in the current editor/context + * (e.g. 2D space strokes in the 3D view, if the same datablock is shared) + */ + if (ED_gpencil_stroke_can_use_direct(p->sa, gps)) { + gp_stroke_eraser_dostroke(p, p->mval, p->mvalo, p->radius, &rect, gpf, gps); + } } } |