mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Fix Lighting/refraction UI drawing crashes and add warning message that they are only IFC data not used by Blender for surface appearance
This commit is contained in:
@@ -744,7 +744,7 @@ class EnableEditingSurfaceStyle(bpy.types.Operator):
|
|||||||
if self.ifc_class == "IfcSurfaceStyleLighting":
|
if self.ifc_class == "IfcSurfaceStyleLighting":
|
||||||
|
|
||||||
def callback(attribute_name: str, _: object, data: dict[str, Any]) -> None:
|
def callback(attribute_name: str, _: object, data: dict[str, Any]) -> None:
|
||||||
assert attributes
|
assert attributes is not None
|
||||||
color = attributes.add()
|
color = attributes.add()
|
||||||
assert isinstance(color, ColourRgb)
|
assert isinstance(color, ColourRgb)
|
||||||
color.name = attribute_name
|
color.name = attribute_name
|
||||||
|
|||||||
@@ -185,6 +185,13 @@ class ColourRgb(PropertyGroup):
|
|||||||
# to fit blender.bim.helper.draw_attribute
|
# to fit blender.bim.helper.draw_attribute
|
||||||
is_optional = False
|
is_optional = False
|
||||||
special_type = ""
|
special_type = ""
|
||||||
|
data_type = ""
|
||||||
|
ifc_class = ""
|
||||||
|
use_explorer_ui = False
|
||||||
|
|
||||||
|
@property
|
||||||
|
def display_name(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
def get_value_name(self, *args, **kwargs):
|
def get_value_name(self, *args, **kwargs):
|
||||||
return "color_value"
|
return "color_value"
|
||||||
|
|||||||
@@ -272,10 +272,17 @@ class BIM_PT_styles(Panel):
|
|||||||
bonsai.bim.helper.draw_attributes(self.props.external_style_attributes, self.layout, enable_search=True)
|
bonsai.bim.helper.draw_attributes(self.props.external_style_attributes, self.layout, enable_search=True)
|
||||||
|
|
||||||
def draw_refraction_surface_style(self):
|
def draw_refraction_surface_style(self):
|
||||||
|
self.layout.label(
|
||||||
|
text="Refraction values are IFC-only and do not affect Blender surface appearance",
|
||||||
|
icon="ERROR",
|
||||||
|
)
|
||||||
bonsai.bim.helper.draw_attributes(self.props.refraction_style_attributes, self.layout, enable_search=True)
|
bonsai.bim.helper.draw_attributes(self.props.refraction_style_attributes, self.layout, enable_search=True)
|
||||||
row = self.layout.row(align=True)
|
|
||||||
|
|
||||||
def draw_lighting_surface_style(self):
|
def draw_lighting_surface_style(self):
|
||||||
|
self.layout.label(
|
||||||
|
text="Lighting values are IFC-only and do not affect Blender surface appearance",
|
||||||
|
icon="ERROR",
|
||||||
|
)
|
||||||
bonsai.bim.helper.draw_attributes(self.props.lighting_style_colours, self.layout)
|
bonsai.bim.helper.draw_attributes(self.props.lighting_style_colours, self.layout)
|
||||||
|
|
||||||
def draw_edit_ui(self, edit_label: str):
|
def draw_edit_ui(self, edit_label: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user