Brush Assets: Add catalog option to asset pushing operator #118382

Merged
Hans Goudey merged 26 commits from HooglyBoogly/blender:brush-assets-save-catalog-option into brush-assets-project 2024-02-21 14:03:41 +01:00
Member

Adds the ability to choose which of the libraries catalogs to add the
new asset to, or to create a new catalog. The catalogs are presented
in a dropdown list, and every hierarchy level is available. Eventually
we might want some form of tree view here. But for now this approach is
very simple.


Screenshot from 2024-02-16 10-45-36
Screenshot from 2024-02-16 10-45-10

Adds the ability to choose which of the libraries catalogs to add the new asset to, or to create a new catalog. The catalogs are presented in a dropdown list, and every hierarchy level is available. Eventually we might want some form of tree view here. But for now this approach is very simple. --- ![Screenshot from 2024-02-16 10-45-36](/attachments/8f5929a3-72fd-4fb4-b7fe-001464457dda) ![Screenshot from 2024-02-16 10-45-10](/attachments/cd7b1bc0-891c-48f3-a76b-4508aecdde7d)
Hans Goudey added 16 commits 2024-02-16 15:26:28 +01:00
Hans Goudey added 3 commits 2024-02-16 16:46:18 +01:00
Hans Goudey added 2 commits 2024-02-16 16:51:20 +01:00
Hans Goudey added 2 commits 2024-02-16 17:08:33 +01:00
Hans Goudey requested review from Brecht Van Lommel 2024-02-16 17:24:06 +01:00
Hans Goudey requested review from Julian Eisel 2024-02-16 17:24:06 +01:00
Hans Goudey added this to the Brush Assets & Asset Shelf project 2024-02-16 17:24:14 +01:00
Hans Goudey added 1 commit 2024-02-16 17:25:37 +01:00
Julian Eisel reviewed 2024-02-16 18:11:11 +01:00
@ -1252,0 +1274,4 @@
/* Adding multiple catalogs in a path at a time with #AssetCatalogService::create_catalog()
* doesn't work; add each potentially new catalog in the hierarchy manually here. */
asset_system::AssetCatalogPath parent = "";
path.iterate_components([&](StringRef component_name, bool /*is_last_component*/) {
Member

Creating a catalog with missing parent catalogs should work fine, the parents would be created with create_missing_catalogs(). Is this not working for you?

Creating a catalog with missing parent catalogs should work fine, the parents would be created with `create_missing_catalogs()`. Is this not working for you?
Author
Member

No, that's the infinite recursion I was mentioning in chat. It creates the missing parent catalogs with a null catalog ID and an empty simple name. If you want, you should be able to reproduce it by calling asset_library_ensure_catalog instead of asset_library_ensure_catalogs_in_path below.

No, that's the infinite recursion I was mentioning in chat. It creates the missing parent catalogs with a null catalog ID and an empty simple name. If you want, you should be able to reproduce it by calling `asset_library_ensure_catalog` instead of `asset_library_ensure_catalogs_in_path` below.
Brecht Van Lommel approved these changes 2024-02-16 19:42:20 +01:00
Brecht Van Lommel left a comment
Owner

Great, looks fine from my side with minor suggestions.

Great, looks fine from my side with minor suggestions.
@ -1295,0 +1327,4 @@
asset_system::AssetLibrary *library = AS_asset_library_load(
CTX_data_main(C), user_library_to_library_ref(*user_library));
if (!library) {
return OPERATOR_CANCELLED;

Maybe add:

    BKE_report(op->reports, RPT_ERROR, "Failed to load asset library");
Maybe add: ``` BKE_report(op->reports, RPT_ERROR, "Failed to load asset library"); ```
Hans Goudey added 1 commit 2024-02-20 21:42:56 +01:00
Hans Goudey added 1 commit 2024-02-20 21:49:37 +01:00
Hans Goudey merged commit 633e0a6b3a into brush-assets-project 2024-02-21 14:03:41 +01:00
Hans Goudey deleted branch brush-assets-save-catalog-option 2024-02-21 14:03:43 +01:00
Sign in to join this conversation.
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
3 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#118382
No description provided.