diff options
Diffstat (limited to 'source/blender/makesdna/intern')
-rw-r--r-- | source/blender/makesdna/intern/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_defaults.c | 39 |
2 files changed, 39 insertions, 4 deletions
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index 92ca09dcbca..342e466c3f7 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -128,7 +128,11 @@ set(SRC ../../blenlib/intern/hash_mm2a.c ../../blenlib/intern/listbase.c + ../DNA_material_defaults.h + ../DNA_mesh_defaults.h + ../DNA_object_defaults.h ../DNA_scene_defaults.h + ../DNA_vec_defaults.h ../DNA_view3d_defaults.h ) diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c index d9ee42026f8..4662f3a0b01 100644 --- a/source/blender/makesdna/intern/dna_defaults.c +++ b/source/blender/makesdna/intern/dna_defaults.c @@ -53,13 +53,35 @@ #include "BLI_math.h" #include "DNA_defaults.h" -#include "DNA_scene_types.h" + #include "DNA_curve_types.h" +#include "DNA_material_types.h" +#include "DNA_mesh_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" +#include "DNA_material_defaults.h" +#include "DNA_mesh_defaults.h" +#include "DNA_object_defaults.h" #include "DNA_scene_defaults.h" -const Scene DNA_DEFAULT_Scene = _DNA_DEFAULT_Scene; -const ToolSettings DNA_DEFAULT_ToolSettings = _DNA_DEFAULT_ToolSettings; +#define SDNA_DEFAULT_DECL_STRUCT(struct_name) \ + const struct_name DNA_DEFAULT_##struct_name = _DNA_DEFAULT_##struct_name + +/* DNA_scene_material.h */ +SDNA_DEFAULT_DECL_STRUCT(Material); + +/* DNA_scene_mesh.h */ +SDNA_DEFAULT_DECL_STRUCT(Mesh); + +/* DNA_scene_object.h */ +SDNA_DEFAULT_DECL_STRUCT(Object); + +/* DNA_scene_defaults.h */ +SDNA_DEFAULT_DECL_STRUCT(Scene); +SDNA_DEFAULT_DECL_STRUCT(ToolSettings); + +#undef SDNA_DEFAULT_DECL_STRUCT /* Reuse existing definitions. */ extern const struct UserDef U_default; @@ -77,7 +99,6 @@ extern const bTheme U_theme_default; # define SDNA_TYPE_CHECKED(v, t) (&(v)) #endif -/* */ #define SDNA_DEFAULT_DECL(struct_name) \ [SDNA_TYPE_FROM_STRUCT(struct_name)] = SDNA_TYPE_CHECKED(DNA_DEFAULT_##struct_name, struct_name) @@ -86,6 +107,16 @@ extern const bTheme U_theme_default; /** Keep headers sorted. */ const void *DNA_default_table[SDNA_TYPE_MAX] = { + + /* DNA_material_defaults.h */ + SDNA_DEFAULT_DECL(Material), + + /* DNA_mesh_defaults.h */ + SDNA_DEFAULT_DECL(Mesh), + + /* DNA_object_defaults.h */ + SDNA_DEFAULT_DECL(Object), + /* DNA_scene_defaults.h */ SDNA_DEFAULT_DECL(Scene), SDNA_DEFAULT_DECL_EX(RenderData, Scene.r), |