IO: Store last file select directory info in file handlers #116999
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116999
Loading…
Reference in New Issue
No description provided.
Delete Branch "guishe:fh-last-dirpath"
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?
Currently the filesel window depends on operator filepath
properties to allow reuse last operator import/export paths
to open automatically the last folder used by the user, and this
depends that the properties does not have a
PROP_SKIP_SAVE
flag.However this has 2 drawbacks:
Since operators can be invoked with drag path data,
operator presets will override this filepath information.
If this filepath properties are defined with update function callbacks,
operator presets would override filepath properties and trigger this callbacks,
but when the user click
import/export
the operator filepath properties are updated againwith the selected fielpath data from the filesel window, that could lead inconsistent behavior.
Instead now the operator will keep track of the last directory used on it owns file handler.
I don't really understand this problem.
To me it seems like reasonable behavior for drag & drop to affect this.
Is this an actual problem you encountered in an add-on?
I don't really understand what this inconsistent behavior is that would be triggered by calling update twice.
This is the 1st problem:
Preset would override drag-n-drop data
Not exactly, but let's say someone wants to create a addon that imports files, but the operator requires to read metadata from the file and adds more menu settings as needed. If presets are selected will override operator filepath props, and and probably read metadata from another file.
This is resolved by adding
skip_save
to props and the presets will not override these neither or trigger callbacks, but withskip_save
the fileselect window would not remeber last location where this operator was used.Although currently internal operators that read files only use the
ot->check
to validate extension, so I don't know if it could be a very strong pointBut maybe the preset at all would not work too well on this scenarios
Thansk for the explanation, I can see the motivation. It still seems like a bit of a workaround for the preset problem. Maybe we need a
skip_preset
to exclude the filepath from the preset but still save it?@deadpin, do you have an opinion on this?
#116724 Resolves in some way the problem that operator presets override filepath props
Because on confirm execution the file path properties are set
This would be something that might not be so supported with #116724.
Specially since the configuration of one file is reused for all other files (in case a operator does not support multiple files
ot->exec
is called for each individually)Right, the Preset issue is what's holding up #116873 mostly. If the file path information was never stored in the preset file to begin with, we wouldn't have run into the problem.
I like the concept of using a
skip_preset
flag too since that removes the need to store the paths again here. I don't think anyone would be relying on the paths inside the preset since the File browser always uses its path information anyways but hard to know for sure. A downside ofskip_preset
is that existing preset files would trigger wrong behavior with drag'n'drop though again I'm not sure how many folks save preset files like that across versions.Actually the last part about existing preset files applies in all cases so that doesn't matter too much.
Both the
skip_preset
option and the otherWM_FILESEL_SKIP_SAVE_PROPS
option added in the other PR will result in not writing file path information into the preset file. So from that angle,skip_preset
(WM_FILESEL_SKIP_SAVE_PRESET
or similar) seems better since it doesn't require us to store the path information in the FileHandler or modify the file browser (I think).Actually, adding
PROP_HIDDEN
also prevents writing to presets and allows to reuse property values between calls, and since they're also hidden to the user...Closing since is not too necessary this, however
skip_preset
can be useful to havePull request closed