change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / modules / bpy_types.py
index 8f8151f297648bc7278f01e353b878dff1ff520f..9d2e157f8436155147275093b79297addb3b8444 100644 (file)
@@ -448,9 +448,9 @@ class _GenericUI:
 
         if draw_funcs is None:
 
-            def draw_ls(*args):
+            def draw_ls(self, context):
                 for func in draw_ls._draw_funcs:
-                    func(*args)
+                    func(self, context)
 
             draw_funcs = draw_ls._draw_funcs = [cls.draw]
             cls.draw = draw_ls
@@ -469,6 +469,12 @@ class _GenericUI:
         draw_funcs = cls._dyn_ui_initialize()
         draw_funcs.insert(0, draw_func)
 
+    @classmethod
+    def remove(cls, draw_func):
+        """Remove a draw function that has been added to this menu"""
+        draw_funcs = cls._dyn_ui_initialize()
+        draw_funcs.remove(draw_func)
+
 
 class Panel(StructRNA, _GenericUI):
     __slots__ = ()