mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
Multifile properties to show selected paths
Before - https://i.imgur.com/AkPvTy3.png After - https://i.imgur.com/znxLqb7.png
This commit is contained in:
@@ -184,15 +184,25 @@ class MultipleFileSelect(PropertyGroup):
|
|||||||
new.name = os.path.join(dirname, f)
|
new.name = os.path.join(dirname, f)
|
||||||
|
|
||||||
def layout_file_select(self, layout: bpy.types.UILayout, filter_glob: str = "", text: str = "") -> None:
|
def layout_file_select(self, layout: bpy.types.UILayout, filter_glob: str = "", text: str = "") -> None:
|
||||||
if len(self.file_list) > 1:
|
# NOTE: current multifile selector design doesn't allow selecting files from different folders.
|
||||||
layout.label(text=f"{len(self.file_list)} Files Selected")
|
column = layout.column(align=True)
|
||||||
|
multiple_files = len(self.file_list) > 1
|
||||||
|
row = column.row(align=True)
|
||||||
|
if multiple_files:
|
||||||
|
row.label(text=f"{len(self.file_list)} Files Selected")
|
||||||
else:
|
else:
|
||||||
layout.prop(self, "single_file", text=text)
|
row.prop(self, "single_file", text=text)
|
||||||
|
|
||||||
layout.context_pointer_set("file_props", self)
|
row.context_pointer_set("file_props", self)
|
||||||
op = layout.operator("bim.multiple_file_selector", icon="FILE_FOLDER", text="")
|
op = row.operator("bim.multiple_file_selector", icon="FILE_FOLDER", text="")
|
||||||
op.filter_glob = filter_glob
|
op.filter_glob = filter_glob
|
||||||
|
|
||||||
|
if not multiple_files:
|
||||||
|
return
|
||||||
|
|
||||||
|
for file in self.file_list:
|
||||||
|
column.prop(file, "name", text="")
|
||||||
|
|
||||||
|
|
||||||
def update_attribute_value(self: "Attribute", context: bpy.types.Context) -> None:
|
def update_attribute_value(self: "Attribute", context: bpy.types.Context) -> None:
|
||||||
value_name = self.get_value_name()
|
value_name = self.get_value_name()
|
||||||
|
|||||||
Reference in New Issue
Block a user