Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-02-05 18:25:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-05 18:25:22 +0400
commit4c3d5a4294756944eba2ab536751e38eecc2bd8d (patch)
tree1da526aad32c3dfda05ec3bac092a268979b09e2 /source
parentfa671fd0d54afa92f0e220aee5ba6ba86aef050e (diff)
add RNA_define_animate_sdna() so animation can be easily disabled when defining many properties - currently use to disable animating brushes and toolsettings.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/RNA_define.h1
-rw-r--r--source/blender/makesrna/intern/makesrna.c7
-rw-r--r--source/blender/makesrna/intern/rna_define.c18
-rw-r--r--source/blender/makesrna/intern/rna_internal.h2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c8
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c3
6 files changed, 34 insertions, 5 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index cd6d74c3488..0d6e66904e7 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -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_animate_sdna(int animate);
void RNA_init(void);
void RNA_exit(void);
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 01df05677e7..e1844faf6e9 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -3882,6 +3882,13 @@ static int rna_preprocess(const char *outfile)
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;
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 8bed562cbf7..2719016856d 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -61,7 +61,7 @@
/* 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 */
@@ -506,6 +506,13 @@ void RNA_define_verify_sdna(int 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
@@ -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_STRING)
+ if (type != PROP_STRING) {
+#ifdef RNA_RUNTIME
prop->flag |= PROP_ANIMATABLE;
+#else
+ if (DefRNA.animate) {
+ prop->flag |= PROP_ANIMATABLE;
+ }
+#endif
+ }
}
if (type == PROP_STRING) {
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index d908e84430b..eaa69a8124c 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -117,7 +117,7 @@ typedef struct BlenderDefRNA {
ListBase structs;
ListBase allocs;
struct StructRNA *laststruct;
- int error, silent, preprocess, verify;
+ int error, silent, preprocess, verify, animate;
} BlenderDefRNA;
extern BlenderDefRNA DefRNA;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 4763c4d3071..6c8242e4333 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -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 */
+ /* *** 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_scene_render_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_define_animate_sdna(true);
+ /* *** Animated *** */
+ rna_def_scene_render_data(brna);
+ rna_def_scene_render_layer(brna);
/* Scene API */
RNA_api_scene(srna);
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 08bac1da7a7..ff0c9d9dec6 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -676,12 +676,15 @@ static void rna_def_particle_edit(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_define_animate_sdna(true);
}
#endif