The storey is now the default container when starting a project for convenience.

This commit is contained in:
Dion Moult
2022-02-10 11:40:38 +11:00
parent d3a43c6e81
commit 7f212963d5
6 changed files with 35 additions and 2 deletions
+3
View File
@@ -63,6 +63,7 @@ class TestCreateProject:
project.run_aggregate_assign_object(relating_obj="building", related_obj="storey").should_be_called()
project.set_context("body").should_be_called()
project.set_active_spatial_element("storey").should_be_called()
subject.create_project(ifc, project, schema="IFC4", template=None)
@@ -103,6 +104,7 @@ class TestCreateProject:
project.run_aggregate_assign_object(relating_obj="building", related_obj="storey").should_be_called()
project.set_context("body").should_be_called()
project.set_active_spatial_element("storey").should_be_called()
project.append_all_types_from_template("template").should_be_called()
@@ -152,5 +154,6 @@ class TestCreateProject:
project.run_aggregate_assign_object(relating_obj="building", related_obj="storey").should_be_called()
project.set_context("body").should_be_called()
project.set_active_spatial_element("storey").should_be_called()
subject.create_project(ifc, project, schema="IFC2X3", template=None)
+12
View File
@@ -82,6 +82,18 @@ class TestRunUnitAssignSceneUnits(NewFile):
pass
class TestSetActiveSpatialElement(NewFile):
def test_run(self):
obj = bpy.data.objects.new("Foo", None)
collection = bpy.data.collections.new("Foo")
bpy.context.scene.collection.children.link(collection)
collection.objects.link(obj)
layer = bpy.context.view_layer.layer_collection.children["Foo"]
assert bpy.context.view_layer.active_layer_collection != layer
subject.set_active_spatial_element(obj)
assert bpy.context.view_layer.active_layer_collection == layer
class TestSetContext(NewFile):
def test_run(self):
ifc = ifcopenshell.file()