diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-01-22 14:42:14 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-01-22 14:42:14 +0300 |
commit | ce8889175a553967583a1152e71b4390a240a112 (patch) | |
tree | 0bb135536e2bac84bf4ac935ac5de049f57d6e9f /intern/cycles/blender | |
parent | d2382f782e74f9e7b4df49ffc8e40dabb0b8af50 (diff) |
Fix T50491: Cycles UI breaks when pushing F8.
Cycles add-on did not actually support reloading correctly.
When you want to correctly reload sub-modules (i.e. modules of an add-on
which is a package), you need to use importlib, a mere import will do
nothing with already loaded modules (RNA classes are sort of
pre-registered when they are evaluated, through the meta-class system).
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/addon/__init__.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py index 29388317873..1fc3758ad4d 100644 --- a/intern/cycles/blender/addon/__init__.py +++ b/intern/cycles/blender/addon/__init__.py @@ -28,6 +28,20 @@ bl_info = { "support": 'OFFICIAL', "category": "Render"} +# Support 'reload' case. +if "bpy" in locals(): + import importlib + if "engine" in locals(): + importlib.reload(engine) + if "version_update" in locals(): + importlib.reload(version_update) + if "ui" in locals(): + importlib.reload(ui) + if "properties" in locals(): + importlib.reload(properties) + if "presets" in locals(): + importlib.reload(presets) + import bpy from . import ( |