add RNA_define_animate_sdna() so animation can be easily disabled when defining many...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 5 Feb 2013 14:25:22 +0000 (14:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 5 Feb 2013 14:25:22 +0000 (14:25 +0000)
source/blender/makesrna/RNA_define.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_sculpt_paint.c

index cd6d74c348800272c276944fdd6638afb656d2a8..0d6e66904e739cef47d6c3dfa58d13c0623dab3b 100644 (file)
@@ -43,6 +43,7 @@ BlenderRNA *RNA_create(void);
 void RNA_define_free(BlenderRNA *brna);
 void RNA_free(BlenderRNA *brna);
 void RNA_define_verify_sdna(int verify);
 void RNA_define_free(BlenderRNA *brna);
 void RNA_free(BlenderRNA *brna);
 void RNA_define_verify_sdna(int verify);
+void RNA_define_animate_sdna(int animate);
 
 void RNA_init(void);
 void RNA_exit(void);
 
 void RNA_init(void);
 void RNA_exit(void);
index 01df05677e700940cb4879bad4acc7b9ee530a98..e1844faf6e9760764475cab75469ca9898e8c0a5 100644 (file)
@@ -3882,6 +3882,13 @@ static int rna_preprocess(const char *outfile)
                if (PROCESS_ITEMS[i].define) {
                        PROCESS_ITEMS[i].define(brna);
 
                if (PROCESS_ITEMS[i].define) {
                        PROCESS_ITEMS[i].define(brna);
 
+                       /* sanity check */
+                       if (!DefRNA.animate) {
+                               fprintf(stderr,
+                                       "Error: DefRNA.animate left disabled in %s\n",
+                                       PROCESS_ITEMS[i].filename);
+                       }
+
                        for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
                                if (!ds->filename)
                                        ds->filename = PROCESS_ITEMS[i].filename;
                        for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
                                if (!ds->filename)
                                        ds->filename = PROCESS_ITEMS[i].filename;
index 8bed562cbf7a329f5a9dd2cfbf591601c0605c59..2719016856dddbf0d0bb9faa995747e2f45fef91 100644 (file)
@@ -61,7 +61,7 @@
 
 /* Global used during defining */
 
 
 /* Global used during defining */
 
-BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1};
+BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1, 1};
 
 /* Duplicated code since we can't link in blenkernel or blenlib */
 
 
 /* Duplicated code since we can't link in blenkernel or blenlib */
 
@@ -506,6 +506,13 @@ void RNA_define_verify_sdna(int verify)
        DefRNA.verify = verify;
 }
 
        DefRNA.verify = verify;
 }
 
+#ifndef RNA_RUNTIME
+void RNA_define_animate_sdna(int animate)
+{
+       DefRNA.animate = animate;
+}
+#endif
+
 void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
 {
 #ifdef RNA_RUNTIME
 void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
 {
 #ifdef RNA_RUNTIME
@@ -1031,8 +1038,15 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
        if (type != PROP_COLLECTION && type != PROP_POINTER) {
                prop->flag = PROP_EDITABLE;
        
        if (type != PROP_COLLECTION && type != PROP_POINTER) {
                prop->flag = PROP_EDITABLE;
        
-               if (type != PROP_STRING)
+               if (type != PROP_STRING) {
+#ifdef RNA_RUNTIME
                        prop->flag |= PROP_ANIMATABLE;
                        prop->flag |= PROP_ANIMATABLE;
+#else
+                       if (DefRNA.animate) {
+                               prop->flag |= PROP_ANIMATABLE;
+                       }
+#endif
+               }
        }
 
        if (type == PROP_STRING) {
        }
 
        if (type == PROP_STRING) {
index d908e84430b2c43608f145a3e082fc2b259835d6..eaa69a8124c78bb312f9f5dbe07db1ddd05f7325 100644 (file)
@@ -117,7 +117,7 @@ typedef struct BlenderDefRNA {
        ListBase structs;
        ListBase allocs;
        struct StructRNA *laststruct;
        ListBase structs;
        ListBase allocs;
        struct StructRNA *laststruct;
-       int error, silent, preprocess, verify;
+       int error, silent, preprocess, verify, animate;
 } BlenderDefRNA;
 
 extern BlenderDefRNA DefRNA;
 } BlenderDefRNA;
 
 extern BlenderDefRNA DefRNA;
index 4763c4d307149788c904928c916bc7a42143cd8a..6c8242e43339639f868464bc98738dd63862acd9 100644 (file)
@@ -4708,15 +4708,19 @@ void RNA_def_scene(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
 
        /* Nestled Data  */
        RNA_def_property_ui_text(prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
 
        /* Nestled Data  */
+       /* *** Non-Animated *** */
+       RNA_define_animate_sdna(false);
        rna_def_tool_settings(brna);
        rna_def_unified_paint_settings(brna);
        rna_def_unit_settings(brna);
        rna_def_scene_image_format_data(brna);
        rna_def_tool_settings(brna);
        rna_def_unified_paint_settings(brna);
        rna_def_unit_settings(brna);
        rna_def_scene_image_format_data(brna);
-       rna_def_scene_render_data(brna);
        rna_def_scene_game_data(brna);
        rna_def_scene_game_data(brna);
-       rna_def_scene_render_layer(brna);
        rna_def_transform_orientation(brna);
        rna_def_selected_uv_element(brna);
        rna_def_transform_orientation(brna);
        rna_def_selected_uv_element(brna);
+       RNA_define_animate_sdna(true);
+       /* *** Animated *** */
+       rna_def_scene_render_data(brna);
+       rna_def_scene_render_layer(brna);
        
        /* Scene API */
        RNA_api_scene(srna);
        
        /* Scene API */
        RNA_api_scene(srna);
index 08bac1da7a7ec65f9529661985f1fdc85de04833..ff0c9d9dec6803bbcc35cfb9e379ab12548583d9 100644 (file)
@@ -676,12 +676,15 @@ static void rna_def_particle_edit(BlenderRNA *brna)
 
 void RNA_def_sculpt_paint(BlenderRNA *brna)
 {
 
 void RNA_def_sculpt_paint(BlenderRNA *brna)
 {
+       /* *** Non-Animated *** */
+       RNA_define_animate_sdna(false);
        rna_def_paint(brna);
        rna_def_sculpt(brna);
        rna_def_uv_sculpt(brna);
        rna_def_vertex_paint(brna);
        rna_def_image_paint(brna);
        rna_def_particle_edit(brna);
        rna_def_paint(brna);
        rna_def_sculpt(brna);
        rna_def_uv_sculpt(brna);
        rna_def_vertex_paint(brna);
        rna_def_image_paint(brna);
        rna_def_particle_edit(brna);
+       RNA_define_animate_sdna(true);
 }
 
 #endif
 }
 
 #endif