Assets: bundle essentials with Blender #104474
Merged
Jacques Lucke
merged 29 commits from 2023-02-14 17:35:41 +01:00
JacquesLucke/blender:bundled-assets
into main
Reviewers
Request review
No reviewers
Labels
Clear labels
This issue affects/is about backward or forward compatibility
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
Apply labels
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
This issue affects/is about backward or forward 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
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
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
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 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
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
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
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#104474
Reference in New Issue
There is no content yet.
Delete Branch "JacquesLucke/blender:bundled-assets"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This patch adds an "Essentials" asset library that is bundled with Blender. Also see #103620.
At build time, the
lib/assets/publish
folder is copied todatafiles/assets
in the build directory.In the UI, the "Essentials" library can be accessed like other custom asset libraries
with the exception that assets from that library cannot be linked.
@blender-bot build
@blender-bot package
Package build started. Download here when ready.
publish
directory. So when I accept this that doesn't mean "all green, go" yet.@ -0,0 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
I'd call this file
AS_essentials_library.h
and name functions and all accordingly. Just use the same term as in Blender, avoids confusion (Bundle vs. Essentials).@ -0,0 +10,4 @@
extern "C" {
#endif
bool ED_asset_bundled_contains_path(const char *path);
Why
ED_
? SuggestAS_essentials_library_contains_path()
.This may in fact not be necessary, see comment below (#104474 (comment)).
@ -98,3 +98,1 @@
/* Add separator if needed. */
if (!BLI_listbase_is_empty(&U.asset_libraries)) {
RNA_enum_item_add_separator(&item, &totitem);
{
This should be in the
include_generated
block I guess (the name is terrible^^).Ok, not obvious to me why this is generated, but fine with me.
@ -101,0 +104,4 @@
"ESSENTIALS",
ICON_NONE,
"Essentials",
"Show assets that came bundled with Blender"};
Would suggest something like: "Show the basic building blocks and utilities coming with Blender.
@ -128,1 +130,4 @@
static eFileAssetImportType get_asset_import_type(const SpaceFile *sfile, const char *blend_path)
{
if (ED_asset_bundled_contains_path(blend_path)) {
Doing this kind of path comparison is a bit meh, and it assumes assets are files on disk. Not a big deal but I think we can do it properly right away.
I'd suggest storing a
bool never_link_
insideasset_system::AssetLibrary
that is set in theget_asset_library()
switch. And then here you can do something like:I liked the idea, but it didn't really work unfortunately, because e.g. "All" is also an asset library but it contains assets that can be linked and those that must not be linked. So I did not address this feedback yet.
I thought it would be fine since during loading you have access to the nested library, but I missed that here, where you need to do the query, you can only access the "All" one.
I'd suggest to let
AssetRepresentation
hold a reference to the owning library, so that the info can be queried through the library. I think that makes most sense longer term.@ -90,3 +88,4 @@
/** Display assets from the current session (current "Main"). */
ASSET_LIBRARY_LOCAL = 1,
ASSET_LIBRARY_ALL = 2,
/* Display assets bundled with Blender by default. */
Doxygen comment.
Wait the big green button is "Approve", not "Send" :)
@ -79,0 +80,4 @@
essentials_library_reference.type = ASSET_LIBRARY_ESSENTIALS;
essentials_library_reference.custom_library_index = -1;
const int essentials_enum_value = ED_asset_library_reference_to_enum_value(
&essentials_library_reference);
Why is any of this needed? Just passing
ASSET_LIBRARY_ESSENTIALS
as the value should be fine.Might be left-over from the time when I had multiple essentials asset repositories for testing.
@ -22,6 +22,7 @@ const char *AS_asset_representation_name_get(const AssetRepresentation *asset)
AssetMetaData *AS_asset_representation_metadata_get(const AssetRepresentation *asset)
ATTR_WARN_UNUSED_RESULT;
bool AS_asset_representation_is_local_id(const AssetRepresentation *asset) ATTR_WARN_UNUSED_RESULT;
bool AS_asset_representation_never_link(const AssetRepresentation *asset) ATTR_WARN_UNUSED_RESULT;
Personally I prefer
is_never_link
to make clear this is getting, not setting.I created #104686 and am trying to get this done for the 3.5 release still, otherwise the import method selection becomes too confusing with the append-only essentials.
For this I also pushed the
AssetRepresentation.owner_asset_library_
part of this patch,99e71ec1f2
.Forgot to note something earlier.
@ -98,4 +103,0 @@
/* Add separator if needed. */
if (!BLI_listbase_is_empty(&U.asset_libraries)) {
RNA_enum_item_add_separator(&item, &totitem);
}
Why is the condition removed? Without it there will be a dangling separator line when there are no custom asset libraries defined in the Preferences.
Think I misread what it was supposed to do somehow, will add it back.
@blender-bot build
@blender-bot package
Package build started. Download here when ready.
Verified again that this works as expected on the build-bot: https://builder.blender.org/download/experimental/bundled-assets/.
Reviewers