ON HOLD - Assets - Support Editing External BlendFile #117239
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117239
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
This task is about the technical design to make it possible to edit external blendfiles, in the Asset Library context. The initial target is to make saving Brush assets possible, as part of the Brush Assets project (see #116337).
Design Overview
Blender needs to be able to:
The current design is based on a 'manager' class, which manages the loading, editing and saving of the external asset library blendfile. Most operations require the manager to acquire the library, which effectively read the blendfile in its own temporary bmain. A manager should remain in its
acquired
state as little as possible, to reduce memory usage and risks of concurrent modifications.Identified challenges so far:
Concurrent Accesses
The proposed solution is to check for external modifications of the target library file, and loop until the whole writing process can be done without conflicts. The data in the library blendfile should always have precedence over the modifications currently being saved.
Step 6 ensures the data re-read from the target file has priority over the data stored into the Main to be written.
Collisions and Updates of Existing Library Data
Assets (and even less basic IDs) have no UUID currently, so we have to rely on their names to identify them. Further more, different assets can use the same sub-data (e.g. a texture).
For Assets themselves, we can assume that if they have the same name, they are the same data.
For sub-IDs, it is way more challenging to find a 'correct' way to decide when to replace them, and when to store a new copy instead.
Proposed behavior to handle ID when there are name collisions. it tries to avoid systematic duplication of data in the asset libraries, while ensuring a
Replace or update existing library data.
Do not follow further dependencies from these sub-assets.
Else, create a new ID in library (with a different name).
Save new library data.
Do not follow further dependencies from these sub-assets.
Performances & Optimizations
Having to load a second complete blendfile in memory can become problematic if the library has a lot of data-blocks and/or heavy ones (like complex geometries etc.).
This is likely not an issue in the Brush Assets context though, so it does not have a high priority currently.
Plan of Action
Tasks to get a minimal testable 'save to default asset library' for brush assets.
These tasks are ordered by priority, from highest to lowest.
Bastien Montagne referenced this issue2024-01-17 16:46:19 +01:00
I think writing to asset files is always an explicit user action in our current design. It can be "Save Changes" or "Delete" on a brush datablock, or deleting or dropping an asset in the asset browser.
So if there is a conflict, I think we would ask the user if they want to overwrite it? Besides leaving that choice to the user, the steps look fine to me.
For collisions, I'm hoping we can save assets to individual asset .blend files as much as possible. And in a first iteration of the design we may enforce that and not allow editing of more complex .blend files, so that we can safely overwrite the whole .blend file contents without conflict resolution.
The proposed logic seems ok to me. Just maybe we don't want to deal with that for a while.
Agreed.
The main issue with one blendfile per brush asset is that there is no sharing of resources possible. Each brush needs its own copy of textures and all the other dependencies.
If we decide to go that way, then I think the whole current 'draft manager' code is useless. We only need to do a 'partial write' of the asset and its dependencies into a new file (or to replace the existing asset source file). There is no need for a temp Main and complex merging process.
Afaik we already have all the BKE/BLO code needed for that, so we mainly have to write some
editor
level code (operators & UI)? With some extra things to take care of probably:mtime
of the file each loaded brush asset comes from (to allow detecting modified asset files).I don't think the disk space or memory usage of image textures used by brushes is really a concern for now. Using high res images in brushes is not common I think. Maybe we need a better distinction between textures used to define the shape of the brush and textures used for projection/stencils that are not really part of the brush.
If we can do such individual asset .blend files without adding much code that would be great. The more complex case is interesting to investigate at some point, but I feel like that could sidetrack things too much right now. There are enough other challenges.
There is some UI needed to communicate what happens when you go and open such an individual asset .blend file and start changing things. But I think it could be enough to warn the says and explain that when they do that, it will be changed into a regular .blend that you can't edit remotely anymore.
Assets - Support Editing External BlendFileto ON HOLD - Assets - Support Editing External BlendFile