From f3bd9e4d588f4089589610e81d62fe75940b6e0b Mon Sep 17 00:00:00 2001 From: Daniel Grauer Date: Sat, 19 Aug 2023 23:27:45 +0200 Subject: [PATCH 1/3] add filtering to window manager to only show folders and images since this is what the user wants to see when using this addon --- io_import_BrushSet.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/io_import_BrushSet.py b/io_import_BrushSet.py index bd58fb37f..7db7a384d 100644 --- a/io_import_BrushSet.py +++ b/io_import_BrushSet.py @@ -61,6 +61,14 @@ class BrushSetImporter(bpy.types.Operator): bl_idname = "import_image.brushset" bl_label = "Import BrushSet" + + 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 directory: StringProperty( name="Directory", description="Directory", -- 2.30.2 From 9c768a042a9bdbe8dea46fd9a71c607a9d408938 Mon Sep 17 00:00:00 2001 From: Daniel Grauer Date: Mon, 25 Sep 2023 21:43:43 +0200 Subject: [PATCH 2/3] increase brush set addon verison --- io_import_BrushSet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_import_BrushSet.py b/io_import_BrushSet.py index 7db7a384d..6073f3334 100644 --- a/io_import_BrushSet.py +++ b/io_import_BrushSet.py @@ -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.", -- 2.30.2 From 5c8272944511fd7ab8b396889d91ff1ba914db12 Mon Sep 17 00:00:00 2001 From: Daniel Grauer Date: Mon, 25 Sep 2023 21:44:43 +0200 Subject: [PATCH 3/3] Rename property and adding documentation to clarify what it is used for. --- io_import_BrushSet.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/io_import_BrushSet.py b/io_import_BrushSet.py index 6073f3334..e841cdc32 100644 --- a/io_import_BrushSet.py +++ b/io_import_BrushSet.py @@ -62,13 +62,15 @@ class BrushSetImporter(bpy.types.Operator): bl_label = "Import BrushSet" - set_default_filters: bool = True + # creating a temporary filter to avoid overriding the users filters + temp_filters: bool = True def draw(self, context): - if self.set_default_filters: + 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.set_default_filters = False + self.temp_filters = False + directory: StringProperty( name="Directory", description="Directory", -- 2.30.2