From b0a1cf2c9ae696b07f7a236bc855a5ab4a493dcb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 17 Mar 2020 14:41:48 +0100 Subject: Objects: add Volume object type, and prototypes for Hair and PointCloud Only the volume object is exposed in the user interface. It is based on OpenVDB internally. Drawing and rendering code will follow in another commit. https://wiki.blender.org/wiki/Source/Objects/Volume https://wiki.blender.org/wiki/Reference/Release_Notes/2.83/Volumes Hair and PointCloud object types are hidden behind a WITH_NEW_OBJECT_TYPES build option. These are unfinished, and included only to make it easier to cooperate on development in the future and avoid tricky merges. https://wiki.blender.org/wiki/Source/Objects/New_Object_Types Ref T73201, T68981 Differential Revision: https://developer.blender.org/D6945 --- source/blender/makesrna/intern/rna_ID.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'source/blender/makesrna/intern/rna_ID.c') diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index bd5c7e755d6..9a660153a3b 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -75,6 +75,11 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""}, {ID_TXT, "TEXT", ICON_TEXT, "Text", ""}, {ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""}, +#ifdef WITH_NEW_OBJECT_TYPES + {ID_HA, "HAIR", ICON_HAIR_DATA, "Hair", ""}, + {ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "PointCloud", ""}, +#endif + {ID_VO, "VOLUME", ICON_VOLUME_DATA, "Volume", ""}, {ID_WM, "WINDOWMANAGER", ICON_WINDOW, "Window Manager", ""}, {ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""}, {ID_WS, "WORKSPACE", ICON_WORKSPACE, "Workspace", ""}, @@ -246,6 +251,11 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_FreestyleLineStyle) { return ID_LS; } +# ifdef WITH_NEW_OBJECT_TYPES + if (base_type == &RNA_Hair) { + return ID_HA; + } +# endif if (base_type == &RNA_Lattice) { return ID_LT; } @@ -279,6 +289,11 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_PaintCurve) { return ID_PC; } +# ifdef WITH_NEW_OBJECT_TYPES + if (base_type == &RNA_PointCloud) { + return ID_PT; + } +# endif if (base_type == &RNA_LightProbe) { return ID_LP; } @@ -303,6 +318,9 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_VectorFont) { return ID_VF; } + if (base_type == &RNA_Volume) { + return ID_VO; + } if (base_type == &RNA_WorkSpace) { return ID_WS; } @@ -337,6 +355,12 @@ StructRNA *ID_code_to_RNA_type(short idcode) return &RNA_GreasePencil; case ID_GR: return &RNA_Collection; + case ID_HA: +# ifdef WITH_NEW_OBJECT_TYPES + return &RNA_Hair; +# else + return &RNA_ID; +# endif case ID_IM: return &RNA_Image; case ID_KE: @@ -369,6 +393,12 @@ StructRNA *ID_code_to_RNA_type(short idcode) return &RNA_Palette; case ID_PC: return &RNA_PaintCurve; + case ID_PT: +# ifdef WITH_NEW_OBJECT_TYPES + return &RNA_PointCloud; +# else + return &RNA_ID; +# endif case ID_LP: return &RNA_LightProbe; case ID_SCE: @@ -385,6 +415,8 @@ StructRNA *ID_code_to_RNA_type(short idcode) return &RNA_Text; case ID_VF: return &RNA_VectorFont; + case ID_VO: + return &RNA_Volume; case ID_WM: return &RNA_WindowManager; case ID_WO: -- cgit v1.2.3