Maniphest T76997

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

Assigned To
Bastien Montagne (mont29)
Authored By
MACHIN3 (MACHIN3)
May 23 2020, 5:13 PM
Tags
  • BF Blender
  • Pipeline, Assets & I/O
Subscribers
Bastien Montagne (mont29)
MACHIN3 (MACHIN3)
Philipp Oeser (lichtwerk)
Piotr (radi0n)
Richard Antalik (ISS)

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

Revisions and Commits

rB Blender

Related Objects

Mentioned Here
rBdf8cbdc69645: Merge branch 'blender-v2.83-release'
rB0a32f6c8686c: Fix T76710: objects get lost in linked/overridden collections

Event Timeline

MACHIN3 (MACHIN3) created this task.May 23 2020, 5:13 PM
MACHIN3 (MACHIN3) updated the task description.
Piotr (radi0n) added a subscriber: Piotr (radi0n).EditedMay 25 2020, 12:00 AM

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 Archived.May 25 2020, 2:16 PM
Richard Antalik (ISS) claimed this task.
Richard Antalik (ISS) added a subscriber: Richard Antalik (ISS).

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
Philipp Oeser (lichtwerk) added a project: Pipeline, Assets & I/O.
Philipp Oeser (lichtwerk) added subscribers: Bastien Montagne (mont29), Philipp Oeser (lichtwerk).

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) claimed this task.May 25 2020, 2:38 PM
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...

Philipp Oeser (lichtwerk) added a comment.May 25 2020, 3:04 PM

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

Bastien Montagne (mont29) closed this task as Resolved by committing rB7a37db61258e: Fix T76997: bad handling of embedded IDs in partial append..May 25 2020, 3:15 PM
Bastien Montagne (mont29) added a commit: rB7a37db61258e: Fix T76997: bad handling of embedded IDs in partial append..
Philipp Oeser (lichtwerk) added a comment.May 25 2020, 3:19 PM
In T76997#938247, @Bastien Montagne (mont29) wrote:

@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

Bastien Montagne (mont29) added a commit: rBe0ff032711ec: Fix T76997: bad handling of embedded IDs in partial append..May 25 2020, 3:28 PM
Bastien Montagne (mont29) added a comment.May 25 2020, 3:38 PM

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