Page MenuHome

DepsGraph: Multi ViewLayer Selection
ClosedPublic

Authored by Jeroen Bakker (jbakker) on May 8 2019, 9:50 AM.

Details

Summary

When using multiple viewlayers and switching between them the selection
gets buggy. The reason for this is that the select_id is updated based
on the index in the viewlayer. This makes the select_id not unique as
objects might be shared or not shared at all.

This fix will update the select_id on all objects in main. This will be triggered in all the selection operators.

Diff Detail

Repository
rB Blender
Branch
T55617 (branched from master)
Build Status
Buildable 3550
Build 3550: arc lint + arc unit

Event Timeline

Harbormaster completed remote builds in B3536: Diff 15198.
Sergey Sharybin (sergey) requested changes to this revision.May 8 2019, 9:59 AM

This code does not belong to dependency graph building: if one needs to create dependency graph for motion paths creation or for compositor/sequencer evaluation, this must not touch anything unrelated to that.

In short words: dependency graph building must not change input data.

source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
112

Comment is a sentence, starting with a capital letter and ending with a fullstop.

115

Appears you are not using clang-format. There should be no space before ++.
Make sure you've got properly configured clang-format.

This revision now requires changes to proceed.May 8 2019, 9:59 AM

Every select operator will now ensure the select_id.

Jeroen Bakker (jbakker) retitled this revision from DepsGraph: Multi Viewport Selection to DepsGraph: Multi Viewport Selection (WIP).May 8 2019, 4:27 PM
Jeroen Bakker (jbakker) planned changes to this revision.

Still need to test armature selection and meta ball selection and some edge cases

Jeroen Bakker (jbakker) changed the visibility from "Public (No Login Required)" to "No One".May 8 2019, 4:28 PM
Jeroen Bakker (jbakker) changed the visibility from "No One" to "Public (No Login Required)".
Jeroen Bakker (jbakker) marked 2 inline comments as done.
Brecht Van Lommel (brecht) requested changes to this revision.May 8 2019, 4:59 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/depsgraph/intern/depsgraph_query_iter.cc
147–148

This should be DEG_get_original_object(dupli_parent)->runtime.select_id, since select IDs are only updated in the original.

Or we could remove this line entirely since select_id is never read from BASE_FROM_DUPLI objects.

source/blender/draw/modes/object_mode.c
2014

DEG_get_original_object(camera_object)->runtime.select_id?

source/blender/editors/space_view3d/view3d_select.c
1174

G_MAIN -> CTX_data_main(C), here and in other places.

source/blender/makesdna/DNA_object_types.h
139

Add a comment that this is only in the original object.

Jeroen Bakker (jbakker) retitled this revision from DepsGraph: Multi Viewport Selection (WIP) to DepsGraph: Multi ViewLayer Selection (WIP).May 9 2019, 9:26 AM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) marked 4 inline comments as done.May 9 2019, 10:50 AM
Jeroen Bakker (jbakker) updated this revision to Diff 15223.
  • armature bone selection
  • metaball edit mode selection
source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
111

Remove empty line

Jeroen Bakker (jbakker) retitled this revision from DepsGraph: Multi ViewLayer Selection (WIP) to DepsGraph: Multi ViewLayer Selection.May 9 2019, 10:57 AM
This revision is now accepted and ready to land.May 9 2019, 12:16 PM
This revision was automatically updated to reflect the committed changes.