mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix ifc2x3 errors editing IfcSurfaceStyleShading #6624
This commit is contained in:
@@ -815,10 +815,7 @@ class EditSurfaceStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
"style.edit_surface_style",
|
||||
tool.Ifc.get(),
|
||||
style=self.surface_style,
|
||||
attributes={
|
||||
"SurfaceColour": self.color_to_dict(self.props.surface_colour),
|
||||
"Transparency": self.props.transparency or None,
|
||||
},
|
||||
attributes=self.get_shading_attributes(),
|
||||
)
|
||||
tool.Loader.create_surface_style_shading(material, self.surface_style)
|
||||
elif self.surface_style.is_a() == "IfcSurfaceStyleRendering":
|
||||
@@ -912,10 +909,11 @@ class EditSurfaceStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
)
|
||||
|
||||
def get_shading_attributes(self) -> dict[str, Any]:
|
||||
return {
|
||||
"SurfaceColour": self.color_to_dict(self.props.surface_colour),
|
||||
"Transparency": self.props.transparency or None,
|
||||
}
|
||||
attributes = {}
|
||||
attributes["SurfaceColour"] = self.color_to_dict(self.props.surface_colour)
|
||||
if tool.Ifc.get_schema() != "IFC2X3":
|
||||
attributes["Transparency"] = self.props.transparency or None
|
||||
return attributes
|
||||
|
||||
def get_rendering_attributes(self) -> dict[str, Any]:
|
||||
if self.props.is_diffuse_colour_null:
|
||||
|
||||
@@ -55,6 +55,7 @@ class BIM_PT_styles(Panel):
|
||||
row.operator("bim.load_styles", text="", icon="IMPORT").style_type = style_type
|
||||
return
|
||||
|
||||
self.is_ifc2x3 = tool.Ifc.get_schema() == "IFC2X3"
|
||||
active_style = self.props.active_style
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text="{} {}s".format(len(self.props.styles), self.props.style_type), icon="SHADING_RENDERED")
|
||||
@@ -158,8 +159,9 @@ class BIM_PT_styles(Panel):
|
||||
def draw_surface_style_shading(self):
|
||||
row = self.layout.row()
|
||||
row.prop(self.props, "surface_colour")
|
||||
row = self.layout.row()
|
||||
row.prop(self.props, "transparency")
|
||||
if not self.is_ifc2x3:
|
||||
row = self.layout.row()
|
||||
row.prop(self.props, "transparency")
|
||||
|
||||
def draw_surface_style_rendering(self):
|
||||
row = self.layout.row()
|
||||
|
||||
Reference in New Issue
Block a user