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>2010-11-04 18:59:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-04 18:59:09 +0300
commit6753882e42282ccf9dea49bdef2fc5455d852710 (patch)
tree5cc4fea764a9eb72b05d5c233d3549c52d7c7e02 /source/blender/editors/gpencil
parent5fafa570d06a920fcbd73b0e5b1944846cce43ed (diff)
bugfix [#24009] Crash when switching area types and performing ops
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 23e2755613c..d42e63bf354 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -141,8 +141,20 @@ static void gp_session_validatebuffer(tGPsdata *p);
/* check if context is suitable for drawing */
static int gpencil_draw_poll (bContext *C)
{
- /* check if current context can support GPencil data */
- return (gpencil_data_get_pointers(C, NULL) != NULL);
+ if(ED_operator_regionactive(C)) {
+ /* check if current context can support GPencil data */
+ if(gpencil_data_get_pointers(C, NULL) != NULL) {
+ return 1;
+ }
+ else {
+ CTX_wm_operator_poll_msg_set(C, "failed to find grease pencil data to draw into");
+ }
+ }
+ else {
+ CTX_wm_operator_poll_msg_set(C, "active region not set");
+ }
+
+ return 0;
}
/* check if projecting strokes into 3d-geometry in the 3D-View */