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-02-10 14:10:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-10 14:10:38 +0300
commitc2b2ccde45a9424339337ef130255138b912d29d (patch)
tree36589ef155abb4fe9cb703fce16fcf52c191521f /release
parentfbc201d2ddcda5db4d5d41ac3a3ba8f3cd4a2ba9 (diff)
fix for python not being able to call operators with a executuon context.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy/ops.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py
index efa4a51530b..0975bf1c60b 100644
--- a/release/scripts/modules/bpy/ops.py
+++ b/release/scripts/modules/bpy/ops.py
@@ -27,19 +27,6 @@ op_call = ops_module.call
op_as_string = ops_module.as_string
op_get_rna = ops_module.get_rna
-# Keep in sync with WM_types.h
-context_dict = {
- 'INVOKE_DEFAULT': 0,
- 'INVOKE_REGION_WIN': 1,
- 'INVOKE_AREA': 2,
- 'INVOKE_SCREEN': 3,
- 'EXEC_DEFAULT': 4,
- 'EXEC_REGION_WIN': 5,
- 'EXEC_AREA': 6,
- 'EXEC_SCREEN': 7,
-}
-
-
class bpy_ops(object):
'''
Fake module like class.
@@ -161,16 +148,10 @@ class bpy_ops_submodule_op(object):
else:
C_exec = args[0]
- try:
- context = context_dict[C_exec]
- except:
- raise ValueError("Expected a single context argument in: " + \
- str(list(context_dict.keys())))
-
if len(args) == 2:
C_dict = args[1]
- ret = op_call(self.idname_py(), C_dict, kw, context)
+ ret = op_call(self.idname_py(), C_dict, kw, C_exec)
else:
ret = op_call(self.idname_py(), C_dict, kw)