Fix #111613: Gesture selection does not deselect when elements hidden #111692

Open
Pratik Borhade wants to merge 2 commits from PratikPB2123/blender:111613-fix-click-deselect into main

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

When objects/collections are hidden, BASE_SELECTED flag is cleared in
BKE_base_eval_flags. When deselecting in viewport, this flag is
considered, otherwise selection is skipped. If nothing is changed during
select/box/lasso select, notifiers are not sent to other regions. Due to
above reasons, selection of hidden object is skipped.
To fix this, send notifiers to outliner whenever operation is executed.

Would it affect the performence in large files? I'm not sure. In that case we can think
of alternative solution.

When objects/collections are hidden, `BASE_SELECTED` flag is cleared in `BKE_base_eval_flags`. When deselecting in viewport, this flag is considered, otherwise selection is skipped. If nothing is changed during select/box/lasso select, notifiers are not sent to other regions. Due to above reasons, selection of hidden object is skipped. To fix this, send notifiers to outliner whenever operation is executed. Would it affect the performence in large files? I'm not sure. In that case we can think of alternative solution.
Pratik Borhade added 1 commit 2023-08-30 13:22:36 +02:00
9bd3d4fac9 Fix #111613: Gesture selection does not deselect when elements hidden
When objects/collections are hidden, `BASE_SELECTED` flag is cleared in
`BKE_base_eval_flags`. When deselecting in viewport, this flag is
considered, otherwise selection is skipped. If nothing is changed during
select/box/lasso select, notifiers are not sent to other regions. Due to
above reasons, selection of hidden object is skipped.
To fix this, send notifiers to outliner whenever operation is executed.

Would it affect the performace? I'm not sure. In that case we can think
of alternative solution.
Pratik Borhade requested review from Julien Kaspar 2023-08-30 13:23:35 +02:00
Pratik Borhade added the
Module
User Interface
label 2023-08-30 13:23:43 +02:00
Author
Member

When deselecting in viewport, this flag is considered

One reference commit: 98bb22a207
I can understand the importance of BASE_SELECTED. Without this if condition, undo steps will be created on every operator call.

> When deselecting in viewport, this flag is considered One reference commit: 98bb22a207037c32ab3dfa3fb3c0df343c611dfb I can understand the importance of `BASE_SELECTED`. Without this `if` condition, undo steps will be created on every operator call.
Member

It works fine with collections with this patch.
But hidden objects are still not deselected in the outliner when using box/lasso selection on empty space. This is still inconsistent with using click selection in empty space.

It works fine with collections with this patch. But hidden objects are still not deselected in the outliner when using box/lasso selection on empty space. This is still inconsistent with using click selection in empty space.
Pratik Borhade added 1 commit 2023-08-31 12:28:46 +02:00
Author
Member

@JulienKaspar , thanks. AFAICS, objects are not deselected by box/lasso gestures when collection is hidden but not the object. Is this what you're observing after applying the PR?

@JulienKaspar , thanks. AFAICS, objects are not deselected by box/lasso gestures [when collection is hidden but not the object](/attachments/6900159a-44ea-4807-b53e-af105ef8a978). Is this what you're observing after applying the PR?
Member

@PratikPB2123 Correct.

@PratikPB2123 Correct.
Author
Member

This can be fixed either by removing BASE_SELECTED flags for child objects of collection
or by removing if(BASE_SELECTABLE(v3d, base)) condition from object_deselect_all_visible function definition.

I'm not sure about consequences of these suggested changes.
@ideasman42 , any idea?


Edit:

Why objects are not deselecting when only collection is hidden: Because object still has `BASE_SELECTED` flag set. If object is not visible and `BASE_SELECTED` flag is set then `BASE_SELECTED` flag is not cleared in `object_deselect_all_visible`

During outline redraw, tree element will remain selected because BASE_SELECTED is still there, see: outliner_select_sync_from_object

This can be fixed either by removing `BASE_SELECTED` flags for child objects of collection or by removing `if(BASE_SELECTABLE(v3d, base))` condition from `object_deselect_all_visible` function definition. I'm not sure about consequences of these suggested changes. @ideasman42 , any idea? - - - Edit: <details> <summary> Why objects are not deselecting when only collection is hidden: </summary> Because object still has `BASE_SELECTED` flag set. If object is not visible and `BASE_SELECTED` flag is set then `BASE_SELECTED` flag is not cleared in `object_deselect_all_visible` During outline redraw, tree element will remain selected because `BASE_SELECTED` is still there, see: `outliner_select_sync_from_object` </details>
This pull request has changes conflicting with the target branch.
  • source/blender/editors/space_view3d/view3d_select.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 111613-fix-click-deselect:PratikPB2123-111613-fix-click-deselect
git checkout PratikPB2123-111613-fix-click-deselect
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#111692
No description provided.