Asset Library can be defined with relative path #93774

Open
opened 2021-12-06 22:52:01 +01:00 by Duarte Farrajota Ramos · 6 comments

System Information
Operating system: Windows-10-10.0.19042-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.63

Blender Version
Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca30557

Short description of error
Asset Library defined with a relative path looses path and displayed content when the Asset Browser editor is resized

Exact steps for others to reproduce the error

  • Under Edit > Preferences > File Paths > Asset Libraries define a new asset
  • In the path enter some relative path for an existing folder structure say //Assets\
  • Create said folder and save the default startup blend file in such way that the asset library can be found using the defined relative path
  • Open an Asset Browser editor and navigate to the asset library defined with relative path.
  • Everything should display correctly
  • Now resize the current Asset Browser editor by dragging any edge
  • Content vanishes and the message Path to asset library does not exist message shows up
  • Change the Import Type from the dropdown to any value (may even be the same) just to trigger a refresh and content shows again correctly

1.png

Startup file if relevant userpref.blend

AssetBrowser (1).mp4

Tested on two different windows 10 computers with the same reproducible results. Resizing in any direction has the adverse effect, and changing the Import Type from the dropdown to any value (may even be the same) always triggers a refresh that brings back the content. It doesn't seem to happen if the Asset Library uses an absolute path.

**System Information** Operating system: Windows-10-10.0.19042-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.63 **Blender Version** Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: `f1cca30557` **Short description of error** Asset Library defined with a relative path looses path and displayed content when the *Asset Browser* editor is resized **Exact steps for others to reproduce the error** - Under *Edit > Preferences > File Paths > Asset Libraries* define a new asset - In the path enter some relative path for an existing folder structure say //Assets\ - Create said folder and save the default startup blend file in such way that the asset library can be found using the defined relative path - Open an *Asset Browser* editor and navigate to the asset library defined with relative path. - Everything should display correctly - Now resize the current *Asset Browser* editor by dragging any edge - Content vanishes and the message `Path to asset library does not exist` message shows up - Change the *Import Type* from the dropdown to any value (may even be the same) just to trigger a refresh and content shows again correctly ![1.png](https://archive.blender.org/developer/F12700247/1.png) Startup file if relevant [userpref.blend](https://archive.blender.org/developer/F12700240/userpref.blend) [AssetBrowser (1).mp4](https://archive.blender.org/developer/F12700245/AssetBrowser__1_.mp4) Tested on two different windows 10 computers with the same reproducible results. Resizing in any direction has the adverse effect, and changing the *Import Type* from the dropdown to any value (may even be the same) always triggers a refresh that brings back the content. It doesn't seem to happen if the Asset Library uses an absolute path.
Member

The Asset Browser isn't supposed to work with such relative paths. I can see why this may be super useful, but it's not something the design currently covers. Not sure if it's worth changing that.

If anything needs fixing, it's that the UI code apparently doesn't enforce absolute paths. Anything else would be a design change.

@dr.sybren thoughts?

The Asset Browser isn't supposed to work with such relative paths. I can see why this may be super useful, but it's not something the design currently covers. Not sure if it's worth changing that. If anything needs fixing, it's that the UI code apparently doesn't enforce absolute paths. Anything else would be a design change. @dr.sybren thoughts?

After discussion with @JulianEisel we decided that relative paths cannot be supported right now. The biggest issue is that when you have any path other than *, let's say *assets, opening a blend file inside the asset library will not detect it as being in that asset library.

To make it more concrete, let's say I have /home/sybren/blendproject/somefile.blend. Opening it would load the assets from /home/sybren/blendproject/assets. So far so good. Now, when I try to edit those assets, I open /home/sybren/blendproject/assets/objects.blend; when this file is opened, it will expect the asset library to be in /home/sybren/blendproject/assets/assets and not find anything. This will make the asset browser not find the catalogs, and also it won't be able to show any of the other assets in the library.

This task is good to keep open, though, because Blender shouldn't even accept relative paths (it does so now, and to make things worse, the directory select window still has the "relative path" option).

