From 54f8ef12d82d6dcae03083a237b3bfef58fe96d2 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 12 Dec 2024 14:00:24 +0100 Subject: [PATCH] Fix: crash when using subdiv modifier on curves This only affected the drawing of the modifier UI, not the actual evaluation. There was a missing check for the object type before retrieving the data from it. --- source/blender/modifiers/intern/MOD_subsurf.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/modifiers/intern/MOD_subsurf.cc b/source/blender/modifiers/intern/MOD_subsurf.cc index d33e75ad856..15a9aed79e2 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.cc +++ b/source/blender/modifiers/intern/MOD_subsurf.cc @@ -393,8 +393,9 @@ static void panel_draw(const bContext *C, Panel *panel) Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); SubsurfModifierData *smd = static_cast(ptr->data); Object *ob = static_cast(ob_ptr.data); - const Mesh *mesh = static_cast(ob->data); - if (BKE_subsurf_modifier_force_disable_gpu_evaluation_for_mesh(smd, mesh)) { + if (ob->type == OB_MESH && BKE_subsurf_modifier_force_disable_gpu_evaluation_for_mesh( + smd, static_cast(ob->data))) + { uiItemL(layout, RPT_("Sharp edges or custom normals detected, disabling GPU subdivision"), ICON_INFO);