Import images as Brush set built in Add on not working. #86080

Open
opened 2021-02-28 11:08:06 +01:00 by Dirk · 41 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

Blender Version
Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-02-13 23:23, hash: blender/blender@f362dad19b ---- and 2.92 + 2.91
Worked: Unknown

Short description of error
File > Import > Brush set is not working .

Exact steps for others to reproduce the error
In blender 2.91 or 2.92 or 2.93

  1. Enable built in add on "Import-Export Import BrushSet"
  2. File > Import > Brush Set
  3. Select several .png images containing mask info (black and white) (zip file included)

See error message
Note the line containing the Brush 3.png . There are too many back slashes in the path.

Python: Traceback (most recent call last):
  File "C:\blender-2.93.0-f362dad19bf4-windows64\2.93\scripts\addons\io_import_BrushSet.py", line 121, in execute
    LoadBrushSet(self.properties.filepath, self.properties.filename)
  File "C:\blender-2.93.0-f362dad19bf4-windows64\2.93\scripts\addons\io_import_BrushSet.py", line 70, in LoadBrushSet
    for file in os.listdir(filepath):
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\mask_set\\Brush 3.png'

location: <unknown location>:-1

mask_set.zip

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89 **Blender Version** Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-02-13 23:23, hash: `blender/blender@f362dad19b` ---- and 2.92 + 2.91 Worked: Unknown **Short description of error** File > Import > Brush set is not working . **Exact steps for others to reproduce the error** In blender 2.91 or 2.92 or 2.93 1) Enable built in add on "Import-Export Import BrushSet" 2) File > Import > Brush Set 3) Select several .png images containing mask info (black and white) (zip file included) See error message **Note the line containing the Brush 3.png . There are too many back slashes in the path.** ``` Python: Traceback (most recent call last): File "C:\blender-2.93.0-f362dad19bf4-windows64\2.93\scripts\addons\io_import_BrushSet.py", line 121, in execute LoadBrushSet(self.properties.filepath, self.properties.filename) File "C:\blender-2.93.0-f362dad19bf4-windows64\2.93\scripts\addons\io_import_BrushSet.py", line 70, in LoadBrushSet for file in os.listdir(filepath): NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\mask_set\\Brush 3.png' location: <unknown location>:-1 ``` [mask_set.zip](https://archive.blender.org/developer/F9851433/mask_set.zip)
Author

Added subscriber: @dirk_teucher

Added subscriber: @dirk_teucher

#100490 was marked as duplicate of this issue

#100490 was marked as duplicate of this issue

blender/blender#100269 was marked as duplicate of this issue

blender/blender#100269 was marked as duplicate of this issue

#97798 was marked as duplicate of this issue

#97798 was marked as duplicate of this issue

#96024 was marked as duplicate of this issue

#96024 was marked as duplicate of this issue

#93597 was marked as duplicate of this issue

#93597 was marked as duplicate of this issue

#93028 was marked as duplicate of this issue

#93028 was marked as duplicate of this issue

#92337 was marked as duplicate of this issue

#92337 was marked as duplicate of this issue

blender/blender#92013 was marked as duplicate of this issue

blender/blender#92013 was marked as duplicate of this issue

blender/blender#89819 was marked as duplicate of this issue

blender/blender#89819 was marked as duplicate of this issue

#88864 was marked as duplicate of this issue

#88864 was marked as duplicate of this issue

#88865 was marked as duplicate of this issue

#88865 was marked as duplicate of this issue

#88821 was marked as duplicate of this issue

#88821 was marked as duplicate of this issue

#87405 was marked as duplicate of this issue

#87405 was marked as duplicate of this issue

#87365 was marked as duplicate of this issue

#87365 was marked as duplicate of this issue

Added subscriber: @rjg

Added subscriber: @rjg

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

This is a bug. The add-on doesn't process the path(s) properly (or uses the file browser incorrectly, if the user is only supposed to select a directory).

This is a bug. The add-on doesn't process the path(s) properly (or uses the file browser incorrectly, if the user is only supposed to select a directory).
Author

There is a workaround for this bug.
This bug only seems to happen when you select the images individually or as a group of images.
If you select the folder containing the brushes then click "Import BrushSet" twice then the textures do load.(2.92 + 2.93)

Selecting the folder does not work in 2.91

There is a workaround for this bug. This bug only seems to happen when you select the images individually or as a group of images. **If you select the folder containing the brushes then click "Import BrushSet" twice then the textures do load.(2.92 + 2.93)** Selecting the folder does not work in 2.91

Added subscriber: @nathan.hild

Added subscriber: @nathan.hild

Hello, I fixed the add-on to be able to select indivual images, also added a few parameters : Add fake user, Overwrite existing images, and use verbose console output. How would I go about submitting it for review, if possible ?

The code is available over on https://github.com/Gorgious56/io_import_BrushSet/blob/main/io_import_BrushSet.py

Hello, I fixed the add-on to be able to select indivual images, also added a few parameters : Add fake user, Overwrite existing images, and use verbose console output. How would I go about submitting it for review, if possible ? The code is available over on https://github.com/Gorgious56/io_import_BrushSet/blob/main/io_import_BrushSet.py

@nathan.hild Please submit a patch as explained in the [code review page ]] in our Wiki. You can either use arcanist (section "Use Arcanist") or submit a plain diff (section "Upload a Diff"). I would suggest you split the parts that fix bugs and add new features if that is possible. In general it's a good idea to follow the [ https:*wiki.blender.org/wiki/Process/Contributing_Code | Ingredients of a Patch for new features.

