[Bf-blender-cvs] [2ed89b09d2f] greasepencil-object: Added ID_GD to the OB_DATA_SUPPORT_ID/OB_DATA_SUPPORT_ID_CASE macros
Joshua Leung
noreply at git.blender.org
Sun Dec 10 12:43:07 CET 2017
Commit: 2ed89b09d2f8714759991b1706e885ba186ae220
Author: Joshua Leung
Date: Mon Dec 11 00:42:40 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rB2ed89b09d2f8714759991b1706e885ba186ae220
Added ID_GD to the OB_DATA_SUPPORT_ID/OB_DATA_SUPPORT_ID_CASE macros
>From the looks of things, all object-linked ID types should be
included in here.
While checking on this, I also found a missing case for GP object
in Main.objects.new()
===================================================================
M source/blender/makesdna/DNA_object_types.h
M source/blender/makesrna/intern/rna_main_api.c
===================================================================
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index b2eb3556d17..e477eea3c1e 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -415,10 +415,10 @@ enum {
/* 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_LP, ID_CA, ID_LT, ID_AR))
+ (ELEM(_id_type, ID_ME, ID_CU, ID_MB, ID_LA, ID_SPK, ID_LP, ID_CA, ID_LT, ID_GD, ID_AR))
#define OB_DATA_SUPPORT_ID_CASE \
- ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_LP: case ID_CA: case ID_LT: case ID_AR
+ ID_ME: case ID_CU: case ID_MB: case ID_LA: case ID_SPK: case ID_LP: case ID_CA: case ID_LT: case ID_GD: case ID_AR
/* partype: first 4 bits: type */
enum {
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 0837d9aee03..bc2864f0b47 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -231,6 +231,9 @@ static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char
case ID_LT:
type = OB_LATTICE;
break;
+ case ID_GD:
+ type = OB_GPENCIL;
+ break;
case ID_AR:
type = OB_ARMATURE;
break;
More information about the Bf-blender-cvs
mailing list