From 3a30ee2c15d913baa77d19dd3b3e85ea2f84467a Mon Sep 17 00:00:00 2001 From: zhouhang95 <765229842@qq.com> Date: Thu, 8 Aug 2024 20:25:53 +0800 Subject: [PATCH] fix --- projects/FBX/FBXSDK.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/FBX/FBXSDK.cpp b/projects/FBX/FBXSDK.cpp index 19f9b96faf..27518f3beb 100644 --- a/projects/FBX/FBXSDK.cpp +++ b/projects/FBX/FBXSDK.cpp @@ -833,10 +833,10 @@ struct NewFBXImportSkeleton : INode { std::vector bone_connects; for (auto bone_name: bone_names) { if (parent_mapping.count(bone_name)) { - auto self_index = std::find(bone_names.begin(), bone_names.end(), bone_name) - bone_names.begin(); auto parent_name = parent_mapping[bone_name]; - auto parent_index = std::find(bone_names.begin(), bone_names.end(), parent_name) - bone_names.begin(); - if (self_index >= 0 && parent_index >= 0) { + if (std::count(bone_names.begin(), bone_names.end(), parent_name)) { + auto self_index = std::find(bone_names.begin(), bone_names.end(), bone_name) - bone_names.begin(); + auto parent_index = std::find(bone_names.begin(), bone_names.end(), parent_name) - bone_names.begin(); bone_connects.push_back(parent_index); bone_connects.push_back(self_index); }