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:
authorClément Foucault <foucault.clem@gmail.com>2019-07-02 17:03:49 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-07-02 17:04:38 +0300
commit57c26453f8aa3ad49a8927f5e299dcab1f2c510b (patch)
treec0bfc57b231172800e46606b856f3484773e64fa /source/blender/draw
parentc362ca3b8abbc6ee766cc2dd1fd8f612889d18c7 (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')
-rw-r--r--source/blender/draw/modes/object_mode.c9
-rw-r--r--source/blender/draw/modes/overlay_mode.c13
2 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 68f3e058693..3fec9d59df4 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -322,6 +322,7 @@ typedef struct OBJECT_DupliData {
GPUBatch *outline_geom;
DRWShadingGroup *extra_shgrp;
GPUBatch *extra_geom;
+ short base_flag;
} OBJECT_DupliData;
static struct {
@@ -3398,6 +3399,10 @@ BLI_INLINE OBJECT_DupliData *OBJECT_duplidata_get(Object *ob, void *vedata, bool
*dupli_data = MEM_callocN(sizeof(OBJECT_DupliData), "OBJECT_DupliData");
*init = true;
}
+ else if ((*dupli_data)->base_flag != ob->base_flag) {
+ /* Select state might have change, reinit. */
+ *init = true;
+ }
return *dupli_data;
}
return NULL;
@@ -3458,6 +3463,9 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
if (dupli_data && !init_duplidata) {
geom = dupli_data->outline_geom;
shgroup = dupli_data->outline_shgrp;
+ /* TODO: Remove. Only here to increment outline id counter. */
+ theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL);
+ shgroup = shgroup_theme_id_to_outline_or_null(stl, theme_id, ob->base_flag);
}
else {
if (stl->g_data->xray_enabled_and_not_wire || is_flat_object_viewed_from_side) {
@@ -3665,6 +3673,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
if (init_duplidata) {
dupli_data->extra_shgrp = shgroup;
dupli_data->extra_geom = geom;
+ dupli_data->base_flag = ob->base_flag;
}
}
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;
}
}
}