Fix #119142: Skip linking collection inside another linked collection #119144
No reviewers
Labels
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119144
Loading…
Reference in New Issue
No description provided.
Delete Branch "PratikPB2123/blender:119142-link-collection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When linking a collection from library, it can be linked inside another
linked/overrided collection if it is selected in outliner. This can be
prevented by linking with editable parent collection.
loose_data_instantiate_collection_process
callsBKE_collection_child_add
so I made the change inchild_add
function (might be helpful in other cases as well).We can do this fix in
loose_data_instantiate_collection_process
by making the collection function non-staticI'd rather not modify BKE core function to add such checks, especially now that we are more and more going into allowing some code to edit linked data (like liboverride resync, doversion, etc.).
IMHO the code that needs to be fixed here is
loose_data_instantiate_ensure_active_collection
, which should ensure thatinstantiate_context->active_collection
is not linked data.Besides small suggestion below, LGTM, thanks for the fix!
@ -524,7 +524,8 @@ static void loose_data_instantiate_ensure_active_collection(
if (instantiate_context->active_collection == nullptr) {
I would add a comment here, stating that in case the
active_collection
is non-null, it is assumed to be editable.@blender-bot build
Oh! Just realized you created this fix against main.
It should rather be committed to 4.1, then merge 4.1 into main, and add the fix to the backport lists for the active LTS too (3.6 and 3.3).
f71917dc43
todd3425a02e
@blender-bot build
@blender-bot build
Thanks for the review. Added this commit in both backport list :)