Fix bug where style colours were not auto synchronised.

This commit is contained in:
Dion Moult
2021-11-11 14:18:44 +11:00
parent 9355969110
commit d5b92c0fea
13 changed files with 106 additions and 49 deletions
+14
View File
@@ -95,6 +95,14 @@ def i_add_a_material():
bpy.context.active_object.active_material = bpy.data.materials.new("Material")
@given(parsers.parse('the material "{name}" colour is set to "{colour}"'))
@when(parsers.parse('the material "{name}" colour is set to "{colour}"'))
def the_material_name_colour_is_set_to_colour(name, colour):
obj = the_material_name_exists(name)
obj.diffuse_color = [float(c) for c in colour.split(",")]
blenderbim.bim.handler.color_callback(obj, None)
@given("I add an array modifier")
def i_add_a_cube():
bpy.ops.object.modifier_add(type="ARRAY")
@@ -385,6 +393,12 @@ def the_material_name_is_not_an_ifc_material(name):
assert id == 0, f"The ID is {id}"
@then(parsers.parse('the material "{name}" colour is "{colour}"'))
def the_material_name_colour_is_set_to_colour(name, colour):
diffuse_color = list(the_material_name_exists(name).diffuse_color)
assert diffuse_color == [float(c) for c in colour.split(",")], f"The colour is {diffuse_color}"
@then(parsers.parse('the object "{name}" has "{number}" vertices'))
def the_object_name_has_number_vertices(name, number):
total = len(the_object_name_exists(name).data.vertices)