Fix bug in IFC2X3 where updating style colours didn't work.

This commit is contained in:
Dion Moult
2021-11-10 16:45:16 +11:00
parent 0dac56dbdf
commit a7b3b5261f
5 changed files with 24 additions and 3 deletions
+14
View File
@@ -131,6 +131,7 @@ class TestGetSurfaceRenderingStyle(NewFile):
class TestGetSurfaceShadingAttributes(NewFile):
def test_get_colours_from_a_basic_material(self):
tool.Ifc.set(ifcopenshell.file())
obj = bpy.data.materials.new("Material")
obj.diffuse_color = [1, 1, 1, 1]
assert subject.get_surface_shading_attributes(obj) == {
@@ -143,6 +144,19 @@ class TestGetSurfaceShadingAttributes(NewFile):
"Transparency": 0,
}
def test_get_colours_from_a_basic_material_ifc2x3(self):
tool.Ifc.set(ifcopenshell.file(schema="IFC2X3"))
obj = bpy.data.materials.new("Material")
obj.diffuse_color = [1, 1, 1, 1]
assert subject.get_surface_shading_attributes(obj) == {
"SurfaceColour": {
"Name": None,
"Red": 1,
"Green": 1,
"Blue": 1,
},
}
class TestGetSurfaceShadingStyle(NewFile):
def test_run(self):