Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2019-05-08 10:45:20 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-05-09 14:27:23 +0300
commit8342a124c462104c12a98cca0b16e69920316346 (patch)
treecfcef9e21038d332476ec38abe5cad83eb27face /source/blender/draw/modes/object_mode.c
parentf877022956df3b55e30c312b20f364fd2657805c (diff)
DepsGraph: Multi ViewLayer Selection
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. Reviewed By: sergey, brecht Maniphest Tasks: T55617 Differential Revision: https://developer.blender.org/D4824
Diffstat (limited to 'source/blender/draw/modes/object_mode.c')
-rw-r--r--source/blender/draw/modes/object_mode.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 5f4888812f9..c494e222b3d 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -1925,13 +1925,14 @@ static void camera_view3d_stereoscopy_display_extra(OBJECT_ShadingGroupList *sgl
static void camera_view3d_reconstruction(OBJECT_ShadingGroupList *sgl,
Scene *scene,
View3D *v3d,
- const Object *camera_object,
+ Object *camera_object,
Object *ob,
const float color[4],
const bool is_select)
{
const DRWContextState *draw_ctx = DRW_context_state_get();
Camera *cam = ob->data;
+ const Object *orig_camera_object = DEG_get_original_object(camera_object);
if ((v3d->flag2 & V3D_SHOW_RECONSTRUCTION) == 0) {
return;
@@ -2012,7 +2013,7 @@ static void camera_view3d_reconstruction(OBJECT_ShadingGroupList *sgl,
}
if (is_select) {
- DRW_select_load_id(camera_object->select_id | (track_index << 16));
+ DRW_select_load_id(orig_camera_object->runtime.select_id | (track_index << 16));
track_index++;
}
@@ -2078,7 +2079,7 @@ static void DRW_shgroup_camera(OBJECT_ShadingGroupList *sgl, Object *ob, ViewLay
RegionView3D *rv3d = draw_ctx->rv3d;
Camera *cam = ob->data;
- const Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera);
+ Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera);
const bool is_select = DRW_state_is_select();
const bool is_active = (ob == camera_object);
const bool look_through = (is_active && (rv3d->persp == RV3D_CAMOB));