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:
authorAntonioya <blendergit@gmail.com>2018-11-12 18:56:50 +0300
committerAntonioya <blendergit@gmail.com>2018-11-12 18:56:50 +0300
commit583bc70435fd550d8fae8e68b8797bfce57a4a5f (patch)
treedd940bd6d9e65b2afebfaaa6e6f434d32c4026cf
parentc199040438a07b0b8a5c6ab9663efd6dc112048f (diff)
GP: Hide cursor in some modes
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 992fb32dcb5..f58df5e2710 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1444,6 +1444,14 @@ static bool gp_check_cursor_region(bContext *C, int mval[2])
{
ARegion *ar = CTX_wm_region(C);
ScrArea *sa = CTX_wm_area(C);
+ Object *ob = CTX_data_active_object(C);
+
+ if ((ob == NULL) ||
+ (!ELEM(ob->mode, OB_MODE_GPENCIL_PAINT, OB_MODE_GPENCIL_SCULPT, OB_MODE_GPENCIL_WEIGHT)))
+ {
+ return false;
+ }
+
/* TODO: add more spacetypes */
if (!ELEM(sa->spacetype, SPACE_VIEW3D)) {
return false;