mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +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",
|
"style.edit_surface_style",
|
||||||
tool.Ifc.get(),
|
tool.Ifc.get(),
|
||||||
style=self.surface_style,
|
style=self.surface_style,
|
||||||
attributes={
|
attributes=self.get_shading_attributes(),
|
||||||
"SurfaceColour": self.color_to_dict(self.props.surface_colour),
|
|
||||||
"Transparency": self.props.transparency or None,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
tool.Loader.create_surface_style_shading(material, self.surface_style)
|
tool.Loader.create_surface_style_shading(material, self.surface_style)
|
||||||
elif self.surface_style.is_a() == "IfcSurfaceStyleRendering":
|
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]:
|
def get_shading_attributes(self) -> dict[str, Any]:
|
||||||
return {
|
attributes = {}
|
||||||
"SurfaceColour": self.color_to_dict(self.props.surface_colour),
|
attributes["SurfaceColour"] = self.color_to_dict(self.props.surface_colour)
|
||||||
"Transparency": self.props.transparency or None,
|
if tool.Ifc.get_schema() != "IFC2X3":
|
||||||
}
|
attributes["Transparency"] = self.props.transparency or None
|
||||||
|
return attributes
|
||||||
|
|
||||||
def get_rendering_attributes(self) -> dict[str, Any]:
|
def get_rendering_attributes(self) -> dict[str, Any]:
|
||||||
if self.props.is_diffuse_colour_null:
|
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
|
row.operator("bim.load_styles", text="", icon="IMPORT").style_type = style_type
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.is_ifc2x3 = tool.Ifc.get_schema() == "IFC2X3"
|
||||||
active_style = self.props.active_style
|
active_style = self.props.active_style
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="{} {}s".format(len(self.props.styles), self.props.style_type), icon="SHADING_RENDERED")
|
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):
|
def draw_surface_style_shading(self):
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(self.props, "surface_colour")
|
row.prop(self.props, "surface_colour")
|
||||||
row = self.layout.row()
|
if not self.is_ifc2x3:
|
||||||
row.prop(self.props, "transparency")
|
row = self.layout.row()
|
||||||
|
row.prop(self.props, "transparency")
|
||||||
|
|
||||||
def draw_surface_style_rendering(self):
|
def draw_surface_style_rendering(self):
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
|
|||||||
Reference in New Issue
Block a user