Wrong object selection with multiple view layers #55617

Closed
opened 2018-06-25 15:45:33 +02:00 by Sybren A. Stüvel · 14 comments

System Information
Kubuntu 17.10, AMD Tonga PRO Radeon R9 285/380 video card with Mesa drivers

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Tonga PRO [Radeon R9 285/380]

Blender Version
Broken: 476b4c415c

Short description of error

Right-click to select sometimes selects the wrong object. Multiple clicks will cycle to the correct object eventually.

Exact steps for others to reproduce the error

  1. Open the attached blend file layercake.blend
  2. Switch the view layer (top-right corner) to 'Physics Sim'
  3. Switch the view layer back to 'RenderLayer'
  4. Right-click on the right-most Suzanne. This selects the Green plane.
  5. Right-click on the top-most Suzanne. This selects the Red plane.
  6. Right-click on the top-most Suzanne again. This selects the Suzanne.

Switching the view layers is important; without it, the bug doesn't show up.

recording-2018-06-25_15.35.30.mp4

**System Information** Kubuntu 17.10, AMD Tonga PRO Radeon R9 285/380 video card with Mesa drivers `01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Tonga PRO [Radeon R9 285/380]` **Blender Version** Broken: 476b4c415c091adf1 **Short description of error** Right-click to select sometimes selects the wrong object. Multiple clicks will cycle to the correct object eventually. **Exact steps for others to reproduce the error** 1. Open the attached blend file [layercake.blend](https://archive.blender.org/developer/F3795066/layercake.blend) 2. Switch the view layer (top-right corner) to 'Physics Sim' 3. Switch the view layer back to 'RenderLayer' 4. Right-click on the right-most Suzanne. This selects the Green plane. 5. Right-click on the top-most Suzanne. This selects the Red plane. 6. Right-click on the top-most Suzanne again. This selects the Suzanne. Switching the view layers is important; without it, the bug doesn't show up. [recording-2018-06-25_15.35.30.mp4](https://archive.blender.org/developer/F3795070/recording-2018-06-25_15.35.30.mp4)

#62666 was marked as duplicate of this issue

#62666 was marked as duplicate of this issue
Author
Member

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Campbell Barton was assigned by Sybren A. Stüvel 2018-06-25 15:46:17 +02:00
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

The problem in the video looks a bit similar to #62666.

The problem in the video looks a bit similar to #62666.

Added subscribers: @MACHIN3, @RobertWesseling, @Teds

Added subscribers: @MACHIN3, @RobertWesseling, @Teds
Brecht Van Lommel changed title from Right-click selects the wrong object to Wrong object selection with multiple view layers 2019-04-05 01:38:56 +02:00

Added subscriber: @brecht

Added subscriber: @brecht

DepsgraphNodeBuilder::build_view_layer assigns each original Object a unique select_id, based on its order in the view layer base list. If there are multiple view layers this can't work correctly, as objects are shared between view layers.

context.scene.update() updates all view layers in the scene, instead of just the active one as usual, so that's another way to trigger the problem.

Possible solutions:
a) select_id in Base which is per view layer.
b) select_id in each original Object, based on its position in the main->objects list.
c) select_id in each evaluated Object which is per view layer.
d) Build a temporary hash for selection and don't store it persistently at all.

`DepsgraphNodeBuilder::build_view_layer` assigns each original `Object` a unique `select_id`, based on its order in the view layer base list. If there are multiple view layers this can't work correctly, as objects are shared between view layers. `context.scene.update()` updates all view layers in the scene, instead of just the active one as usual, so that's another way to trigger the problem. Possible solutions: a) `select_id` in `Base` which is per view layer. b) `select_id` in each original `Object`, based on its position in the `main->objects` list. c) `select_id` in each evaluated `Object` which is per view layer. d) Build a temporary hash for selection and don't store it persistently at all.

Removed subscriber: @Teds

Removed subscriber: @Teds

Added subscriber: @RainerTrummer

Added subscriber: @RainerTrummer

Added subscriber: @dfelinto

Added subscriber: @dfelinto
Campbell Barton was unassigned by Jeroen Bakker 2019-05-07 16:57:30 +02:00
Jeroen Bakker self-assigned this 2019-05-07 16:57:30 +02:00
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

Evaluating the different options @brecht proposes

a) no change in performance as it is a counter, when selecting the base needs to be checked. which I assume would be no problem, impacts a lot of code as select_id is used in many places
b) smallest change in code, adds loop over all objects in DepsgraphNodeBuilder::build_view_layer (negligible performance impact), but does update objects that are not needed at this moment. You could argue if it is logical to add the code to the build_view_layer....
c) not 100% sure about c, but that could also be my limmitted knowledge of the depsgraph evaluation. isn't the orig object used when no changes happens to the object?
d) you could argue that this option is the best in design as it solves the issue in the selection code and does not use deps builder at all, but will impact a lot of code as select_id is used in many places and for all these placed we need to find a solution.

Looking at the time we might want to spend on this issue I would go for B in the short term.

Evaluating the different options @brecht proposes a) no change in performance as it is a counter, when selecting the base needs to be checked. which I assume would be no problem, impacts a lot of code as select_id is used in many places b) smallest change in code, adds loop over all objects in `DepsgraphNodeBuilder::build_view_layer` (negligible performance impact), but does update objects that are not needed at this moment. You could argue if it is logical to add the code to the build_view_layer.... c) not 100% sure about c, but that could also be my limmitted knowledge of the depsgraph evaluation. isn't the orig object used when no changes happens to the object? d) you could argue that this option is the best in design as it solves the issue in the selection code and does not use deps builder at all, but will impact a lot of code as select_id is used in many places and for all these placed we need to find a solution. Looking at the time we might want to spend on this issue I would go for B in the short term.
Member

Hmmm... armature drawing, meta balls use the select_id on object.

Just discussed for the next solution:

  • move select_id to runtime data.
  • add a BKE_object method to update all select_id, based on their index in the main->objects
  • find all operators that perform selects and add a call to the method described above.
Hmmm... armature drawing, meta balls use the select_id on object. Just discussed for the next solution: * move select_id to runtime data. * add a BKE_object method to update all select_id, based on their index in the main->objects * find all operators that perform selects and add a call to the method described above.
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' 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
8 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#55617
No description provided.