change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / ui / properties_world.py
index a53aeec2c17c1b711c0fee2edab5ee03f77d12cc..5902c70b2e7391db7b3c39fd56cc5b528d53aee5 100644 (file)
@@ -267,14 +267,27 @@ class WORLD_PT_gather(WorldButtonsPanel):
             col.prop(light, "pixel_cache")
             col.prop(light, "correction")
 
-bpy.types.register(WORLD_PT_context_world)
-bpy.types.register(WORLD_PT_preview)
-bpy.types.register(WORLD_PT_world)
-bpy.types.register(WORLD_PT_ambient_occlusion)
-bpy.types.register(WORLD_PT_environment_lighting)
-bpy.types.register(WORLD_PT_indirect_lighting)
-bpy.types.register(WORLD_PT_gather)
-bpy.types.register(WORLD_PT_mist)
-bpy.types.register(WORLD_PT_stars)
-
-bpy.types.register(WORLD_PT_custom_props)
+
+classes = [
+    WORLD_PT_context_world,
+    WORLD_PT_preview,
+    WORLD_PT_world,
+    WORLD_PT_ambient_occlusion,
+    WORLD_PT_environment_lighting,
+    WORLD_PT_indirect_lighting,
+    WORLD_PT_gather,
+    WORLD_PT_mist,
+    WORLD_PT_stars,
+
+    WORLD_PT_custom_props]
+
+
+def register():
+    register = bpy.types.register
+    for cls in classes:
+        register(cls)
+
+def unregister():
+    unregister = bpy.types.unregister
+    for cls in classes:
+        unregister(cls)