bonsai bim module imports #5178

This commit is contained in:
Andrej730
2024-08-14 14:10:36 +05:00
committed by Andrej
parent c03777cfe6
commit 485643863f
246 changed files with 1010 additions and 1110 deletions
+5 -5
View File
@@ -25,7 +25,7 @@ from . import handler, ui, prop, operator, helper
from typing import Callable, Union
try:
from blenderbim.translations import translations_dict
from bonsai.translations import translations_dict
except ImportError:
translations_dict = {}
cwd = os.path.dirname(os.path.realpath(__file__))
@@ -91,7 +91,7 @@ modules = {
for name in modules.keys():
modules[name] = importlib.import_module(f"blenderbim.bim.module.{name}")
modules[name] = importlib.import_module(f"bonsai.bim.module.{name}")
classes = [
@@ -254,7 +254,7 @@ def register():
icon_preview.load(icon_name, icon_path, "IMAGE")
icons = icon_preview
bpy.app.translations.register("blenderbim", translations_dict)
bpy.app.translations.register("bonsai", translations_dict)
def unregister():
@@ -291,10 +291,10 @@ def unregister():
km.keymap_items.remove(kmi)
addon_keymaps.clear()
import blenderbim.tool as tool
import bonsai.tool as tool
# use tuple() as method will be removing keys from dict
for panel in tuple(original_scene_panels_polls.keys()):
tool.Blender.remove_scene_panel_override(panel)
bpy.app.translations.unregister("blenderbim")
bpy.app.translations.unregister("bonsai")
@@ -39,7 +39,7 @@ function connectSocket() {
socket.on("svg_data", handleSvgData);
}
// function used to get drawings data from blenderbim
// function used to get drawings data from Bonsai
function handleWebConnect() {
getDrawingsData();
}
+7 -7
View File
@@ -28,12 +28,12 @@ import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.placement
import ifcopenshell.util.unit
import blenderbim.tool as tool
import blenderbim.core.geometry
import blenderbim.core.aggregate
import blenderbim.core.spatial
import blenderbim.core.style
from blenderbim.bim.ifc import IfcStore
import bonsai.tool as tool
import bonsai.core.geometry
import bonsai.core.aggregate
import bonsai.core.spatial
import bonsai.core.style
from bonsai.bim.ifc import IfcStore
from mathutils import Vector
from typing import Union
from logging import Logger
@@ -151,7 +151,7 @@ class IfcExporter:
return self.sync_grid_axis_object_placement(obj, element)
if not hasattr(element, "ObjectPlacement"):
return
blenderbim.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
return element
def sync_grid_axis_object_placement(self, obj: bpy.types.Object, element: ifcopenshell.entity_instance) -> None:
+9 -9
View File
@@ -22,14 +22,14 @@ import ifcopenshell.util.element
import ifcopenshell.util.representation
import ifcopenshell.util.unit
import ifcopenshell.api.owner.settings
import blenderbim.bim
import blenderbim.tool as tool
import blenderbim.core.owner as core_owner
import bonsai.bim
import bonsai.tool as tool
import bonsai.core.owner as core_owner
from bpy.app.handlers import persistent
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.owner.prop import get_user_person, get_user_organisation
from blenderbim.bim.module.model.data import AuthoringData
from blenderbim.bim.module.model.workspace import LIST_OF_TOOLS, TOOLS_TO_CLASSES_MAP
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.owner.prop import get_user_person, get_user_organisation
from bonsai.bim.module.model.data import AuthoringData
from bonsai.bim.module.model.workspace import LIST_OF_TOOLS, TOOLS_TO_CLASSES_MAP
from mathutils import Vector
from math import cos, degrees
from typing import Union
@@ -174,7 +174,7 @@ def refresh_ui_data():
Note that calling non-ifc-operators by itself doesn't refresh the UI data
and it need to be refreshed manually if needed.
"""
from blenderbim.bim import modules
from bonsai.bim import modules
for name, value in modules.items():
try:
@@ -299,7 +299,7 @@ def load_post(scene):
# tab. We override default scene properties panels with our own poll
# to hide them unless the user has chosen to view Blender properties.
for panel in tool.Blender.get_scene_panels_list():
if panel in blenderbim.bim.original_scene_panels_polls:
if panel in bonsai.bim.original_scene_panels_polls:
continue
tool.Blender.override_scene_panel(panel)
tool.Blender.setup_tabs()
+2 -2
View File
@@ -27,8 +27,8 @@ import ifcopenshell.util.unit
from ifcopenshell.util.doc import get_attribute_doc, get_predefined_type_doc, get_property_doc
from mathutils import geometry
from mathutils import Vector
import blenderbim.tool as tool
from blenderbim.bim.ifc import IfcStore
import bonsai.tool as tool
from bonsai.bim.ifc import IfcStore
from typing import Optional, Callable, Any, Union
+13 -13
View File
@@ -27,11 +27,11 @@ import traceback
import ifcopenshell
import ifcopenshell.geom
import ifcopenshell.ifcopenshell_wrapper
import blenderbim
import blenderbim.bim.handler
import blenderbim.tool as tool
import bonsai
import bonsai.bim.handler
import bonsai.tool as tool
from pathlib import Path
from blenderbim.tool.brick import BrickStore
from bonsai.tool.brick import BrickStore
from typing import Set, Union, Optional, TypedDict, Callable
@@ -252,11 +252,11 @@ class IfcStore:
else:
obj.BIMObjectProperties.ifc_definition_id = element.id()
blenderbim.bim.handler.subscribe_to(obj, "name", blenderbim.bim.handler.name_callback)
bonsai.bim.handler.subscribe_to(obj, "name", bonsai.bim.handler.name_callback)
if isinstance(obj, bpy.types.Object):
blenderbim.bim.handler.subscribe_to(
obj, "active_material_index", blenderbim.bim.handler.active_material_index_callback
bonsai.bim.handler.subscribe_to(
obj, "active_material_index", bonsai.bim.handler.active_material_index_callback
)
if IfcStore.history:
@@ -279,10 +279,10 @@ class IfcStore:
IfcStore.id_map[data["id"]] = obj
if "guid" in data:
IfcStore.guid_map[data["guid"]] = obj
blenderbim.bim.handler.subscribe_to(obj, "name", blenderbim.bim.handler.name_callback)
bonsai.bim.handler.subscribe_to(obj, "name", bonsai.bim.handler.name_callback)
if isinstance(obj, bpy.types.Object):
blenderbim.bim.handler.subscribe_to(
obj, "active_material_index", blenderbim.bim.handler.active_material_index_callback
bonsai.bim.handler.subscribe_to(
obj, "active_material_index", bonsai.bim.handler.active_material_index_callback
)
# TODO Listeners are not re-registered. Does this cause nasty problems to debug later on?
# TODO We're handling id_map and guid_map, but what about edited_objs? This might cause big problems.
@@ -364,7 +364,7 @@ class IfcStore:
@staticmethod
def execute_ifc_operator(operator: bpy.types.Operator, context: bpy.types.Context, is_invoke=False):
blenderbim.last_actions.append({"type": "operator", "name": operator.bl_idname})
bonsai.last_actions.append({"type": "operator", "name": operator.bl_idname})
bpy.context.scene.BIMProperties.is_dirty = True
is_top_level_operator = not bool(IfcStore.current_transaction)
@@ -385,7 +385,7 @@ class IfcStore:
else:
result = getattr(operator, "_execute")(context)
except:
blenderbim.last_error = traceback.format_exc()
bonsai.last_error = traceback.format_exc()
raise
if is_top_level_operator:
@@ -397,7 +397,7 @@ class IfcStore:
if BrickStore.graph is not None: # `if BrickStore.graph` by itself takes ages.
BrickStore.end_transaction()
IfcStore.end_transaction(operator)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return result
+3 -3
View File
@@ -32,10 +32,10 @@ import ifcopenshell.util.geolocation
import ifcopenshell.util.placement
import ifcopenshell.util.representation
import ifcopenshell.util.shape
import blenderbim.tool as tool
import bonsai.tool as tool
from itertools import chain, accumulate
from blenderbim.bim.ifc import IfcStore, IFC_CONNECTED_TYPE
from blenderbim.tool.loader import OBJECT_DATA_TYPE
from bonsai.bim.ifc import IfcStore, IFC_CONNECTED_TYPE
from bonsai.tool.loader import OBJECT_DATA_TYPE
from typing import Dict, Union, Optional, Any
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.tool as tool
import bonsai.tool as tool
import ifcopenshell.util.element
@@ -20,11 +20,10 @@ import bpy
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
import blenderbim.tool as tool
import blenderbim.core.aggregate as core
import blenderbim.core.spatial
import blenderbim.bim.handler
from blenderbim.bim.ifc import IfcStore
import bonsai.tool as tool
import bonsai.core.aggregate as core
import bonsai.core.spatial
from bonsai.bim.ifc import IfcStore
class BIM_OT_aggregate_assign_object(bpy.types.Operator, tool.Ifc.Operator):
@@ -164,7 +163,7 @@ class BIM_OT_add_aggregate(bpy.types.Operator, tool.Ifc.Operator):
related_obj=aggregate,
)
elif current_container:
blenderbim.core.spatial.assign_container(
bonsai.core.spatial.assign_container(
tool.Ifc,
tool.Collector,
tool.Spatial,
@@ -284,7 +283,7 @@ class BIM_OT_add_part_to_object(bpy.types.Operator, tool.Ifc.Operator):
part_class=self.part_class,
part_name=self.part_name,
)
blenderbim.core.spatial.import_spatial_decomposition(tool.Spatial)
bonsai.core.spatial.import_spatial_decomposition(tool.Spatial)
class BIM_OT_break_link_to_other_aggregates(bpy.types.Operator, tool.Ifc.Operator):
@@ -17,8 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.prop import StrProperty, Attribute
from blenderbim.bim.module.spatial.data import SpatialData
from bonsai.bim.prop import StrProperty, Attribute
from bonsai.bim.module.spatial.data import SpatialData
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+4 -4
View File
@@ -17,10 +17,10 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
from bpy.types import Panel
from blenderbim.bim.module.aggregate.data import AggregateData
from blenderbim.bim.module.group.data import GroupsData, ObjectGroupsData
from blenderbim.bim.ifc import IfcStore
import blenderbim.tool as tool
from bonsai.bim.module.aggregate.data import AggregateData
from bonsai.bim.module.group.data import GroupsData, ObjectGroupsData
from bonsai.bim.ifc import IfcStore
import bonsai.tool as tool
class BIM_PT_aggregate(Panel):
@@ -18,7 +18,7 @@
import bpy
import ifcopenshell
import blenderbim.tool as tool
import bonsai.tool as tool
def refresh():
@@ -22,11 +22,10 @@ import ifcopenshell
import ifcopenshell.api
import ifcopenshell.guid
import ifcopenshell.util.element
import blenderbim.bim.helper
import blenderbim.bim.handler
import blenderbim.tool as tool
import blenderbim.core.attribute as core
from blenderbim.bim.ifc import IfcStore
import bonsai.bim.helper
import bonsai.tool as tool
import bonsai.core.attribute as core
from bonsai.bim.ifc import IfcStore
class EnableEditingAttributes(bpy.types.Operator):
@@ -59,13 +58,13 @@ class EnableEditingAttributes(bpy.types.Operator):
new.data_type = "string"
new.ifc_class = data["type"]
new.string_value = "" if new.is_null else json.dumps(data[name])
blenderbim.bim.helper.add_attribute_description(new)
bonsai.bim.helper.add_attribute_description(new)
new.description += " The degrees, minutes and seconds should follow this format : [12,34,56]"
if name in ("PredefinedType", "ObjectType") and has_inherited_predefined_type:
props.attributes.remove(len(props.attributes) - 1)
return True
blenderbim.bim.helper.import_attributes2(element, props.attributes, callback=callback)
bonsai.bim.helper.import_attributes2(element, props.attributes, callback=callback)
props.is_editing_attributes = True
return {"FINISHED"}
@@ -106,7 +105,7 @@ class EditAttributes(bpy.types.Operator, tool.Ifc.Operator):
attributes[prop.name] = None
return True
attributes = blenderbim.bim.helper.export_attributes(props.attributes, callback=callback)
attributes = bonsai.bim.helper.export_attributes(props.attributes, callback=callback)
ifcopenshell.api.run("attribute.edit_attributes", self.file, product=product, attributes=attributes)
bpy.ops.bim.disable_editing_attributes(obj=obj.name)
return {"FINISHED"}
@@ -17,8 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.prop import StrProperty, Attribute
from bonsai.bim.ifc import IfcStore
from bonsai.bim.prop import StrProperty, Attribute
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+4 -4
View File
@@ -16,10 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.bim.helper
import bonsai.bim.helper
from bpy.types import Panel
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.attribute.data import AttributesData
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.attribute.data import AttributesData
def draw_ui(context, layout, attributes):
@@ -34,7 +34,7 @@ def draw_ui(context, layout, attributes):
op = row.operator("bim.disable_editing_attributes", icon="CANCEL", text="")
op.obj = obj.name
blenderbim.bim.helper.draw_attributes(props.attributes, layout, copy_operator="bim.copy_attribute_to_selection")
bonsai.bim.helper.draw_attributes(props.attributes, layout, copy_operator="bim.copy_attribute_to_selection")
else:
row = layout.row()
op = row.operator("bim.enable_editing_attributes", icon="GREASEPENCIL", text="Edit")
@@ -24,7 +24,7 @@ import shutil
import requests
import tempfile
import datetime
import blenderbim.tool as tool
import bonsai.tool as tool
class AuginLogin(bpy.types.Operator):
+4 -4
View File
@@ -31,11 +31,11 @@ import webbrowser
import ifcopenshell
import ifcopenshell.util.geolocation
import ifcopenshell.util.unit
import blenderbim.tool as tool
import blenderbim.bim.module.bcf.prop as bcf_prop
import blenderbim.bim.module.bcf.bcfstore as bcfstore
import bonsai.tool as tool
import bonsai.bim.module.bcf.prop as bcf_prop
import bonsai.bim.module.bcf.bcfstore as bcfstore
from pathlib import Path
from blenderbim.bim.ifc import IfcStore
from bonsai.bim.ifc import IfcStore
from math import radians, degrees, atan, tan, cos, sin
from mathutils import Vector, Matrix, Euler, geometry
from xsdata.models.datatype import XmlDateTime
+1 -1
View File
@@ -18,7 +18,7 @@
import bpy
from . import bcfstore
from blenderbim.bim.prop import StrProperty
from bonsai.bim.prop import StrProperty
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.tool as tool
import bonsai.tool as tool
def refresh():
@@ -18,7 +18,7 @@
import gpu
import bmesh
import blenderbim.tool as tool
import bonsai.tool as tool
from bpy.types import SpaceView3D
from mathutils import Vector
from gpu_extras.batch import batch_for_shader
@@ -31,15 +31,15 @@ import ifcopenshell.util.shape
import ifcopenshell.util.element
import ifcopenshell.util.placement
import ifcopenshell.util.representation
import blenderbim.tool as tool
import blenderbim.bim.import_ifc as import_ifc
import bonsai.tool as tool
import bonsai.bim.import_ifc as import_ifc
from math import pi, inf, degrees, acos, radians
from mathutils import Vector, Matrix
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.model.decorator import ProfileDecorator
from blenderbim.bim.module.boundary.decorator import BoundaryDecorator
import blenderbim.core
import blenderbim.core.geometry
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.model.decorator import ProfileDecorator
from bonsai.bim.module.boundary.decorator import BoundaryDecorator
import bonsai.core
import bonsai.core.geometry
def get_boundaries_collection(blender_space):
@@ -521,7 +521,7 @@ class ShowBoundaries(bpy.types.Operator, tool.Ifc.Operator):
if not element or not getattr(element, "BoundedBy", None):
continue
if tool.Ifc.is_moved(obj):
blenderbim.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
element = tool.Ifc.get_entity(obj)
for rel in element.BoundedBy or []:
boundary_obj = loader.load_boundary(rel, obj)
@@ -1014,7 +1014,7 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
def get_flattened_polygon(self, element, relating_space_obj, target_face_matrix_i):
obj = tool.Ifc.get_object(element)
if obj and tool.Ifc.is_moved(obj):
blenderbim.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
space_matrix_i = relating_space_obj.matrix_world.inverted()
@@ -18,7 +18,7 @@
import bpy
from bpy.types import PropertyGroup
from blenderbim.bim.prop import ObjProperty
from bonsai.bim.prop import ObjProperty
from bpy.props import (
PointerProperty,
StringProperty,
@@ -29,7 +29,7 @@ from bpy.props import (
FloatVectorProperty,
CollectionProperty,
)
import blenderbim.tool as tool
import bonsai.tool as tool
def space_filter(self, object):
+3 -4
View File
@@ -17,11 +17,10 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.bim.helper
from bpy.types import Panel, UIList
from blenderbim.bim.ifc import IfcStore
import blenderbim.tool as tool
from blenderbim.bim.module.boundary.data import SpaceBoundariesData
from bonsai.bim.ifc import IfcStore
import bonsai.tool as tool
from bonsai.bim.module.boundary.data import SpaceBoundariesData
class BIM_PT_SceneBoundaries(Panel):
+2 -2
View File
@@ -17,8 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.tool as tool
from blenderbim.tool.brick import BrickStore
import bonsai.tool as tool
from bonsai.tool.brick import BrickStore
try:
from rdflib import URIRef, BNode
@@ -19,11 +19,11 @@
import os
import bpy
import ifcopenshell.api
import blenderbim.tool as tool
import blenderbim.core.brick as core
import blenderbim.bim.handler
from blenderbim.bim.ifc import IfcStore
from blenderbim.tool.brick import BrickStore
import bonsai.tool as tool
import bonsai.core.brick as core
import bonsai.bim.handler
from bonsai.bim.ifc import IfcStore
from bonsai.tool.brick import BrickStore
class LoadBrickProject(bpy.types.Operator, tool.Ifc.Operator):
@@ -197,7 +197,7 @@ class NewBrickFile(bpy.types.Operator):
}
IfcStore.add_transaction_operation(self, rollback=lambda data: True, commit=self.commit)
IfcStore.end_transaction(self)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
def _execute(self, context):
+5 -5
View File
@@ -17,8 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.module.brick.data import BrickschemaData, BrickschemaReferencesData
from blenderbim.bim.prop import StrProperty, Attribute
from bonsai.bim.module.brick.data import BrickschemaData, BrickschemaReferencesData
from bonsai.bim.prop import StrProperty, Attribute
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
@@ -30,9 +30,9 @@ from bpy.props import (
FloatVectorProperty,
CollectionProperty,
)
import blenderbim.core.brick as core
import blenderbim.tool.brick as tool
from blenderbim.tool.brick import BrickStore
import bonsai.core.brick as core
import bonsai.tool.brick as tool
from bonsai.tool.brick import BrickStore
def update_active_brick_index(self, context):
+4 -4
View File
@@ -16,11 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.tool as tool
import bonsai.tool as tool
from bpy.types import Panel, UIList
from blenderbim.bim.helper import prop_with_search
from blenderbim.bim.module.brick.data import BrickschemaData, BrickschemaReferencesData
from blenderbim.tool.brick import BrickStore
from bonsai.bim.helper import prop_with_search
from bonsai.bim.module.brick.data import BrickschemaData, BrickschemaReferencesData
from bonsai.tool.brick import BrickStore
class BIM_PT_brickschema(Panel):
@@ -18,8 +18,8 @@
import bpy
import bsdd
import blenderbim.tool as tool
from blenderbim.core import bsdd as core
import bonsai.tool as tool
from bonsai.core import bsdd as core
class LoadBSDDDomains(bpy.types.Operator):
+1 -1
View File
@@ -18,7 +18,7 @@
import bpy
from bpy.types import PropertyGroup
from blenderbim.bim.prop import Attribute, StrProperty
from bonsai.bim.prop import Attribute, StrProperty
from bpy.props import (
PointerProperty,
StringProperty,
+2 -2
View File
@@ -16,9 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.tool as tool
import bonsai.tool as tool
from bpy.types import Panel, UIList
from blenderbim.bim.ifc import IfcStore
from bonsai.bim.ifc import IfcStore
class BIM_PT_bsdd(Panel):
+1 -1
View File
@@ -21,7 +21,7 @@ import math
import bmesh
import mathutils
import bpy_extras
import blenderbim.tool as tool
import bonsai.tool as tool
from mathutils import Vector, Matrix
from math import pi, radians, sin, cos, sqrt
import ifcopenshell.util.unit
+1 -1
View File
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.module.model.data import AuthoringData
from bonsai.bim.module.model.data import AuthoringData
from bpy.types import PropertyGroup
from math import pi
@@ -18,11 +18,11 @@
import os
import bpy
import blenderbim.tool as tool
import blenderbim.bim.module.type.prop as type_prop
import bonsai.tool as tool
import bonsai.bim.module.type.prop as type_prop
import ifcopenshell.util.unit
from bpy.types import WorkSpaceTool
from blenderbim.bim.module.model.data import AuthoringData, RailingData, RoofData
from bonsai.bim.module.model.data import AuthoringData, RailingData, RoofData
class CadTool(WorkSpaceTool):
+1 -1
View File
@@ -19,7 +19,7 @@
import bpy
import json
import ifcopenshell.util.element
import blenderbim.tool as tool
import bonsai.tool as tool
def refresh():
@@ -19,7 +19,7 @@
import blf
import gpu
import bmesh
import blenderbim.tool as tool
import bonsai.tool as tool
from bpy.types import SpaceView3D
from mathutils import Vector
from gpu_extras.batch import batch_for_shader
@@ -23,11 +23,11 @@ import bmesh
import logging
import numpy as np
import ifcopenshell
import blenderbim.tool as tool
import bonsai.tool as tool
from math import radians
from mathutils import Matrix, Vector
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.clash.decorator import ClashDecorator
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.clash.decorator import ClashDecorator
class ExportClashSets(bpy.types.Operator):
+1 -1
View File
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.prop import StrProperty, Attribute, BIMFilterGroup
from bonsai.bim.prop import StrProperty, Attribute, BIMFilterGroup
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+4 -4
View File
@@ -17,9 +17,9 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.bim.helper
import bonsai.bim.helper
from bpy.types import Panel
from blenderbim.bim.module.clash.data import ClashData
from bonsai.bim.module.clash.data import ClashData
class BIM_PT_ifcclash(Panel):
@@ -92,7 +92,7 @@ class BIM_PT_ifcclash(Panel):
op.group = "a"
if source.mode != "a":
blenderbim.bim.helper.draw_filter(
bonsai.bim.helper.draw_filter(
layout, source.filter_groups, ClashData, f"clash_{props.active_clash_set_index}_a_{index}"
)
@@ -112,7 +112,7 @@ class BIM_PT_ifcclash(Panel):
op.group = "b"
if source.mode != "a":
blenderbim.bim.helper.draw_filter(
bonsai.bim.helper.draw_filter(
layout, source.filter_groups, ClashData, f"clash_{props.active_clash_set_index}_b_{index}"
)
@@ -20,8 +20,8 @@ import bpy
import ifcopenshell
import ifcopenshell.util.date
import ifcopenshell.util.classification
import blenderbim.tool as tool
from blenderbim.bim.ifc import IfcStore
import bonsai.tool as tool
from bonsai.bim.ifc import IfcStore
def refresh():
@@ -22,9 +22,9 @@ import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.classification
import ifcopenshell.util.element
import blenderbim.tool as tool
import blenderbim.bim.helper
from blenderbim.bim.ifc import IfcStore
import bonsai.tool as tool
import bonsai.bim.helper
from bonsai.bim.ifc import IfcStore
class LoadClassificationLibrary(bpy.types.Operator, tool.Ifc.Operator):
@@ -63,7 +63,7 @@ class AddManualClassification(bpy.types.Operator, tool.Ifc.Operator):
def _execute(self, context):
props = context.scene.BIMClassificationProperties
attributes = blenderbim.bim.helper.export_attributes(props.classification_attributes)
attributes = bonsai.bim.helper.export_attributes(props.classification_attributes)
classification = ifcopenshell.api.run(
"classification.add_classification", tool.Ifc.get(), classification="Unnamed"
)
@@ -89,7 +89,7 @@ class AddManualClassificationReference(bpy.types.Operator, tool.Ifc.Operator):
else:
objects = [self.obj]
props = context.scene.BIMClassificationReferenceProperties
attributes = blenderbim.bim.helper.export_attributes(props.reference_attributes)
attributes = bonsai.bim.helper.export_attributes(props.reference_attributes)
products = [
tool.Ifc.get().by_id(ifc_definition_id)
for obj in objects
@@ -152,7 +152,7 @@ class EnableAddingManualClassification(bpy.types.Operator):
props.is_adding = True
props.active_classification_id = 0
props.classification_attributes.clear()
blenderbim.bim.helper.import_attributes2("IfcClassification", props.classification_attributes)
bonsai.bim.helper.import_attributes2("IfcClassification", props.classification_attributes)
return {"FINISHED"}
@@ -176,7 +176,7 @@ class EnableAddingManualClassificationReference(bpy.types.Operator):
props = context.scene.BIMClassificationReferenceProperties
props.is_adding = True
props.reference_attributes.clear()
blenderbim.bim.helper.import_attributes2("IfcClassificationReference", props.reference_attributes)
bonsai.bim.helper.import_attributes2("IfcClassificationReference", props.reference_attributes)
return {"FINISHED"}
@@ -210,7 +210,7 @@ class EnableEditingClassification(bpy.types.Operator):
props = context.scene.BIMClassificationProperties
props.classification_attributes.clear()
blenderbim.bim.helper.import_attributes2(
bonsai.bim.helper.import_attributes2(
tool.Ifc.get().by_id(self.classification), props.classification_attributes, callback
)
props.active_classification_id = self.classification
@@ -280,7 +280,7 @@ class EnableEditingClassificationReference(bpy.types.Operator):
def execute(self, context):
props = context.scene.BIMClassificationReferenceProperties
props.reference_attributes.clear()
blenderbim.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.reference), props.reference_attributes)
bonsai.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.reference), props.reference_attributes)
props.active_reference_id = self.reference
return {"FINISHED"}
@@ -17,10 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.bim.helper
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.prop import StrProperty, Attribute
from blenderbim.bim.module.classification.data import ClassificationsData, ClassificationReferencesData
from bonsai.bim.prop import Attribute
from bonsai.bim.module.classification.data import ClassificationsData, ClassificationReferencesData
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
@@ -16,12 +16,12 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.bim.helper
import blenderbim.tool as tool
import blenderbim.bim.module.classification.prop as classification_prop
import bonsai.bim.helper
import bonsai.tool as tool
import bonsai.bim.module.classification.prop as classification_prop
from bpy.types import Panel, UIList
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.classification.data import (
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.classification.data import (
ClassificationsData,
ClassificationReferencesData,
MaterialClassificationsData,
@@ -67,7 +67,7 @@ class BIM_PT_classifications(Panel):
def draw_add_manual_ui(self, context):
if self.props.is_adding:
blenderbim.bim.helper.draw_attributes(self.props.classification_attributes, self.layout)
bonsai.bim.helper.draw_attributes(self.props.classification_attributes, self.layout)
row = self.layout.row(align=True)
row.operator("bim.add_manual_classification", text="Save", icon="CHECKMARK")
row.operator("bim.disable_adding_manual_classification", text="", icon="CANCEL")
@@ -104,7 +104,7 @@ class BIM_PT_classifications(Panel):
row = self.layout.row(align=True)
row.operator("bim.edit_classification", text="Save changes", icon="CHECKMARK")
row.operator("bim.disable_editing_classification", text="", icon="CANCEL")
blenderbim.bim.helper.draw_attributes(self.props.classification_attributes, self.layout)
bonsai.bim.helper.draw_attributes(self.props.classification_attributes, self.layout)
def draw_ui(self, classification):
row = self.layout.row(align=True)
@@ -151,7 +151,7 @@ class ReferenceUI:
row = self.layout.row()
row.prop(self.props, "classifications", text="")
if self.props.is_adding:
blenderbim.bim.helper.draw_attributes(self.props.reference_attributes, self.layout)
bonsai.bim.helper.draw_attributes(self.props.reference_attributes, self.layout)
row = self.layout.row(align=True)
op = row.operator("bim.add_manual_classification_reference", text="Save", icon="CHECKMARK")
op.obj_type = self.data.data["object_type"]
@@ -203,7 +203,7 @@ class ReferenceUI:
box = self.layout.box()
row = box.row()
row.label(text=pset.name, icon="COPY_ID")
blenderbim.bim.helper.draw_attributes(pset.properties, box)
bonsai.bim.helper.draw_attributes(pset.properties, box)
def draw_add_file_ui(self, context):
if not self.data.data["active_classification_library"]:
@@ -243,7 +243,7 @@ class ReferenceUI:
row = self.layout.row(align=True)
row.operator("bim.edit_classification_reference", text="Save changes", icon="CHECKMARK")
row.operator("bim.disable_editing_classification_reference", text="", icon="CANCEL")
blenderbim.bim.helper.draw_attributes(self.props.reference_attributes, self.layout)
bonsai.bim.helper.draw_attributes(self.props.reference_attributes, self.layout)
def draw_reference_ui(self, reference):
row = self.layout.row(align=True)
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.tool as tool
import bonsai.tool as tool
def refresh():
@@ -20,9 +20,9 @@ import bpy
import json
import ifcopenshell.api
import ifcopenshell.util.attribute
import blenderbim.bim.helper
import blenderbim.tool as tool
from blenderbim.bim.ifc import IfcStore
import bonsai.bim.helper
import bonsai.tool as tool
from bonsai.bim.ifc import IfcStore
class LoadObjectives(bpy.types.Operator):
@@ -62,7 +62,7 @@ class EnableEditingConstraint(bpy.types.Operator):
def execute(self, context):
props = context.scene.BIMConstraintProperties
props.constraint_attributes.clear()
blenderbim.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.constraint), props.constraint_attributes)
bonsai.bim.helper.import_attributes2(tool.Ifc.get().by_id(self.constraint), props.constraint_attributes)
props.active_constraint_id = self.constraint
return {"FINISHED"}
@@ -18,8 +18,8 @@
import bpy
from ifcopenshell.util.doc import get_entity_doc
import blenderbim.tool as tool
from blenderbim.bim.prop import Attribute
import bonsai.tool as tool
from bonsai.bim.prop import Attribute
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
@@ -17,9 +17,9 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
from bpy.types import Panel, UIList
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.helper import draw_attributes
from blenderbim.bim.module.constraint.data import ConstraintsData, ObjectConstraintsData
from bonsai.bim.ifc import IfcStore
from bonsai.bim.helper import draw_attributes
from bonsai.bim.module.constraint.data import ConstraintsData, ObjectConstraintsData
class BIM_PT_constraints(Panel):
+1 -1
View File
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.tool as tool
import bonsai.tool as tool
def refresh():
@@ -17,11 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.tool as tool
import blenderbim.core.context as core
import blenderbim.bim.module.context.data
import blenderbim.bim.handler
from blenderbim.bim.ifc import IfcStore
import bonsai.tool as tool
import bonsai.core.context as core
class AddContext(bpy.types.Operator, tool.Ifc.Operator):
+2 -2
View File
@@ -17,8 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.prop import StrProperty, Attribute
from blenderbim.bim.module.context.data import ContextData
from bonsai.bim.prop import StrProperty, Attribute
from bonsai.bim.module.context.data import ContextData
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+7 -7
View File
@@ -17,9 +17,9 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.bim.helper
import blenderbim.tool as tool
from blenderbim.bim.module.context.data import ContextData
import bonsai.bim.helper
import bonsai.tool as tool
from bonsai.bim.module.context.data import ContextData
class BIM_PT_context(bpy.types.Panel):
@@ -56,7 +56,7 @@ class BIM_PT_context(bpy.types.Panel):
row = box.row(align=True)
row.operator("bim.edit_context", icon="CHECKMARK")
row.operator("bim.disable_editing_context", icon="CANCEL", text="")
blenderbim.bim.helper.draw_attributes(ifc_context["props"], box)
bonsai.bim.helper.draw_attributes(ifc_context["props"], box)
else:
row = box.row(align=True)
row.label(text=ifc_context["context_type"])
@@ -64,8 +64,8 @@ class BIM_PT_context(bpy.types.Panel):
row.operator("bim.remove_context", icon="X", text="").context = ifc_context["id"]
row = box.row(align=True)
blenderbim.bim.helper.prop_with_search(row, props, "subcontexts", text="")
blenderbim.bim.helper.prop_with_search(row, props, "target_views", text="")
bonsai.bim.helper.prop_with_search(row, props, "subcontexts", text="")
bonsai.bim.helper.prop_with_search(row, props, "target_views", text="")
op = row.operator("bim.add_context", icon="ADD", text="")
op.context_type = ifc_context["context_type"]
op.context_identifier = props.subcontexts
@@ -77,7 +77,7 @@ class BIM_PT_context(bpy.types.Panel):
row = box.row(align=True)
row.operator("bim.edit_context", icon="CHECKMARK")
row.operator("bim.disable_editing_context", icon="CANCEL", text="")
blenderbim.bim.helper.draw_attributes(subcontext["props"], box)
bonsai.bim.helper.draw_attributes(subcontext["props"], box)
else:
row = box.row(align=True)
row.label(text=subcontext["context_type"])
+1 -2
View File
@@ -22,8 +22,7 @@ import ifcopenshell.util.cost
import ifcopenshell.util.date
import ifcopenshell.util.element
import ifcopenshell.util.unit
import blenderbim.tool as tool
import blenderbim.bim.schema
import bonsai.tool as tool
from ifcopenshell.util.doc import get_entity_doc, get_predefined_type_doc
from typing import Any
@@ -16,16 +16,12 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import os
import bpy
import json
import time
import ifcopenshell.api
import blenderbim.bim.helper
import blenderbim.tool as tool
import bonsai.tool as tool
from bpy_extras.io_utils import ImportHelper
import blenderbim.tool as tool
import blenderbim.core.cost as core
import bonsai.tool as tool
import bonsai.core.cost as core
class AddCostSchedule(bpy.types.Operator, tool.Ifc.Operator):
+5 -5
View File
@@ -18,11 +18,11 @@
import bpy
import ifcopenshell.api
import blenderbim.tool as tool
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.classification.data import CostClassificationsData
from blenderbim.bim.module.cost.data import CostSchedulesData, CostItemRatesData, CostItemQuantitiesData
from blenderbim.bim.prop import StrProperty, Attribute
import bonsai.tool as tool
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.classification.data import CostClassificationsData
from bonsai.bim.module.cost.data import CostSchedulesData, CostItemRatesData, CostItemQuantitiesData
from bonsai.bim.prop import StrProperty, Attribute
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+8 -8
View File
@@ -16,11 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.bim.helper
import blenderbim.bim.module.cost.prop as CostProp
import bonsai.bim.helper
import bonsai.bim.module.cost.prop as CostProp
from bpy.types import Panel, UIList
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.cost.data import CostSchedulesData
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.cost.data import CostSchedulesData
from typing import Any
@@ -131,7 +131,7 @@ class BIM_PT_cost_schedules(Panel):
row.operator("bim.add_currency", text="", icon="ADD")
def draw_editable_cost_schedule_ui(self):
blenderbim.bim.helper.draw_attributes(self.props.cost_schedule_attributes, self.layout)
bonsai.bim.helper.draw_attributes(self.props.cost_schedule_attributes, self.layout)
def draw_editable_cost_item_ui(self):
row = self.layout.row(align=True)
@@ -188,7 +188,7 @@ class BIM_PT_cost_schedules(Panel):
self.draw_editable_cost_item_values_ui()
def draw_editable_cost_item_attributes_ui(self):
blenderbim.bim.helper.draw_attributes(self.props.cost_item_attributes, self.layout)
bonsai.bim.helper.draw_attributes(self.props.cost_item_attributes, self.layout)
def draw_editable_cost_item_quantities_ui(self, cost_item: dict[str, Any]):
quantities = CostSchedulesData.data["cost_quantities"]
@@ -225,7 +225,7 @@ class BIM_PT_cost_schedules(Panel):
op.physical_quantity = quantity["id"]
if self.props.active_cost_item_quantity_id and self.props.active_cost_item_quantity_id == quantity["id"]:
blenderbim.bim.helper.draw_attributes(self.props.quantity_attributes, self.layout.box())
bonsai.bim.helper.draw_attributes(self.props.quantity_attributes, self.layout.box())
def draw_editable_cost_item_values_ui(self):
row = self.layout.row(align=True)
@@ -245,7 +245,7 @@ class BIM_PT_cost_schedules(Panel):
self.draw_readonly_cost_value_ui(row, cost_value)
if self.props.cost_value_editing_type == "ATTRIBUTES":
blenderbim.bim.helper.draw_attributes(self.props.cost_value_attributes, self.layout.box())
bonsai.bim.helper.draw_attributes(self.props.cost_value_attributes, self.layout.box())
def draw_readonly_cost_value_ui(self, layout, cost_value):
if cost_value["name"]:
@@ -17,24 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.prop import StrProperty, Attribute
# from blenderbim.bim.module.spatial.data import SpatialData
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
StringProperty,
EnumProperty,
BoolProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
CollectionProperty,
)
# import blenderbim.tool as tool
# import blenderbim.core.geometry
# import ifcopenshell
class BIMCoveringProperties(PropertyGroup):
@@ -20,12 +20,10 @@
import os
import bpy
import ifcopenshell
import blenderbim.tool as tool
from blenderbim.bim.helper import prop_with_search
from blenderbim.bim.module.model.data import AuthoringData
import bonsai.tool as tool
from bonsai.bim.helper import prop_with_search
from bonsai.bim.module.model.data import AuthoringData
from bpy.types import WorkSpaceTool
from blenderbim.bim.ifc import IfcStore
import blenderbim.bim.handler
class CoveringTool(WorkSpaceTool):
@@ -21,7 +21,7 @@ import json
import ifcopenshell
import ifcopenshell.util.element
from math import degrees, atan2
from blenderbim.bim.ifc import IfcStore
from bonsai.bim.ifc import IfcStore
from .api import Api
+4 -4
View File
@@ -24,10 +24,10 @@ import logging
import tempfile
import ifcopenshell
import ifcopenshell.util.selector
import blenderbim.tool as tool
import blenderbim.bim.module.drawing.scheduler as scheduler
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.handler import refresh_ui_data
import bonsai.tool as tool
import bonsai.bim.module.drawing.scheduler as scheduler
from bonsai.bim.ifc import IfcStore
from bonsai.bim.handler import refresh_ui_data
class AddCsvAttribute(bpy.types.Operator):
+1 -1
View File
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.prop import StrProperty, BIMFilterGroup
from bonsai.bim.prop import StrProperty, BIMFilterGroup
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+4 -4
View File
@@ -16,10 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.bim.helper
import bonsai.bim.helper
from bpy.types import Panel
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.search.data import SearchData
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.search.data import SearchData
class BIM_PT_ifccsv(Panel):
@@ -85,7 +85,7 @@ class BIM_PT_ifccsv(Panel):
row.prop(props, "concat_value")
layout.use_property_split = False
blenderbim.bim.helper.draw_filter(self.layout, props.filter_groups, SearchData, "csv")
bonsai.bim.helper.draw_filter(self.layout, props.filter_groups, SearchData, "csv")
row = layout.row(align=True)
op = row.operator("bim.search", text="Select", icon="VIEWZOOM")
+8 -10
View File
@@ -30,13 +30,13 @@ import ifcopenshell.util.element
import ifcopenshell.util.placement
import ifcopenshell.util.representation
import ifcopenshell.util.unit
import blenderbim.tool as tool
import blenderbim.core.debug as core
import blenderbim.bim.handler
import blenderbim.bim.import_ifc as import_ifc
import bonsai.tool as tool
import bonsai.core.debug as core
import bonsai.bim.handler
import bonsai.bim.import_ifc as import_ifc
from pathlib import Path
from blenderbim import get_debug_info, format_debug_info
from blenderbim.bim.ifc import IfcStore
from bonsai import get_debug_info, format_debug_info
from bonsai.bim.ifc import IfcStore
class CopyDebugInformation(bpy.types.Operator):
@@ -99,7 +99,7 @@ class ConvertToBlender(bpy.types.Operator):
context.scene.BIMProperties.ifc_file = ""
context.scene.BIMDebugProperties.attributes.clear()
IfcStore.purge()
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
@@ -408,7 +408,7 @@ class ParseExpress(bpy.types.Operator):
def execute(self, context):
core.parse_express(tool.Debug, context.scene.BIMDebugProperties.express_file)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
@@ -609,8 +609,6 @@ class PipInstall(bpy.types.Operator):
name: bpy.props.StringProperty()
def execute(self, context):
import blenderbim.bim
blender_path = Path(bpy.app.binary_path).parent
target = next(
path for p in sys.path if (path := Path(p)).name == "site-packages" and path.is_relative_to(blender_path)
+1 -1
View File
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
from blenderbim.bim.prop import StrProperty, Attribute
from bonsai.bim.prop import StrProperty, Attribute
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+1 -1
View File
@@ -29,7 +29,7 @@
# of "fetching data" and "displaying data" is a common concept that makes UI
# code much simpler, more efficient, and less error-prone to refresh data.
import blenderbim.tool as tool
import bonsai.tool as tool
# All data must have a refresh function. The refresh function simply sets all
@@ -28,9 +28,8 @@
# "Operators", since they correlate to a single user operation.
import bpy
import blenderbim.tool as tool
import blenderbim.core.demo as core
import blenderbim.bim.handler
import bonsai.tool as tool
import bonsai.core.demo as core
# Each button correlates to a class like the one below. In this case, we're
+1 -1
View File
@@ -27,7 +27,7 @@
# panels, buttons, labels, and input fields are laid out.
import bpy
from blenderbim.bim.module.demo.data import DemoData
from bonsai.bim.module.demo.data import DemoData
# Every panel in the interface correlates to one of these classes. If you enable
+1 -1
View File
@@ -18,7 +18,7 @@
import bpy
import json
import blenderbim.tool as tool
import bonsai.tool as tool
def refresh():
@@ -21,10 +21,10 @@ import json
import logging
import ifcdiff
import ifcopenshell
import blenderbim.bim.handler
import blenderbim.bim.import_ifc
import blenderbim.tool as tool
from blenderbim.bim.ifc import IfcStore
import bonsai.bim.handler
import bonsai.bim.import_ifc
import bonsai.tool as tool
from bonsai.bim.ifc import IfcStore
class SelectDiffJsonFile(bpy.types.Operator):
@@ -174,7 +174,7 @@ class ExecuteIfcDiff(bpy.types.Operator):
self.load_changed_elements(ifc_diff)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
def load_changed_elements(self, ifc_diff: ifcdiff.IfcDiff):
@@ -183,8 +183,8 @@ class ExecuteIfcDiff(bpy.types.Operator):
active_ifc = tool.Ifc.get()
logger = logging.getLogger("ImportIFC")
ifc_import_settings = blenderbim.bim.import_ifc.IfcImportSettings.factory(bpy.context, None, logger)
ifc_importer = blenderbim.bim.import_ifc.IfcImporter(ifc_import_settings)
ifc_import_settings = bonsai.bim.import_ifc.IfcImportSettings.factory(bpy.context, None, logger)
ifc_importer = bonsai.bim.import_ifc.IfcImporter(ifc_import_settings)
if self.props.active_file == "NEW":
tool.Ifc.set(ifc_diff.old)
+2 -2
View File
@@ -17,8 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.prop import StrProperty, BIMFilterGroup
from blenderbim.bim.module.diff.data import DiffData
from bonsai.bim.prop import StrProperty, BIMFilterGroup
from bonsai.bim.module.diff.data import DiffData
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+5 -5
View File
@@ -17,10 +17,10 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
from bpy.types import Panel
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.diff.data import DiffData
import blenderbim.bim.helper
import blenderbim.tool as tool
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.diff.data import DiffData
import bonsai.bim.helper
import bonsai.tool as tool
class BIM_PT_diff(Panel):
@@ -93,7 +93,7 @@ class BIM_PT_diff(Panel):
remove.collection = "diff_relationships"
remove.index = index
blenderbim.bim.helper.draw_filter(self.layout, props.filter_groups, DiffData, "diff")
bonsai.bim.helper.draw_filter(self.layout, props.filter_groups, DiffData, "diff")
row = layout.row()
row.operator("bim.execute_ifc_diff")
@@ -20,7 +20,7 @@ import os
import bpy
import ifcopenshell
import ifcopenshell.util.schema
import blenderbim.tool as tool
import bonsai.tool as tool
def refresh():
@@ -20,9 +20,9 @@ import bpy
import json
import ifcopenshell.api
import ifcopenshell.util.attribute
import blenderbim.tool as tool
import blenderbim.core.document as core
from blenderbim.bim.ifc import IfcStore
import bonsai.tool as tool
import bonsai.core.document as core
from bonsai.bim.ifc import IfcStore
class LoadProjectDocuments(bpy.types.Operator, tool.Ifc.Operator):
@@ -17,7 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.prop import StrProperty, Attribute
from bonsai.bim.prop import StrProperty, Attribute
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+3 -3
View File
@@ -17,9 +17,9 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
from bpy.types import Panel, UIList
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.helper import draw_attributes
from blenderbim.bim.module.document.data import DocumentData, ObjectDocumentData
from bonsai.bim.ifc import IfcStore
from bonsai.bim.helper import draw_attributes
from bonsai.bim.module.document.data import DocumentData, ObjectDocumentData
class BIM_PT_documents(Panel):
@@ -20,7 +20,7 @@ import os
import bpy
import math
import bmesh
import blenderbim.tool as tool
import bonsai.tool as tool
import ifcopenshell.util.element
from mathutils import Vector, Matrix
+1 -1
View File
@@ -22,7 +22,7 @@ import json
import ifcopenshell.util.element
import ifcopenshell.util.representation
import ifcopenshell.util.unit
import blenderbim.tool as tool
import bonsai.tool as tool
from pathlib import Path
from typing import Any, Union
@@ -26,16 +26,16 @@ import shapely
import ifcopenshell
import ifcopenshell.util.element
import ifcopenshell.util.unit
import blenderbim.tool as tool
import blenderbim.bim.module.drawing.helper as helper
import bonsai.tool as tool
import bonsai.bim.module.drawing.helper as helper
from math import pi, sin, cos, tan, acos, atan, degrees, radians, ceil
from bpy.types import SpaceView3D
from mathutils import Vector, Matrix
from bpy_extras.view3d_utils import location_3d_to_region_2d
from gpu_extras.batch import batch_for_shader
from blenderbim.bim.module.drawing.data import DecoratorData, DrawingsData
from blenderbim.bim.module.drawing.shaders import add_verts_sequence, add_offsets
from blenderbim.bim.module.drawing.helper import format_distance
from bonsai.bim.module.drawing.data import DecoratorData, DrawingsData
from bonsai.bim.module.drawing.shaders import add_verts_sequence, add_offsets
from bonsai.bim.module.drawing.helper import format_distance
from timeit import default_timer as timer
from functools import lru_cache
from typing import Optional, Iterator, Type, Union
@@ -23,7 +23,7 @@ from bpy import types
from mathutils import Vector
from mathutils import geometry
from bpy_extras import view3d_utils
from blenderbim.bim.module.drawing.shaders import DotsGizmoShader, ExtrusionGuidesShader
from bonsai.bim.module.drawing.shaders import DotsGizmoShader, ExtrusionGuidesShader
from ifcopenshell.util.unit import si_conversions
@@ -17,8 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.bim.module.drawing.decoration as decoration
import blenderbim.tool as tool
import bonsai.bim.module.drawing.decoration as decoration
import bonsai.tool as tool
from bpy.app.handlers import persistent
@@ -19,7 +19,7 @@
import bpy
import math
import mathutils.geometry
import blenderbim.tool as tool
import bonsai.tool as tool
from mathutils import Vector
# Code taken and updated from https://blenderartists.org/t/detecting-intersection-of-bounding-boxes/457520/2
@@ -35,26 +35,25 @@ import ifcopenshell.geom
import ifcopenshell.util.selector
import ifcopenshell.util.representation
import ifcopenshell.util.element
import blenderbim.bim.schema
import blenderbim.bim.helper
import blenderbim.bim.handler
import blenderbim.tool as tool
import blenderbim.core.geometry
import blenderbim.core.drawing as core
import blenderbim.bim.module.drawing.svgwriter as svgwriter
import blenderbim.bim.module.drawing.annotation as annotation
import blenderbim.bim.module.drawing.sheeter as sheeter
import blenderbim.bim.module.drawing.scheduler as scheduler
import blenderbim.bim.module.drawing.helper as helper
import blenderbim.bim.export_ifc
from blenderbim.bim.module.drawing.decoration import CutDecorator
from blenderbim.bim.module.drawing.data import DecoratorData, DrawingsData
import bonsai.bim.helper
import bonsai.bim.handler
import bonsai.tool as tool
import bonsai.core.geometry
import bonsai.core.drawing as core
import bonsai.bim.module.drawing.svgwriter as svgwriter
import bonsai.bim.module.drawing.annotation as annotation
import bonsai.bim.module.drawing.sheeter as sheeter
import bonsai.bim.module.drawing.scheduler as scheduler
import bonsai.bim.module.drawing.helper as helper
import bonsai.bim.export_ifc
from bonsai.bim.module.drawing.decoration import CutDecorator
from bonsai.bim.module.drawing.data import DecoratorData, DrawingsData
from typing import NamedTuple, List, Union, Optional, Literal
from lxml import etree
from mathutils import Vector, Color, Matrix
from timeit import default_timer as timer
from blenderbim.bim.module.drawing.prop import RasterStyleProperty, RASTER_STYLE_PROPERTIES_EXCLUDE
from blenderbim.bim.ifc import IfcStore
from bonsai.bim.module.drawing.prop import RasterStyleProperty, RASTER_STYLE_PROPERTIES_EXCLUDE
from bonsai.bim.ifc import IfcStore
from pathlib import Path
from bpy_extras.image_utils import load_image
@@ -499,7 +498,7 @@ class CreateDrawing(bpy.types.Operator):
if self.sync and self.drawing_index == 0:
with profile("sync"):
# All very hackish whilst prototyping
exporter = blenderbim.bim.export_ifc.IfcExporter(None)
exporter = bonsai.bim.export_ifc.IfcExporter(None)
exporter.file = tool.Ifc.get()
invalidated_elements = exporter.sync_all_objects()
invalidated_elements += exporter.sync_edited_objects()
@@ -1490,7 +1489,7 @@ class ActivateModel(bpy.types.Operator):
if model:
current_representation = tool.Geometry.get_active_representation(obj)
if current_representation != model:
blenderbim.core.geometry.switch_representation(
bonsai.core.geometry.switch_representation(
tool.Ifc,
tool.Geometry,
obj=obj,
@@ -1505,7 +1504,7 @@ class ActivateModel(bpy.types.Operator):
obj.hide_set(hide_status)
tool.Blender.update_viewport()
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
@@ -1844,7 +1843,7 @@ class SaveDrawingStylesData(bpy.types.Operator, tool.Ifc.Operator):
ifcopenshell.api.run(
"pset.edit_pset", ifc_file, pset=pset, properties={"CurrentShadingStyle": new_style_name}
)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
@@ -1873,7 +1872,7 @@ class ActivateDrawingStyle(bpy.types.Operator, tool.Ifc.Operator):
ifcopenshell.api.run(
"pset.edit_pset", ifc_file, pset=pset, properties={"CurrentShadingStyle": self.drawing_style.name}
)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
def set_raster_style(self, context):
@@ -2239,7 +2238,7 @@ class EditTextPopup(bpy.types.Operator):
# skip BoxAlignment since we're going to format it ourselves
attributes = [a for a in literal_props.attributes if a.name != "BoxAlignment"]
blenderbim.bim.helper.draw_attributes(attributes, box, popup_active_attribute=attributes[0])
bonsai.bim.helper.draw_attributes(attributes, box, popup_active_attribute=attributes[0])
row = box.row(align=True)
cols = [row.column(align=True) for i in range(3)]
@@ -2323,7 +2322,7 @@ class AddTextLiteral(bpy.types.Operator):
"Path": "RIGHT",
"BoxAlignment": "bottom_left",
}
# emulates `blenderbim.bim.helper.import_attributes2(ifc_literal, literal_props.attributes)`
# emulates `bonsai.bim.helper.import_attributes2(ifc_literal, literal_props.attributes)`
for attr_name in literal_attr_values:
attr = literal_attributes.add()
attr.name = attr_name
+8 -8
View File
@@ -23,15 +23,15 @@ import enum
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
import blenderbim.tool as tool
import blenderbim.core.drawing as core
import blenderbim.bim.module.drawing.annotation as annotation
import blenderbim.bim.module.drawing.decoration as decoration
from blenderbim.bim.prop import BIMFilterGroup
from blenderbim.bim.module.drawing.data import DrawingsData, DecoratorData, SheetsData, AnnotationData
from blenderbim.bim.module.drawing.data import refresh as refresh_drawing_data
import bonsai.tool as tool
import bonsai.core.drawing as core
import bonsai.bim.module.drawing.annotation as annotation
import bonsai.bim.module.drawing.decoration as decoration
from bonsai.bim.prop import BIMFilterGroup
from bonsai.bim.module.drawing.data import DrawingsData, DecoratorData, SheetsData, AnnotationData
from bonsai.bim.module.drawing.data import refresh as refresh_drawing_data
from pathlib import Path
from blenderbim.bim.prop import Attribute, StrProperty
from bonsai.bim.prop import Attribute, StrProperty
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
@@ -23,14 +23,14 @@ import string
import svgwrite
import openpyxl
from blenderbim.bim.module.drawing.svgwriter import SvgWriter
from bonsai.bim.module.drawing.svgwriter import SvgWriter
from odf.opendocument import load as load_ods
from odf.table import Table, TableRow, TableColumn, TableCell
from odf.text import P
from odf.style import Style
from textwrap import wrap
from pathlib import Path
from blenderbim.bim.ifc import IfcStore
from bonsai.bim.ifc import IfcStore
DEBUG = False
@@ -24,7 +24,7 @@ import ntpath
import pystache
import urllib.parse
import xml.etree.ElementTree as ET
import blenderbim.tool as tool
import bonsai.tool as tool
import ifcopenshell.util.geolocation
from xml.dom import minidom
from mathutils import Vector
@@ -30,13 +30,13 @@ import ifcopenshell.util.element
import ifcopenshell.util.representation
import ifcopenshell.util.selector
import ifcopenshell.util.unit
import blenderbim.tool as tool
import blenderbim.bim.module.drawing.helper as helper
import blenderbim.bim.module.drawing.annotation as annotation
from blenderbim.bim.module.drawing.data import DrawingsData
import bonsai.tool as tool
import bonsai.bim.module.drawing.helper as helper
import bonsai.bim.module.drawing.annotation as annotation
from bonsai.bim.module.drawing.data import DrawingsData
from blenderbim.bim.module.drawing.data import DecoratorData
from blenderbim.bim.ifc import IfcStore
from bonsai.bim.module.drawing.data import DecoratorData
from bonsai.bim.ifc import IfcStore
from math import pi, ceil, atan, degrees, acos
from mathutils import geometry, Vector
+6 -6
View File
@@ -17,10 +17,10 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.bim.helper
import blenderbim.tool as tool
import bonsai.bim.helper
import bonsai.tool as tool
from bpy.types import Panel
from blenderbim.bim.module.drawing.data import (
from bonsai.bim.module.drawing.data import (
ProductAssignmentsData,
SheetsData,
DocumentsData,
@@ -119,7 +119,7 @@ class BIM_PT_element_filters(Panel):
props = context.scene.camera.data.BIMCameraProperties
if props.filter_mode == "INCLUDE":
blenderbim.bim.helper.draw_filter(
bonsai.bim.helper.draw_filter(
self.layout, props.include_filter_groups, ElementFiltersData, "drawing_include"
)
row = self.layout.row(align=True)
@@ -128,7 +128,7 @@ class BIM_PT_element_filters(Panel):
)
row.operator("bim.enable_editing_element_filter", icon="CANCEL", text="").filter_mode = "NONE"
elif props.filter_mode == "EXCLUDE":
blenderbim.bim.helper.draw_filter(
bonsai.bim.helper.draw_filter(
self.layout, props.exclude_filter_groups, ElementFiltersData, "drawing_exclude"
)
row = self.layout.row(align=True)
@@ -545,7 +545,7 @@ class BIM_PT_text(Panel):
# skip BoxAlignment since we're going to format it ourselves
attributes = [a for a in literal_props.attributes if a.name != "BoxAlignment"]
blenderbim.bim.helper.draw_attributes(attributes, box)
bonsai.bim.helper.draw_attributes(attributes, box)
row = box.row(align=True)
cols = [row.column(align=True) for i in range(3)]
@@ -19,15 +19,12 @@
import os
import bpy
import blenderbim.core.type
import blenderbim.tool as tool
from blenderbim.bim.helper import prop_with_search
import bonsai.core.type
import bonsai.tool as tool
from bonsai.bim.module.drawing.data import DecoratorData, AnnotationData
from bonsai.bim.helper import prop_with_search
from bpy.types import WorkSpaceTool
from blenderbim.bim.module.drawing.data import DecoratorData, AnnotationData
from blenderbim.bim.ifc import IfcStore
import blenderbim.bim.handler
class LaunchAnnotationTypeManager(bpy.types.Operator):
bl_idname = "bim.launch_annotation_type_manager"
@@ -171,7 +168,7 @@ def create_annotation_occurrence(context):
ifc_representation_class=tool.Drawing.get_ifc_representation_class(object_type),
)
blenderbim.core.type.assign_type(tool.Ifc, tool.Type, element=element, type=relating_type)
bonsai.core.type.assign_type(tool.Ifc, tool.Type, element=element, type=relating_type)
tool.Ifc.run("group.assign_group", group=tool.Drawing.get_drawing_group(drawing), products=[element])
tool.Collector.assign(obj)
+1 -1
View File
@@ -23,7 +23,7 @@ import ifcfm
import logging
import tempfile
import ifcopenshell
import blenderbim.tool as tool
import bonsai.tool as tool
class ExecuteIfcFM(bpy.types.Operator):
+2 -2
View File
@@ -17,8 +17,8 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
from blenderbim.bim.module.fm.data import FMData
from blenderbim.bim.prop import MultipleFileSelect, StrProperty
from bonsai.bim.module.fm.data import FMData
from bonsai.bim.prop import MultipleFileSelect, StrProperty
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
+3 -3
View File
@@ -16,10 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.tool as tool
import bonsai.tool as tool
from bpy.types import Panel
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.module.fm.data import FMData
from bonsai.bim.ifc import IfcStore
from bonsai.bim.module.fm.data import FMData
class BIM_PT_fm(Panel):
@@ -22,7 +22,7 @@ import ifcopenshell.util.geolocation
import ifcopenshell.util.placement
import ifcopenshell.util.schema
import ifcopenshell.util.unit
import blenderbim.tool as tool
import bonsai.tool as tool
from mathutils import Vector
@@ -21,7 +21,7 @@ import bmesh
import mathutils
import ifcopenshell
import ifcopenshell.util.unit
import blenderbim.tool as tool
import bonsai.tool as tool
from math import pi, pow
from mathutils import Vector, Matrix, geometry
from typing import Union
@@ -28,17 +28,17 @@ import ifcopenshell.util.element
import ifcopenshell.util.representation
import ifcopenshell.util.placement
import ifcopenshell.api
import blenderbim.core.geometry
import blenderbim.core.geometry as core
import blenderbim.core.aggregate
import blenderbim.core.style
import blenderbim.core.root
import blenderbim.core.drawing
import blenderbim.tool as tool
import blenderbim.bim.handler
import bonsai.core.geometry
import bonsai.core.geometry as core
import bonsai.core.aggregate
import bonsai.core.style
import bonsai.core.root
import bonsai.core.drawing
import bonsai.tool as tool
import bonsai.bim.handler
from mathutils import Vector, Matrix
from time import time
from blenderbim.bim.ifc import IfcStore
from bonsai.bim.ifc import IfcStore
from ifcopenshell.util.shape_builder import ShapeBuilder
from typing import Any
@@ -89,7 +89,7 @@ class OverrideMeshSeparate(bpy.types.Operator, tool.Ifc.Operator):
if new_obj == obj:
continue
# This is not very efficient, it needlessly copies the representations first.
blenderbim.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
bonsai.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
new_objs.append(new_obj)
for new_obj in new_objs:
bpy.ops.bim.update_representation(obj=new_obj.name)
@@ -874,7 +874,7 @@ class OverrideDuplicateMove(bpy.types.Operator):
# Prior to duplicating, sync the object placement to make decomposition recreation more stable.
if tool.Ifc.is_moved(obj):
blenderbim.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
new_obj = obj.copy()
temp_data = None
@@ -897,7 +897,7 @@ class OverrideDuplicateMove(bpy.types.Operator):
# clear object's collection so it will be able to have it's own
new_obj.BIMObjectProperties.collection = None
# copy the actual class
new = blenderbim.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
new = bonsai.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
# clean up the orphaned mesh with ifc id of the original object to avoid confusion
# IfcGridAxis keeps the same mesh data (it's pointing to ifc id 0, so it's not a problem)
@@ -934,7 +934,7 @@ class OverrideDuplicateMove(bpy.types.Operator):
# Recreate decompositions
tool.Root.recreate_decompositions(decomposition_relationships, old_to_new)
OverrideDuplicateMove.remove_linked_aggregate_data(old_to_new)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return old_to_new
@staticmethod
@@ -1201,7 +1201,7 @@ class DuplicateMoveLinkedAggregate(bpy.types.Operator):
if location_from_3d_cursor:
get_location_from_3d_cursor(old_to_new, selected_element)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
return old_to_new
@@ -1432,7 +1432,7 @@ class RefreshLinkedAggregate(bpy.types.Operator):
new_aggregate = ifcopenshell.util.element.get_aggregate(new[0])
if not new_aggregate:
blenderbim.core.aggregate.assign_object(
bonsai.core.aggregate.assign_object(
tool.Ifc,
tool.Aggregate,
tool.Collector,
@@ -1444,7 +1444,7 @@ class RefreshLinkedAggregate(bpy.types.Operator):
new_obj = tool.Ifc.get_object(new[0])
set_original_name(new_obj, original_names)
blenderbim.bim.handler.refresh_ui_data()
bonsai.bim.handler.refresh_ui_data()
operator_time = time() - refresh_start_time
if operator_time > 10:
@@ -1922,7 +1922,7 @@ def poll_editing_representaiton_item_style(cls, context):
if shape_aspect == "":
return True
from blenderbim.bim.module.material.data import ObjectMaterialData
from bonsai.bim.module.material.data import ObjectMaterialData
if not ObjectMaterialData.is_loaded:
ObjectMaterialData.load()
@@ -17,9 +17,9 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.tool as tool
from blenderbim.bim.prop import StrProperty, Attribute
from blenderbim.bim.module.geometry.data import RepresentationsData, ViewportData
import bonsai.tool as tool
from bonsai.bim.prop import StrProperty, Attribute
from bonsai.bim.module.geometry.data import RepresentationsData, ViewportData
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
@@ -56,7 +56,7 @@ def get_mode(self, context):
def get_styles(self, context):
# postponed import to avoid circular import
from blenderbim.bim.module.material.data import MaterialsData
from bonsai.bim.module.material.data import MaterialsData
if not MaterialsData.is_loaded:
MaterialsData.load()
@@ -70,7 +70,7 @@ def get_shape_aspects(self, context):
def get_material_constituents(self, context, edit_text):
from blenderbim.bim.module.material.data import ObjectMaterialData
from bonsai.bim.module.material.data import ObjectMaterialData
if not ObjectMaterialData.is_loaded:
ObjectMaterialData.load()
+8 -8
View File
@@ -17,19 +17,19 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import bpy
import blenderbim.bim
import blenderbim.tool as tool
import bonsai.bim
import bonsai.tool as tool
from bpy.types import Panel, Menu, UIList
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.helper import prop_with_search
from blenderbim.bim.module.geometry.data import (
from bonsai.bim.ifc import IfcStore
from bonsai.bim.helper import prop_with_search
from bonsai.bim.module.geometry.data import (
RepresentationsData,
RepresentationItemsData,
ConnectionsData,
PlacementData,
DerivedCoordinatesData,
)
from blenderbim.bim.module.layer.data import LayersData
from bonsai.bim.module.layer.data import LayersData
def mode_menu(self, context):
@@ -38,7 +38,7 @@ def mode_menu(self, context):
row = self.layout.row(align=True)
if context.scene.BIMGeometryProperties.mode == "EDIT":
row.operator("bim.override_mode_set_object", icon="CANCEL", text="Discard Changes").should_save = False
row.prop(context.scene.BIMGeometryProperties, "mode", text="", icon_value=blenderbim.bim.icons["IFC"].icon_id)
row.prop(context.scene.BIMGeometryProperties, "mode", text="", icon_value=bonsai.bim.icons["IFC"].icon_id)
def object_menu(self, context):
@@ -69,7 +69,7 @@ class BIM_MT_hotkey_separate(Menu):
bl_label = "Separate"
def draw(self, context):
self.layout.label(text="IFC Separate", icon_value=blenderbim.bim.icons["IFC"].icon_id)
self.layout.label(text="IFC Separate", icon_value=bonsai.bim.icons["IFC"].icon_id)
self.layout.operator("bim.override_mesh_separate", text="Selection").type = "SELECTED"
self.layout.operator("bim.override_mesh_separate", text="By Material").type = "MATERIAL"
self.layout.operator("bim.override_mesh_separate", text="By Loose Parts").type = "LOOSE"
@@ -19,7 +19,7 @@
import bpy
import numpy as np
import blenderbim.tool as tool
import bonsai.tool as tool
import ifcopenshell.util.element
import ifcopenshell.util.geolocation
import ifcopenshell.util.schema
@@ -21,13 +21,13 @@ import blf
import gpu
import bmesh
import ifcopenshell
import blenderbim.tool as tool
import bonsai.tool as tool
from math import radians
from bpy.types import SpaceView3D
from mathutils import Vector, Matrix
from gpu_extras.batch import batch_for_shader
from bpy_extras.view3d_utils import location_3d_to_region_2d
from blenderbim.bim.module.georeference.data import GeoreferenceData
from bonsai.bim.module.georeference.data import GeoreferenceData
class GeoreferenceDecorator:
@@ -18,9 +18,9 @@
import bpy
import blenderbim.tool as tool
import blenderbim.core.georeference as core
from blenderbim.bim.module.georeference.decorator import GeoreferenceDecorator
import bonsai.tool as tool
import bonsai.core.georeference as core
from bonsai.bim.module.georeference.decorator import GeoreferenceDecorator
class AddGeoreferencing(bpy.types.Operator, tool.Ifc.Operator):
@@ -18,8 +18,8 @@
import bpy
import ifcopenshell.util.geolocation
import blenderbim.tool as tool
from blenderbim.bim.prop import Attribute
import bonsai.tool as tool
from bonsai.bim.prop import Attribute
from bpy.types import PropertyGroup
from bpy.props import (
PointerProperty,
@@ -31,8 +31,8 @@ from bpy.props import (
FloatVectorProperty,
CollectionProperty,
)
from blenderbim.bim.module.georeference.data import GeoreferenceData
from blenderbim.bim.module.georeference.decorator import GeoreferenceDecorator
from bonsai.bim.module.georeference.data import GeoreferenceData
from bonsai.bim.module.georeference.decorator import GeoreferenceDecorator
def get_coordinate_operation_class(self, context):
@@ -16,10 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.tool as tool
import bonsai.tool as tool
from bpy.types import Panel
from blenderbim.bim.helper import draw_attributes, draw_attribute
from blenderbim.bim.module.georeference.data import GeoreferenceData
from bonsai.bim.helper import draw_attributes, draw_attribute
from bonsai.bim.module.georeference.data import GeoreferenceData
class BIM_PT_gis(Panel):
+1 -1
View File
@@ -18,7 +18,7 @@
from bpy.types import PropertyGroup
from bpy.props import StringProperty, BoolProperty, EnumProperty, CollectionProperty
from blenderbim.bim.prop import StrProperty
from bonsai.bim.prop import StrProperty
class BIMCityJsonProperties(PropertyGroup):

Some files were not shown because too many files have changed in this diff Show More