Implement Asset Traits #105808
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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.
Dependencies
No dependencies set.
Reference: blender/blender#105808
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Asset traits would be keywords that are stored in the asset metadata, and provide information about the type of an asset. For example
{"ID", "Node Tree", "Geometry Nodes"}
, or{"ID", "Brush", "Sculpt Mode"}
. Unlike tags, they are managed by Blender or add-ons, not by the user.Comprehensive design task: #105807
Implementation
AssetMetaData
IDTypeInfo.refine_asset_traits()
callback?AssetRepresentation
?Plenty of code can be copied from tags.
@Harley wanted to look into implementing the basics for this.
PR #105841 should be doing the first five items, string list of traits in AssetMetaData,
RNA access, File read/write, Index read/write, Code to add/remove traits.
It currently displays in the interface somewhat identically to "tags" so have "add" and "remove" that we (I assume) don't need or want. But I needed that for testing so assume it can be removed once confirmed correct. Currently unclear on the rest of the TODO items, but will take a look around to see if any make sense to me.
Clarification for the remaining points:
I'd imagine an API to enable something like this:
Actually, this callback should be defined in
AssetTypeInfo
, notIDTypeInfo
.It's not entirely clear when this would be called, I think for now doing it when marking as asset is enough. Doing it on file save for every asset would be the most reliable. But would rather avoid having to do that for potentially 100s of assets on every save.
There's the question if we should add asset traits for existing assets in versioning. E.g. "Object" and "ID" for object assets. Open question still. It's easy to add this later also.
Currently the "ID" and id type traits are redundant. All asset must be IDs and the ID type is read from the .blend file anyway. So instead of storing this in the asset metadata itself, we can just create these traits when loading an asset library.
In future I expect we'll often want to do lookups inside the traits, since they give crucial type information. A list lookup is rather slow and scales bad, so we should use a hash map. This may not be entirely trivial to add though, let's first get the basics working and merged.
Hmmm... that forced me to learn about object ID and IDTypeInfo. Yikes.
I might be misunderstanding you about the "ID" trait, but right now my PR will add things like the following:
Add a "Cube" and get the following traits
Add a "Collection"
Add a "Charge Forcefield"
Sorry, I didn't mean to imply that you should already add such callbacks. I'd say we add them on a as needed basis.
I guess the nodes team would want to add some traits to identify the type of node tree (e.g. to display the geometry nodes icon in the asset browser), and to identify node group assets that can be used as modifiers.
For brush assets we will need this to determine which modes a brush can be used in, and to filter by that.
Closing this since there have been objections to the design, see #105807.