Fix: ensure loaded path is folder and not file #104812
No reviewers
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Depends on
#104802 Cleanup: import-brush-set-replace-hardcoded-file-extensions
blender/blender-addons
Reference: blender/blender-addons#104812
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "DanielGrauer:fix-error-when-file-is-selected"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The input path to load brush sets only works with a folder as path. If a file is selected in the filemanger to load the path the import fails and throws a error. To avoid the import failing, the filename is now stripped from the path to load the folder.
This solution seems to be a workaround, is it possible to solve it without this path manipulation?
Note that this code may not be completely problem-free as it depends on the specific file system (e.g. the backslash is used as a path separator on Windows, but on Unix-based systems the separator would be a forward slash "/ ").
Rather than using such a workaround, it might be better to check how the
LoadBrushSet
function is called and ensure thatfilepath
is always given as a valid directory rather than relying on this path manipulation.Thanks a lot for the feedback, i changed it in the LoadBrushSet so only directories can be loaded and removed the "workaround". I also added a filter to show only folders and images as this is what is relevant when using this importer.
c71ff2b3ee
to1b985c5ed7
Pull request closed