change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / ui / space_graph.py
index 16a615d2be7c997f03b11456f0d64cce31760109..fa8d607e4ff078d1a69f8ae4dc98c9bdfd13abea 100644 (file)
@@ -198,9 +198,21 @@ class GRAPH_MT_key_transform(bpy.types.Menu):
         layout.operator("transform.resize", text="Scale")
 
 
-bpy.types.register(GRAPH_HT_header) # header/menu classes
-bpy.types.register(GRAPH_MT_view)
-bpy.types.register(GRAPH_MT_select)
-bpy.types.register(GRAPH_MT_channel)
-bpy.types.register(GRAPH_MT_key)
-bpy.types.register(GRAPH_MT_key_transform)
+classes = [
+    GRAPH_HT_header, # header/menu classes
+    GRAPH_MT_view,
+    GRAPH_MT_select,
+    GRAPH_MT_channel,
+    GRAPH_MT_key,
+    GRAPH_MT_key_transform]
+
+
+def register():
+    register = bpy.types.register
+    for cls in classes:
+        register(cls)
+
+def unregister():
+    unregister = bpy.types.unregister
+    for cls in classes:
+        unregister(cls)