Edit linked library addon breaks relative links #67111

Closed
opened 2019-07-17 10:11:41 +02:00 by Frederico Martins · 20 comments

System Information
Operating system: Windows 10
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2

Blender Version
Broken:
version: 2.80 (sub 74), branch: master, commit date: 2019-07-11 13:50, hash: 06312c6d2db8

Short description of error
Edit linked library addon breaks relative links when toggling between files, when the child file also has linked materials.

Exact steps for others to reproduce the error
Based on attached files:
1- open scene/base.blend
It is linking an object from ..\obj\object.blend, and then that object is linking a material from..\Mat\mat.blend
If I edit any file from the File>Open menu, everything works well.
but If I use the Edit Linked Library addon, by:

2 - select "cubito" object and File>External Data>Edit Linked Library

3- then File>External Data>Return to original file (or corresponding hotkeys)
It breaks the relative links by turning
..\Mat\mat.blend into......\Mat\mat.blend

This is happening in several files I'm working on and in several blender 2.8 versions from a couple of weeks back.
This add-on has been amazingly useful, hope this is an easy fix!

bugLink.zip

**System Information** Operating system: Windows 10 Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 **Blender Version** Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-11 13:50, hash: 06312c6d2db8 **Short description of error** Edit linked library addon breaks relative links when toggling between files, when the child file also has linked materials. **Exact steps for others to reproduce the error** Based on attached files: 1- open scene/base.blend It is linking an object from *..\obj\object.blend, and then that object is linking a material from*..\Mat\mat.blend If I edit any file from the File>Open menu, everything works well. but If I use the Edit Linked Library addon, by: 2 - select "cubito" object and File>External Data>Edit Linked Library 3- then File>External Data>Return to original file (or corresponding hotkeys) It breaks the relative links by turning *..\Mat\mat.blend into*..\..\..\Mat\mat.blend This is happening in several files I'm working on and in several blender 2.8 versions from a couple of weeks back. This add-on has been amazingly useful, hope this is an easy fix! [bugLink.zip](https://archive.blender.org/developer/F7614427/bugLink.zip)

Added subscriber: @FredericoMartins

Added subscriber: @FredericoMartins

#69446 was marked as duplicate of this issue

#69446 was marked as duplicate of this issue

Added subscriber: @Harvester

Added subscriber: @Harvester

I can confirm the above issue on a daily build of version 2.80 (Hash: 65168825e0b0) on my laptop (Win10 64bit, GeForce 1070). The add-on seems to loose the correct relative path to the linked material, after editing the linked object, apart from other minor issues (see below):

Traceback (most recent call last):

File "D:\Blender_2.80_stable\2.80\scripts\addons\object_edit_linked.py", line 56, in linked_file_check
  context.view_layer.objects.active = bpy.data.objects[settings["linked_objects"][0]]

AttributeError: 'NoneType' object has no attribute 'view_layer'

The material file is being searched with the wrong relative path, while the linked object file's relative path is fine.
T67111_edit_linked_error.jpg

I can confirm the above issue on a daily build of version 2.80 (Hash: 65168825e0b0) on my laptop (Win10 64bit, GeForce 1070). The add-on seems to loose the correct relative path to the linked material, after editing the linked object, apart from other minor issues (see below): Traceback (most recent call last): ``` File "D:\Blender_2.80_stable\2.80\scripts\addons\object_edit_linked.py", line 56, in linked_file_check context.view_layer.objects.active = bpy.data.objects[settings["linked_objects"][0]] ``` AttributeError: 'NoneType' object has no attribute 'view_layer' The material file is being searched with the wrong relative path, while the linked object file's relative path is fine. ![T67111_edit_linked_error.jpg](https://archive.blender.org/developer/F7614858/T67111_edit_linked_error.jpg)
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Seems to be fine here on linux...

Seems to be fine here on linux...

Unfortunately, with such scenario, it seems that even with the previous version 2.79b, when you edit the linked object using the Edit Linked Object add-on (ver. 0.8.1), and then return to the start file, it doesn't apply the correct relative path to the just edited file breaking links to external assets.

After several tests with Blender 2.79b, the above issue appears only when using relative paths, while it works fine with absolute paths. When using relative paths they get broken in the linked file being edited using the add-on.

Inside the add-on's code (line 218) there is a note about nested links which suggests to use another instance of Blender to edit the linked file, but even so the issue is still there.

