Fix T65960 Crash on entering Edit Mode of BesierCurve with modifiers

This commit is contained in:
Clément Foucault 2019-06-21 00:06:37 +02:00
parent 2f3f1f6038
commit b30f3f6c19
Notes: blender-bot 2023-05-03 10:14:48 +02:00
Referenced by issue #65960, Crash on entering Edit Mode of BesierCurve (with Extrude and Mirror Modifier)
1 changed files with 12 additions and 4 deletions

View File

@ -269,7 +269,9 @@ static void EDIT_CURVE_cache_populate(void *vedata, Object *ob)
}
geom = DRW_cache_curve_edge_wire_get(ob);
DRW_shgroup_call(wire_shgrp, geom, ob);
if (geom) {
DRW_shgroup_call(wire_shgrp, geom, ob);
}
if ((cu->flag & CU_3D) && (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_NORMALS) != 0) {
geom = DRW_cache_curve_edge_normal_get(ob);
@ -282,17 +284,23 @@ static void EDIT_CURVE_cache_populate(void *vedata, Object *ob)
}
geom = DRW_cache_curve_vert_overlay_get(ob, stl->g_data->show_handles);
DRW_shgroup_call(stl->g_data->overlay_vert_shgrp, geom, ob);
if (geom) {
DRW_shgroup_call(stl->g_data->overlay_vert_shgrp, geom, ob);
}
}
}
if (ob->type == OB_SURF) {
if (BKE_object_is_in_editmode(ob)) {
struct GPUBatch *geom = DRW_cache_curve_edge_overlay_get(ob);
DRW_shgroup_call(stl->g_data->overlay_edge_shgrp, geom, ob);
if (geom) {
DRW_shgroup_call(stl->g_data->overlay_edge_shgrp, geom, ob);
}
geom = DRW_cache_curve_vert_overlay_get(ob, false);
DRW_shgroup_call(stl->g_data->overlay_vert_shgrp, geom, ob);
if (geom) {
DRW_shgroup_call(stl->g_data->overlay_vert_shgrp, geom, ob);
}
}
}
}