From 38f98fd8684810fb87a0252f7ef5cd684748ec7e Mon Sep 17 00:00:00 2001 From: iaomw Date: Wed, 28 Aug 2024 19:01:10 +0800 Subject: [PATCH] fix crash --- zenovis/src/optx/RenderEngineOptx.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zenovis/src/optx/RenderEngineOptx.cpp b/zenovis/src/optx/RenderEngineOptx.cpp index 27fb426cbb..0b3a5867ce 100644 --- a/zenovis/src/optx/RenderEngineOptx.cpp +++ b/zenovis/src/optx/RenderEngineOptx.cpp @@ -220,11 +220,12 @@ struct GraphicsManager { auto curveTypeIndex = ud.get2("curve", 0u); auto curveTypeEnum = magic_enum::enum_cast(curveTypeIndex).value_or(zeno::CurveType::LINEAR); - auto& normalArray = prim_in->verts.attr("v"); auto& widthArray = prim_in->verts.attr("width"); auto& pointArray = prim_in->verts; + + std::vector dummy {}; - auto& normals = reinterpret_cast&>(normalArray); + auto& normals = prim_in->verts.has_attr("v") ? reinterpret_cast&>(prim_in->verts.attr("v")) : dummy; auto& points = reinterpret_cast&>(pointArray); auto& widths = reinterpret_cast&>(widthArray);