If you have questions about the process, people on the blender-coders channel on blender.chat will help you.

@nathan.hild Please submit a patch as explained in the [code review page ]] in our Wiki. You can either use arcanist (section "Use Arcanist") or submit a plain diff (section "Upload a Diff"). I would suggest you split the parts that fix bugs and add new features if that is possible. In general it's a good idea to follow the [[ https:*wiki.blender.org/wiki/Process/Contributing_Code | Ingredients of a Patch ](https:*wiki.blender.org/wiki/Tools/CodeReview) for new features. If you have questions about the process, people on the [blender-coders ](https://blender.chat/channel/blender-coders) channel on blender.chat will help you.

Alright ! That was not without a sweat but I finally managed to commit it :

https://developer.blender.org/D10572

As you suggested this commit only contains the fix to allow users to select individual files.
I plan on updating it further if my addition is accepted by the team.

I guess I have to ping some developper to review it, how do I choose ? The add-ons modules mentions Campbell Barton, Bastien Montagne, Brendon Murphy, Jacques Lucke, Sybren Stüvel.

Thanks for the pointers :)

Alright ! That was not without a sweat but I finally managed to commit it : https://developer.blender.org/D10572 As you suggested this commit only contains the fix to allow users to select individual files. I plan on updating it further if my addition is accepted by the team. I guess I have to ping some developper to review it, how do I choose ? The add-ons modules mentions Campbell Barton, Bastien Montagne, Brendon Murphy, Jacques Lucke, Sybren Stüvel. Thanks for the pointers :)

Added subscriber: @titan2792

Added subscriber: @titan2792
Author

Does this still need to be reviewed? Or has it been merged into master?

Does this still need to be reviewed? Or has it been merged into master?

@dirk_teucher The patch has not been reviewed yet.

@dirk_teucher The patch has not been reviewed yet.

Added subscriber: @waltage

Added subscriber: @waltage

Added subscriber: @markli

Added subscriber: @markli

Added subscriber: @GavinWyatt

Added subscriber: @GavinWyatt

Added subscriber: @CarlForeman

Added subscriber: @CarlForeman

Added subscriber: @Narek-1

Added subscriber: @Narek-1
Member

Added subscribers: @Laci, @PratikPB2123

Added subscribers: @Laci, @PratikPB2123

Hello, could we maybe talk about assigning someone to this task ?

It looks like the combined time it took bug triagers and bug reporters up until this point outweighs the time it may take someone to look over the 26 lines I changed in the addon code :p

Cheers

Hello, could we maybe talk about assigning someone to this task ? It looks like the combined time it took bug triagers and bug reporters up until this point outweighs the time it may take someone to look over the 26 lines I changed in the addon code :p Cheers
Member

Added subscriber: @DannyBCreative

Added subscriber: @DannyBCreative
Member

Added subscriber: @plazma

Added subscriber: @plazma

Added subscriber: @Nico-Traber

Added subscriber: @Nico-Traber

Added subscribers: @Shady.Hamza, @ThomasDinges

Added subscribers: @Shady.Hamza, @ThomasDinges

Added subscriber: @MIDIManNI

Added subscriber: @MIDIManNI

Added subscriber: @hamiltonjr2

Added subscriber: @hamiltonjr2

Added subscriber: @gundanlei

Added subscriber: @gundanlei
Member

Alright ! That was not without a sweat but I finally managed to commit it :

https://developer.blender.org/D10572

@nathan.hild hi, can you submit PR for it?
@ideasman42 , can you review it? original author of the add-on doesn't seem active anymore.

> Alright ! That was not without a sweat but I finally managed to commit it : > > https://developer.blender.org/D10572 @nathan.hild hi, can you submit PR for it? @ideasman42 , can you review it? original author of the add-on doesn't seem active anymore.
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#86080
No description provided.