diff options
Diffstat (limited to 'source')
9 files changed, 14 insertions, 63 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c index 98db7136398..a2362cd8850 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.c +++ b/source/blender/draw/engines/overlay/overlay_extra.c @@ -762,10 +762,7 @@ void OVERLAY_lightprobe_cache_populate(OVERLAY_Data *vedata, Object *ob) instdata.mat[1][3] = prb->grid_resolution_y; instdata.mat[2][3] = prb->grid_resolution_z; /* Put theme id in matrix. */ - if (UNLIKELY(ob->base_flag & BASE_FROM_DUPLI)) { - instdata.mat[3][3] = 0.0; - } - else if (theme_id == TH_ACTIVE) { + if (theme_id == TH_ACTIVE) { instdata.mat[3][3] = 1.0; } else /* TH_SELECT */ { diff --git a/source/blender/draw/engines/overlay/shaders/extra_lightprobe_grid_vert.glsl b/source/blender/draw/engines/overlay/shaders/extra_lightprobe_grid_vert.glsl index 3746cbcf90b..1f3a23324bb 100644 --- a/source/blender/draw/engines/overlay/shaders/extra_lightprobe_grid_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/extra_lightprobe_grid_vert.glsl @@ -10,9 +10,6 @@ vec4 color_from_id(float color_id) if (isTransform) { return colorTransform; } - else if (color_id == 0.0) { - return colorDupliSelect; - } else if (color_id == 1.0) { return colorActive; } diff --git a/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl b/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl index df10f3f7ae2..0e4757f8ea8 100644 --- a/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl @@ -241,9 +241,6 @@ void main() else if (color_id == 1u) { fragColor = colorSelect; } - else if (color_id == 2u) { - fragColor = colorDupliSelect; - } else if (color_id == 3u) { fragColor = colorActive; } diff --git a/source/blender/draw/engines/overlay/shaders/outline_prepass_vert.glsl b/source/blender/draw/engines/overlay/shaders/outline_prepass_vert.glsl index 582a7c6cae2..701760dac18 100644 --- a/source/blender/draw/engines/overlay/shaders/outline_prepass_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/outline_prepass_vert.glsl @@ -17,18 +17,8 @@ flat out uint objectId; uint outline_colorid_get(void) { int flag = int(abs(ObjectInfo.w)); - bool is_from_dupli = (flag & DRW_BASE_FROM_DUPLI) != 0; bool is_active = (flag & DRW_BASE_ACTIVE) != 0; - if (is_from_dupli) { - if (isTransform) { - return 0u; /* colorTransform */ - } - else { - return 2u; /* colorDupliSelect */ - } - } - if (isTransform) { return 0u; /* colorTransform */ } diff --git a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl index c083fdacbbe..060b7a957c1 100644 --- a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl @@ -28,27 +28,12 @@ void wire_color_get(out vec3 rim_col, out vec3 wire_col) { int flag = int(abs(ObjectInfo.w)); bool is_selected = (flag & DRW_BASE_SELECTED) != 0; - bool is_from_dupli = (flag & DRW_BASE_FROM_DUPLI) != 0; bool is_from_set = (flag & DRW_BASE_FROM_SET) != 0; bool is_active = (flag & DRW_BASE_ACTIVE) != 0; if (is_from_set) { - rim_col = colorDupli.rgb; - wire_col = colorDupli.rgb; - } - else if (is_from_dupli) { - if (is_selected) { - if (isTransform) { - rim_col = colorTransform.rgb; - } - else { - rim_col = colorDupliSelect.rgb; - } - } - else { - rim_col = colorDupli.rgb; - } - wire_col = colorDupli.rgb; + rim_col = colorWire.rgb; + wire_col = colorWire.rgb; } else if (is_selected && useColoring) { if (isTransform) { diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 62d715460bb..9151c0bd68b 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -101,11 +101,6 @@ void DRW_globals_update(void) gb->colorEditMeshMiddle, dot_v3v3(gb->colorEditMeshMiddle, (float[3]){0.3333f, 0.3333f, 0.3333f})); /* Desaturate */ - interp_v4_v4v4(gb->colorDupliSelect, gb->colorBackground, gb->colorSelect, 0.5f); - /* Was 50% in 2.7x since the background was lighter making it easier to tell the color from - * black, with a darker background we need a more faded color. */ - interp_v4_v4v4(gb->colorDupli, gb->colorBackground, gb->colorWire, 0.3f); - #ifdef WITH_FREESTYLE UI_GetThemeColor4fv(TH_FREESTYLE_EDGE_MARK, gb->colorEdgeFreestyle); UI_GetThemeColor4fv(TH_FREESTYLE_FACE_MARK, gb->colorFaceFreestyle); @@ -300,7 +295,10 @@ int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color { const DRWContextState *draw_ctx = DRW_context_state_get(); const bool is_edit = (draw_ctx->object_mode & OB_MODE_EDIT) && (ob->mode & OB_MODE_EDIT); - const bool active = (view_layer->basact && view_layer->basact->object == ob); + const bool active = (ob->base_flag & BASE_FROM_DUPLI) ? + (DRW_object_get_dupli_parent(ob) == view_layer->basact->object) : + (view_layer->basact && view_layer->basact->object == ob); + /* confusing logic here, there are 2 methods of setting the color * 'colortab[colindex]' and 'theme_id', colindex overrides theme_id. * @@ -345,21 +343,7 @@ int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color if (r_color != NULL) { if (UNLIKELY(ob->base_flag & BASE_FROM_SET)) { - *r_color = G_draw.block.colorDupli; - } - else if (UNLIKELY(ob->base_flag & BASE_FROM_DUPLI)) { - switch (theme_id) { - case TH_ACTIVE: - case TH_SELECT: - *r_color = G_draw.block.colorDupliSelect; - break; - case TH_TRANSFORM: - *r_color = G_draw.block.colorTransform; - break; - default: - *r_color = G_draw.block.colorDupli; - break; - } + *r_color = G_draw.block.colorWire; } else { switch (theme_id) { diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index 2913877c9c1..48a3fb209ba 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -43,8 +43,6 @@ typedef struct GlobalsUboStorage { float colorWireEdit[4]; float colorActive[4]; float colorSelect[4]; - float colorDupliSelect[4]; - float colorDupli[4]; float colorLibrarySelect[4]; float colorLibrary[4]; float colorTransform[4]; diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index 5d3e3db866f..c98ecc8ac00 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -538,7 +538,12 @@ static void drw_call_obinfos_init(DRWObjectInfos *ob_infos, Object *ob) ob_infos->ob_flag += (ob->base_flag & BASE_SELECTED) ? (1 << 1) : 0; ob_infos->ob_flag += (ob->base_flag & BASE_FROM_DUPLI) ? (1 << 2) : 0; ob_infos->ob_flag += (ob->base_flag & BASE_FROM_SET) ? (1 << 3) : 0; - ob_infos->ob_flag += (ob == DST.draw_ctx.obact) ? (1 << 4) : 0; + if (ob->base_flag & BASE_FROM_DUPLI) { + ob_infos->ob_flag += (DRW_object_get_dupli_parent(ob) == DST.draw_ctx.obact) ? (1 << 4) : 0; + } + else { + ob_infos->ob_flag += (ob == DST.draw_ctx.obact) ? (1 << 4) : 0; + } /* Negative scaling. */ ob_infos->ob_flag *= (ob->transflag & OB_NEG_SCALE) ? -1.0f : 1.0f; /* Object Color. */ diff --git a/source/blender/draw/intern/shaders/common_globals_lib.glsl b/source/blender/draw/intern/shaders/common_globals_lib.glsl index 3c76c8a5b28..77b34543989 100644 --- a/source/blender/draw/intern/shaders/common_globals_lib.glsl +++ b/source/blender/draw/intern/shaders/common_globals_lib.glsl @@ -7,8 +7,6 @@ layout(std140) uniform globalsBlock vec4 colorWireEdit; vec4 colorActive; vec4 colorSelect; - vec4 colorDupliSelect; - vec4 colorDupli; vec4 colorLibrarySelect; vec4 colorLibrary; vec4 colorTransform; |