Page MenuHome

Severe problem with relocating linked libraries
Closed, ResolvedPublic

Description

System Information
Win10 x64, nVidia GTX 780 3GB

Blender Version
Broken: Official 2.78c, all current builds
Worked: (optional)

(Not so) Short description of error
This one is either a complete misunderstanding of the concept of linked libraries on my side or a real bug, but either way it's a workflow and project killer lurking in the dark that should be taken care of ASAP. It can easily kill your open blend files without even saving them and without you noticing it before it's too late.

I am working on a project that involves linking groups containing objects and armatures (like 90% of my projects so far). Nothing special. I just noticed that sometimes blend files get corrupted / behave differently / get completely messed up although I didn't even save them after changing something. I was lucky to have a working ".blend1" copy lying around each time.

IIRC 2.78 (?) introduced the possibility to relocate linked libraries which is great.

Some days ago I noticed that while using relocate to switch to a new version of a linked file the "Blender File" layout of the Outliner showed both the new and the old version of the linked file. The scene / rig itself kept working until I saved the scene and reloaded it. OK, I thought maybe I did do something wrong.
It felt kind of fishy that the outdated library still showed up in the Outliner's "Blender File" display after replacing it with another one. So this time I relocated the library to switch to the new version and after that used "Purge All" in the "Orphan Data" mode of the Outliner to get rid of the unused data blocks. The link to the old file was removed but all rigs were gone.

This was not what I wanted so I just closed the scene without saving.

Then I closed Blender and reloaded the previously working blend file. It was broken. I opened it on another computer just to be sure there was nothing still in memory that could cause this. The blend file was broken. It must have been saved after pressing "Purge All".

I did more tests with simple scenes and I can now reproduce what went wrong. To make a long story short: if you don't want to kill your scene don't use "Relocate" but replace it manually in the "Data Blocks" Outliner display. And don't use "Purge All" as it will silently overwrite your opened scene file without any warning.

Exact steps for others to reproduce the error

  • Open the attached "Masterscene.blend". It's a simple scene where I linked the "Link_Me" group of the attached "Scene_to_link_1.blend". I also made a proxy of the Armature inside the group to be able to animate the rig.
  • Go to the "Blender File" display mode of the Outliner
  • Right-click the "//Scene_to_link_1.blend" entry on the bottom and select "Relocate"
  • In the opening file browser select "Scene_to_link_2.blend". It's a 1:1 copy of the previously linked file
  • Notice that according to the Outliner both files are still linked while only the new one should be. The rig itself is still working.
  • Now either save the Masterscene.blend to a new file. After opening the new blend file both the link to the replaced library file and the rig will be gone.
  • Or if you want to destroy your Masterscene just switch the Outliner to display "Orphan Data" and use the "Purge All" button. The link to the old library file and the rig will be gone and your scene will be saved in this state afterwards!!! Hopefully you have a backup of it!
  • Using the "Datablocks" display in the Outliner and manually replacing the "_1" of the libraries file name with "_2" will properly replace the old library with the new one and everything works fine.
  • Basically it's the killer combination of the "Relocate" function not working 100% like expected and the "Purge All" button silently saving over your currently open blend file! "Purge All" only tells you that there will be no undo, but saving over your open blend file is a total no go!

Event Timeline

Bastien Montagne (mont29) lowered the priority of this task from 90 to 50.

Bah, proxy again… :(((( Issue confirmed.

Note that 'PurgeAll' operator merely indeed saves and reload the whole .blend file (as said in tooltip, this is irreversible action)… It’s old feature that ideally should be removed at some point, once new ID management is complete and fully working.

Nice you can reproduce it and thanks for your quick reaction.

The "Purge All" button shows a warning indeed but it only says that it "cannot be undone" which IMHO sounds a lot like it's not undoable in the current session of Blender. It doesn't warn you that it actually saves over your opened blend file which could be devastating.

Thanks Bastien for instantly fixing the linking bug and updating the "Purge All" button with important information! ?