RNA-property tagging using tags defined by struct (+ operator properties tagged 'BASIC')
Adds support for defining a number of tags as part of struct definition, which its properties can set for custom behaviour. Further, it uses it to tag operator properties as BASIC (alternative to D2881).
Note that this also includes Python integration.
Defining & setting tags
- To define tags for a struct (which its properties can use then), define the tags in an EnumPropertyItem array, and assign them to the struct using RNA_def_struct_property_tags(...). E.g.:
- To set tags for an RNA-property in C, use the new RNA_def_property_tags(...).
- To set tags for an RNA-property in Python, use the newly added tags parameter. E.g.:
How to test
- For testing I tagged a bunch of operator properties as BASIC. Redo panel only draws these. (see D2881, "For Testing" section)
- Python: The following script should spawn a popup containing only properties tagged as BASIC (note the tags parameters):
- Python console :)
- Using BASIC tag is more of a proof-of-concept, we can decide to use something different instead.
- We discussed auto-tagging of operator properties by setting a state (e.g. call WM_operatortype_props_advanced to auto-tag following properties as advanced). Shall we do this?
- Need to update BPY documentation in bpy_props.c still.
- Would be nice to have a place to explain the tagging system. Wiki maybe?