Search replace BlenderBIM with Bonsai

This commit is contained in:
Dion Moult
2024-08-13 15:45:33 +10:00
parent 17b90c3241
commit a57a7041ac
17 changed files with 45 additions and 45 deletions
+5 -5
View File
@@ -126,7 +126,7 @@ def safe_link_dlls() -> None:
# Then, Blender won't have a problem unlinking unloaded dlls as they are still linked somewhere.
# On register() we clean up our temp directory with binaries.
#
# TODO: If user uninstalls BlenderBIM to never use it again, temporary directory won't be cleared.
# TODO: If user uninstalls Bonsai to never use it again, temporary directory won't be cleared.
#
# See: https://projects.blender.org/blender/blender/issues/125049
import bpy
@@ -279,7 +279,7 @@ if IN_BLENDER:
print("\nFATAL ERROR: Unable to load Bonsai")
class BIM_PT_fatal_error(bpy.types.Panel):
bl_label = "BlenderBIM Fatal Error"
bl_label = "Bonsai Fatal Error"
bl_idname = "SCENE_PT_error_message"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
@@ -290,7 +290,7 @@ if IN_BLENDER:
layout = self.layout
layout.alert = True
layout.label(text="BlenderBIM could not load.", icon="ERROR")
layout.label(text="Bonsai could not load.", icon="ERROR")
if info["os"] == "Windows":
layout.operator("wm.console_toggle", text="View the console for full logs.", icon="CONSOLE")
else:
@@ -311,7 +311,7 @@ if IN_BLENDER:
# From wrong-platform-build issues we're guarded by Blender extension installation.
# But Blender currently doesn't support separate builds for different Python version,
# so those issues might still slip in.
box.label(text="BlenderBIM installed for wrong Python version.")
box.label(text="Bonsai installed for wrong Python version.")
box.label(text=f"Expected: {py}. Got: {binary_py}.")
# On reinstallation, dependencies versions doesn't change, so Blender will just ignore new dependencies.
# So, we need to make user will disable an extension (just uninstallation won't remove dependencies).
@@ -319,7 +319,7 @@ if IN_BLENDER:
# as dependencies failed to load due to Python version mismatch.
box.label(text="Try reinstalling with the correct Python version.")
box.label(text="Before reinstallation make sure to")
box.label(text="DISABLE BlenderBIM (uninstallation won't help).")
box.label(text="DISABLE Bonsai (uninstallation won't help).")
box.label(text="You can download correct version below.")
layout.operator("bim.copy_debug_information", text="Copy Error Message To Clipboard")
+1 -1
View File
@@ -164,7 +164,7 @@ class IfcExporter:
tool.Geometry.record_object_position(obj)
def get_application_name(self) -> str:
return "BlenderBIM"
return "Bonsai"
class IfcExportSettings:
+2 -2
View File
@@ -228,14 +228,14 @@ def get_application(ifc: ifcopenshell.file) -> ifcopenshell.entity_instance:
# TODO: cache this for even faster application retrieval. It honestly makes a difference on long scripts.
version = tool.Blender.get_blenderbim_version()
for element in ifc.by_type("IfcApplication"):
if element.ApplicationIdentifier == "BlenderBIM" and element.Version == version:
if element.ApplicationIdentifier == "Bonsai" and element.Version == version:
return element
return ifcopenshell.api.run(
"owner.add_application",
ifc,
version=version,
application_full_name="Bonsai",
application_identifier="BlenderBIM",
application_identifier="Bonsai",
)
@@ -84,7 +84,7 @@ class AuginCreateNewModel(bpy.types.Operator):
"project_name": props.project_name,
"model_filename": props.project_filename + ".ifc",
"thumb_filename": props.project_filename + ".png",
"app_name": "BlenderBIM",
"app_name": "Bonsai",
"sw_version": bpy.app.version_string,
"plugin_version": addon_version,
}
@@ -107,7 +107,7 @@ class RunAnalysis(bpy.types.Operator):
"run": context.scene.CoveToolProperties.projects[
context.scene.CoveToolProperties.active_project_index
].run_set,
"source": "BlenderBIM",
"source": "Bonsai",
"rotation_angle": self.get_rotation_angle(),
**self.inputs,
}
@@ -36,7 +36,7 @@ from blenderbim.bim.module.demo.data import DemoData
# file like this one where you can see this code. Pretty neat!
class BIM_PT_demo(bpy.types.Panel):
# Every panel has a title.
bl_label = "BlenderBIM Demo"
bl_label = "Bonsai Demo"
# Every panel must have an ID. It must be unique. For example, you may want
# to later reference the panel (such as if you want to create a nested
@@ -1419,7 +1419,7 @@ class OpenDrawing(bpy.types.Operator):
view: bpy.props.StringProperty()
bl_description = (
"Opens a .svg drawing based on currently active camera with default system viewer\n"
+ 'or using "svg_command" from the BlenderBIM preferences (if provided).\n\n'
+ 'or using "svg_command" from the Bonsai preferences (if provided).\n\n'
+ "SHIFT+CLICK to open all selected drawings"
)
open_all: bpy.props.BoolProperty(name="Open All", default=False, options={"SKIP_SAVE"})
@@ -26,56 +26,56 @@ from bpy.app.handlers import persistent
@persistent
def load_post(*args):
ifcopenshell.api.add_pre_listener("attribute.edit_attributes", "BlenderBIM.Root.SyncName", root.sync_name)
ifcopenshell.api.add_pre_listener("style.edit_presentation_style", "BlenderBIM.Root.SyncStyleName", root.sync_name)
ifcopenshell.api.add_pre_listener("attribute.edit_attributes", "Bonsai.Root.SyncName", root.sync_name)
ifcopenshell.api.add_pre_listener("style.edit_presentation_style", "Bonsai.Root.SyncStyleName", root.sync_name)
ifcopenshell.api.add_post_listener(
"geometry.add_representation", "BlenderBIM.Product.GenerateBox", product.generate_box
"geometry.add_representation", "Bonsai.Product.GenerateBox", product.generate_box
)
ifcopenshell.api.add_post_listener(
"sequence.edit_task_time", "BlenderBIM.Task.CalculateQuantities", task.calculate_quantities
"sequence.edit_task_time", "Bonsai.Task.CalculateQuantities", task.calculate_quantities
)
ifcopenshell.api.add_post_listener(
"material.edit_profile_usage",
"BlenderBIM.Product.RegenerateProfileUsage",
"Bonsai.Product.RegenerateProfileUsage",
product.regenerate_profile_usage,
)
ifcopenshell.api.add_post_listener(
"geometry.add_representation", "BlenderBIM.DumbWall.CalculateQuantities", wall.calculate_quantities
"geometry.add_representation", "Bonsai.DumbWall.CalculateQuantities", wall.calculate_quantities
)
ifcopenshell.api.add_post_listener(
"material.edit_layer", "BlenderBIM.DumbWall.RegenerateFromLayer", wall.DumbWallPlaner().regenerate_from_layer
"material.edit_layer", "Bonsai.DumbWall.RegenerateFromLayer", wall.DumbWallPlaner().regenerate_from_layer
)
ifcopenshell.api.add_post_listener(
"type.assign_type", "BlenderBIM.DumbWall.RegenerateFromType", wall.DumbWallPlaner().regenerate_from_type
"type.assign_type", "Bonsai.DumbWall.RegenerateFromType", wall.DumbWallPlaner().regenerate_from_type
)
ifcopenshell.api.add_post_listener(
"geometry.add_representation", "BlenderBIM.DumbSlab.CalculateQuantities", slab.calculate_quantities
"geometry.add_representation", "Bonsai.DumbSlab.CalculateQuantities", slab.calculate_quantities
)
ifcopenshell.api.add_post_listener(
"material.edit_layer", "BlenderBIM.DumbSlab.RegenerateFromLayer", slab.DumbSlabPlaner().regenerate_from_layer
"material.edit_layer", "Bonsai.DumbSlab.RegenerateFromLayer", slab.DumbSlabPlaner().regenerate_from_layer
)
ifcopenshell.api.add_post_listener(
"type.assign_type", "BlenderBIM.DumbSlab.RegenerateFromType", slab.DumbSlabPlaner().regenerate_from_type
"type.assign_type", "Bonsai.DumbSlab.RegenerateFromType", slab.DumbSlabPlaner().regenerate_from_type
)
ifcopenshell.api.add_post_listener(
"material.edit_profile",
"BlenderBIM.DumbProfile.RegenerateFromProfile",
"Bonsai.DumbProfile.RegenerateFromProfile",
profile.DumbProfileRegenerator().regenerate_from_profile,
)
ifcopenshell.api.add_post_listener(
"type.assign_type",
"BlenderBIM.DumbProfile.RegenerateFromType",
"Bonsai.DumbProfile.RegenerateFromType",
profile.DumbProfileRegenerator().regenerate_from_type,
)
ifcopenshell.api.add_post_listener(
"type.assign_type",
"BlenderBIM.Opening.RegenerateFromType",
"Bonsai.Opening.RegenerateFromType",
opening.FilledOpeningGenerator().regenerate_from_type,
)
@@ -139,7 +139,7 @@ class DumbProfileGenerator:
tool.Blender.remove_data_block(mesh)
pset = ifcopenshell.api.run("pset.add_pset", self.file, product=element, name="EPset_Parametric")
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Engine": "BlenderBIM.DumbProfile"})
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Engine": "Bonsai.DumbProfile"})
obj.select_set(True)
@@ -42,7 +42,7 @@ def calculate_quantities(usecase_path, ifc_file, settings):
obj = settings["blender_object"]
product = ifc_file.by_id(obj.BIMObjectProperties.ifc_definition_id)
parametric = ifcopenshell.util.element.get_psets(product).get("EPset_Parametric")
if not parametric or "Engine" not in parametric or parametric["Engine"] != "BlenderBIM.DumbLayer3":
if not parametric or "Engine" not in parametric or parametric["Engine"] != "Bonsai.DumbLayer3":
return
qto = ifcopenshell.api.run(
"pset.add_qto", ifc_file, should_run_listeners=False, product=product, name="Qto_SlabBaseQuantities"
@@ -219,7 +219,7 @@ class DumbSlabGenerator:
)
pset = ifcopenshell.api.run("pset.add_pset", self.file, product=element, name="EPset_Parametric")
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Engine": "BlenderBIM.DumbLayer3"})
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Engine": "Bonsai.DumbLayer3"})
obj.select_set(True)
return obj
@@ -149,7 +149,7 @@ class BIM_PT_authoring(Panel):
bl_idname = "BIM_PT_authoring"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "BlenderBIM"
bl_category = "Bonsai"
def draw(self, context):
row = self.layout.row(align=True)
@@ -1019,7 +1019,7 @@ class DumbWallGenerator:
)
tool.Blender.remove_data_block(mesh)
pset = ifcopenshell.api.run("pset.add_pset", self.file, product=element, name="EPset_Parametric")
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Engine": "BlenderBIM.DumbLayer2"})
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Engine": "Bonsai.DumbLayer2"})
obj.select_set(True)
return obj
@@ -1033,7 +1033,7 @@ def calculate_quantities(usecase_path, ifc_file, settings):
obj = settings["blender_object"]
product = ifc_file.by_id(obj.BIMObjectProperties.ifc_definition_id)
parametric = ifcopenshell.util.element.get_psets(product).get("EPset_Parametric")
if not parametric or "Engine" not in parametric or parametric["Engine"] != "BlenderBIM.DumbLayer2":
if not parametric or "Engine" not in parametric or parametric["Engine"] != "Bonsai.DumbLayer2":
return
qto = ifcopenshell.api.run(
"pset.add_qto", ifc_file, should_run_listeners=False, product=product, name="Qto_WallBaseQuantities"
@@ -37,9 +37,9 @@ classes = (
operator.AssignRecurrencePattern,
operator.AssignSuccessor,
operator.AssignWorkSchedule,
operator.BlenderBIM_DatePicker,
operator.BlenderBIM_DatePickerSetDate,
operator.BlenderBIM_RedrawDatePicker,
operator.Bonsai_DatePicker,
operator.Bonsai_DatePickerSetDate,
operator.Bonsai_RedrawDatePicker,
operator.CalculateTaskDuration,
operator.ClearPreviousAnimation,
operator.ContractAllTasks,
@@ -1135,7 +1135,7 @@ class VisualiseWorkScheduleDateRange(bpy.types.Operator):
return {"FINISHED"}
class BlenderBIM_DatePicker(bpy.types.Operator):
class Bonsai_DatePicker(bpy.types.Operator):
bl_label = "Date Picker"
bl_idname = "bim.datepicker"
bl_options = {"REGISTER", "UNDO"}
@@ -1208,7 +1208,7 @@ class BlenderBIM_DatePicker(bpy.types.Operator):
parent[prop] = value
class BlenderBIM_DatePickerSetDate(bpy.types.Operator):
class Bonsai_DatePickerSetDate(bpy.types.Operator):
bl_label = "Set Date"
bl_idname = "bim.datepicker_setdate"
bl_options = {"REGISTER", "UNDO"}
@@ -1219,7 +1219,7 @@ class BlenderBIM_DatePickerSetDate(bpy.types.Operator):
return {"FINISHED"}
class BlenderBIM_RedrawDatePicker(bpy.types.Operator):
class Bonsai_RedrawDatePicker(bpy.types.Operator):
bl_label = "Redraw Datepicker Window"
bl_idname = "bim.redraw_datepicker"
bl_options = {"REGISTER", "UNDO"}
+3 -3
View File
@@ -246,7 +246,7 @@ class SelectSchemaDir(bpy.types.Operator):
class FileAssociate(bpy.types.Operator):
bl_idname = "bim.file_associate"
bl_label = "Associate BlenderBIM with *.ifc files"
bl_label = "Associate Bonsai with *.ifc files"
bl_options = {"REGISTER", "UNDO"}
bl_description = "Creates a Desktop launcher and associates it with IFC files"
@@ -352,7 +352,7 @@ class FileAssociate(bpy.types.Operator):
class FileUnassociate(bpy.types.Operator):
bl_idname = "bim.file_unassociate"
bl_label = "Remove BlenderBIM *.ifc association"
bl_label = "Remove Bonsai *.ifc association"
bl_options = {"REGISTER", "UNDO"}
bl_description = "Removes Desktop launcher and unassociates it with IFC files"
@@ -420,7 +420,7 @@ class OpenUpstream(bpy.types.Operator):
elif self.page == "docs":
webbrowser.open("https://docs.blenderbim.org/")
elif self.page == "wiki":
webbrowser.open("https://wiki.osarch.org/index.php?title=Category:BlenderBIM_Add-on")
webbrowser.open("https://wiki.osarch.org/index.php?title=Category:Bonsai")
elif self.page == "community":
webbrowser.open("https://community.osarch.org/")
elif self.page == "fund":
+3 -3
View File
@@ -440,8 +440,8 @@ class BIM_PT_tabs(Panel):
box = self.layout.box()
box.alert = True
box.label(text="BlenderBIM requires Blender to restart.", icon="ERROR")
box.label(text="BlenderBIM was reinstalled in the current session:")
box.label(text="Bonsai requires Blender to restart.", icon="ERROR")
box.label(text="Bonsai was reinstalled in the current session:")
box.label(text=f"{blenderbim.FIRST_INSTALLED_BBIM_VERSION} -> {blenderbim.REINSTALLED_BBIM_VERSION}")
box.label(text="Please restart Blender to avoid potential issues.")
box.operator("bim.restart_blender", text="Restart Blender", icon="BLENDER")
@@ -450,7 +450,7 @@ class BIM_PT_tabs(Panel):
box = self.layout.box()
box.alert = True
row = box.row(align=True)
row.label(text="BlenderBIM experienced an error :(", icon="ERROR")
row.label(text="Bonsai experienced an error :(", icon="ERROR")
row.operator("bim.close_error", text="", icon="CANCEL")
if platform.system() == "Windows":
box.operator("wm.console_toggle", text="View the console for full logs.", icon="CONSOLE")
+1 -1
View File
@@ -118,7 +118,7 @@ class Web(blenderbim.core.tool.Web):
/ "site-packages"
)
else:
addon = [a for a in addon_utils.modules() if a.bl_info["name"] == "BlenderBIM"][0]
addon = [a for a in addon_utils.modules() if a.bl_info["name"] == "Bonsai"][0]
blenderbim_path = os.path.dirname(addon.__file__)
blenderbim_lib_path = os.path.join(blenderbim_path, "libs", "site", "packages")