diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-14 14:21:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-14 14:21:21 +0300 |
commit | 39c04315e2815bbd24c9ba5f7e0aa11736fa1c48 (patch) | |
tree | 6c88f9d9dc4562374df40f080147b3a6144834e6 /release/scripts/op/presets.py | |
parent | b02f78ed02fd0c6fbb8f67bba1c123552052321c (diff) |
change python scripts so modules which register with blender have a register() function rather then making import automatically run the register functions (generally considered bad practice by python people)
Diffstat (limited to 'release/scripts/op/presets.py')
-rw-r--r-- | release/scripts/op/presets.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py index d1e059622fc..0d220fe9c2b 100644 --- a/release/scripts/op/presets.py +++ b/release/scripts/op/presets.py @@ -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) + |