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:
Diffstat (limited to 'release/scripts/modules/bpy_types.py')
-rw-r--r--release/scripts/modules/bpy_types.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 8fc23731c42..7c8f767f327 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -678,6 +678,9 @@ class _GenericUI:
if draw_funcs is None:
def draw_ls(self, context):
+ # ensure menus always get default context
+ operator_context_default = self.layout.operator_context
+
for func in draw_ls._draw_funcs:
# so bad menu functions dont stop the entire menu from drawing.
try:
@@ -686,6 +689,8 @@ class _GenericUI:
import traceback
traceback.print_exc()
+ self.layout.operator_context = operator_context_default
+
draw_funcs = draw_ls._draw_funcs = [cls.draw]
cls.draw = draw_ls