diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-09 05:37:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-09 05:37:09 +0400 |
commit | a6f13f9d7bfef7020d43cb0a8058753e6d7a128d (patch) | |
tree | 09535f0341f93288fc492c3318ba2213291345d9 /release/scripts/modules/rna_prop_ui.py | |
parent | 7fcbbad5a45acf5b4ef49d16cf6733afd1e481c7 (diff) |
poll() as a python '@staticmethod' was too limiting and didnt allow useful base class poll functions in many cases.
now rna functions that dont have a 'self' are automatically assumed '@classmethods'.
de-duplicated poll functions and made some minor tweaks too.
Diffstat (limited to 'release/scripts/modules/rna_prop_ui.py')
-rw-r--r-- | release/scripts/modules/rna_prop_ui.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index eda27240fb5..63762855737 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -132,6 +132,10 @@ class PropertyPanel(): bl_label = "Custom Properties" bl_default_closed = True + @classmethod + def poll(cls, context): + bool(eval("context.%s" % cls._context_path)) + def draw(self, context): draw(self.layout, context, self._context_path) |