From 87341020b0779df1097a58bc7b23b17189f29c0d Mon Sep 17 00:00:00 2001 From: zhouhang95 <765229842@qq.com> Date: Mon, 12 Aug 2024 19:44:42 +0800 Subject: [PATCH] fix no bones --- projects/FBX/FBXSDK.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/FBX/FBXSDK.cpp b/projects/FBX/FBXSDK.cpp index 66dc96655d..3540fe2715 100644 --- a/projects/FBX/FBXSDK.cpp +++ b/projects/FBX/FBXSDK.cpp @@ -666,12 +666,12 @@ struct NewFBXImportSkin : INode { std::vector prims_ptr; int maxnum_boneWeight = 0; for (auto prim: prims) { - maxnum_boneWeight = zeno::max(maxnum_boneWeight, prim->userData().get2("maxnum_boneWeight")); + maxnum_boneWeight = zeno::max(maxnum_boneWeight, prim->userData().get2("maxnum_boneWeight", 0)); } for (auto prim: prims) { prims_ptr.push_back(prim.get()); std::vector nameMapping; - auto boneName_count = prim->userData().get2("boneName_count"); + auto boneName_count = prim->userData().get2("boneName_count", 0); for (auto i = 0; i < boneName_count; i++) { auto boneName = prim->userData().get2(zeno::format("boneName_{}", i)); if (nameMappingGlobal.count(boneName) == 0) {