diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-08 11:54:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-08 11:54:41 +0300 |
commit | b8ca67ca3345f0c1bf6021b4f44de2256c144a6a (patch) | |
tree | 1f3f3b6214b18041cbec1973b6c0564b76bee05d /release/scripts/modules/rna_prop_ui.py | |
parent | ceab17ee17f158840faec6b681ff02a31998e995 (diff) |
custom properties panels for most ID types. use subclassing to keep panel UI definitions minimal
Diffstat (limited to 'release/scripts/modules/rna_prop_ui.py')
-rw-r--r-- | release/scripts/modules/rna_prop_ui.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index 543a10e47e9..f5b9e518c8f 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -124,6 +124,18 @@ def draw(layout, context, context_member, use_edit=True): assign_props(prop, val_draw, key) +class PropertyPanel(bpy.types.Panel): + """ + The subclass should have its own poll function + and the variable '_context_path' MUST be set. + """ + bl_label = "Custom Properties" + bl_default_closed = True + + def draw(self, context): + draw(self.layout, context, self._context_path) + + from bpy.props import * @@ -257,3 +269,4 @@ class WM_OT_properties_remove(bpy.types.Operator): item = eval("context.%s" % self.properties.path) del item[self.properties.property] return {'FINISHED'} + |