Fix #119142: Skip linking collection inside another linked collection #119144

Merged
Pratik Borhade merged 4 commits from PratikPB2123/blender:119142-link-collection into blender-v4.1-release 2024-03-08 12:23:32 +01:00
Member

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.

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.
Pratik Borhade requested review from Bastien Montagne 2024-03-07 07:00:58 +01:00
Author
Member

loose_data_instantiate_collection_process calls BKE_collection_child_add so I made the change in child_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-static

`loose_data_instantiate_collection_process` calls `BKE_collection_child_add` so I made the change in `child_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-static
Pratik Borhade added the
Module
User Interface
label 2024-03-07 07:20:39 +01:00
Bastien Montagne requested changes 2024-03-07 10:51:30 +01:00
Dismissed
Bastien Montagne left a comment
Owner

I'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 that instantiate_context->active_collection is not linked data.

I'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 that `instantiate_context->active_collection` is not linked data.
Bastien Montagne approved these changes 2024-03-07 14:13:07 +01:00
Dismissed
Bastien Montagne left a comment
Owner

Besides small suggestion below, LGTM, thanks for the fix!

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.

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

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

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).
Pratik Borhade force-pushed 119142-link-collection from f71917dc43 to dd3425a02e 2024-03-08 04:36:51 +01:00 Compare
PratikPB2123 changed target branch from main to blender-v4.1-release 2024-03-08 04:37:47 +01:00
Author
Member

@blender-bot build

@blender-bot build
Pratik Borhade added 1 commit 2024-03-08 04:54:14 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
385e708921
Fix formatting
Author
Member

@blender-bot build

@blender-bot build
Bastien Montagne approved these changes 2024-03-08 09:58:17 +01:00
Pratik Borhade merged commit 021565d867 into blender-v4.1-release 2024-03-08 12:23:32 +01:00
Pratik Borhade deleted branch 119142-link-collection 2024-03-08 12:23:38 +01:00
Author
Member

Thanks for the review. Added this commit in both backport list :)

Thanks for the review. Added this commit in both backport list :)
Sign in to join this conversation.
No reviewers
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
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#119144
No description provided.