Outliner Context Menu Cleanup #77770

Closed
opened 2020-06-11 17:43:12 +02:00 by Nathan Craddock · 6 comments

The outliner context menu needs an extensive cleanup.

  • Many of the tools are implemented as "multi" operators that combine multiple similar operators into one. This has caused issues in the past (e.g. undo 121b2c0424).
  • The combined operators also cause the "Undocumented Operator" title and description for most of the context menu entries
  • Some operators do not work; a report is sent saying "Not yet implemented" to the user. This has been the case for a long time.
  • The context menu options are based on the selection. For example, a right click on a modifier properly brings up the context menu to delete the modifier. But if any other items are selected, a Delete entry is still shown, but it is mapped to delete objects and not modifiers.

A refactoring of most (all?) of the outliner operators and related code is needed to address these issues. Some work has already started with D7558: Outliner: Add new delete operator by combining the object and collection delete operators into a separate operator.

The proposed behavior of the new context menu:

  1. Entries in the context menu are shown based on the target of the right-click rather than the selection. In the above example about modifier delete, the right click on the modifier would still show the delete modifier option because the modifier was the target of the right-click.
    If selection exists, but the right-click target is outside of the selection, the target will replace the selection If the target is already selected, no selection will be modified
  2. The object_operation, id_operation, etc. operators will be split up into smaller, more focused operators.
    ** One benefit of the current combined operators is that they can share logic (like loops over the outliner tree). A function to iterate through the tree returning only the objects supported for the operation can be created to be used in each operator.
  3. As much as possible, and where logical, support the operator for the entire selection (supported items).
  4. Rely on synced selection. For example, we currently have Object Select Hierarchy and Collection Select Objects operators to select child objects. The behavior of these are essentially the same; select the objects in the tree beneath the selected object. In this case, synced selection of object makes this a very easy operator to implement: recursively select the objects in the tree. This will remove similar/duplicated code. An additional benefit is that these operators will work when synced selection is disabled by selecting the outliner elements and then syncing to objects if syncing is enabled.
  5. Remove unnecessary operators to focus the outliner. For example, Object Select and Object Deselect don't make much sense in a context menu when those are supported now by synced selection.

Overall there are two targets:

  1. Cleaner and updated code.
  2. Better user experience. (Operate on right-click target and cleaner context menu entries. Menu entry tooltips)
The outliner context menu needs an extensive cleanup. * Many of the tools are implemented as "multi" operators that combine multiple similar operators into one. This has caused issues in the past (e.g. undo 121b2c0424). * The combined operators also cause the "Undocumented Operator" title and description for most of the context menu entries * Some operators do not work; a report is sent saying "Not yet implemented" to the user. This has been the case for a long time. * The context menu options are based on the selection. For example, a right click on a modifier properly brings up the context menu to delete the modifier. But if any other items are selected, a `Delete` entry is still shown, but it is mapped to delete objects and not modifiers. A refactoring of most (all?) of the outliner operators and related code is needed to address these issues. Some work has already started with [D7558: Outliner: Add new delete operator](https://archive.blender.org/developer/D7558) by combining the object and collection delete operators into a separate operator. The proposed behavior of the new context menu: 1. Entries in the context menu are shown based on the *target* of the right-click rather than the selection. In the above example about modifier delete, the right click on the modifier would still show the delete modifier option because the modifier was the target of the right-click. **If selection exists, but the right-click target is outside of the selection, the target will replace the selection** If the target is already selected, no selection will be modified 2. The `object_operation`, `id_operation`, etc. operators will be split up into smaller, more focused operators. ** One benefit of the current combined operators is that they can share logic (like loops over the outliner tree). A function to iterate through the tree returning only the objects supported for the operation can be created to be used in each operator. 3. As much as possible, and where logical, support the operator for the entire selection (supported items). 4. Rely on synced selection. For example, we currently have `Object Select Hierarchy` and `Collection Select Objects` operators to select child objects. The behavior of these are essentially the same; select the objects in the tree beneath the selected object. In this case, synced selection of object makes this a very easy operator to implement: recursively select the objects in the tree. This will remove similar/duplicated code. An additional benefit is that these operators will work when synced selection is disabled by selecting the outliner elements and then syncing to objects if syncing is enabled. 5. Remove unnecessary operators to focus the outliner. For example, `Object Select` and `Object Deselect` don't make much sense in a context menu when those are supported now by synced selection. Overall there are two targets: 1. Cleaner and updated code. 2. Better user experience. (Operate on right-click target and cleaner context menu entries. Menu entry tooltips)
Nathan Craddock self-assigned this 2020-06-11 17:43:12 +02:00
Author
Member

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

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

Added subscriber: @natecraddock

Added subscriber: @natecraddock

blender/documentation#76297 was marked as duplicate of this issue

blender/documentation#76297 was marked as duplicate of this issue
Member

Added subscribers: @Alaska, @Blendify, @jenkm, @ankitm, @lichtwerk

Added subscribers: @Alaska, @Blendify, @jenkm, @ankitm, @lichtwerk
Author
Member

Resolved by b0741e1dcb

Resolved by b0741e1dcb
Author
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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
3 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#77770
No description provided.