mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 04:59:52 +00:00
Since issue is resolved upstream and there's no need to keep import optional.
This commit is contained in:
@@ -25,20 +25,7 @@ from pathlib import Path
|
|||||||
import importlib
|
import importlib
|
||||||
import importlib.util
|
import importlib.util
|
||||||
import traceback
|
import traceback
|
||||||
|
import pyradiance
|
||||||
# There are unresolved problems with pyradiance import that we couldn't narrow down.
|
|
||||||
# So import is optional not to make it a showstopper for random users,
|
|
||||||
# who don't even need pyradiance.
|
|
||||||
# See #6633.
|
|
||||||
try:
|
|
||||||
import pyradiance
|
|
||||||
except ImportError as e:
|
|
||||||
print(traceback.format_exc())
|
|
||||||
print(
|
|
||||||
"PyRadiance is not available. Pyradiance Rendering functionality will be disabled. "
|
|
||||||
"See above for more detailed import traceback."
|
|
||||||
)
|
|
||||||
pyradiance = None
|
|
||||||
|
|
||||||
|
|
||||||
def get_pyradiance_path():
|
def get_pyradiance_path():
|
||||||
|
|||||||
@@ -18,11 +18,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
try:
|
import pyradiance as pr
|
||||||
import pyradiance as pr
|
|
||||||
except ImportError:
|
|
||||||
pr = None
|
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import bpy
|
import bpy
|
||||||
import bonsai.tool as tool
|
import bonsai.tool as tool
|
||||||
@@ -137,10 +133,6 @@ class RadianceRender(bpy.types.Operator):
|
|||||||
bl_description = "Renders the scene using Radiance"
|
bl_description = "Renders the scene using Radiance"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
if pr is None:
|
|
||||||
self.report({"ERROR"}, "PyRadiance is not available. Cannot perform rendering.")
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
print("Starting Radiance rendering process...")
|
print("Starting Radiance rendering process...")
|
||||||
props = tool.Blender.get_radiance_exporter_props()
|
props = tool.Blender.get_radiance_exporter_props()
|
||||||
resolution_x, resolution_y = props.radiance_resolution_x, props.radiance_resolution_y
|
resolution_x, resolution_y = props.radiance_resolution_x, props.radiance_resolution_y
|
||||||
|
|||||||
@@ -21,11 +21,6 @@ import bonsai.tool as tool
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
from bonsai.bim.module.light.data import SolarData
|
from bonsai.bim.module.light.data import SolarData
|
||||||
|
|
||||||
try:
|
|
||||||
import pyradiance
|
|
||||||
except ImportError:
|
|
||||||
pyradiance = None
|
|
||||||
|
|
||||||
|
|
||||||
class BIM_PT_radiance_exporter(bpy.types.Panel):
|
class BIM_PT_radiance_exporter(bpy.types.Panel):
|
||||||
"""Creates a Panel in the render properties window"""
|
"""Creates a Panel in the render properties window"""
|
||||||
@@ -43,13 +38,6 @@ class BIM_PT_radiance_exporter(bpy.types.Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
props = tool.Blender.get_radiance_exporter_props()
|
props = tool.Blender.get_radiance_exporter_props()
|
||||||
|
|
||||||
if pyradiance is None:
|
|
||||||
box = layout.box()
|
|
||||||
box.label(text="There was a problem importing Pyradiance", icon="ERROR")
|
|
||||||
box.label(text="and it's functionality is not available.")
|
|
||||||
box.label(text="See system console logs at Bonsai startup.")
|
|
||||||
return
|
|
||||||
|
|
||||||
if tool.Ifc.get():
|
if tool.Ifc.get():
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(props, "should_load_from_memory")
|
row.prop(props, "should_load_from_memory")
|
||||||
|
|||||||
Reference in New Issue
Block a user