add filtering to window manager to only show folders and images since this is what the user wants to see when using this addon #104845

Merged
Germano Cavalcante merged 3 commits from DanielGrauer/blender-addons:brushset-import-filter-files into main 2023-09-25 22:06:29 +02:00
1 changed files with 11 additions and 1 deletions

View File

@ -11,7 +11,7 @@ from bpy.props import (
bl_info = {
"name": "Import BrushSet",
"author": "Daniel Grauer (kromar), CansecoGPC",
"version": (1, 3, 0),
"version": (1, 3, 1),
"blender": (2, 80, 0),
"location": "File > Import > BrushSet",
"description": "Imports all image files from a folder.",
@ -61,6 +61,16 @@ class BrushSetImporter(bpy.types.Operator):
bl_idname = "import_image.brushset"
bl_label = "Import BrushSet"
# creating a temporary filter to avoid overriding the users filters
temp_filters: bool = True
def draw(self, context):
if self.temp_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.temp_filters = False
directory: StringProperty(
name="Directory",
description="Directory",