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.
This commit is contained in:
Jacques Lucke
2024-12-12 14:00:24 +01:00
parent a01fd34f2d
commit 54f8ef12d8

View File

@@ -393,8 +393,9 @@ static void panel_draw(const bContext *C, Panel *panel)
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
SubsurfModifierData *smd = static_cast<SubsurfModifierData *>(ptr->data);
Object *ob = static_cast<Object *>(ob_ptr.data);
const Mesh *mesh = static_cast<const Mesh *>(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<const Mesh *>(ob->data)))
{
uiItemL(layout,
RPT_("Sharp edges or custom normals detected, disabling GPU subdivision"),
ICON_INFO);