diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-13 16:01:02 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-13 16:01:02 +0300 |
commit | 128bed8480ca65c79ecdb2cf279383e9d0f65a2c (patch) | |
tree | 3f24ba345c5179dd791e2186865f62f8319e8e2f /source | |
parent | 280592be9f45d8d32f21cd4805570d8dcf3d790e (diff) |
RNA: use a different method to set DNA types for BlendData* collections, to
solve issues with c++ api.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 28 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main_api.c | 25 |
2 files changed, 25 insertions, 28 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 21f3d99041a..e19ae4cf56d 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -353,34 +353,6 @@ typedef struct ExtensionRNA { } ExtensionRNA; -/* fake struct definitions, needed otherwise collections end up owning the C - * structs like 'Object' when defined first */ -#define BlendDataActions Main -#define BlendDataArmatures Main -#define BlendDataBrushes Main -#define BlendDataCameras Main -#define BlendDataCurves Main -#define BlendDataFonts Main -#define BlendDataGreasePencils Main -#define BlendDataGroups Main -#define BlendDataImages Main -#define BlendDataLamps Main -#define BlendDataLattices Main -#define BlendDataLibraries Main -#define BlendDataMaterials Main -#define BlendDataMeshes Main -#define BlendDataMetaBalls Main -#define BlendDataNodeTrees Main -#define BlendDataObjects Main -#define BlendDataParticles Main -#define BlendDataScenes Main -#define BlendDataScreens Main -#define BlendDataSounds Main -#define BlendDataTexts Main -#define BlendDataTextures Main -#define BlendDataWindowManagers Main -#define BlendDataWorlds Main - #ifdef __cplusplus } #endif diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 527b9187b8c..f5cbc6b2e87 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -537,6 +537,7 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataCameras"); srna= RNA_def_struct(brna, "BlendDataCameras", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras"); func= RNA_def_function(srna, "new", "rna_Main_cameras_new"); @@ -566,6 +567,7 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataScenes"); srna= RNA_def_struct(brna, "BlendDataScenes", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes"); func= RNA_def_function(srna, "new", "rna_Main_scenes_new"); @@ -591,6 +593,7 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataObjects"); srna= RNA_def_struct(brna, "BlendDataObjects", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects"); func= RNA_def_function(srna, "new", "rna_Main_objects_new"); @@ -624,6 +627,7 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataMaterials"); srna= RNA_def_struct(brna, "BlendDataMaterials", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Material", "Collection of materials"); func= RNA_def_function(srna, "new", "rna_Main_materials_new"); @@ -658,6 +662,7 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataNodeTrees"); srna= RNA_def_struct(brna, "BlendDataNodeTrees", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees"); func= RNA_def_function(srna, "new", "rna_Main_nodetree_new"); @@ -688,6 +693,7 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataMeshes"); srna= RNA_def_struct(brna, "BlendDataMeshes", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes"); func= RNA_def_function(srna, "new", "rna_Main_meshes_new"); @@ -716,6 +722,7 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataLamps"); srna= RNA_def_struct(brna, "BlendDataLamps", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Lamps", "Collection of lamps"); func= RNA_def_function(srna, "new", "rna_Main_lamps_new"); @@ -747,6 +754,7 @@ void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataLibraries"); srna= RNA_def_struct(brna, "BlendDataLibraries", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries"); func= RNA_def_function(srna, "tag", "rna_Main_libraries_tag"); @@ -762,6 +770,7 @@ void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataScreens"); srna= RNA_def_struct(brna, "BlendDataScreens", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens"); func= RNA_def_function(srna, "tag", "rna_Main_screens_tag"); @@ -777,6 +786,7 @@ void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataWindowManagers"); srna= RNA_def_struct(brna, "BlendDataWindowManagers", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers"); func= RNA_def_function(srna, "tag", "rna_Main_window_managers_tag"); @@ -791,6 +801,7 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataImages"); srna= RNA_def_struct(brna, "BlendDataImages", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Images", "Collection of images"); func= RNA_def_function(srna, "new", "rna_Main_images_new"); @@ -835,6 +846,7 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataLattices"); srna= RNA_def_struct(brna, "BlendDataLattices", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices"); func= RNA_def_function(srna, "new", "rna_Main_lattices_new"); @@ -863,6 +875,7 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataCurves"); srna= RNA_def_struct(brna, "BlendDataCurves", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves"); func= RNA_def_function(srna, "new", "rna_Main_curves_new"); @@ -893,6 +906,7 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataMetaBalls"); srna= RNA_def_struct(brna, "BlendDataMetaBalls", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main MetaBall", "Collection of metaballs"); func= RNA_def_function(srna, "new", "rna_Main_metaballs_new"); @@ -921,6 +935,7 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataFonts"); srna= RNA_def_struct(brna, "BlendDataFonts", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts"); func= RNA_def_function(srna, "load", "rna_Main_fonts_load"); @@ -950,6 +965,7 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataTextures"); srna= RNA_def_struct(brna, "BlendDataTextures", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Textures", "Collection of groups"); func= RNA_def_function(srna, "new", "rna_Main_textures_new"); @@ -980,6 +996,7 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataBrushes"); srna= RNA_def_struct(brna, "BlendDataBrushes", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes"); func= RNA_def_function(srna, "new", "rna_Main_brushes_new"); @@ -1009,6 +1026,7 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataWorlds"); srna= RNA_def_struct(brna, "BlendDataWorlds", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds"); func= RNA_def_function(srna, "new", "rna_Main_worlds_new"); @@ -1038,6 +1056,7 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataGroups"); srna= RNA_def_struct(brna, "BlendDataGroups", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Groups", "Collection of groups"); func= RNA_def_function(srna, "new", "rna_Main_groups_new"); @@ -1065,6 +1084,7 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataTexts"); srna= RNA_def_struct(brna, "BlendDataTexts", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts"); func= RNA_def_function(srna, "new", "rna_Main_texts_new"); @@ -1103,6 +1123,7 @@ void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataSounds"); srna= RNA_def_struct(brna, "BlendDataSounds", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds"); /* TODO, 'load' */ @@ -1120,6 +1141,7 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataArmatures"); srna= RNA_def_struct(brna, "BlendDataArmatures", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures"); func= RNA_def_function(srna, "new", "rna_Main_armatures_new"); @@ -1148,6 +1170,7 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataActions"); srna= RNA_def_struct(brna, "BlendDataActions", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions"); func= RNA_def_function(srna, "new", "rna_Main_actions_new"); @@ -1176,6 +1199,7 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataParticles"); srna= RNA_def_struct(brna, "BlendDataParticles", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings"); func= RNA_def_function(srna, "new", "rna_Main_particles_new"); @@ -1205,6 +1229,7 @@ void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_srna(cprop, "BlendDataGreasePencils"); srna= RNA_def_struct(brna, "BlendDataGreasePencils", NULL); + RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils"); func= RNA_def_function(srna, "tag", "rna_Main_gpencil_tag"); |