diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-20 04:16:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-20 04:16:51 +0300 |
commit | eaf88f564c7e68a71ea43c667ed8a1396f182814 (patch) | |
tree | 92801383acb0f12fda59770a76c7fa30bd55b765 /intern/cycles | |
parent | fa11d41113514e46038888285e3244858ff5a30c (diff) |
Remove register_module use in Cycles
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/addon/__init__.py | 15 | ||||
-rw-r--r-- | intern/cycles/blender/addon/presets.py | 15 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 58 |
3 files changed, 84 insertions, 4 deletions
diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py index 235d19e91e8..eb792af7264 100644 --- a/intern/cycles/blender/addon/__init__.py +++ b/intern/cycles/blender/addon/__init__.py @@ -107,7 +107,13 @@ def engine_exit(): engine.exit() +classes = ( + CyclesRender, +) + + def register(): + from bpy.utils import register_class from . import ui from . import properties from . import presets @@ -122,12 +128,15 @@ def register(): properties.register() ui.register() presets.register() - bpy.utils.register_module(__name__) + + for cls in classes: + register_class(cls) bpy.app.handlers.version_update.append(version_update.do_versions) def unregister(): + from bpy.utils import unregister_class from . import ui from . import properties from . import presets @@ -138,4 +147,6 @@ def unregister(): ui.unregister() properties.unregister() presets.unregister() - bpy.utils.unregister_module(__name__) + + for cls in classes: + unregister_class(cls) diff --git a/intern/cycles/blender/addon/presets.py b/intern/cycles/blender/addon/presets.py index f97b51b629d..82c4ffc6e50 100644 --- a/intern/cycles/blender/addon/presets.py +++ b/intern/cycles/blender/addon/presets.py @@ -82,12 +82,23 @@ class AddPresetSampling(AddPresetBase, Operator): preset_subdir = "cycles/sampling" +classes = ( + AddPresetIntegrator, + AddPresetSampling, +) + + def register(): - pass + from bpy.utils import register_class + for cls in classes: + register_class(cls) def unregister(): - pass + from bpy.utils import unregister_class + for cls in classes: + unregister_class(cls) + if __name__ == "__main__": register() diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index c9b98956c93..c7b9b21e935 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1713,17 +1713,75 @@ def get_panels(): return panels + +classes = ( + CYCLES_MT_sampling_presets, + CYCLES_MT_integrator_presets, + CyclesRender_PT_sampling, + CyclesRender_PT_geometry, + CyclesRender_PT_light_paths, + CyclesRender_PT_motion_blur, + CyclesRender_PT_film, + CyclesRender_PT_performance, + CyclesRender_PT_layer_options, + CyclesRender_PT_layer_passes, + CyclesRender_PT_views, + Cycles_PT_post_processing, + CyclesCamera_PT_dof, + Cycles_PT_context_material, + CyclesObject_PT_motion_blur, + CyclesObject_PT_cycles_settings, + CYCLES_OT_use_shading_nodes, + CyclesLamp_PT_preview, + CyclesLamp_PT_lamp, + CyclesLamp_PT_nodes, + CyclesLamp_PT_spot, + CyclesWorld_PT_preview, + CyclesWorld_PT_surface, + CyclesWorld_PT_volume, + CyclesWorld_PT_ambient_occlusion, + CyclesWorld_PT_mist, + CyclesWorld_PT_ray_visibility, + CyclesWorld_PT_settings, + CyclesMaterial_PT_preview, + CyclesMaterial_PT_surface, + CyclesMaterial_PT_volume, + CyclesMaterial_PT_displacement, + CyclesMaterial_PT_settings, + CyclesTexture_PT_context, + CyclesTexture_PT_node, + CyclesTexture_PT_mapping, + CyclesTexture_PT_colors, + CyclesParticle_PT_textures, + CyclesRender_PT_bake, + CyclesRender_PT_debug, + CyclesParticle_PT_CurveSettings, + CyclesScene_PT_simplify, +) + + def register(): + from bpy.utils import register_class + bpy.types.RENDER_PT_render.append(draw_device) bpy.types.VIEW3D_HT_header.append(draw_pause) for panel in get_panels(): panel.COMPAT_ENGINES.add('CYCLES') + for cls in classes: + register_class(cls) + + def unregister(): + from bpy.utils import unregister_class + bpy.types.RENDER_PT_render.remove(draw_device) bpy.types.VIEW3D_HT_header.remove(draw_pause) for panel in get_panels(): if 'CYCLES' in panel.COMPAT_ENGINES: panel.COMPAT_ENGINES.remove('CYCLES') + + for cls in classes: + unregister_class(cls) |