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).
This commit is contained in:
Bastien Montagne 2017-01-22 12:42:14 +01:00
parent d2382f782e
commit ce8889175a
Notes: blender-bot 2023-02-14 19:45:25 +01:00
Referenced by issue #50506, blender windows 10 build 15014white screen
Referenced by issue #50491, Cycles UI breaks when pushing F8
1 changed files with 14 additions and 0 deletions

View File

@ -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 (