diff --git a/src/blenderbim/blenderbim/core/style.py b/src/blenderbim/blenderbim/core/style.py index 5b59063b97..518a71c2a6 100644 --- a/src/blenderbim/blenderbim/core/style.py +++ b/src/blenderbim/blenderbim/core/style.py @@ -37,7 +37,7 @@ def add_style(ifc: tool.Ifc, style: tool.Style, obj: bpy.types.Material) -> ifco material = ifc.get_entity(obj) if material: - ifc.run("style.assign_material_style", material=material, style=element, context=style.get_context(obj)) + ifc.run("style.assign_material_style", material=material, style=element, context=style.get_context()) return element diff --git a/src/blenderbim/blenderbim/tool/style.py b/src/blenderbim/blenderbim/tool/style.py index 0a162cb409..d2869dd918 100644 --- a/src/blenderbim/blenderbim/tool/style.py +++ b/src/blenderbim/blenderbim/tool/style.py @@ -95,9 +95,8 @@ class Style(blenderbim.core.tool.Style): def get_active_style_type(cls) -> str: return bpy.context.scene.BIMStylesProperties.style_type - # TODO: `obj` argument is unused? @classmethod - def get_context(cls, obj) -> Union[ifcopenshell.entity_instance, None]: + def get_context(cls) -> Union[ifcopenshell.entity_instance, None]: return ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Body", "MODEL_VIEW") @classmethod diff --git a/src/blenderbim/test/tool/test_style.py b/src/blenderbim/test/tool/test_style.py index 66e874420a..a474a0e13c 100644 --- a/src/blenderbim/test/tool/test_style.py +++ b/src/blenderbim/test/tool/test_style.py @@ -95,7 +95,7 @@ class TestGetContext(NewFile): def test_run(self): bpy.ops.bim.create_project() context = ifcopenshell.util.representation.get_context(tool.Ifc.get(), "Model", "Body", "MODEL_VIEW") - assert subject.get_context("obj") == context + assert subject.get_context() == context class TestGetElementsByStyle(NewFile):