[Bf-blender-cvs] [583bc70435f] blender2.8: GP: Hide cursor in some modes

Antonioya noreply at git.blender.org
Mon Nov 12 16:56:59 CET 2018


Commit: 583bc70435fd550d8fae8e68b8797bfce57a4a5f
Author: Antonioya
Date:   Mon Nov 12 16:56:50 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB583bc70435fd550d8fae8e68b8797bfce57a4a5f

GP: Hide cursor in some modes

===================================================================

M	source/blender/editors/gpencil/gpencil_utils.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list