From 3860884db3445ed7f5e2e8c6e5ec63ef2e8b73d1 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 14 Aug 2024 14:09:45 +0500 Subject: [PATCH] bonsai other ifcopenshell packages #5178 --- src/ifc5d/ifc5d/qto.py | 4 ++-- .../ifcopenshell/api/geometry/add_representation.py | 10 +++++----- .../api/georeference/edit_georeferencing.py | 4 ++-- .../ifcopenshell/api/style/add_surface_textures.py | 2 +- src/ifcopenshell-python/test/util/test_file.py | 2 +- .../ifcpatch/recipes/FixArchiCADToRevitSpaces.py | 4 ++-- src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py | 2 +- src/ifcpatch/ifcpatch/recipes/Optimise.py | 2 +- .../ifcpatch/recipes/RecycleNonRootedElements.py | 2 +- src/ifcsverchok/__init__.py | 2 +- src/ifcsverchok/nodes/ifc/bmesh_to_ifc.py | 6 +++--- src/ifcsverchok/nodes/ifc/create_shape.py | 6 +++--- src/ifcsverchok/nodes/ifc/select_blender_objects.py | 2 +- src/ifcsverchok/nodes/ifc/sverchok_to_ifc.py | 4 ++-- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/ifc5d/ifc5d/qto.py b/src/ifc5d/ifc5d/qto.py index 3f41bf5130..f73d5870c1 100644 --- a/src/ifc5d/ifc5d/qto.py +++ b/src/ifc5d/ifc5d/qto.py @@ -288,8 +288,8 @@ class Blender: def calculate( ifc_file: ifcopenshell.file, elements: set[ifcopenshell.entity_instance], qtos: dict, results: dict ) -> None: - import blenderbim.tool as tool - import blenderbim.bim.module.qto.calculator as calculator + import bonsai.tool as tool + import bonsai.bim.module.qto.calculator as calculator unit_converter = SI2ProjectUnitConverter(ifc_file) formula_functions = {} diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py index a06deca887..b60863cff2 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py @@ -24,7 +24,7 @@ from mathutils import Vector, Matrix from typing import Union, Optional, Literal, Any, TYPE_CHECKING if TYPE_CHECKING: - from blenderbim.bim.module.geometry.helper import Helper + from bonsai.bim.module.geometry.helper import Helper Z_AXIS = Vector((0, 0, 1)) @@ -72,7 +72,7 @@ def add_representation( ) -> ifcopenshell.entity_instance: # lazy import Helper to avoid circular import if "Helper" not in globals(): - from blenderbim.bim.module.geometry.helper import Helper + from bonsai.bim.module.geometry.helper import Helper globals()["Helper"] = Helper @@ -460,7 +460,7 @@ class Usecase: return results def is_mesh_curve_consecutive(self, geom_data): - import blenderbim.tool as tool + import bonsai.tool as tool bm = tool.Blender.get_bmesh_for_mesh(geom_data) bm.verts.ensure_lookup_table() @@ -514,7 +514,7 @@ class Usecase: return self.create_curves_from_mesh_ifc2x3(should_exclude_faces=should_exclude_faces, is_2d=is_2d) return self.create_curves_from_mesh(should_exclude_faces=should_exclude_faces, is_2d=is_2d) - import blenderbim.tool as tool + import bonsai.tool as tool selected_objects = bpy.context.selected_objects active_object = bpy.context.active_object @@ -568,7 +568,7 @@ class Usecase: return curves def remove_doubles_from_mesh(self, mesh): - import blenderbim.tool as tool + import bonsai.tool as tool bm = tool.Blender.get_bmesh_for_mesh(mesh) bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=0.0001) diff --git a/src/ifcopenshell-python/ifcopenshell/api/georeference/edit_georeferencing.py b/src/ifcopenshell-python/ifcopenshell/api/georeference/edit_georeferencing.py index 7a43afabcb..3fbb4dd7f0 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/georeference/edit_georeferencing.py +++ b/src/ifcopenshell-python/ifcopenshell/api/georeference/edit_georeferencing.py @@ -31,7 +31,7 @@ def edit_georeferencing( Setting the correct georeferencing parameters is a complex topic and should ideally be done with three parties present: the lead architect, surveyor, and a third-party digital engineer with expertise in IFC to - moderate. For more information, read the BlenderBIM Add-on documentation + moderate. For more information, read the Bonsai documentation for Georeferencing: https://docs.bonsaibim.org/users/advanced/georeferencing.html @@ -63,7 +63,7 @@ def edit_georeferencing( # For buildings, it is almost always recommended to specify map # conversion parameters to a false origin and orientation to project - # north. See the diagram in the BlenderBIM Add-on Georeferencing + # north. See the diagram in the Bonsai Georeferencing # documentation for correct calculation of the X Axis Abcissa and # Ordinate. ifcopenshell.api.georeference.edit_georeferencing(model, diff --git a/src/ifcopenshell-python/ifcopenshell/api/style/add_surface_textures.py b/src/ifcopenshell-python/ifcopenshell/api/style/add_surface_textures.py index 48583984aa..2722d36596 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/style/add_surface_textures.py +++ b/src/ifcopenshell-python/ifcopenshell/api/style/add_surface_textures.py @@ -174,7 +174,7 @@ class Usecase: return self.create_surface_texture(links[0].from_node, "DIFFUSE") def create_surface_texture(self, node, mode): - import blenderbim.tool as tool + import bonsai.tool as tool texture = self.file.create_entity( "IfcImageTexture", diff --git a/src/ifcopenshell-python/test/util/test_file.py b/src/ifcopenshell-python/test/util/test_file.py index f1bfcb0c59..6517bbd5d8 100644 --- a/src/ifcopenshell-python/test/util/test_file.py +++ b/src/ifcopenshell-python/test/util/test_file.py @@ -28,7 +28,7 @@ HEADER_EXTRACTOR_TEST_FILE_STR = """ ISO-10303-21; HEADER; FILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1'); -FILE_NAME('file.ifc','2024-06-25T15:48:10+05:00',(),(),'IfcOpenShell 0.0.0','BlenderBIM 0.0.999999-xxxxxxx','Nobody'); +FILE_NAME('file.ifc','2024-06-25T15:48:10+05:00',(),(),'IfcOpenShell 0.0.0','Bonsai 0.0.999999-xxxxxxx','Nobody'); FILE_SCHEMA(('IFC4X3_ADD2')); ENDSEC; DATA; diff --git a/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitSpaces.py b/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitSpaces.py index 13d5a383ae..c65cdc0356 100644 --- a/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitSpaces.py +++ b/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitSpaces.py @@ -58,10 +58,10 @@ class Patcher: def patch(self): import bpy - import blenderbim.tool as tool + import bonsai.tool as tool import ifcopenshell import ifcopenshell.util.element - from blenderbim.bim.ifc import IfcStore + from bonsai.bim.ifc import IfcStore from mathutils import Vector, Matrix if len(bpy.data.objects) > 0: diff --git a/src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py b/src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py index a7bfb7fb36..f2ec982aa4 100644 --- a/src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py +++ b/src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py @@ -70,7 +70,7 @@ class Patcher: def patch(self): import bpy import bmesh - import blenderbim.tool as tool + import bonsai.tool as tool from math import degrees bpy.context.scene.BIMProjectProperties.should_use_native_meshes = True diff --git a/src/ifcpatch/ifcpatch/recipes/Optimise.py b/src/ifcpatch/ifcpatch/recipes/Optimise.py index 34ac152cc7..bca0c12ef7 100644 --- a/src/ifcpatch/ifcpatch/recipes/Optimise.py +++ b/src/ifcpatch/ifcpatch/recipes/Optimise.py @@ -34,7 +34,7 @@ class Patcher: If filesize is an issue, another approach would be to use IFCZIP instead to compress the model. Optimising the model only typically affects filesize and has minimal impact on load times. Large filesizes - can usually be solved through other means. Consult the BlenderBIM Add-on + can usually be solved through other means. Consult the bonsai Add-on documentation on dealing with large models for more details. Warning: this optimise recipe is very, very slow. Please consider using diff --git a/src/ifcpatch/ifcpatch/recipes/RecycleNonRootedElements.py b/src/ifcpatch/ifcpatch/recipes/RecycleNonRootedElements.py index 079a26494c..6bb08bb678 100644 --- a/src/ifcpatch/ifcpatch/recipes/RecycleNonRootedElements.py +++ b/src/ifcpatch/ifcpatch/recipes/RecycleNonRootedElements.py @@ -34,7 +34,7 @@ class Patcher: If filesize is an issue, another approach would be to use IFCZIP instead to compress the model. Optimising the model only typically affects filesize and has minimal impact on load times. Large filesizes - can usually be solved through other means. Consult the BlenderBIM Add-on + can usually be solved through other means. Consult Bonsai documentation on dealing with large models for more details. This patch may be run multiple times with diminishing returns. diff --git a/src/ifcsverchok/__init__.py b/src/ifcsverchok/__init__.py index e7d75036b8..71b683eb54 100644 --- a/src/ifcsverchok/__init__.py +++ b/src/ifcsverchok/__init__.py @@ -68,7 +68,7 @@ def ensure_addons_are_enabled(*addon_names: str) -> None: raise Exception("Some issues were found trying to enable IFC Sverchok:\n" + "\n".join(errors)) -ensure_addons_are_enabled("blenderbim", "sverchok") +ensure_addons_are_enabled("bonsai", "sverchok") from sverchok.ui.nodeview_space_menu import add_node_menu diff --git a/src/ifcsverchok/nodes/ifc/bmesh_to_ifc.py b/src/ifcsverchok/nodes/ifc/bmesh_to_ifc.py index 0b8afcbeb3..1c6f37644d 100644 --- a/src/ifcsverchok/nodes/ifc/bmesh_to_ifc.py +++ b/src/ifcsverchok/nodes/ifc/bmesh_to_ifc.py @@ -24,8 +24,8 @@ import ifcopenshell import ifcsverchok.helper import ifcopenshell.api from ifcsverchok.ifcstore import SvIfcStore -import blenderbim.tool as tool -import blenderbim.core.geometry as core +import bonsai.tool as tool +import bonsai.core.geometry as core from bpy.props import ( StringProperty, EnumProperty, @@ -35,7 +35,7 @@ from bpy.props import ( ) from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, flatten_data, fixed_iter, flat_iter -from blenderbim.bim.module.root.prop import get_contexts +from bonsai.bim.module.root.prop import get_contexts from sverchok.data_structure import zip_long_repeat, node_id from sverchok.core.socket_data import sv_get_socket diff --git a/src/ifcsverchok/nodes/ifc/create_shape.py b/src/ifcsverchok/nodes/ifc/create_shape.py index 8fe5b63d73..2795ef2dcd 100644 --- a/src/ifcsverchok/nodes/ifc/create_shape.py +++ b/src/ifcsverchok/nodes/ifc/create_shape.py @@ -21,7 +21,7 @@ import logging import ifcopenshell import ifcsverchok.helper from ifcsverchok.ifcstore import SvIfcStore -import blenderbim.bim.import_ifc +import bonsai.bim.import_ifc from bpy.props import StringProperty, PointerProperty, BoolProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, flatten_data @@ -84,10 +84,10 @@ class SvIfcCreateShape(bpy.types.Node, SverchCustomTreeNode, ifcsverchok.helper. if not entity.is_a("IfcProduct"): return logger = logging.getLogger("ImportIFC") - self.ifc_import_settings = blenderbim.bim.import_ifc.IfcImportSettings.factory(bpy.context, "", logger) + self.ifc_import_settings = bonsai.bim.import_ifc.IfcImportSettings.factory(bpy.context, "", logger) settings = ifcopenshell.geom.settings() shape = ifcopenshell.geom.create_shape(settings, entity) - ifc_importer = blenderbim.bim.import_ifc.IfcImporter(self.ifc_import_settings) + ifc_importer = bonsai.bim.import_ifc.IfcImporter(self.ifc_import_settings) ifc_importer.file = self.file mesh = ifc_importer.create_mesh(entity, shape) obj = bpy.data.objects.new("IFC Element", mesh) diff --git a/src/ifcsverchok/nodes/ifc/select_blender_objects.py b/src/ifcsverchok/nodes/ifc/select_blender_objects.py index f6a6e52476..66bd27a4a0 100644 --- a/src/ifcsverchok/nodes/ifc/select_blender_objects.py +++ b/src/ifcsverchok/nodes/ifc/select_blender_objects.py @@ -23,7 +23,7 @@ import ifcsverchok.helper from bpy.props import StringProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode -from blenderbim.bim.ifc import IfcStore +from bonsai.bim.ifc import IfcStore class SvIfcSelectBlenderObjectsRefresh(bpy.types.Operator): diff --git a/src/ifcsverchok/nodes/ifc/sverchok_to_ifc.py b/src/ifcsverchok/nodes/ifc/sverchok_to_ifc.py index dfedcf1f4a..a2b092aa79 100644 --- a/src/ifcsverchok/nodes/ifc/sverchok_to_ifc.py +++ b/src/ifcsverchok/nodes/ifc/sverchok_to_ifc.py @@ -23,8 +23,8 @@ import ifcsverchok.helper import ifcopenshell.api import ifcopenshell.util.representation from ifcsverchok.ifcstore import SvIfcStore -import blenderbim.tool as tool -import blenderbim.core.geometry as core +import bonsai.tool as tool +import bonsai.core.geometry as core from bpy.props import StringProperty, EnumProperty, IntProperty, FloatVectorProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, ensure_min_nesting