New UI to set features dir and diff JSON file

This commit is contained in:
Dion Moult
2019-10-29 18:13:10 +11:00
parent e2764c9764
commit 0a610f88e0
3 changed files with 72 additions and 0 deletions
@@ -18,6 +18,8 @@ classes = (
operator.AssignClass,
operator.SelectClass,
operator.SelectType,
operator.SelectFeaturesDir,
operator.SelectDiffJsonFile,
operator.SelectDataDir,
operator.SelectSchemaDir,
operator.ExportIFC,
@@ -53,6 +55,8 @@ classes = (
ui.BIMMeshProperties,
ui.GISPanel,
ui.BIMPanel,
ui.QAPanel,
ui.DiffPanel,
ui.MVDPanel,
ui.MaterialPanel,
ui.MeshPanel,
@@ -384,6 +384,32 @@ class SelectExternalMaterialDir(bpy.types.Operator):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
class SelectDiffJsonFile(bpy.types.Operator):
bl_idname = "bim.select_diff_json_file"
bl_label = "Select Diff JSON File"
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
bpy.context.scene.BIMProperties.diff_json_file = self.filepath
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
class SelectFeaturesDir(bpy.types.Operator):
bl_idname = "bim.select_features_dir"
bl_label = "Select Features Directory"
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
bpy.context.scene.BIMProperties.features_dir = self.filepath
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
class SelectDataDir(bpy.types.Operator):
bl_idname = "bim.select_data_dir"
bl_label = "Select Data Directory"
+42
View File
@@ -49,6 +49,8 @@ class BIMProperties(bpy.types.PropertyGroup):
pset_file: bpy.props.EnumProperty(items=getPsetFiles, name="Pset File")
has_georeferencing: bpy.props.BoolProperty(name="Has Georeferencing", default=False)
global_id: bpy.props.StringProperty(name="GlobalId")
features_dir: bpy.props.StringProperty(default='', name="Features Directory")
diff_json_file: bpy.props.StringProperty(default='', name="Diff JSON File")
class MapConversion(bpy.types.PropertyGroup):
eastings: bpy.props.StringProperty(name="Eastings")
@@ -301,6 +303,26 @@ class BIMPanel(bpy.types.Panel):
row.operator("bim.assign_pset")
row.operator("bim.unassign_pset")
class QAPanel(bpy.types.Panel):
bl_label = "BIMTester Quality Auditing"
bl_idname = "BIM_PT_qa"
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 = bpy.context.scene.BIMProperties
layout.label(text="Gherkin Setup:")
row = layout.row(align=True)
row.prop(bim_properties, "features_dir")
row.operator("bim.select_features_dir", icon="FILE_FOLDER", text="")
layout.label(text="Quality Auditing:")
row = layout.row()
@@ -319,6 +341,26 @@ class BIMPanel(bpy.types.Panel):
row = layout.row()
row.operator("bim.select_audited")
class DiffPanel(bpy.types.Panel):
bl_label = "IFC Diff"
bl_idname = "BIM_PT_diff"
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 = bpy.context.scene.BIMProperties
layout.label(text="IFC Diff Setup:")
row = layout.row(align=True)
row.prop(bim_properties, "diff_json_file")
row.operator("bim.select_diff_json_file", icon="FILE_FOLDER", text="")
class MVDPanel(bpy.types.Panel):
bl_label = "Model View Definitions"
bl_idname = "BIM_PT_mvd"