Objects linked from Asset Library ignore relative path preference #103546

Closed
opened 2022-12-29 22:26:33 +01:00 by David Gilson · 19 comments

System Information
Operating system: Windows 11
Graphics card: GTX3060

Blender Version
Broken: 3.3.1
Worked: N/A

Short description of error
An object or collection that has been linked via the asset browser is always referenced via an absolute path even though the default preference is to link files with a relative path.

Expected Behavior: Blender should obey the relative path preference, regardless of how it was linked to the current Blend file (e.g. File->Link, Dragged in from File viewport and linked, or linked in from Asset library).

Actual Behavior: If something is linked from the asset browser, it ignores the relative paths flag, and creates a reference in the blend file with an absolute paths. (This then breaks linked assets when working with remote team members over cloud syncing services who have a different directory structure).

Exact steps for others to reproduce the error
With the attached files:

  • Open a.blend.
  • Open preferences, and in "Save & Load", set the "Default to" check box for relative paths to true/on.
  • {nav Preferences > File Path > Asset libraries} and add path to b.blend and c.blend (or use any other asset library)
  • open asset browser
  • Select the test library, and make sure that the Link option is selected (i.e. do not append).
  • Drag the sphere into the 3D viewport from the asset library.
  • Go to the Outliner viewport, and switch to "Blender File" view.
  • Path shown is not relative for c.blend.

If object is linked with Link option from file menu, it correctly shows relative path

a.blend

c.blend

b.blend

