WIP improved UI ordering, and print export time in console for convenience. See #1222.

This commit is contained in:
Dion Moult
2021-01-26 16:07:35 +11:00
parent fa7353c923
commit 92cb138ca8
5 changed files with 27 additions and 74 deletions
+25 -29
View File
@@ -9,38 +9,38 @@ if bpy is not None:
from . import ui, prop, operator
modules = {
"root": None,
"aggregate": None,
"attribute": None,
"project": None,
"search": None,
"bcf": None,
"clash": None,
"classification": None,
"cobie": None,
"context": None,
"constraint": None,
"covetool": None,
"csv": None,
"diff": None,
"bimtester": None,
"debug": None,
"document": None,
"geometry": None,
"root": None,
"unit": None,
"georeference": None,
"layer": None,
"context": None,
"attribute": None,
"type": None,
"spatial": None,
"void": None,
"aggregate": None,
"geometry": None,
"cobie": None,
"material": None,
"style": None,
"layer": None,
"model": None,
"owner": None,
"patch": None,
"project": None,
"pset": None,
"pset_template": None,
"qto": None,
"search": None,
"spatial": None,
"style": None,
"type": None,
"unit": None,
"void": None,
"classification": None,
"constraint": None,
"document": None,
"pset_template": None,
"clash": None,
"csv": None,
"bimtester": None,
"diff": None,
"patch": None,
"covetool": None,
"debug": None,
}
for name in modules.keys():
@@ -62,7 +62,6 @@ if bpy is not None:
operator.SelectSweptSolidInnerCurves,
operator.AssignSweptSolidExtrusion,
operator.SelectSweptSolidExtrusion,
operator.FetchLibraryInformation,
operator.FetchExternalMaterial,
operator.FetchObjectPassport,
operator.CutSection,
@@ -120,7 +119,6 @@ if bpy is not None:
prop.Sheet,
prop.BIMProperties,
prop.DocProperties,
prop.BIMLibrary,
prop.IfcParameter,
prop.BoundaryCondition,
prop.PsetQto,
@@ -137,7 +135,6 @@ if bpy is not None:
ui.BIM_PT_drawings,
ui.BIM_PT_schedules,
ui.BIM_PT_sheets,
ui.BIM_PT_library,
ui.BIM_PT_camera,
ui.BIM_PT_text,
ui.BIM_PT_annotation_utilities,
@@ -170,7 +167,6 @@ if bpy is not None:
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=prop.BIMProperties)
bpy.types.Scene.DocProperties = bpy.props.PointerProperty(type=prop.DocProperties)
bpy.types.Scene.BIMLibrary = bpy.props.PointerProperty(type=prop.BIMLibrary)
bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
bpy.types.Material.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
bpy.types.Collection.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties) # Check if we need this
@@ -5,6 +5,7 @@ from blenderbim.bim.module.aggregate.data import Data
class BIM_PT_aggregate(Panel):
bl_label = "IFC Aggregates"
bl_idname = "BIM_PT_aggregate"
bl_options = {"DEFAULT_CLOSED"}
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
@@ -96,6 +96,7 @@ class ExportIFC(bpy.types.Operator):
settings.logger.info("Starting export")
ifc_exporter.export()
settings.logger.info("Export finished in {:.2f} seconds".format(time.time() - start))
print("Export finished in {:.2f} seconds".format(time.time() - start))
if not bpy.context.scene.DocProperties.ifc_files:
new = bpy.context.scene.DocProperties.ifc_files.add()
new.name = output_file
@@ -393,15 +394,6 @@ class FetchExternalMaterial(bpy.types.Operator):
return
class FetchLibraryInformation(bpy.types.Operator):
bl_idname = "bim.fetch_library_information"
bl_label = "Fetch Library Information"
def execute(self, context):
# TODO
return {"FINISHED"}
class FetchObjectPassport(bpy.types.Operator):
bl_idname = "bim.fetch_object_passport"
bl_label = "Fetch Object Passport"
@@ -474,7 +474,6 @@ class BIMProperties(PropertyGroup):
data_dir: StringProperty(default=os.path.join(cwd, "data") + os.path.sep, name="Data Directory")
ifc_file: StringProperty(name="IFC File")
export_schema: EnumProperty(items=[("IFC4", "IFC4", ""), ("IFC2X3", "IFC2X3", "")], name="IFC Schema")
has_library: BoolProperty(name="Has Project Library", default=False)
contexts: EnumProperty(items=getContexts, name="Contexts")
available_contexts: EnumProperty(items=[("Model", "Model", ""), ("Plan", "Plan", "")], name="Available Contexts")
available_subcontexts: EnumProperty(items=getSubcontexts, name="Available Subcontexts")
@@ -531,15 +530,6 @@ class BIMProperties(PropertyGroup):
)
class BIMLibrary(PropertyGroup):
name: StringProperty(name="Name")
version: StringProperty(name="Version")
publisher: StringProperty(name="Publisher")
version_date: StringProperty(name="Version Date")
location: StringProperty(name="Location")
description: StringProperty(name="Description")
class IfcParameter(PropertyGroup):
name: StringProperty(name="Name")
step_id: IntProperty(name="STEP ID")
-26
View File
@@ -255,32 +255,6 @@ class BIM_PT_text(Panel):
row.prop(variable, "prop_key")
class BIM_PT_library(Panel):
bl_label = "IFC BIM Server Library"
bl_idname = "BIM_PT_library"
bl_options = {"DEFAULT_CLOSED"}
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
bim_properties = scene.BIMProperties
layout.row().prop(scene.BIMProperties, "has_library")
layout.label(text="Project Library:")
layout.row().prop(scene.BIMLibrary, "location")
layout.row().operator("bim.fetch_library_information")
layout.row().prop(scene.BIMLibrary, "name")
layout.row().prop(scene.BIMLibrary, "version")
layout.row().prop(scene.BIMLibrary, "version_date")
layout.row().prop(scene.BIMLibrary, "description")
class BIM_UL_generic(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
if item: