From 9c8cc9fe60e783f698e291ed5ef338a477214f22 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Jun 2011 10:54:57 +0000 Subject: rna option not to save certain properties for redoing later, currently only used by operator presets. --- source/blender/makesrna/RNA_types.h | 2 ++ source/blender/makesrna/intern/rna_rna.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 090b87e9e39..ec213d6a496 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -159,6 +159,8 @@ typedef enum PropertyFlag { /* hidden in the user interface */ PROP_HIDDEN = 1<<19, + /* do not write in presets */ + PROP_SKIP_SAVE = 1<<28, /* function paramater flags */ PROP_REQUIRED = 1<<2, diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 84bb624b546..b4da3a02442 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -493,6 +493,13 @@ static int rna_Property_is_hidden_get(PointerRNA *ptr) return prop->flag & PROP_HIDDEN ? 1:0; } +static int rna_Property_is_skip_save_get(PointerRNA *ptr) +{ + PropertyRNA *prop= (PropertyRNA*)ptr->data; + return prop->flag & PROP_SKIP_SAVE ? 1:0; +} + + static int rna_Property_is_enum_flag_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; @@ -1037,6 +1044,11 @@ static void rna_def_property(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Property_is_hidden_get", NULL); RNA_def_property_ui_text(prop, "Hidden", "True when the property is hidden"); + prop= RNA_def_property(srna, "is_skip_save", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Property_is_skip_save_get", NULL); + RNA_def_property_ui_text(prop, "Skip Save", "True when the property is not saved in presets"); + prop= RNA_def_property(srna, "is_output", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Property_use_output_get", NULL); -- cgit v1.2.3