UI: Rewrite Move to Collection menu #110667

Open
Guillermo Venegas wants to merge 19 commits from guishe/blender:move-to-collection into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

The code with which the move_to_collection operator menu is created is
simplified.

There are several user-visible changes (see #110667 (comment)):

  1. Each sub menu will first draw the collection to which it belongs, then
    the button to create a new child collection, and finally the childs collections.
    Before the button to create a new child collection was first and second the
    button for the collection itself, this way is hard to recognize that the sub menu
    belongs to the collection.

  2. Every collection will have a submenu, in order to be able to select the
    collection or create a new collection from it.

  3. The collection_index parameter is replaced by the collection
    parameter, this simplifies the use of the operator since it is easier to access
    a collection by its name rather than by an index that is not very clear how to
    get outside the apy, now the apy allows to move/link any object to any collection in the
    current file.

  4. Added a operator paramether scene, that uses the scene master collection to move the objects.

On the developer side, the static pointer master_collection_menu is removed,
this variable points to dynamic allocated memory, which is not always freed.
Without this change, when exiting, blender can report the use memory that was
not freed. Removing this variable reduces the chances of taking this leak as
mismanaged memory elsewhere.

The code with which the `move_to_collection` operator menu is created is simplified. There are several user-visible changes (see https://projects.blender.org/blender/blender/pulls/110667#issuecomment-990158): 1. Each sub menu will first draw the `collection` to which it belongs, then the button to create a `new child collection`, and finally the `childs collections`. Before the button to create a `new child collection` was first and second the button for the `collection` itself, this way is hard to recognize that the sub menu belongs to the `collection`. 2. Every collection will have a submenu, in order to be able to select the collection or create a new collection from it. 3. The `collection_index` parameter is replaced by the `collection` parameter, this simplifies the use of the operator since it is easier to access a collection by its name rather than by an index that is not very clear how to get outside the apy, now the apy allows to move/link any object to any collection in the current file. 4. Added a operator paramether `scene`, that uses the scene master collection to move the objects. On the developer side, the static pointer `master_collection_menu` is removed, this variable points to dynamic allocated memory, which is not always freed. Without this change, when exiting, blender can report the use memory that was not freed. Removing this variable reduces the chances of taking this leak as mismanaged memory elsewhere.
Guillermo Venegas added 1 commit 2023-08-01 04:19:33 +02:00
Author
Contributor

Visible changes:

Before After(New collection as last option) After(New collection as Second option)
image image image
Visible changes: | Before | After(New collection as last option) | After(New collection as Second option)| | ----------- | ----------- | ----------- | | ![image](/attachments/299ce2bc-47a1-4a74-b831-5a886c1f30e2) | ![image](/attachments/3888b762-6b82-418c-aba7-9c474626e68e) |![image](/attachments/96bb2d17-329a-4c34-8cd5-890d5bc07a39)|
527 KiB
497 KiB
505 KiB
Iliya Katushenock added the
Module
User Interface
label 2023-08-01 12:33:05 +02:00
Guillermo Venegas added 1 commit 2023-08-01 17:05:50 +02:00
Guillermo Venegas added 1 commit 2023-08-01 20:17:00 +02:00
Guillermo Venegas force-pushed move-to-collection from dd7ad44d69 to 12781e066b 2023-08-02 05:00:21 +02:00 Compare
Guillermo Venegas added 1 commit 2023-08-02 05:04:04 +02:00
Guillermo Venegas added 1 commit 2023-08-02 05:07:50 +02:00
Guillermo Venegas added 1 commit 2023-08-02 21:47:10 +02:00
Guillermo Venegas added 2 commits 2023-08-02 22:09:10 +02:00
Guillermo Venegas added 1 commit 2023-08-02 22:14:06 +02:00
Guillermo Venegas added 1 commit 2023-08-02 22:14:48 +02:00
Guillermo Venegas added 1 commit 2023-08-02 22:23:15 +02:00
First-time contributor

hi, IMHO i want to mention that "new collection" must be close to the flesh, because we want to create new collection and we often have many collections in the list so it's hard to go every time to it, i prefer to have it the second below the scene collection then the existed collections ....

a question, especially GPencil, we create many new layers so having 'new layer' in bottom is a bad choice... so maybe the same here? and will this going to affect GPencil layers?

hi, IMHO i want to mention that "new collection" must be close to the flesh, because we want to create new collection and we often have many collections in the list so it's hard to go every time to it, i prefer to have it the second below the scene collection then the existed collections .... a question, especially GPencil, we create many new layers so having 'new layer' in bottom is a bad choice... so maybe the same here? and will this going to affect GPencil layers?
Guillermo Venegas added 2 commits 2023-08-11 23:05:18 +02:00
Guillermo Venegas added 1 commit 2023-08-11 23:05:37 +02:00
Author
Contributor

a question, especially GPencil, we create many new layers so having 'new layer' in bottom is a bad choice.

@hamza-el-barmaki I moved in this pr New Collection as the second option in menus, I see it reasonable, but it would be better if someone from ui says something about it. And for GPencil new layers, would be another pr

> a question, especially GPencil, we create many new layers so having 'new layer' in bottom is a bad choice. @hamza-el-barmaki I moved in this pr New Collection as the second option in menus, I see it reasonable, but it would be better if someone from ui says something about it. And for GPencil new layers, would be another pr
Guillermo Venegas added 2 commits 2023-09-11 18:07:13 +02:00
Guillermo Venegas added 1 commit 2023-09-21 04:34:36 +02:00
Guillermo Venegas added 1 commit 2023-09-21 04:39:32 +02:00
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u move-to-collection:guishe-move-to-collection
git checkout guishe-move-to-collection
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#110667
No description provided.