diff options
Diffstat (limited to 'source/blender/draw/engines/overlay')
4 files changed, 20 insertions, 15 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index 668a1255843..4029f1237e8 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -667,7 +667,7 @@ static void drw_shgroup_bone_custom_solid(ArmatureDrawContext *ctx, /* TODO(fclem): arg... less than ideal but we never iter on this object * to assure batch cache is valid. */ - DRW_mesh_batch_cache_validate(mesh); + DRW_mesh_batch_cache_validate(custom, mesh); struct GPUBatch *surf = DRW_mesh_batch_cache_get_surface(mesh); struct GPUBatch *edges = DRW_mesh_batch_cache_get_edge_detection(mesh, NULL); @@ -715,7 +715,7 @@ static void drw_shgroup_bone_custom_wire(ArmatureDrawContext *ctx, } /* TODO(fclem): arg... less than ideal but we never iter on this object * to assure batch cache is valid. */ - DRW_mesh_batch_cache_validate(mesh); + DRW_mesh_batch_cache_validate(custom, mesh); struct GPUBatch *geom = DRW_mesh_batch_cache_get_all_edges(mesh); if (geom) { diff --git a/source/blender/draw/engines/overlay/overlay_edit_mesh.c b/source/blender/draw/engines/overlay/overlay_edit_mesh.c index 3a2871249a2..ad929cc0835 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_mesh.c +++ b/source/blender/draw/engines/overlay/overlay_edit_mesh.c @@ -28,6 +28,7 @@ #include "BKE_customdata.h" #include "BKE_editmesh.h" +#include "BKE_object.h" #include "draw_cache_impl.h" #include "draw_manager_text.h" @@ -229,7 +230,10 @@ static void overlay_edit_mesh_add_ob_to_pass(OVERLAY_PrivateData *pd, Object *ob Mesh *me = (Mesh *)ob->data; BMEditMesh *embm = me->edit_mesh; if (embm) { - has_edit_mesh_cage = embm->mesh_eval_cage && (embm->mesh_eval_cage != embm->mesh_eval_final); + Mesh *editmesh_eval_final = BKE_object_get_editmesh_eval_final(ob); + Mesh *editmesh_eval_cage = BKE_object_get_editmesh_eval_cage(ob); + + has_edit_mesh_cage = editmesh_eval_cage && (editmesh_eval_cage != editmesh_eval_final); has_skin_roots = CustomData_get_offset(&embm->bm->vdata, CD_MVERT_SKIN) != -1; } diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.c b/source/blender/draw/engines/overlay/overlay_edit_uv.c index 983df1ceac8..f51df908fbf 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_uv.c +++ b/source/blender/draw/engines/overlay/overlay_edit_uv.c @@ -412,7 +412,7 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata) draw_ctx->view_layer, NULL, &objects_len, draw_ctx->object_mode); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *object_eval = DEG_get_evaluated_object(draw_ctx->depsgraph, objects[ob_index]); - DRW_mesh_batch_cache_validate((Mesh *)object_eval->data); + DRW_mesh_batch_cache_validate(object_eval, (Mesh *)object_eval->data); overlay_edit_uv_cache_populate(vedata, object_eval); } MEM_freeN(objects); @@ -441,22 +441,22 @@ static void overlay_edit_uv_cache_populate(OVERLAY_Data *vedata, Object *ob) if (has_active_edit_uvmap) { if (pd->edit_uv.do_uv_overlay) { - geom = DRW_mesh_batch_cache_get_edituv_edges(ob->data); + geom = DRW_mesh_batch_cache_get_edituv_edges(ob, ob->data); if (geom) { DRW_shgroup_call_obmat(pd->edit_uv_edges_grp, geom, NULL); } - geom = DRW_mesh_batch_cache_get_edituv_verts(ob->data); + geom = DRW_mesh_batch_cache_get_edituv_verts(ob, ob->data); if (geom) { DRW_shgroup_call_obmat(pd->edit_uv_verts_grp, geom, NULL); } if (pd->edit_uv.do_faces) { - geom = DRW_mesh_batch_cache_get_edituv_faces(ob->data); + geom = DRW_mesh_batch_cache_get_edituv_faces(ob, ob->data); if (geom) { DRW_shgroup_call_obmat(pd->edit_uv_faces_grp, geom, NULL); } } if (pd->edit_uv.do_face_dots) { - geom = DRW_mesh_batch_cache_get_edituv_facedots(ob->data); + geom = DRW_mesh_batch_cache_get_edituv_facedots(ob, ob->data); if (geom) { DRW_shgroup_call_obmat(pd->edit_uv_face_dots_grp, geom, NULL); } @@ -465,14 +465,14 @@ static void overlay_edit_uv_cache_populate(OVERLAY_Data *vedata, Object *ob) if (pd->edit_uv.do_uv_stretching_overlay) { if (pd->edit_uv.draw_type == SI_UVDT_STRETCH_ANGLE) { - geom = DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(me); + geom = DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(ob, me); } else /* SI_UVDT_STRETCH_AREA */ { OVERLAY_StretchingAreaTotals *totals = MEM_mallocN(sizeof(OVERLAY_StretchingAreaTotals), __func__); BLI_addtail(&pd->edit_uv.totals, totals); geom = DRW_mesh_batch_cache_get_edituv_faces_stretch_area( - me, &totals->total_area, &totals->total_area_uv); + ob, me, &totals->total_area, &totals->total_area_uv); } if (geom) { DRW_shgroup_call_obmat(pd->edit_uv_stretching_grp, geom, NULL); @@ -482,7 +482,7 @@ static void overlay_edit_uv_cache_populate(OVERLAY_Data *vedata, Object *ob) if (draw_shadows && (has_active_object_uvmap || has_active_edit_uvmap)) { if (pd->edit_uv.do_uv_shadow_overlay) { - geom = DRW_mesh_batch_cache_get_uv_edges(ob->data); + geom = DRW_mesh_batch_cache_get_uv_edges(ob, ob->data); if (geom) { DRW_shgroup_call_obmat(pd->edit_uv_shadow_edges_grp, geom, NULL); } diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c index 449130c4c5b..1eb8fc981cf 100644 --- a/source/blender/draw/engines/overlay/overlay_wireframe.c +++ b/source/blender/draw/engines/overlay/overlay_wireframe.c @@ -185,10 +185,11 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata, Mesh *me = ob->data; if (is_edit_mode) { BLI_assert(me->edit_mesh); - BMEditMesh *embm = me->edit_mesh; - has_edit_mesh_cage = embm->mesh_eval_cage && (embm->mesh_eval_cage != embm->mesh_eval_final); - if (embm->mesh_eval_final) { - me = embm->mesh_eval_final; + Mesh *editmesh_eval_final = BKE_object_get_editmesh_eval_final(ob); + Mesh *editmesh_eval_cage = BKE_object_get_editmesh_eval_cage(ob); + has_edit_mesh_cage = editmesh_eval_cage && (editmesh_eval_cage != editmesh_eval_final); + if (editmesh_eval_final) { + me = editmesh_eval_final; } } is_mesh_verts_only = me->totedge == 0 && me->totvert > 0; |