Collections created with CTRL G do not appear in Outliner View Layer #73197

Closed
opened 2020-01-17 15:40:13 +01:00 by Wayne Johnson · 12 comments

System Information
Operating system: Darwin-19.2.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon R9 M295X OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.4.19

Blender Version
Broken: version: 2.83 (sub 0), branch: master, commit date: 2020-01-16 20:11, hash: 86db35845a
Worked: (optional)

Short description of error
Collections created with CTRL G do not appear in Outliner View Layer

Exact steps for others to reproduce the error

  1. Select more than one object
  2. CTRL G to 'Make New Collection'
  3. Observe that this collection is not shown in View Layer of Outliner
  4. Switch Outliner to Blender File
  5. Observe that the new collection IS shown in the Blender File list

Looks like a bug to me?
Thanks
Wayne

**System Information** Operating system: Darwin-19.2.0-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon R9 M295X OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.4.19 **Blender Version** Broken: version: 2.83 (sub 0), branch: master, commit date: 2020-01-16 20:11, hash: `86db35845a` Worked: (optional) **Short description of error** Collections created with CTRL G do not appear in Outliner View Layer **Exact steps for others to reproduce the error** 1. Select more than one object 2. CTRL G to 'Make New Collection' 3. Observe that this collection is not shown in View Layer of Outliner 4. Switch Outliner to Blender File 5. Observe that the new collection IS shown in the Blender File list Looks like a bug to me? Thanks Wayne
Author

Added subscriber: @slowboy

Added subscriber: @slowboy

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

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

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

AFAIK this is by design. The newly created collection doesn't have to be in the scene to be used; for example, it can be used in a particle system.

Something like this could be sufficient to implement this:

diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c
index a00e5e7b198..12c6a488532 100644
--- a/source/blender/editors/object/object_collection.c
+++ b/source/blender/editors/object/object_collection.c
@@ -401,6 +401,28 @@ static int collection_create_exec(bContext *C, wmOperator *op)
   }
   CTX_DATA_END;
 
+  /* Add the new collection to the scene. */
+  Collection *active_collection = CTX_data_collection(C);
+  Scene *scene = CTX_data_scene(C);
+  bool scene_is_linked = ID_IS_LINKED(scene);
+  if ((active_collection->flag & COLLECTION_IS_MASTER) && scene_is_linked) {
+    BKE_report(op->reports, RPT_WARNING, "Cannot add a collection to a linked scene");
+    active_collection = NULL;
+  }
+  else if (ID_IS_LINKED(active_collection)) {
+    /* Fall back to the scene master collection if possible. */
+    if (scene_is_linked) {
+      BKE_report(op->reports, RPT_WARNING, "Cannot add a collection to a linked scene");
+      active_collection = NULL;
+    }
+    else {
+      active_collection = scene->master_collection;
+    }
+  }
+  if (active_collection != NULL) {
+    BKE_collection_child_add(bmain, active_collection, collection);
+  }
+
   DEG_relations_tag_update(bmain);
   WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL);
 

However, a change like this should be properly designed & the behaviour agreed upon before implementing it.

AFAIK this is by design. The newly created collection doesn't have to be in the scene to be used; for example, it can be used in a particle system. Something like this could be sufficient to implement this: ``` diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index a00e5e7b198..12c6a488532 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -401,6 +401,28 @@ static int collection_create_exec(bContext *C, wmOperator *op) } CTX_DATA_END; + /* Add the new collection to the scene. */ + Collection *active_collection = CTX_data_collection(C); + Scene *scene = CTX_data_scene(C); + bool scene_is_linked = ID_IS_LINKED(scene); + if ((active_collection->flag & COLLECTION_IS_MASTER) && scene_is_linked) { + BKE_report(op->reports, RPT_WARNING, "Cannot add a collection to a linked scene"); + active_collection = NULL; + } + else if (ID_IS_LINKED(active_collection)) { + /* Fall back to the scene master collection if possible. */ + if (scene_is_linked) { + BKE_report(op->reports, RPT_WARNING, "Cannot add a collection to a linked scene"); + active_collection = NULL; + } + else { + active_collection = scene->master_collection; + } + } + if (active_collection != NULL) { + BKE_collection_child_add(bmain, active_collection, collection); + } + DEG_relations_tag_update(bmain); WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); ``` However, a change like this should be properly designed & the behaviour agreed upon before implementing it.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

This task was "usually" used for this #53662 (Usability issues with old group operators), @dr.sybren, feel free to merge in either direction...

This task was "usually" used for this #53662 (Usability issues with old group operators), @dr.sybren, feel free to merge in either direction...

Closed as duplicate of #68942

Closed as duplicate of #68942

Added subscriber: @dfelinto

Added subscriber: @dfelinto

I checked with @dfelinto and Ctrl+G is working as designed right now.

I checked with @dfelinto and Ctrl+G is working as designed right now.
Author

Fair enough, but does seem strange to me. If a dialog tells me that I am about to 'Create New Collection' as CTRL+G does, wouldn't I reasonably expect that created Collection to behave just the same as any other Collection, and appear in the View Layer, just as a Collection created in any other way does?

Fair enough, but does seem strange to me. If a dialog tells me that I am about to 'Create New Collection' as CTRL+G does, wouldn't I reasonably expect that created Collection to behave just the same as any other Collection, and appear in the View Layer, just as a Collection created in any other way does?

Added subscriber: @juang3d

Added subscriber: @juang3d

O agree on this, if it’s working as designed there are two possibilities:

1.- Bad design :) but I don’t think so, I see the utility of this

2.- Bad user feedback/UI/communication of what is happening, I think the dialog should communicate a bit better what is happening, and in any case a checkbox like “Instance to Scene” or “Add collection to scene” wouldn’t hurt :)

O agree on this, if it’s working as designed there are two possibilities: 1.- Bad design :) but I don’t think so, I see the utility of this 2.- Bad user feedback/UI/communication of what is happening, I think the dialog should communicate a bit better what is happening, and in any case a checkbox like “Instance to Scene” or “Add collection to scene” wouldn’t hurt :)
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#73197
No description provided.