Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-01-08 11:54:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-08 11:54:41 +0300
commitb8ca67ca3345f0c1bf6021b4f44de2256c144a6a (patch)
tree1f3f3b6214b18041cbec1973b6c0564b76bee05d /release/scripts/modules/rna_prop_ui.py
parentceab17ee17f158840faec6b681ff02a31998e995 (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.py13
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'}
+