mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Add warning messaging for unsupported reflectance methods and texture modes
This commit is contained in:
@@ -176,8 +176,10 @@ class BIM_PT_styles(Panel):
|
|||||||
row.prop(self.props, "reflectance_method")
|
row.prop(self.props, "reflectance_method")
|
||||||
|
|
||||||
if self.props.reflectance_method not in ("PHYSICAL", "NOTDEFINED", "FLAT"):
|
if self.props.reflectance_method not in ("PHYSICAL", "NOTDEFINED", "FLAT"):
|
||||||
self.layout.label(text="Supported reflectance methods are:")
|
self.layout.label(
|
||||||
self.layout.label(text="PHYSICAL / NOTDEFINED / FLAT")
|
text=f"{self.props.reflectance_method} will be skipped: only PHYSICAL / NOTDEFINED / FLAT are supported",
|
||||||
|
icon="ERROR",
|
||||||
|
)
|
||||||
|
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="Emissive" if self.props.reflectance_method == "FLAT" else "Diffuse")
|
row.label(text="Emissive" if self.props.reflectance_method == "FLAT" else "Diffuse")
|
||||||
@@ -246,6 +248,22 @@ class BIM_PT_styles(Panel):
|
|||||||
op_clear = row.operator("bim.remove_texture_map", text="", icon="X")
|
op_clear = row.operator("bim.remove_texture_map", text="", icon="X")
|
||||||
op_path.texture_map_index = op_clear.texture_map_index = i
|
op_path.texture_map_index = op_clear.texture_map_index = i
|
||||||
|
|
||||||
|
reflectance = self.props.reflectance_method
|
||||||
|
mode = texture.mode
|
||||||
|
if reflectance == "FLAT":
|
||||||
|
if mode != "EMISSIVE":
|
||||||
|
self.layout.label(
|
||||||
|
text=f"{mode} will be skipped: only EMISSIVE is supported for Render Reflectance FLAT",
|
||||||
|
icon="ERROR",
|
||||||
|
)
|
||||||
|
elif reflectance in ("PHYSICAL", "NOTDEFINED"):
|
||||||
|
_SUPPORTED = {"DIFFUSE", "NORMAL", "METALLICROUGHNESS", "EMISSIVE", "OCCLUSION"}
|
||||||
|
if mode not in _SUPPORTED:
|
||||||
|
self.layout.label(
|
||||||
|
text=f"{mode} will be skipped: not supported for Render Reflectance PHYSICAL/NOTDEFINED",
|
||||||
|
icon="ERROR",
|
||||||
|
)
|
||||||
|
|
||||||
def draw_externally_defined_surface_style(self):
|
def draw_externally_defined_surface_style(self):
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
op = row.operator("bim.browse_external_style", icon="APPEND_BLEND", text="Append From Blend File")
|
op = row.operator("bim.browse_external_style", icon="APPEND_BLEND", text="Append From Blend File")
|
||||||
|
|||||||
Reference in New Issue
Block a user