Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug: continue processing model if skeleton check fails #177

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions src/tydra/render-data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3703,31 +3703,30 @@ bool RenderSceneConverter::ConvertMesh(

if (skelPath.is_valid()) {
SkelHierarchy skel;
nonstd::optional<Animation> anim;
if (!ConvertSkeletonImpl(env, mesh, &skel, &anim)) {
return false;
}
DCOUT("Converted skeleton attached to : " << abs_path);
nonstd::optional <Animation> anim;
if (ConvertSkeletonImpl(env, mesh, &skel, &anim)) {
DCOUT("Converted skeleton attached to : " << abs_path);

auto it = std::find_if(skeletons.begin(), skeletons.end(), [&abs_path](const SkelHierarchy &sk) {
return sk.abs_path == abs_path.full_path_name();
});
auto it = std::find_if(skeletons.begin(), skeletons.end(), [&abs_path](const SkelHierarchy &sk) {
return sk.abs_path == abs_path.full_path_name();
});

if (anim) {
skel.anim_id = int(animations.size());
animations.emplace_back(anim.value());
}
if (anim) {
skel.anim_id = int(animations.size());
animations.emplace_back(anim.value());
}

int skel_id{0};
if (it != skeletons.end()) {
skel_id = int(std::distance(skeletons.begin(), it));
} else {
skel_id = int(skeletons.size());
skeletons.emplace_back(std::move(skel));
}
int skel_id{0};
if (it != skeletons.end()) {
skel_id = int(std::distance(skeletons.begin(), it));
} else {
skel_id = int(skeletons.size());
skeletons.emplace_back(std::move(skel));
}

dst.skel_id = skel_id;
dst.skel_id = skel_id;

}
}
}

Expand Down
Loading