Content from linked scenes disappears after reopening the linked-to file #115486

Closed
opened 2023-11-27 17:23:42 +01:00 by wojtaj · 7 comments

System Information
Operating system: Windows-10-10.0.22631-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 546.17

Blender Version
Broken: version: 3.5.1, branch: blender-v3.5-release, commit date: 2023-04-24 18:11, hash: e1ccd9d4a1d3
Worked: 3.4

Short description of error
I noticed this issue while developing an addon to link multiple scenes into one blend file. The scenes seem to be linked properly at first, but when I save and reopen the linked-to blend, the contents from the other files are now missing. Linking collections only appears to work correctly.

Exact steps for others to reproduce the error

  1. Create a new .blend file, save it as "one.blend"
  2. Create a second new .blend file, save it as "two.blend"
  3. Create a third new .blend file, save it as "target.blend"
  4. Using File -> Link, link the default scenes from one.blend and two.blend to target.blend
    Screenshot 2023-11-27 164843.png
  5. Save, close, and reopen target.blend
  6. one.blend and two.blend are still linked, but the contents are missing
    Screenshot 2023-11-27 164943.png
    6a) (alternative) one.blend stays properly linked if target.blend was saved while the scene from one.blend was active (interchangeable with two.blend)
    Screenshot 2023-11-27 165119.png
**System Information** Operating system: Windows-10-10.0.22631-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 546.17 **Blender Version** Broken: version: 3.5.1, branch: blender-v3.5-release, commit date: 2023-04-24 18:11, hash: `e1ccd9d4a1d3` Worked: 3.4 **Short description of error** I noticed this issue while developing an addon to link multiple scenes into one blend file. The scenes seem to be linked properly at first, but when I save and reopen the linked-to blend, the contents from the other files are now missing. Linking collections only appears to work correctly. **Exact steps for others to reproduce the error** 1) Create a new .blend file, save it as "one.blend" 2) Create a second new .blend file, save it as "two.blend" 3) Create a third new .blend file, save it as "target.blend" 4) Using File -> Link, link the default scenes from one.blend and two.blend to target.blend [![Screenshot 2023-11-27 164843.png](/attachments/1e8fd61b-21e1-4988-b84d-56c4e2044e59)](url) 5) Save, close, and reopen target.blend 6) one.blend and two.blend are still linked, but the contents are missing [![Screenshot 2023-11-27 164943.png](/attachments/2833ad6f-99f3-455c-9403-459546389c5a)](url) 6a) (alternative) one.blend stays properly linked if target.blend was saved while the scene from one.blend was active (interchangeable with two.blend) [![Screenshot 2023-11-27 165119.png](/attachments/431701c5-0b60-446a-aaae-67683b66f3e0)](url)
wojtaj added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-11-27 17:23:42 +01:00
Member

Hi, thanks for the report. I can confirm.
Guess this has been reported before but unable to locate, I'll bisect it anyways.

Hi, thanks for the report. I can confirm. Guess this has been reported before but unable to locate, I'll bisect it anyways.
Pratik Borhade added
Module
Core
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-12-06 11:43:38 +01:00
Pratik Borhade added
Priority
High
and removed
Priority
Normal
labels 2023-12-06 11:51:56 +01:00
Member

behavior changed between ae081b2de1d4 - 9cb061f4f011

behavior changed between `ae081b2de1d4 - 9cb061f4f011`
Member

Caused by 133dde41bb
But this is not a bug then as @mont29 said in #113109 (comment) because scene is unused

Caused by 133dde41bb5bbbbd083b12723f1ec9053764348a But this is not a bug then as @mont29 said in https://projects.blender.org/blender/blender/issues/113109#issuecomment-1036892 because scene is unused

This is indeed the expected behavior currently, see also #106321 and #105786.

The Scene case is a bit more problematic than nodes or texts data-blocks, but I think ultimately the answer would be the same: if you want to keep an unused linked ID, you have to manually reference it in your local data somehow (typically by adding a Custom Property pointing to it, from Blender 4.0 onward).

(Technically, we could make an exception for linked Scene IDs, but then we end up again with the 'garbage data piling up in production files' issue, especially since Scenes would typically link in a lot of other things).

@brecht not sure if you'd have another point of view on this topic?

