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:
@@ -1615,11 +1615,10 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata,
|
|||||||
const bool do_cull = (draw_ctx->v3d &&
|
const bool do_cull = (draw_ctx->v3d &&
|
||||||
(draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING));
|
(draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING));
|
||||||
const bool is_active = (ob == draw_ctx->obact);
|
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. */
|
/* For now just force fully shaded with eevee when supported. */
|
||||||
const bool is_sculpt_mode_draw = is_sculpt_mode &&
|
const bool is_sculpt_mode_draw = ob->sculpt && ob->sculpt->pbvh &&
|
||||||
((ob->sculpt && ob->sculpt->pbvh) &&
|
BKE_pbvh_type(ob->sculpt->pbvh) != PBVH_FACES;
|
||||||
(BKE_pbvh_type(ob->sculpt->pbvh) != PBVH_FACES));
|
|
||||||
const bool is_default_mode_shader = is_sculpt_mode;
|
const bool is_default_mode_shader = is_sculpt_mode;
|
||||||
|
|
||||||
/* First get materials for this mesh. */
|
/* First get materials for this mesh. */
|
||||||
|
|||||||
@@ -935,7 +935,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
|
|||||||
WORKBENCH_MaterialData *material;
|
WORKBENCH_MaterialData *material;
|
||||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) {
|
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_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 bool use_hide = is_active && DRW_object_use_hide_faces(ob);
|
||||||
const int materials_len = MAX2(1, (is_sculpt_mode ? 1 : ob->totcol));
|
const int materials_len = MAX2(1, (is_sculpt_mode ? 1 : ob->totcol));
|
||||||
const Mesh *me = (ob->type == OB_MESH) ? ob->data : NULL;
|
const Mesh *me = (ob->type == OB_MESH) ? ob->data : NULL;
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
|
|||||||
WORKBENCH_MaterialData *material;
|
WORKBENCH_MaterialData *material;
|
||||||
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) {
|
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_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;
|
bool is_drawn = false;
|
||||||
|
|
||||||
if (!is_sculpt_mode && TEXTURE_DRAWING_ENABLED(wpd) && ELEM(ob->type, OB_MESH)) {
|
if (!is_sculpt_mode && TEXTURE_DRAWING_ENABLED(wpd) && ELEM(ob->type, OB_MESH)) {
|
||||||
|
|||||||
@@ -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 != draw_ctx->object_edit) && !is_edit_mode) || has_edit_mesh_cage) ||
|
||||||
ob->type != OB_MESH) {
|
ob->type != OB_MESH) {
|
||||||
const bool is_active = (ob == draw_ctx->obact);
|
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 all_wires = (ob->dtx & OB_DRAW_ALL_EDGES);
|
||||||
const bool is_wire = (ob->dt < OB_SOLID);
|
const bool is_wire = (ob->dt < OB_SOLID);
|
||||||
const bool use_coloring = (pd->show_overlays && !is_edit_mode && !is_sculpt_mode &&
|
const bool use_coloring = (pd->show_overlays && !is_edit_mode && !is_sculpt_mode &&
|
||||||
|
|||||||
Reference in New Issue
Block a user