[Bf-blender-cvs] [8e462b0f48d] gsoc-2018-many-light-sampling: DNA: add OB_DATA_SUPPORT_EDITMODE macro

Campbell Barton noreply at git.blender.org
Fri Jun 1 16:18:17 CEST 2018


Commit: 8e462b0f48d7968d071dfb94dcde568001f5f72d
Author: Campbell Barton
Date:   Wed May 30 07:31:35 2018 +0200
Branches: gsoc-2018-many-light-sampling
https://developer.blender.org/rB8e462b0f48d7968d071dfb94dcde568001f5f72d

DNA: add OB_DATA_SUPPORT_EDITMODE macro

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

M	source/blender/editors/space_outliner/outliner_select.c
M	source/blender/makesdna/DNA_object_types.h

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

diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 760673e5a5f..9c3b9c7b179 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -951,7 +951,7 @@ static void do_outliner_item_activate_tree_element(
 
 			WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
 		}
-		else if (ELEM(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) {
+		else if (OB_DATA_SUPPORT_EDITMODE(te->idcode)) {
 			WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_INVOKE_REGION_WIN, NULL);
 		}
 		else {  // rest of types
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index e0b4d117bd1..ae84108864e 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -378,6 +378,10 @@ enum {
 #define OB_TYPE_SUPPORT_PARVERT(_type) \
 	(ELEM(_type, OB_MESH, OB_SURF, OB_CURVE, OB_LATTICE))
 
+/** Matches #OB_TYPE_SUPPORT_EDITMODE. */
+#define OB_DATA_SUPPORT_EDITMODE(_type) \
+	(ELEM(_type, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR))
+
 /* is this ID type used as object data */
 #define OB_DATA_SUPPORT_ID(_id_type) \
 	(ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_CA, ID_LT, ID_AR))



More information about the Bf-blender-cvs mailing list