Page MenuHome

Could not link object because the collection 'Master Collection'(of appended scene) is linked
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Linux-4.15.0-96-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 435.21

Blender Version
Broken: version: 2.83 (sub 17), branch: master, commit date: 2020-05-22 19:52, hash: rBe8dd8c2829f3
Worked: rB31bf04fad93

Short description of error
I have a script that appends a scene from another blend file, then attempts to link an object to that scene's master collection.
Doing this worked without any issue until rBe8dd8c2829f3 (or a bit earlier).
Now this error is thrown:

Traceback (most recent call last):
  File "/home/x/TEMP/blender/283/bugs/link_obj_to_master_collection/link_obj_to_master_collection.blend/Text", line 29, in <module>
RuntimeError: Error: Could not link the object 'Plane.001' because the collection 'Master Collection' is linked.

It's possible to prevent this by running scene.collection.make_local() before attempting to link any object, but I'm wondering if that's supposed to be necessary?
Why would the collection of an appended scene be linked?

I have a prepared a blend file to reproduce the issue.

Exact steps for others to reproduce the error

  • extract the zip and open link_obj_to_master_collection.blend
  • from the Scripting workspace, run the script
  • the error should pop up
  • reload the blend and uncomment line 25, and it will run successfully

Event Timeline

MACHIN3 (MACHIN3) updated the task description. (Show Details)

The same behavior in blender-2.83-e8dd8c2829f3-windows64 on latest Windows 10 64bit

renderer: 'GeForce GTX 1080/PCIe/SSE2'
vendor: 'NVIDIA Corporation'
version: '4.5.0 NVIDIA 445.87'

Richard Antalik (ISS) closed this task as Invalid.May 25 2020, 2:16 PM
Richard Antalik (ISS) claimed this task.

This is consistent behavior with the error message as well as with what you are allowed to do manually.

Philipp Oeser (lichtwerk) reopened this task as Confirmed.May 25 2020, 2:26 PM

Not sure, I think this is a bug actually, I am getting this when appending a scene:

BLI_assert failed: /blender/source/blender/blenkernel/intern/lib_id.c:1690, library_make_local_copying_check(), at '0'

@Bastien Montagne (mont29): this is not supposed to assert, right?

MACHIN3 (MACHIN3) added a comment.EditedMay 25 2020, 2:34 PM

This is consistent behavior with the error message as well as with what you are allowed to do manually.

Clearly there was a change made to cause this behavior, as make_local was not necessary in the past.
On top of that, doing the same manually (append scene, then append object to scene's collection), does not require the collection being made local.

And so my question is still open:

Why would the collection of an appended scene be linked?

Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".
Bastien Montagne (mont29) moved this task from Backlog to Bugs on the Pipeline, Assets & I/O board.

@Philipp Oeser (lichtwerk) not getting any assert here when appending a scene, regardless of making everything local or not... Please be more descriptive about your issue.

That being said, original report is indeed a bug, boils down again to our beloved embedded IDs (master collection in that case) and how much of a pain it is to deal with them...

My related commit was rB0a32f6c8686c: Fix T76710: objects get lost in linked/overridden collections -- but that should only kick in if stuff is really linked/overridden

@Philipp Oeser (lichtwerk) not getting any assert here when appending a scene, regardless of making everything local or not... Please be more descriptive about your issue.

I am getting this in rBdf8cbdc69645 with saving a default scene and then appending that scene into a new default startup scene

  • File > Append > T76997.blend > Scene > Scene
  • assert

(does not matter if Localize All or not... does not happen when linking)

Sorry, not sure what else I could check?
In library_make_local_copying_check, id is Master Collection, par_id is Collection, then asserts because par_id is neither ID_OB nor ID_KE

@Philipp Oeser (lichtwerk) Ah, I see now, would not trigger with provided file in this task because it has no children collections...