diff --git a/src/blenderbim/blenderbim/bim/module/brick/operator.py b/src/blenderbim/blenderbim/bim/module/brick/operator.py index 4194514355..2c57e937e5 100644 --- a/src/blenderbim/blenderbim/bim/module/brick/operator.py +++ b/src/blenderbim/blenderbim/bim/module/brick/operator.py @@ -233,7 +233,6 @@ class RefreshBrickViewer(bpy.types.Operator, Operator): def _execute(self, context): core.refresh_brick_viewer(tool.Brick) - core.refresh_brick_viewer(tool.Brick, split_screen=True) class RemoveBrick(bpy.types.Operator, Operator): @@ -289,7 +288,7 @@ class AddBrickNamespace(bpy.types.Operator, Operator): props = context.scene.BIMBrickProperties alias = props.new_brick_namespace_alias uri = props.new_brick_namespace_uri - core.add_namespace(tool.Brick, alias=alias, uri=uri) + core.add_brick_namespace(tool.Brick, alias=alias, uri=uri) class RemoveBrickRelation(bpy.types.Operator, Operator): diff --git a/src/blenderbim/blenderbim/core/brick.py b/src/blenderbim/blenderbim/core/brick.py index 5c8cd6ee58..c16b341b1c 100644 --- a/src/blenderbim/blenderbim/core/brick.py +++ b/src/blenderbim/blenderbim/core/brick.py @@ -25,6 +25,14 @@ def load_brick_project(brick, filepath=None, brick_root=None): brick.set_active_brick_class(brick_root, split_screen=True) +def new_brick_file(brick, brick_root=None): + brick.new_brick_file() + brick.import_brick_classes(brick_root) + brick.import_brick_classes(brick_root, split_screen=True) + brick.set_active_brick_class(brick_root) + brick.set_active_brick_class(brick_root, split_screen=True) + + def view_brick_class(brick, brick_class=None, split_screen=False): brick.add_brick_breadcrumb(split_screen=split_screen) brick.clear_brick_browser(split_screen=split_screen) @@ -35,7 +43,7 @@ def view_brick_class(brick, brick_class=None, split_screen=False): def view_brick_item(brick, item=None, split_screen=False): brick_class = brick.get_item_class(item) - view_brick_class(brick, brick_class=brick_class, split_screen=split_screen) + brick.run_view_brick_class(brick_class=brick_class, split_screen=split_screen) brick.select_browser_item(item, split_screen=split_screen) @@ -79,15 +87,13 @@ def add_brick(ifc, brick, element=None, namespace=None, brick_class=None, librar if library: brick.run_assign_brick_reference(element=element, library=library, brick_uri=brick_uri) else: - brick_uri = brick.add_brick(namespace, brick_class, label) + brick.add_brick(namespace, brick_class, label) brick.run_refresh_brick_viewer() - brick.run_refresh_brick_viewer(split_screen=True) def add_brick_relation(brick, brick_uri=None, predicate=None, object=None): brick.add_relation(brick_uri, predicate, object) brick.run_refresh_brick_viewer() - brick.run_refresh_brick_viewer(split_screen=True) def convert_ifc_to_brick(brick, namespace=None, library=None): @@ -129,23 +135,13 @@ def convert_ifc_to_brick(brick, namespace=None, library=None): for downstream_equipment in feeds: brick.add_relation(equipment_uris[element], "https://brickschema.org/schema/Brick#feeds", equipment_uris[downstream_equipment]) brick.run_refresh_brick_viewer() - brick.run_refresh_brick_viewer(split_screen=True) -def new_brick_file(brick, brick_root=None): - brick.new_brick_file() - brick.import_brick_classes(brick_root) - brick.import_brick_classes(brick_root, split_screen=True) - brick.set_active_brick_class(brick_root) - brick.set_active_brick_class(brick_root, split_screen=True) - - -def refresh_brick_viewer(brick, split_screen=False): - if split_screen: - brick.run_view_brick_class(brick_class=brick.get_active_brick_class(split_screen=split_screen), split_screen=split_screen) - else: - brick.run_view_brick_class(brick_class=brick.get_active_brick_class(), split_screen=split_screen) - brick.pop_brick_breadcrumb(split_screen=split_screen) +def refresh_brick_viewer(brick): + brick.run_view_brick_class(brick_class=brick.get_active_brick_class()) + brick.pop_brick_breadcrumb() + brick.run_view_brick_class(brick_class=brick.get_active_brick_class(split_screen=True), split_screen=True) + brick.pop_brick_breadcrumb(split_screen=True) def remove_brick(ifc, brick, library=None, brick_uri=None): @@ -155,14 +151,13 @@ def remove_brick(ifc, brick, library=None, brick_uri=None): ifc.run("library.remove_reference", reference=reference) brick.remove_brick(brick_uri) brick.run_refresh_brick_viewer() - brick.run_refresh_brick_viewer(split_screen=True) def serialize_brick(brick): brick.serialize_brick() -def add_namespace(brick, alias=None, uri=None): +def add_brick_namespace(brick, alias=None, uri=None): brick.add_namespace(alias, uri) @@ -173,4 +168,3 @@ def set_brick_list_root(brick, brick_root=None, split_screen=False): def remove_brick_relation(brick, brick_uri=None, predicate=None, object=None): brick.remove_relation(brick_uri, predicate, object) - brick.run_refresh_brick_viewer() diff --git a/src/blenderbim/blenderbim/tool/brick.py b/src/blenderbim/blenderbim/tool/brick.py index fdfce170e3..6b2f7a1435 100644 --- a/src/blenderbim/blenderbim/tool/brick.py +++ b/src/blenderbim/blenderbim/tool/brick.py @@ -398,8 +398,8 @@ class Brick(blenderbim.core.tool.Brick): ) @classmethod - def run_refresh_brick_viewer(cls, split_screen=False): - return blenderbim.core.brick.refresh_brick_viewer(tool.Brick, split_screen) + def run_refresh_brick_viewer(cls): + return blenderbim.core.brick.refresh_brick_viewer(tool.Brick) @classmethod def run_view_brick_class(cls, brick_class=None, split_screen=False):