Brush Assets: Operator to edit asset metadata #120081
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#120081
Loading…
Reference in New Issue
No description provided.
Delete Branch "HooglyBoogly/blender:brush-assets-metadata-edit-operator"
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?
Add an operator to edit the catalog, author, and description of brush
assets. This doesn't edit the preview image yet, I prefer to add that
separately.
WIP: Brush Assets: Operator to edit asset metadatato Brush Assets: Operator to edit asset metadata@HooglyBoogly how about license and copyright? They're part of the asset metadata in asset browser. Thumbnail too technically
Since brushes aren't included in renders or shipped in files, I'm not sure either of those are so important. They can always be edited in the files directly. I could add them of course, just not convinced it's worth the space. I mentioned thumbnails in the description-- I'll consider those separately.
I think just the catalog and the description should be enough. This is just for the user's own quick organization. Author might be useful as well, but I don't think it's necessary? No strong opinion.
Maybe the popup should have a label "Use the Asset Browser to access the full asset metadata"?
On that note, I wonder if the operator should be called "Quick Edit Metadata"?
@ -1088,0 +1119,4 @@
if (catalog_path[0]) {
const asset_system::AssetCatalog &catalog = asset_library_ensure_catalogs_in_path(
*library, catalog_path);
meta_data.catalog_id = catalog.catalog_id;
Use
BKE_asset_metadata_catalog_id_set()
?The main idea there was for the common use case of duplicating an essentials brush or a brush from someone else's library-- being able to correct the author earlier and easily sounds good.
I like that idea, but I'd rather wait until we either:
.asset.blend
files without reverting them to regular.blend
files. The current behavior is too strict IMO.Maybe, not sure though, for similar reasons as the last point.
Some inline comments that are more asking for clarification than changes I guess. Sorry if I'm being a bit dumb here, I still need to build up more of a mental model for how we deal with brushes, the asset system and the whole separate main storage at runtime.
It does seem like bit of a pain point that we have to query so many different bits of data (local active brush ID, active brush weak reference, asset representation, asset library, asset library ref, ...) in so many different ways... Seems like this should be simpler, but guess it is what it is for now.
@ -1085,0 +1097,4 @@
const Brush *brush = (paint) ? BKE_paint_brush_for_read(paint) : nullptr;
BLI_assert(ID_IS_ASSET(&brush->id));
const AssetWeakReference &brush_weak_ref = *paint->brush_asset_reference;
const asset_system::AssetRepresentation &asset = *asset::find_asset_from_weak_ref(
Usually failure should be expected and handled when looking up the asset from a weak reference. Since this is already done in the poll I guess we can skip that here, but would note that in a comment at least.
That said, an extra check here to handle the lookup failure would be trivial & safer (e.g. for when the operator is called while an asset library is being reloaded). So I'd actually prefer that.
@ -1085,0 +1192,4 @@
if (paint == nullptr || brush == nullptr) {
return false;
}
if (!ID_IS_ASSET(&brush->id)) {
I find it confusing that both the active brush and the active brush asset reference are required. But I guess they are referring to / representing the same brush asset? And the local brush is in the separate main?
To add to that, if this is indeed the imported brush asset, I guess it relies on not clearing the asset data like we normally do. Maybe good to note somewhere that we're intentionally not doing that. E.g. in brush queries like
BKE_paint_brush_for_read()
and the import code.Yeah, exactly. I think we just use either one depending on what's more convenient.
Yes, the imported brushes are still marked as assets. That's not really related to this PR though.
@ -1085,0 +1204,4 @@
const asset_system::AssetRepresentation *asset = asset::find_asset_from_weak_ref(
*C, *brush_weak_ref, nullptr);
if (!asset) {
BLI_assert_unreachable();
I think failure is valid here? The asset might not be available anymore, for various reasons, but the weak reference may still be set. I'd hope that the name "weak" reference makes this clear enough :)