**System Information** Operating system: Windows 11 Graphics card: GTX3060 **Blender Version** Broken: 3.3.1 Worked: N/A **Short description of error** An object or collection that has been linked via the asset browser is always referenced via an absolute path even though the default preference is to link files with a relative path. *Expected Behavior*: Blender should obey the relative path preference, regardless of how it was linked to the current Blend file (e.g. File->Link, Dragged in from File viewport and linked, or linked in from Asset library). *Actual Behavior*: If something is linked from the asset browser, it ignores the relative paths flag, and creates a reference in the blend file with an absolute paths. *(This then breaks linked assets when working with remote team members over cloud syncing services who have a different directory structure).* **Exact steps for others to reproduce the error** With the attached files: - Open a.blend. - Open preferences, and in "Save & Load", set the "Default to" check box for **relative paths** to **true**/on. - {nav Preferences > File Path > Asset libraries} and add path to b.blend and c.blend (or use any other asset library) - open asset browser - Select the test library, and make sure that the Link option is selected (i.e. do not append). - Drag the **sphere** into the 3D viewport from the asset library. - Go to the **Outliner** viewport, and switch to "**Blender File**" view. - Path shown is not relative for **c.blend**. --- If object is linked with `Link option` from file menu, it correctly shows relative path [a.blend](https://archive.blender.org/developer/F14099448/a.blend) [c.blend](https://archive.blender.org/developer/F14099449/c.blend) [b.blend](https://archive.blender.org/developer/F14099450/b.blend)
Author

Added subscriber: @DavidGilson-1

Added subscriber: @DavidGilson-1
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Hi, thanks for the report. I can confirm path for linked file is not absolute.
But File path shown in outliner is not independent on Relative path preference option.
Instead it appears to be depends on Relative path(relative_path) option from file browser
image.png
I'm not sure whether this is considered as a bug. Forwarding to devs.

Hi, thanks for the report. I can confirm path for linked file is not absolute. But File path shown in outliner is not independent on [Relative path ](https:*docs.blender.org/api/3.5*bpy.types.PreferencesFilePaths.html#bpy.types.PreferencesFilePaths.use_relative_paths) preference option. Instead it appears to be depends on [Relative path(relative_path) ](https://docs.blender.org/api/3.5/bpy.ops.wm.html#bpy.ops.wm.link) option from file browser ![image.png](https://archive.blender.org/developer/F14099968/image.png) I'm not sure whether this is considered as a bug. Forwarding to devs.
Author

Hi @PratikPB2123 ,
Thank you for looking into this !

Hi @PratikPB2123 , Thank you for looking into this !
Author

@PratikPB2123 Just reviewing this and wanted to make sure I understood your posted. You confirmed my observations, but do you think the observed behavior is what Blender should or should not have?

@PratikPB2123 Just reviewing this and wanted to make sure I understood your posted. You confirmed my observations, but do you think the observed behavior is what Blender should or should not have?
Member

@DavidGilson-1 hi, I think current behavior is correct.
In case of File > Link, you can adjust display method(relative or not) of each link object by relative path button
But for asset library we explicitly specify the path in preferences tab

@DavidGilson-1 hi, I think current behavior is correct. In case of File > Link, you can adjust display method(relative or not) of each link object by `relative path` button But for asset library we explicitly specify the path in preferences tab
Author

I understand that the path of an asset library is absolute, and why that needs to be so. However, I don't see why that once objects are linked from the library, that their path cannot be set as relative, if that is what the user has set as their default preference in the main settings of Blender?

I understand that the path of an asset library is absolute, and why that needs to be so. However, I don't see why that once objects are linked from the library, that their path cannot be set as relative, if that is what the user has set as their default preference in the main settings of Blender?
Author

As thing stand, if you need to use relative paths (e.g working with a remote team via Dropbox or something similar), and you're using the asset library, you have to remember to manually change all the paths to relative, even though, you have set relative paths as your default preference. This is causing a lot of speed bumps with my colleagues and while I do my best to remember, I sometimes forget, and then blender file links are broken on my colleagues computers, until they tell me and I have to go back and manually set everything to relative.

I can live with doing things manually when it's necessary, but given that there is a preference for whether linked files should be absolute or relative, I don't really see a good reason for me to have to manually set things to relative, when I have already set that as my default preference, it should just do it by ... default!

As thing stand, if you need to use relative paths (e.g working with a remote team via Dropbox or something similar), and you're using the asset library, you have to remember to manually change all the paths to relative, *even though*, you have set relative paths as your default preference. This is causing a lot of speed bumps with my colleagues and while I do my best to remember, I sometimes forget, and then blender file links are broken on my colleagues computers, until they tell me and I have to go back and *manually* set everything to relative. I can live with doing things manually when it's necessary, but given that there is a preference for whether linked files should be absolute or relative, I don't really see a good reason for me to have to manually set things to relative, when I have already set that as my default preference, it should just do it by ... default!

Added subscriber: @pauanyu_blender

Added subscriber: @pauanyu_blender

I also would benefit a lot from this. I have multiple blend files in the same asset library. Those blend files are importing assets from other blend files (in the same asset library).

Because all of the blend files are in the same asset library, I want them to use relative imports, so that way I can move the asset library around without any issue.

However, Blender is always using absolute imports, so that causes the asset library to completely break. This is really bad behavior.

I also would benefit a lot from this. I have multiple blend files in the same asset library. Those blend files are importing assets from other blend files (in the same asset library). Because all of the blend files are in the same asset library, I want them to use relative imports, so that way I can move the asset library around without any issue. However, Blender is always using absolute imports, so that causes the asset library to completely break. This is really bad behavior.
Author

Glad to hear my team isn't the only one affected by this!

Glad to hear my team isn't the only one affected by this!
Author

Pinging this issue, as it would be great to see it resolved. The dev who first responded, @PratikPB2123 , didn't seem to think it was a problem if I understood him correctly, but I have to disagree. Anyone else out there?

Pinging this issue, as it would be great to see it resolved. The dev who first responded, @PratikPB2123 , didn't seem to think it was a problem if I understood him correctly, but I have to disagree. Anyone else out there?
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

@JulianEisel can you check?

@JulianEisel can you check?
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:39:30 +01:00

@JulianEisel Your turf

@JulianEisel Your turf
Member

This topic needs design work. Simply using the existing option from the Preferences is not a good choice IMO, since this is just supposed to be the default for new file browsing operations and you can still change that while file browsing. Just as @PratikPB2123 explained. It would also bother me that settings affecting asset library usage are spread across the Preferences.

For assets you'd probably want to be able to use relative paths for some asset libraries, absolute for others. Or maybe it differs per asset even. So a single global option doesn't make sense. A per asset library option seems like a better choice, plus maybe the possibility to override this temporarily in the asset browser? Similar to the new import method option in the Preferences: ae84a2956e

In addition to this, I would like to find out to what degree this would be covered by Blender Projects (see #104883). For multi-file projects with their own dedicated asset libraries, I'd expect you'd want to use relative paths always. For personal asset libraries that are used across multiple projects, absolute paths is the better choice - I think. So, maybe we don't need an option for this, and just use relative paths for project libraries and absolute ones for personal, cross-project ones?

I'm unsure about this myself, so again: A design is needed. The asset browser is geared more towards using of personal asset libraries at this point, it's known that these (rather significant) weak spots exist.


Also, the preferences option doesn't make much sense to me anymore, the File Browser could just remember what it was set to last time. This should now be possible to implement, but wasn't back when the options was added to the Preferences.

This topic needs design work. Simply using the existing option from the Preferences is not a good choice IMO, since this is just supposed to be the default for new file browsing operations and you can still change that while file browsing. Just as @PratikPB2123 explained. It would also bother me that settings affecting asset library usage are spread across the Preferences. For assets you'd probably want to be able to use relative paths for some asset libraries, absolute for others. Or maybe it differs per asset even. So a single global option doesn't make sense. A per asset library option seems like a better choice, plus *maybe* the possibility to override this temporarily in the asset browser? Similar to the new import method option in the Preferences: ae84a2956e In addition to this, I would like to find out to what degree this would be covered by *Blender Projects* (see #104883). For multi-file projects with their own dedicated asset libraries, I'd expect you'd want to use relative paths always. For personal asset libraries that are used across multiple projects, absolute paths is the better choice - *I think*. So, maybe we don't need an option for this, and just use relative paths for project libraries and absolute ones for personal, cross-project ones? I'm unsure about this myself, so again: A design is needed. The asset browser is geared more towards using of personal asset libraries at this point, it's known that these (rather significant) weak spots exist. --- Also, the preferences option doesn't make much sense to me anymore, the File Browser could just remember what it was set to last time. This should now be possible to implement, but wasn't back when the options was added to the Preferences.

As a user with multiple computers (laptop + desktop) with differing operating systems, absolute paths are difficult to deal with. If I want to be able to open a Blender file on both my computers, I cannot use absolute paths, since the OS dictates that user-space files live in different places.

A potentially robust solution would be to have some way to indicate that two Asset Libraries are the same (maybe the library name is good enough?), and then read assets relative to the asset library root, rather than the .blend file.

For example, a linked asset might have the path ${User Library}/Props/Indoors/Modern Table A.

As a user with multiple computers (laptop + desktop) with differing operating systems, absolute paths are difficult to deal with. If I want to be able to open a Blender file on both my computers, I *cannot* use absolute paths, since the OS dictates that user-space files live in different places. A potentially robust solution would be to have some way to indicate that two Asset Libraries are the same (maybe the library name is good enough?), and then read assets relative to the asset library root, rather than the .blend file. For example, a linked asset might have the path `${User Library}/Props/Indoors/Modern Table A`.
Member

Since 3.6 there's a Relative Path option per asset library, see https://developer.blender.org/docs/release_notes/3.6/pipeline_assets_io/#assets. So I'll consider this closed (this has never been a bug anyway, since the existing option was only meant for the File Browser, not for assets).

Blender Project support may further help address use-cases, see blender/blender!107655.

Since 3.6 there's a _Relative Path_ option per asset library, see https://developer.blender.org/docs/release_notes/3.6/pipeline_assets_io/#assets. So I'll consider this closed (this has never been a bug anyway, since the existing option was only meant for the File Browser, not for assets). Blender Project support may further help address use-cases, see blender/blender!107655.
Blender Bot added
Status
Archived
and removed
Status
Needs Info from Developers
labels 2024-03-12 15:47:00 +01: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
6 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#103546
No description provided.