Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_edit_uv.c
| Show First 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata) | ||||
| /* HACK: When editing objects that share the same mesh we should only draw the | /* HACK: When editing objects that share the same mesh we should only draw the | ||||
| * first one in the order that is used during uv editing. We can only trust that the first object | * first one in the order that is used during uv editing. We can only trust that the first object | ||||
| * has the correct batches with the correct selection state. See T83187. */ | * has the correct batches with the correct selection state. See T83187. */ | ||||
| if (pd->edit_uv.do_uv_overlay || pd->edit_uv.do_uv_shadow_overlay) { | if (pd->edit_uv.do_uv_overlay || pd->edit_uv.do_uv_shadow_overlay) { | ||||
| uint objects_len = 0; | uint objects_len = 0; | ||||
| Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data( | Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data( | ||||
| draw_ctx->view_layer, NULL, &objects_len, draw_ctx->object_mode); | draw_ctx->view_layer, NULL, &objects_len, draw_ctx->object_mode); | ||||
| for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | ||||
| if (objects[ob_index]->type == OB_MESH) { | |||||
| Object *object_eval = DEG_get_evaluated_object(draw_ctx->depsgraph, objects[ob_index]); | Object *object_eval = DEG_get_evaluated_object(draw_ctx->depsgraph, objects[ob_index]); | ||||
jbakker: I would move this one line up and check against `objects[ob_index]` so the depsgraph call is… | |||||
| DRW_mesh_batch_cache_validate((Mesh *)object_eval->data); | DRW_mesh_batch_cache_validate((Mesh *)object_eval->data); | ||||
| overlay_edit_uv_cache_populate(vedata, object_eval); | overlay_edit_uv_cache_populate(vedata, object_eval); | ||||
| } | } | ||||
| } | |||||
| MEM_freeN(objects); | MEM_freeN(objects); | ||||
| } | } | ||||
| } | } | ||||
| static void overlay_edit_uv_cache_populate(OVERLAY_Data *vedata, Object *ob) | static void overlay_edit_uv_cache_populate(OVERLAY_Data *vedata, Object *ob) | ||||
| { | { | ||||
| OVERLAY_StorageList *stl = vedata->stl; | OVERLAY_StorageList *stl = vedata->stl; | ||||
| OVERLAY_PrivateData *pd = stl->pd; | OVERLAY_PrivateData *pd = stl->pd; | ||||
| ▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines | |||||
I would move this one line up and check against objects[ob_index] so the depsgraph call is also skipped.