mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 13:43:40 +00:00
Fix confusing transparency attribute in add style API usecase. See #1529.
This commit is contained in:
@@ -10,6 +10,7 @@ def get_colour_settings(material):
|
|||||||
bsdf = material.node_tree.nodes["Principled BSDF"]
|
bsdf = material.node_tree.nodes["Principled BSDF"]
|
||||||
transparency = bsdf.inputs["Alpha"].default_value
|
transparency = bsdf.inputs["Alpha"].default_value
|
||||||
diffuse_colour = bsdf.inputs["Base Color"].default_value
|
diffuse_colour = bsdf.inputs["Base Color"].default_value
|
||||||
|
transparency = 1 - transparency
|
||||||
return {
|
return {
|
||||||
"surface_colour": tuple(material.diffuse_color),
|
"surface_colour": tuple(material.diffuse_color),
|
||||||
"transparency": transparency,
|
"transparency": transparency,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Usecase:
|
|||||||
"IfcSurfaceStyleRendering",
|
"IfcSurfaceStyleRendering",
|
||||||
**{
|
**{
|
||||||
"SurfaceColour": self.create_colour_rgb(self.settings["surface_colour"]),
|
"SurfaceColour": self.create_colour_rgb(self.settings["surface_colour"]),
|
||||||
"Transparency": (self.settings["transparency"] - 1) * -1,
|
"Transparency": self.settings["transparency"],
|
||||||
"ReflectanceMethod": "NOTDEFINED",
|
"ReflectanceMethod": "NOTDEFINED",
|
||||||
"DiffuseColour": self.create_colour_rgb(self.settings["diffuse_colour"]),
|
"DiffuseColour": self.create_colour_rgb(self.settings["diffuse_colour"]),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user