Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
iaomw committed Aug 28, 2024
1 parent 45b2ee6 commit 38f98fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zenovis/src/optx/RenderEngineOptx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,12 @@ struct GraphicsManager {
auto curveTypeIndex = ud.get2<uint>("curve", 0u);
auto curveTypeEnum = magic_enum::enum_cast<zeno::CurveType>(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<float3> dummy {};

auto& normals = reinterpret_cast<const std::vector<float3>&>(normalArray);
auto& normals = prim_in->verts.has_attr("v") ? reinterpret_cast<std::vector<float3>&>(prim_in->verts.attr("v")) : dummy;
auto& points = reinterpret_cast<const std::vector<float3>&>(pointArray);
auto& widths = reinterpret_cast<const std::vector<float>&>(widthArray);

Expand Down

0 comments on commit 38f98fd

Please sign in to comment.