change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / op / presets.py
index d1e059622fca653c0f15b65561b341cc529ac662..0d220fe9c2bfcd99afd57422737b49dc34a15f43 100644 (file)
@@ -158,7 +158,20 @@ class AddPresetSunSky(AddPresetBase):
     preset_subdir = "sunsky"
 
 
-bpy.types.register(AddPresetRender)
-bpy.types.register(AddPresetSSS)
-bpy.types.register(AddPresetCloth)
-bpy.types.register(AddPresetSunSky)
+classes = [
+    AddPresetRender,
+    AddPresetSSS,
+    AddPresetCloth,
+    AddPresetSunSky]
+
+
+def register():
+    register = bpy.types.register
+    for cls in classes:
+        register(cls)
+
+def unregister():
+    unregister = bpy.types.unregister
+    for cls in classes:
+        unregister(cls)
+