After discussion with @JulianEisel we decided that relative paths cannot be supported right now. The biggest issue is that when you have any path other than `*`, let's say `*assets`, opening a blend file inside the asset library will not detect it as being in that asset library. To make it more concrete, let's say I have `/home/sybren/blendproject/somefile.blend`. Opening it would load the assets from `/home/sybren/blendproject/assets`. So far so good. Now, when I try to edit those assets, I open `/home/sybren/blendproject/assets/objects.blend`; when this file is opened, it will expect the asset library to be in `/home/sybren/blendproject/assets/assets` and not find anything. This will make the asset browser not find the catalogs, and also it won't be able to show any of the other assets in the library. This task is good to keep open, though, because Blender shouldn't even accept relative paths (it does so now, and to make things worse, the directory select window still has the "relative path" option).
Sybren A. Stüvel changed title from Asset Library looses path when Asset Browser editor is resized to Asset Library can be defined with relative path 2021-12-09 16:57:41 +01:00

Ah I see, thanks for the feedback.

In #93774#1269425, @JulianEisel wrote:
I can see why this may be super useful, but it's not something the design currently covers.

This is indeed super helpful for "local" project exclusive libraries one would link from, rather than append from some "centralized" asset library.
I'd rather keep the possibility to use relative paths along with the bug, rather than enforce absolute paths then XD

Ah I see, thanks for the feedback. > In #93774#1269425, @JulianEisel wrote: > I can see why this may be super useful, but it's not something the design currently covers. This is indeed super helpful for "local" project exclusive libraries one would link from, rather than append from some "centralized" asset library. I'd rather keep the possibility to use relative paths along with the bug, rather than enforce absolute paths then XD
Member

There are probably more cases in the code where this will cause issues, relative paths are simply not covered. The upcoming indexing (#91406) will also break I think, since it is designed to work with the registered asset libraries, and not with continuously moving targets.

Note that one of the strategical follow-up projects of the Asset Browser is introducing the concept of a project in Blender. A high-priority one I'd say even. This way we want to support per-project asset libraries, and Blender would be able to identify assets as being part of a project.

There are probably more cases in the code where this will cause issues, relative paths are simply not covered. The upcoming indexing (#91406) will also break I think, since it is designed to work with the registered asset libraries, and not with continuously moving targets. Note that one of the strategical follow-up projects of the Asset Browser is introducing the concept of a project in Blender. A high-priority one I'd say even. This way we want to support per-project asset libraries, and Blender would be able to identify assets as being part of a project.

Ah I see, real shame we can't keep it, but I can see how this is troublesome.

Looking forward for the concept of a Blender project. Being able to define relative paths is pretty useful for flexibility reasons, so stuff doesn't break easily if file paths are changed.

Ah I see, real shame we can't keep it, but I can see how this is troublesome. Looking forward for the concept of a Blender project. Being able to define relative paths is pretty useful for flexibility reasons, so stuff doesn't break easily if file paths are changed.

I'm curious,

 What would be the recommended way to handle coordinating an asset library when one may have multiple systems?
 Say a Mac for the road and a Linux desktop at home.
 If relatively paths aren't the answer, should environment variables be used instead?
 Otherwise links are almost guaranteed to be broken paths if one needs to switch between Macs, Linux, and/or Windows.  Each system has a different "home" directory.

Edit: Edited the question for clarity, punctuation, etc.

I'm curious, ``` What would be the recommended way to handle coordinating an asset library when one may have multiple systems? Say a Mac for the road and a Linux desktop at home. If relatively paths aren't the answer, should environment variables be used instead? Otherwise links are almost guaranteed to be broken paths if one needs to switch between Macs, Linux, and/or Windows. Each system has a different "home" directory. ``` Edit: Edited the question for clarity, punctuation, etc.
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:40:38 +01:00
Philipp Oeser removed the
Interest
Pipeline, Assets & IO
label 2023-02-10 08:54:06 +01:00
Dalai Felinto added
Type
Known Issue
and removed
Type
Bug
labels 2023-10-03 12:13:39 +02: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
4 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#93774
No description provided.