The problem was double. They were not selectable in wireframe view and
they would not display with the right color, thus always appearing
un-selected.
/* Make flat object selectable in ortho view if wireframe is enabled. */
if ((draw_ctx->v3d->overlay.flag & V3D_OVERLAY_WIREFRAMES) ||
/* Make flat object selectable in ortho view if wireframe is enabled. */
if ((draw_ctx->v3d->overlay.flag & V3D_OVERLAY_WIREFRAMES) ||
+ (draw_ctx->v3d->shading.type == OB_WIRE) ||
(ob->dtx & OB_DRAWWIRE) ||
(ob->dt == OB_WIRE))
{
(ob->dtx & OB_DRAWWIRE) ||
(ob->dt == OB_WIRE))
{
psl->face_wireframe_pass = DRW_pass_create("Face Wires", state);
g_data->flat_wires = DRW_shgroup_create(flat_wires_sh, psl->face_wireframe_pass);
psl->face_wireframe_pass = DRW_pass_create("Face Wires", state);
g_data->flat_wires = DRW_shgroup_create(flat_wires_sh, psl->face_wireframe_pass);
- DRW_shgroup_uniform_vec4(g_data->flat_wires, "color", ts.colorWire, 1);
g_data->sculpt_wires = DRW_shgroup_create(sculpt_wire_sh, psl->face_wireframe_pass);
g_data->sculpt_wires = DRW_shgroup_create(sculpt_wire_sh, psl->face_wireframe_pass);
const int stencil_mask = (ob->dtx & OB_DRAWXRAY) ? 0x00 : 0xFF;
DRWShadingGroup *shgrp = NULL;
const int stencil_mask = (ob->dtx & OB_DRAWXRAY) ? 0x00 : 0xFF;
DRWShadingGroup *shgrp = NULL;
+ float *rim_col = ts.colorWire;
+ if (!is_edit_mode && !is_sculpt_mode && !has_edit_mesh_cage &&
+ ((ob->base_flag & BASE_SELECTED) != 0))
+ {
+ rim_col = (ob == draw_ctx->obact) ? ts.colorActive : ts.colorSelect;
+ }
+
/* This fixes only the biggest case which is a plane in ortho view. */
int flat_axis = 0;
bool is_flat_object_viewed_from_side = (rv3d->persp == RV3D_ORTHO) &&
/* This fixes only the biggest case which is a plane in ortho view. */
int flat_axis = 0;
bool is_flat_object_viewed_from_side = (rv3d->persp == RV3D_ORTHO) &&
shgrp = DRW_shgroup_create_sub(shgrp);
DRW_shgroup_stencil_mask(shgrp, stencil_mask);
DRW_shgroup_call_object_add(shgrp, geom, ob);
shgrp = DRW_shgroup_create_sub(shgrp);
DRW_shgroup_stencil_mask(shgrp, stencil_mask);
DRW_shgroup_call_object_add(shgrp, geom, ob);
+ DRW_shgroup_uniform_vec4(shgrp, "color", rim_col, 1);
}
}
else {
struct GPUBatch *geom = DRW_cache_object_face_wireframe_get(ob);
if (geom || is_sculpt_mode) {
}
}
else {
struct GPUBatch *geom = DRW_cache_object_face_wireframe_get(ob);
if (geom || is_sculpt_mode) {
- float *rim_col = ts.colorWire;
- if (!is_edit_mode && !is_sculpt_mode && !has_edit_mesh_cage &&
- ((ob->base_flag & BASE_SELECTED) != 0))
- {
- rim_col = (ob == draw_ctx->obact) ? ts.colorActive : ts.colorSelect;
- }
shgrp = (is_sculpt_mode) ? pd->sculpt_wires : pd->face_wires;
shgrp = DRW_shgroup_create_sub(shgrp);
shgrp = (is_sculpt_mode) ? pd->sculpt_wires : pd->face_wires;
shgrp = DRW_shgroup_create_sub(shgrp);