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>2013-06-01 08:06:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-01 08:06:38 +0400
commit2d4a682a8e48e41af2867bc71a621eb0fac27b1e (patch)
tree040f6811f870d72f8268250b61f719b3eef2f0a7 /release
parent0ad88d1001449f71b9448e237e6f05fb244f1a85 (diff)
add popup menu to allow python scripts to show popups without having to define a menu class first.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy_types.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index a4080b673db..d3ac5a6093c 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -128,6 +128,19 @@ class Object(bpy_types.ID):
if self in scene.objects[:])
+class WindowManager(bpy_types.ID):
+ __slots__ = ()
+
+ def popup_menu(self, draw_func, title="", icon='NONE'):
+ import bpy
+ popup = self.pupmenu_begin__internal(title, icon)
+
+ try:
+ draw_func(popup, bpy.context)
+ finally:
+ self.pupmenu_end__internal(popup)
+
+
class _GenericBone:
"""
functions for bones, common between Armature/Pose/Edit bones.