diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-05-08 10:45:20 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-05-09 14:27:23 +0300 |
commit | 8342a124c462104c12a98cca0b16e69920316346 (patch) | |
tree | cfcef9e21038d332476ec38abe5cad83eb27face /source/blender/draw/modes/edit_metaball_mode.c | |
parent | f877022956df3b55e30c312b20f364fd2657805c (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/edit_metaball_mode.c')
-rw-r--r-- | source/blender/draw/modes/edit_metaball_mode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c index aa7c6863423..e94d394b98f 100644 --- a/source/blender/draw/modes/edit_metaball_mode.c +++ b/source/blender/draw/modes/edit_metaball_mode.c @@ -26,6 +26,8 @@ #include "BKE_object.h" +#include "DEG_depsgraph_query.h" + #include "ED_mball.h" /* If builtin shaders are needed */ @@ -160,7 +162,8 @@ static void EDIT_METABALL_cache_populate(void *vedata, Object *ob) copy_v3_v3(draw_scale_xform[2], scamat[2]); } - int select_id = ob->select_id; + const Object *orig_object = DEG_get_original_object(ob); + int select_id = orig_object->runtime.select_id; for (MetaElem *ml = mb->editelems->first; ml != NULL; ml = ml->next, select_id += 0x10000) { float world_pos[3]; mul_v3_m4v3(world_pos, ob->obmat, &ml->x); |