This is indeed the expected behavior currently, see also #106321 and #105786. The Scene case is a bit more problematic than nodes or texts data-blocks, but I think ultimately the answer would be the same: if you want to keep an unused linked ID, you have to manually reference it in your local data somehow (typically by adding a Custom Property pointing to it, from Blender 4.0 onward). (Technically, we _could_ make an exception for linked Scene IDs, but then we end up again with the 'garbage data piling up in production files' issue, especially since Scenes would typically link in a lot of other things). @brecht not sure if you'd have another point of view on this topic?

@mont29 I think an exception for scenes would actually make sense. It's basically the top level datablock, there are cases where it doesn't really make sense to attach it to anything else. I think in some sense the main database is a user of the scene.

If we make an exception, would it be possible to have a distinction between directly and indirectly linked scenes? Like a background set scene would be indirectly link, and could be removed along with the scene using it. Or is that not practical in the design?

@mont29 I think an exception for scenes would actually make sense. It's basically the top level datablock, there are cases where it doesn't really make sense to attach it to anything else. I think in some sense the main database is a user of the scene. If we make an exception, would it be possible to have a distinction between directly and indirectly linked scenes? Like a background set scene would be indirectly link, and could be removed along with the scene using it. Or is that not practical in the design?

@mont29 I think an exception for scenes would actually make sense. It's basically the top level datablock, there are cases where it doesn't really make sense to attach it to anything else. I think in some sense the main database is a user of the scene.

Make sense to me as well.

If we make an exception, would it be possible to have a distinction between directly and indirectly linked scenes? Like a background set scene would be indirectly link, and could be removed along with the scene using it. Or is that not practical in the design?

@brecht No, we do not have that info at all currently. We could add it (as a new flag in ID struct, that gets saved as part of the 'linked reference' ID on disk e.g., and is only set for scenes explicitly linked by the user from the FileBrowser)... That's more or less what was proposal nbr. 1 in #106321.

But I think it would be simpler to just never move a linked scene marked as 'directly linked' back to 'indirectly linked' status. That way, scenes that were indirectly linked (as a dependency of another linked data) and never e.g. made active in any window or workspace, or referenced by any other local ID, would still be discarded when their linked usage disappear.

Note that that would be going back to previous situation, for Scene IDs. I think that this is acceptable, considering that typically there are not hundreds or more of scenes in a blendfile, and that they are quite easily discoverable and browsable from the main UI.

> @mont29 I think an exception for scenes would actually make sense. It's basically the top level datablock, there are cases where it doesn't really make sense to attach it to anything else. I think in some sense the main database is a user of the scene. Make sense to me as well. > If we make an exception, would it be possible to have a distinction between directly and indirectly linked scenes? Like a background set scene would be indirectly link, and could be removed along with the scene using it. Or is that not practical in the design? @brecht No, we do not have that info at all currently. We could add it (as a new flag in ID struct, that gets saved as part of the 'linked reference' ID on disk e.g., and is only set for scenes explicitly linked by the user from the FileBrowser)... That's more or less what was proposal nbr. 1 in #106321. But I think it would be simpler to just never move a linked scene marked as 'directly linked' back to 'indirectly linked' status. That way, scenes that were indirectly linked (as a dependency of another linked data) and never e.g. made active in any window or workspace, or referenced by any other local ID, would still be discarded when their linked usage disappear. Note that that would be going back to previous situation, for Scene IDs. I think that this is acceptable, considering that typically there are not hundreds or more of scenes in a blendfile, and that they are quite easily discoverable and browsable from the main UI.

But I think it would be simpler to just never move a linked scene marked as 'directly linked' back to 'indirectly linked' status. That way, scenes that were indirectly linked (as a dependency of another linked data) and never e.g. made active in any window or workspace, or referenced by any other local ID, would still be discarded when their linked usage disappear.

That sounds reasonable.

> But I think it would be simpler to just never move a linked scene marked as 'directly linked' back to 'indirectly linked' status. That way, scenes that were indirectly linked (as a dependency of another linked data) and never e.g. made active in any window or workspace, or referenced by any other local ID, would still be discarded when their linked usage disappear. That sounds reasonable.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-12-13 19:01:07 +01:00
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
4 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#115486
No description provided.