[Bf-blender-cvs] [ce8889175a] master: Fix T50491: Cycles UI breaks when pushing F8.

Bastien Montagne noreply at git.blender.org
Sun Jan 22 12:51:30 CET 2017


Commit: ce8889175a553967583a1152e71b4390a240a112
Author: Bastien Montagne
Date:   Sun Jan 22 12:42:14 2017 +0100
Branches: master
https://developer.blender.org/rBce8889175a553967583a1152e71b4390a240a112

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).

===================================================================

M	intern/cycles/blender/addon/__init__.py

===================================================================

diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py
index 2938831787..1fc3758ad4 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 (




More information about the Bf-blender-cvs mailing list