diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-01-22 14:42:14 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-01-26 13:15:18 +0300 |
commit | 82e01270651823d9784f627682c2bb544bd10360 (patch) | |
tree | 68222a09fdf86471b3df3fe5531f4c40ce836447 | |
parent | bfd209007d51b4dc358c41ab541be0cb9b0e7c74 (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).
-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 ( |