diff options
author | Jacques Lucke <jacques@blender.org> | 2020-11-24 19:32:40 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-11-24 19:32:56 +0300 |
commit | e922dd7d8a307c54d49bc01649a12610b022192b (patch) | |
tree | 21ab3edb04efa7eb95aec6f8df0868acd820ea1c /source/blender/depsgraph | |
parent | 256a9d983d4862560071393f7ddf44bcbd34ad74 (diff) |
Viewport: cannot select object by clicking on its instances
Selecting an object by clicking on its instances only worked,
when the object itself is visible. However, it is possible to hide
the object and still keep the instances visible.
The solution is to give every object the correct `select_id` in the
depsgraph object iterator right before rendering.
Reviewers: fclem, brecht
Differential Revision: https://developer.blender.org/D9640
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_query_iter.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc index 7d47e1fb541..dd5c998466b 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc @@ -154,6 +154,7 @@ bool deg_objects_dupli_iterator_next(BLI_Iterator *iter) dupli_parent->runtime.local_collections_bits; temp_dupli_object->dt = MIN2(temp_dupli_object->dt, dupli_parent->dt); copy_v4_v4(temp_dupli_object->color, dupli_parent->color); + temp_dupli_object->runtime.select_id = dupli_parent->runtime.select_id; /* Duplicated elements shouldn't care whether their original collection is visible or not. */ temp_dupli_object->base_flag |= BASE_VISIBLE_DEPSGRAPH; @@ -224,6 +225,7 @@ void deg_iterator_objects_step(BLI_Iterator *iter, deg::IDNode *id_node) } } + object->runtime.select_id = DEG_get_original_object(object)->runtime.select_id; if (ob_visibility & OB_VISIBLE_INSTANCES) { if ((data->flag & DEG_ITER_OBJECT_FLAG_DUPLI) && (object->transflag & OB_DUPLI)) { data->dupli_parent = object; |