diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-12 17:36:44 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-13 19:21:58 +0300 |
commit | dc00d66c897fb30b2742812f2669fa79a941839e (patch) | |
tree | d02d67a308b12dae908743857a65e19741ee6bf5 /release | |
parent | 5e2804a40be649e55a827b08d3c424001be43006 (diff) |
UI: only show API defined custom properties when Developer Extras is on.
These are intended to behave just like any other builting property, so
no to always show them in the Custom Properties panels for regular users.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/rna_prop_ui.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index e50922593de..bdb0751c973 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -129,6 +129,7 @@ def draw(layout, context, context_member, property_type, use_edit=True): props.data_path = context_member del row + show_developer_ui = context.user_preferences.view.show_developer_ui rna_properties = {prop.identifier for prop in rna_item.bl_rna.properties if prop.is_runtime} if items else None for key, val in items: @@ -136,6 +137,12 @@ def draw(layout, context, context_member, property_type, use_edit=True): if key == '_RNA_UI': continue + is_rna = (key in rna_properties) + + # only show API defined for developers + if is_rna and not show_developer_ui: + continue + row = layout.row() to_dict = getattr(val, "to_dict", None) to_list = getattr(val, "to_list", None) @@ -161,8 +168,6 @@ def draw(layout, context, context_member, property_type, use_edit=True): row.label(text=key, translate=False) # explicit exception for arrays - is_rna = (key in rna_properties) - if to_dict or to_list: row.label(text=val_draw, translate=False) else: |