Workspace inspired by IFCArchitect's layout is now setup by default and irrelevant Blender scene panels are hidden. You can disable this behaviour for advanced users, or use your own workspace layout but at least now there is a better "BIM-optimised" layout.

The layout uses three columns with a focus on a larger outliner (important as BIM models have lots of objects and complex hierarchies!) and properties, and removes the mostly irrelevant timeline for beginners.
This commit is contained in:
Dion Moult
2023-07-08 16:26:21 +10:00
parent 52ac1090e9
commit 8cb63720eb
4 changed files with 29 additions and 3 deletions
@@ -1,2 +0,0 @@
Name,foo
TransomThickness,500
1 Name foo
2 TransomThickness 500
Binary file not shown.
+25
View File
@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>. # along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import os
import bpy import bpy
import json import json
import addon_utils import addon_utils
@@ -30,6 +31,7 @@ from mathutils import Vector
from math import cos, degrees from math import cos, degrees
cwd = os.path.dirname(os.path.realpath(__file__))
global_subscription_owner = object() 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_user = lambda ifc: core_owner.get_user(tool.Owner)
ifcopenshell.api.owner.settings.get_application = get_application ifcopenshell.api.owner.settings.get_application = get_application
AuthoringData.type_thumbnails = {} 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
+4 -1
View File
@@ -133,6 +133,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
spreadsheet_command: StringProperty(name="Spreadsheet Command", description="E.g. [['libreoffice', path]]") spreadsheet_command: StringProperty(name="Spreadsheet Command", description="E.g. [['libreoffice', path]]")
openlca_port: IntProperty(name="OpenLCA IPC Port", default=8080) openlca_port: IntProperty(name="OpenLCA IPC Port", default=8080)
should_hide_empty_props: BoolProperty(name="Should Hide Empty Properties", default=True) 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( should_play_chaching_sound: BoolProperty(
name="Should Make A Cha-Ching Sound When Project Costs Updates", default=False 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 = layout.row()
row.prop(self, "should_hide_empty_props") row.prop(self, "should_hide_empty_props")
row = layout.row() row = layout.row()
row.prop(self, "should_setup_workspace")
row = layout.row()
row.prop(self, "should_play_chaching_sound") row.prop(self, "should_play_chaching_sound")
row = layout.row() row = layout.row()
row.prop(self, "lock_grids_on_import") row.prop(self, "lock_grids_on_import")
@@ -493,7 +496,7 @@ class UIData:
@classmethod @classmethod
def load(cls): def load(cls):
cls.data = { "version": cls.version() } cls.data = {"version": cls.version()}
cls.is_loaded = True cls.is_loaded = True
@classmethod @classmethod