forked from LuxCoreRender/BlendLuxCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
76 lines (65 loc) · 2.74 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import bpy
import addon_utils
import platform
_, luxblend_is_enabled = addon_utils.check("luxrender")
if luxblend_is_enabled:
addon_utils.disable("luxrender", default_set=True)
print("Disabled the old LuxBlend addon.")
raise Exception("\n\nThe old LuxBlend addon causes conflicts, "
"so it was disabled. Save your user preferences "
"and restart Blender before you can enable the "
"new addon.")
if platform.system() == "Darwin":
if bpy.app.version < (2, 82, 7):
raise Exception("\n\nUnsupported Blender version. 2.82a or higher is required.")
mac_version = tuple(map(int, platform.mac_ver()[0].split(".")))
if mac_version < (10, 9, 0):
raise Exception("\n\nUnsupported Mac OS version. 10.9 or higher is required.")
try:
from .bin import pyluxcore
except ImportError as error:
msg = "\n\nCould not import pyluxcore."
if platform.system() == "Windows":
msg += ("\nYou probably forgot to install one of the "
"redistributable packages.\n"
"They are listed in the release announcement post.")
elif platform.system() == "Linux":
if str(error) == "ImportError: libOpenCL.so.1: cannot open shared object file: No such file or directory":
msg += ("\nYour OpenCL installation is probably missing or broken. "
"Look up how to install OpenCL on your system.")
# Raise from None to suppress the unhelpful
# "during handling of the above exception, ..."
raise Exception(msg + "\n\nImportError: %s" % error) from None
bl_info = {
"name": "LuxCore",
"author": "Simon Wendsche (B.Y.O.B.), Michael Klemm (neo2068), Philstix",
"version": (2, 4),
"blender": (2, 80, 0),
"category": "Render",
"location": "Info header, render engine menu",
"description": "LuxCore integration for Blender",
"warning": "alpha0",
"wiki_url": "https://wiki.luxcorerender.org/",
"tracker_url": "https://github.com/LuxCoreRender/BlendLuxCore/issues/new",
}
from . import auto_load, nodes, properties, handlers
auto_load.init()
from .operators import keymaps
def register():
auto_load.register()
nodes.materials.register()
nodes.textures.register()
nodes.volumes.register()
handlers.register()
keymaps.register()
from .utils.log import LuxCoreLog
pyluxcore.Init(LuxCoreLog.add)
version_string = f'{bl_info["version"][0]}.{bl_info["version"][1]}{bl_info["warning"]}'
print(f"BlendLuxCore {version_string} registered (with pyluxcore {pyluxcore.Version()})")
def unregister():
keymaps.unregister()
handlers.unregister()
nodes.materials.unregister()
nodes.textures.unregister()
nodes.volumes.unregister()
auto_load.unregister()