Fix #3632. Make search and CSV UIs share the same Blender props for DRY.

This commit is contained in:
Dion Moult
2023-08-24 17:01:25 +10:00
parent 6b05f4a2aa
commit 2333997bda
2 changed files with 4 additions and 14 deletions
+4 -2
View File
@@ -277,6 +277,8 @@ def draw_filter(layout, props, data, module):
if not data.is_loaded:
data.load()
sprops = bpy.context.scene.BIMSearchProperties
if tool.Ifc.get():
row = layout.row(align=True)
row.label(text=f"{len(data.data['saved_searches'])} Saved Searches")
@@ -293,9 +295,9 @@ def draw_filter(layout, props, data, module):
box = layout.box()
row = box.row(align=True)
row.prop(props, "facet", text="")
row.prop(sprops, "facet", text="")
op = row.operator("bim.add_filter", text="Add Filter", icon="ADD")
op.type = props.facet
op.type = sprops.facet
op.index = i
op.module = module
@@ -64,18 +64,6 @@ class CsvProperties(PropertyGroup):
csv_ifc_file: StringProperty(default="", name="IFC File")
ifc_selector: StringProperty(default="", name="IFC Selector")
filter_groups: CollectionProperty(type=BIMFilterGroup, name="Filter Groups")
facet: EnumProperty(
items=[
("entity", "Class", "", "FILE_3D", 0),
("attribute", "Attribute", "", "COPY_ID", 1),
("property", "Property", "", "PROPERTIES", 2),
("material", "Material", "", "MATERIAL", 3),
("classification", "Classification", "", "OUTLINER", 4),
("location", "Location", "", "PACKAGE", 5),
("type", "Type", "", "FILE_VOLUME", 6),
("instance", "GlobalId", "", "GRIP", 7),
],
)
csv_attributes: CollectionProperty(name="CSV Attributes", type=CsvAttribute)
should_preserve_existing: BoolProperty(default=False, name="Preserve Existing")
include_global_id: BoolProperty(default=True, name="Include GlobalId")