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>2018-11-04 22:57:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-04 23:12:57 +0300
commit2f8a45e3140a4984bd18eadb2dc4850919d27bd4 (patch)
treec3f4f787fd581b8229258e4be34728acefdca042 /release/scripts/startup/bl_ui/space_toolsystem_common.py
parent5195f03ca129a417524280278e87257dc8188646 (diff)
Tool System: support passing in args to ToolDef functions
Needed since class aren't yet defined so we can't access their namespace. This avoids intermediate draw functions.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_toolsystem_common.py')
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_common.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 98bd0e3531a..79da1ee786e 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -143,10 +143,16 @@ def from_fn(fn):
return ToolDef.from_dict(fn())
+def with_args(*args):
+ def from_fn(fn):
+ return ToolDef.from_dict(fn(*args))
+ return from_fn
+
+
+from_fn.with_args = with_args
ToolDef.from_dict = from_dict
ToolDef.from_fn = from_fn
-del from_dict
-del from_fn
+del from_dict, from_fn, with_args
class ToolSelectPanelHelper: