Fix: ensure loaded path is folder and not file #104812

Closed
Daniel Grauer wants to merge 4 commits from DanielGrauer:fix-error-when-file-is-selected into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 9bedba2ac5 - Show all commits

View File

@ -90,6 +90,13 @@ class BrushSetImporter(bpy.types.Operator):
directory: bpy.props.StringProperty(name="Directory", options={"HIDDEN"}) directory: bpy.props.StringProperty(name="Directory", options={"HIDDEN"})
set_default_filters: bool = True
def draw(self, context):
if self.set_default_filters:
context.space_data.params.use_filter = True
context.space_data.params.use_filter_folder = True
context.space_data.params.use_filter_image = True
self.set_default_filters = False
def execute(self, context): def execute(self, context):
LoadBrushSet(self.directory) LoadBrushSet(self.directory)