[Bf-blender-cvs] [4c216cb982e] greasepencil-object: Fix problem when back from paint and sculpt modes

Antonio Vazquez noreply at git.blender.org
Tue Jun 6 11:28:46 CEST 2017


Commit: 4c216cb982e5f26fbfe765aa0afc9c2b696911e2
Author: Antonio Vazquez
Date:   Tue Jun 6 10:56:08 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB4c216cb982e5f26fbfe765aa0afc9c2b696911e2

Fix problem when back from paint and sculpt modes

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

M	source/blender/editors/object/object_edit.c

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

diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 2e09ecd403b..797dc7b2a81 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1548,7 +1548,19 @@ static int object_mode_set_exec(bContext *C, wmOperator *op)
 	if ((ob) && (ob->type == OB_GPENCIL)) {
 		if ((ob->gpd) && (ob->gpd == gpd))
 		{
-			if (ELEM(mode, OB_MODE_GPENCIL_EDIT, OB_MODE_OBJECT, OB_MODE_EDIT)) {
+			if (ELEM(mode, OB_MODE_OBJECT, OB_MODE_EDIT)) {
+				if (ELEM(ob->mode, OB_MODE_OBJECT, OB_MODE_EDIT, OB_MODE_GPENCIL_EDIT)) {
+					WM_operator_name_call(C, "GPENCIL_OT_editmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+				}
+				if (ob->mode == OB_MODE_GPENCIL_PAINT) {
+					WM_operator_name_call(C, "GPENCIL_OT_paintmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+				}
+				if (ob->mode == OB_MODE_GPENCIL_SCULPT) {
+					WM_operator_name_call(C, "GPENCIL_OT_sculptmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+				}
+				return OPERATOR_FINISHED;
+			}
+			if (mode == OB_MODE_GPENCIL_EDIT) {
 				WM_operator_name_call(C, "GPENCIL_OT_editmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
 				return OPERATOR_FINISHED;
 			}




More information about the Bf-blender-cvs mailing list