diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-07-02 17:03:49 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-07-02 17:04:38 +0300 |
commit | 57c26453f8aa3ad49a8927f5e299dcab1f2c510b (patch) | |
tree | c0bfc57b231172800e46606b856f3484773e64fa /source/blender/draw/modes/overlay_mode.c | |
parent | c362ca3b8abbc6ee766cc2dd1fd8f612889d18c7 (diff) |
Fix T66295 Collection instance duplicates don't have selection outline
Was cause by shgroup reuse even if select state changed from previous dupli.
Also fixes T64438 Collection Instance object highlight wrong
Diffstat (limited to 'source/blender/draw/modes/overlay_mode.c')
-rw-r--r-- | source/blender/draw/modes/overlay_mode.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c index ae5c0064cde..a5b1133abf4 100644 --- a/source/blender/draw/modes/overlay_mode.c +++ b/source/blender/draw/modes/overlay_mode.c @@ -50,6 +50,7 @@ typedef struct OVERLAY_DupliData { DRWShadingGroup *shgrp; struct GPUBatch *geom; + short base_flag; } OVERLAY_DupliData; typedef struct OVERLAY_StorageList { @@ -370,9 +371,16 @@ static void overlay_cache_populate(void *vedata, Object *ob) } else { if ((*dupli_data)->shgrp && (*dupli_data)->geom) { - DRW_shgroup_call((*dupli_data)->shgrp, (*dupli_data)->geom, ob); + if ((*dupli_data)->base_flag == ob->base_flag) { + DRW_shgroup_call((*dupli_data)->shgrp, (*dupli_data)->geom, ob); + } + else { + /* Continue and create a new Shgroup. */ + } + } + else { + return; } - return; } } @@ -437,6 +445,7 @@ static void overlay_cache_populate(void *vedata, Object *ob) if (dupli_data) { (*dupli_data)->shgrp = shgrp; (*dupli_data)->geom = geom; + (*dupli_data)->base_flag = ob->base_flag; } } } |