diff --git a/src/blenderbim/blenderbim/bim/data/window/typical/IfcWindowLiningProperties.csv b/src/blenderbim/blenderbim/bim/data/window/typical/IfcWindowLiningProperties.csv deleted file mode 100644 index 2c7207fe62..0000000000 --- a/src/blenderbim/blenderbim/bim/data/window/typical/IfcWindowLiningProperties.csv +++ /dev/null @@ -1,2 +0,0 @@ -Name,foo -TransomThickness,500 diff --git a/src/blenderbim/blenderbim/bim/data/workspace.blend b/src/blenderbim/blenderbim/bim/data/workspace.blend new file mode 100644 index 0000000000..1327250c42 Binary files /dev/null and b/src/blenderbim/blenderbim/bim/data/workspace.blend differ diff --git a/src/blenderbim/blenderbim/bim/handler.py b/src/blenderbim/blenderbim/bim/handler.py index 6075d7d8d1..85f05eacab 100644 --- a/src/blenderbim/blenderbim/bim/handler.py +++ b/src/blenderbim/blenderbim/bim/handler.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU General Public License # along with BlenderBIM Add-on. If not, see . +import os import bpy import json import addon_utils @@ -30,6 +31,7 @@ from mathutils import Vector from math import cos, degrees +cwd = os.path.dirname(os.path.realpath(__file__)) global_subscription_owner = object() @@ -296,3 +298,26 @@ def setDefaultProperties(scene): ifcopenshell.api.owner.settings.get_user = lambda ifc: core_owner.get_user(tool.Owner) ifcopenshell.api.owner.settings.get_application = get_application AuthoringData.type_thumbnails = {} + + if bpy.context.preferences.addons["blenderbim"].preferences.should_setup_workspace: + if "BIM" in bpy.data.workspaces: + bpy.context.window.workspace = bpy.data.workspaces["BIM"] + else: + bpy.ops.workspace.append_activate(idname="BIM", filepath=os.path.join(cwd, "data", "workspace.blend")) + + for obj in [bpy.data.objects.get("Camera"), bpy.data.objects.get("Light")]: + if obj: + bpy.data.objects.remove(obj) + + for panel in [ + "SCENE_PT_scene", + "SCENE_PT_unit", + "SCENE_PT_physics", + "SCENE_PT_rigid_body_world", + "SCENE_PT_audio", + "SCENE_PT_keying_sets", + ]: + try: + bpy.utils.unregister_class(getattr(bpy.types, panel)) + except: + pass diff --git a/src/blenderbim/blenderbim/bim/ui.py b/src/blenderbim/blenderbim/bim/ui.py index 4d8ab1120a..c0ef075f35 100644 --- a/src/blenderbim/blenderbim/bim/ui.py +++ b/src/blenderbim/blenderbim/bim/ui.py @@ -133,6 +133,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences): spreadsheet_command: StringProperty(name="Spreadsheet Command", description="E.g. [['libreoffice', path]]") openlca_port: IntProperty(name="OpenLCA IPC Port", default=8080) should_hide_empty_props: BoolProperty(name="Should Hide Empty Properties", default=True) + should_setup_workspace: BoolProperty(name="Should Setup Workspace Layout for BIM", default=True) should_play_chaching_sound: BoolProperty( name="Should Make A Cha-Ching Sound When Project Costs Updates", default=False ) @@ -209,6 +210,8 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences): row = layout.row() row.prop(self, "should_hide_empty_props") row = layout.row() + row.prop(self, "should_setup_workspace") + row = layout.row() row.prop(self, "should_play_chaching_sound") row = layout.row() row.prop(self, "lock_grids_on_import") @@ -493,7 +496,7 @@ class UIData: @classmethod def load(cls): - cls.data = { "version": cls.version() } + cls.data = {"version": cls.version()} cls.is_loaded = True @classmethod