Support tagging operator properties as 'advanced'

This will later be used to show advanced operator properties separate from
basic (as in non-advanced) ones in the UI.

Tagging a single operator property in C should be done via
`WM_operatortype_prop_tag()`. It does additional checks for type safety
that `RNA_def_property_tags()` doesn't do.

To avoid having to tag each advanced property individually, multiple
ones can be tagged by wrapping them into
`WM_operatortype_props_advanced_bein()` and
`WM_operatortype_props_advanced_end()` calls. It's also possible to only
call `_begin()`, all properties added after this will get tagged then.
In most cases this last approach should be sufficient.

Example of Python usage:
`my_float = bpy.props.FloatProperty(name="Some Float", tags={'ADVANCED'})`
This commit is contained in:
Julian Eisel
2017-11-23 13:58:05 +01:00
parent 23d148ecaf
commit 60cbdb0152
7 changed files with 99 additions and 0 deletions

View File

@@ -727,6 +727,23 @@ bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
return found;
}
unsigned int RNA_struct_count_properties(StructRNA *srna)
{
PointerRNA struct_ptr;
unsigned int counter = 0;
RNA_pointer_create(NULL, srna, NULL, &struct_ptr);
RNA_STRUCT_BEGIN (&struct_ptr, prop)
{
counter++;
UNUSED_VARS(prop);
}
RNA_STRUCT_END;
return counter;
}
/* low level direct access to type->properties, note this ignores parent classes so should be used with care */
const struct ListBase *RNA_struct_type_properties(StructRNA *srna)
{