diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-08-27 01:39:06 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-08-27 01:39:06 +0400 |
commit | 71e5e90fb7d44482c87692c3fe3332c22e353d07 (patch) | |
tree | d43fb8c8489faa86c699bec85df170e85a39acf8 /source/blender | |
parent | 1679cd7f966b5441bd02e8960ece398ee1980c7f (diff) |
Followup to r59536: make "is_argument_optional" available to py, and use it in API doc generation.
Thanks Campbell for the much better name suggestion!
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 67fc3056485..380bde90ff9 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -566,6 +566,12 @@ static int rna_Property_is_required_get(PointerRNA *ptr) return prop->flag & PROP_REQUIRED ? 1 : 0; } +static int rna_Property_is_argument_optional_get(PointerRNA *ptr) +{ + PropertyRNA *prop = (PropertyRNA *)ptr->data; + return prop->flag & PROP_PYFUNC_OPTIONAL ? 1 : 0; +} + static int rna_Property_is_never_none_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; @@ -1171,6 +1177,12 @@ static void rna_def_property(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Property_is_required_get", NULL); RNA_def_property_ui_text(prop, "Required", "False when this property is an optional argument in an RNA function"); + prop = RNA_def_property(srna, "is_argument_optional", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Property_is_argument_optional_get", NULL); + RNA_def_property_ui_text(prop, "Optional Argument", + "True when the property is optional in a Python function implementing an RNA function"); + prop = RNA_def_property(srna, "is_never_none", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Property_is_never_none_get", NULL); |