Could not link object because the collection 'Master Collection'(of appended scene) is linked #76997

Closed
opened 2020-05-23 17:13:22 +02:00 by MACHIN3 · 17 comments

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: e8dd8c2829
Worked: 31bf04fad9

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 e8dd8c2829 (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.
link_obj_to_master_collection.zip

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
**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: `e8dd8c2829` Worked: `31bf04fad9` **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 `e8dd8c2829` (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. [link_obj_to_master_collection.zip](https://archive.blender.org/developer/F8549499/link_obj_to_master_collection.zip) **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
Author

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3

Added subscriber: @Pinnhead

Added subscriber: @Pinnhead

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'

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'

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Richard Antalik self-assigned this 2020-05-25 14:16:32 +02:00

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

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

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Member

Changed status from 'Archived' to: 'Confirmed'

Changed status from 'Archived' to: 'Confirmed'
Member

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'

@mont29: this is not supposed to assert, right?

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' ``` @mont29: this is not supposed to assert, right?
Author

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?

> 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?
Richard Antalik was unassigned by Bastien Montagne 2020-05-25 14:38:07 +02:00
Bastien Montagne self-assigned this 2020-05-25 14:38:07 +02:00

@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...

@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...
Member

My related commit was 0a32f6c868 -- but that should only kick in if stuff is really linked/overridden

My related commit was 0a32f6c868 -- but that should only kick in if stuff is really linked/overridden

This issue was referenced by e0ff032711

This issue was referenced by e0ff032711ec1a8cb85a2a9be9a6b0188d7f9db5

This issue was referenced by 7a37db6125

This issue was referenced by 7a37db61258ed7d34e76f1e55a5fb7c597f8104e

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Member

In #76997#938247, @mont29 wrote:
@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 df8cbdc696 with saving a default scene and then appending that scene into a new default startup scene
#76997.blend

  • File > Append > #76997.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

> In #76997#938247, @mont29 wrote: > @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 df8cbdc696 with saving a default scene and then appending that scene into a new default startup scene [#76997.blend](https://archive.blender.org/developer/F8552942/T76997.blend) - File > Append > #76997.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`

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

@lichtwerk Ah, I see now, would not trigger with provided file in this task because it has no children collections...
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 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#76997
No description provided.