Unfortunately, with such scenario, it seems that even with the previous version 2.79b, when you edit the linked object using the Edit Linked Object add-on (ver. 0.8.1), and then return to the start file, it doesn't apply the correct relative path to the just edited file breaking links to external assets. After several tests with Blender 2.79b, the above issue appears only when using relative paths, while it works fine with absolute paths. When using relative paths they get broken in the linked file being edited using the add-on. Inside the add-on's code (line 218) there is a note about nested links which suggests to use another instance of Blender to edit the linked file, but even so the issue is still there.

In #67111#725393, @lichtwerk wrote:
Seems to be fine here on linux...

Yep, tried it at home in linux and works well.. guess it is mostly a windows problem, will try during the week on several windows and macs at work.

> In #67111#725393, @lichtwerk wrote: > Seems to be fine here on linux... Yep, tried it at home in linux and works well.. guess it is mostly a windows problem, will try during the week on several windows and macs at work.

Tried it on windows 10 (different computers) and windows 8, and it is buggy too.

But it does work on macOS (tested on Mojave) and Linux(Ubuntu) as mentioned before, so it seems to be a windows problem only :(

Tried it on windows 10 (different computers) and windows 8, and it is buggy too. But it does work on macOS (tested on Mojave) and Linux(Ubuntu) as mentioned before, so it seems to be a windows problem only :(

Thank you Federico for testing it on Windows too. So it's confirmed. Do you think it can be fixed? This is a crucial add-on but in this state it's not only useless but also dangerous if your are not aware of how it messes up with the paths in the edited linked file.

Thank you Federico for testing it on Windows too. So it's confirmed. Do you think it can be fixed? This is a crucial add-on but in this state it's not only useless but also dangerous if your are not aware of how it messes up with the paths in the edited linked file.
Member

Added subscribers: @JasonvanGumster, @BrendonMurphy

Added subscribers: @JasonvanGumster, @BrendonMurphy
Member

confirming @JasonvanGumster are you interested here?

confirming @JasonvanGumster are you interested here?
Member

Added subscriber: @ideasfijas

Added subscriber: @ideasfijas

Hello devs. I've noticed a recent update to this useful add-on (ea945ab58d). Are there any plans to tackle this quite annoying problem with linked libraries path being messed up? I would like to use it in production but I am not confident to try it in this state. Thank you for your attention.

Hello devs. I've noticed a recent update to this useful add-on (ea945ab58d85). Are there any plans to tackle this quite annoying problem with linked libraries path being messed up? I would like to use it in production but I am not confident to try it in this state. Thank you for your attention.

I don't have a full-on Windows machine to test this, but I think I should be able to try it in a VM. There's nothing in the add-on code that writes relative paths, so my suspicion is that maybe this has something to do with how the Remap Relative save option works in Blender itself when on Windows. I'll try and investigate this later today.

I don't have a full-on Windows machine to test this, but I think I should be able to try it in a VM. There's nothing in the add-on code that writes relative paths, so my suspicion is that maybe this has something to do with how the Remap Relative save option works in Blender itself when on Windows. I'll try and investigate this later today.

Hi Jason, thank you very much for having a look at this. I look forward to read about your discoveries on this add-on's behaviour.

Hi Jason, thank you very much for having a look at this. I look forward to read about your discoveries on this add-on's behaviour.

I believe I have a fix in place (I realize now the the start of my commit message is a bit vague. oops). Please have a look and test it out.

I believe I have a fix in place (I realize now the the start of my commit message is a bit vague. oops). Please have a look and test it out.

Brilliant! I tested your patched script and it works fine with all these versions of Blender, without breaking the relative paths of linked objects and materials:

2.83.16 (Hash d553edeb7dbb)
2.92.0 (Hash 02948a2cab44)
2.93.0 (Hash d5c3bff6e774)
3.0 (Hash 7e841c797fb8)

I might test it a little more with some complex linking rig but it seems already to work properly.

Thank you very much for having fixed this very useful add-on.

Brilliant! I tested your patched script and it works fine with all these versions of Blender, without breaking the relative paths of linked objects and materials: 2.83.16 (Hash d553edeb7dbb) 2.92.0 (Hash 02948a2cab44) 2.93.0 (Hash d5c3bff6e774) 3.0 (Hash 7e841c797fb8) I might test it a little more with some complex linking rig but it seems already to work properly. Thank you very much for having fixed this very useful add-on.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jason van Gumster self-assigned this 2021-05-25 02:53:53 +02:00

Excellent! In that case, I'm going to mark this as resolved. Let me know if you run into further issues.

Excellent! In that case, I'm going to mark this as resolved. Let me know if you run into further issues.
Sign in to join this conversation.
No Milestone
No project
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-addons#67111
No description provided.