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:
authorJoshua Leung <aligorith@gmail.com>2015-12-11 05:55:03 +0300
committerJoshua Leung <aligorith@gmail.com>2015-12-11 05:55:03 +0300
commitca8184c6cceb727f46e6175f4dc835c112b225c2 (patch)
treec14a8dfd07ea090a1d672e5474c90c0fefab8f5e
parent5368505ef32b39c1c12e1090bf69f25de78f959f (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.c8
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);
+ }
}
}