Brush Assets: Add library choice to "Save As" operator #118021

Merged
Hans Goudey merged 14 commits from HooglyBoogly/blender:brush-assets-save-library-option into brush-assets-project 2024-02-14 17:36:57 +01:00
Member

Previously the new brush would always be saved to the default library.
Now the user is presented with a choice that defaults to the library marked
as "Default" in the preferences.

Because the library is now chosen by an operator property, we can't check
its editable status in the poll function. Instead we just check it when the
operator executes.


image

Previously the new brush would always be saved to the default library. Now the user is presented with a choice that defaults to the library marked as "Default" in the preferences. Because the library is now chosen by an operator property, we can't check its editable status in the poll function. Instead we just check it when the operator executes. --- ![image](/attachments/2e435914-7864-44b0-97e8-85aae444717f)
Hans Goudey added 6 commits 2024-02-09 00:36:05 +01:00
Hans Goudey requested review from Brecht Van Lommel 2024-02-09 00:36:18 +01:00
Hans Goudey added this to the Brush Assets & Asset Shelf project 2024-02-09 00:36:23 +01:00
Brecht Van Lommel requested changes 2024-02-09 12:26:58 +01:00
Brecht Van Lommel left a comment
Owner

Because the library is now chosen by an operator property, we can't check
its editable status in the poll function. Instead we just check it when the
operator executes.

Can we make a custom ot->ui callback and check it there? Seems not great to have it fail later.

> Because the library is now chosen by an operator property, we can't check > its editable status in the poll function. Instead we just check it when the > operator executes. Can we make a custom `ot->ui` callback and check it there? Seems not great to have it fail later.
@ -1203,4 +1204,1 @@
const bUserAssetLibrary *user_library = brush_asset_get_default_library();
if (user_library == nullptr || user_library->dirpath[0] == '\0') {
CTX_wm_operator_poll_msg_set(C, "No default asset library available to save to");

If there is no user asset library at all, I think it's still fine for this poll to return false.

If there is no user asset library at all, I think it's still fine for this poll to return false.
Author
Member

I looked into that, but I realized I wasn't sure about the premise. The old poll check mentions:

Check if the asset belongs to an editable blend file

Since the source and destination library may be different, and since can just create a new editable file if the existing file isn't editable, maybe we don't need this check at all.

I looked into that, but I realized I wasn't sure about the premise. The old poll check mentions: >Check if the asset belongs to an editable blend file Since the source and destination library may be different, and since can just create a new editable file if the existing file isn't editable, maybe we don't need this check at all.
Hans Goudey added 2 commits 2024-02-14 17:00:51 +01:00
Hans Goudey added 4 commits 2024-02-14 17:13:42 +01:00
Brecht Van Lommel approved these changes 2024-02-14 17:30:58 +01:00
Hans Goudey added 2 commits 2024-02-14 17:35:36 +01:00
Hans Goudey merged commit a2768e3066 into brush-assets-project 2024-02-14 17:36:57 +01:00
Hans Goudey deleted branch brush-assets-save-library-option 2024-02-14 17:37:00 +01:00
Sign in to join this conversation.
No reviewers
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 Assignees
2 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#118021
No description provided.