Fix T58966 Sculpted changes dissapear visually when selecting a second object

Display sculpt mesh if there is a sculpt session.
This commit is contained in:
Clément Foucault 2019-04-26 16:17:35 +02:00
parent 86914e7133
commit d4827cfa81
Notes: blender-bot 2023-02-14 04:38:06 +01:00
Referenced by issue #64064, Weight paint doesn't display on meshes with subdivision modifier
Referenced by issue #63997, Weird z-fight during weight paint
Referenced by issue #58966, Sculpted changes dissapear visually when selecting a second object
4 changed files with 6 additions and 7 deletions

View File

@ -1615,11 +1615,10 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata,
const bool do_cull = (draw_ctx->v3d &&
(draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING));
const bool is_active = (ob == draw_ctx->obact);
const bool is_sculpt_mode = is_active && (draw_ctx->object_mode & OB_MODE_SCULPT) != 0;
const bool is_sculpt_mode = (ob->sculpt != NULL);
/* For now just force fully shaded with eevee when supported. */
const bool is_sculpt_mode_draw = is_sculpt_mode &&
((ob->sculpt && ob->sculpt->pbvh) &&
(BKE_pbvh_type(ob->sculpt->pbvh) != PBVH_FACES));
const bool is_sculpt_mode_draw = ob->sculpt && ob->sculpt->pbvh &&
BKE_pbvh_type(ob->sculpt->pbvh) != PBVH_FACES;
const bool is_default_mode_shader = is_sculpt_mode;
/* First get materials for this mesh. */

View File

@ -935,7 +935,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
WORKBENCH_MaterialData *material;
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) {
const bool is_active = (ob == draw_ctx->obact);
const bool is_sculpt_mode = is_active && (draw_ctx->object_mode & OB_MODE_SCULPT) != 0;
const bool is_sculpt_mode = (ob->sculpt != NULL);
const bool use_hide = is_active && DRW_object_use_hide_faces(ob);
const int materials_len = MAX2(1, (is_sculpt_mode ? 1 : ob->totcol));
const Mesh *me = (ob->type == OB_MESH) ? ob->data : NULL;

View File

@ -566,7 +566,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
WORKBENCH_MaterialData *material;
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) {
const bool is_active = (ob == draw_ctx->obact);
const bool is_sculpt_mode = is_active && (draw_ctx->object_mode & OB_MODE_SCULPT) != 0;
const bool is_sculpt_mode = (ob->sculpt != NULL);
bool is_drawn = false;
if (!is_sculpt_mode && TEXTURE_DRAWING_ENABLED(wpd) && ELEM(ob->type, OB_MESH)) {

View File

@ -360,7 +360,7 @@ static void overlay_cache_populate(void *vedata, Object *ob)
(((ob != draw_ctx->object_edit) && !is_edit_mode) || has_edit_mesh_cage) ||
ob->type != OB_MESH) {
const bool is_active = (ob == draw_ctx->obact);
const bool is_sculpt_mode = is_active && (draw_ctx->object_mode & OB_MODE_SCULPT) != 0;
const bool is_sculpt_mode = (ob->sculpt != NULL);
const bool all_wires = (ob->dtx & OB_DRAW_ALL_EDGES);
const bool is_wire = (ob->dt < OB_SOLID);
const bool use_coloring = (pd->show_overlays && !is_edit_mode && !is_sculpt_mode &&