Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Split weight error msg and add node name in log
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Jun 8, 2023
1 parent 5b0d46e commit 5dc1f15
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/BadgerConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ bool BadgerConverter::convertToBadger(const char* fbx, const char* outputDirecto
auto type = attribute->GetAttributeType();

if (type == FbxNodeAttribute::eSkeleton) {
std::cout << "Exporting bones." << std::endl;
std::cout << "Node: " << child->GetName() << " - exporting bone." << std::endl;

FbxSkeleton* bone = FbxCast<FbxSkeleton>(attribute);
if (!exportBone(geometry, bone, child)) {
std::cerr << "Error: failed to export bone." << std::endl;
return false;
}
} else if (type == FbxNodeAttribute::eMesh) {
std::cout << "Exporting mesh." << std::endl;
std::cout << "Node: " << child->GetName() << " - exporting mesh." << std::endl;

FbxMesh* mesh = FbxCast<FbxMesh>(attribute);
if (!exportMesh(geometry, mesh, child)) {
Expand Down Expand Up @@ -296,8 +296,12 @@ bool BadgerConverter::exportMesh(Badger::Geometry& geometry, const FbxMesh* mesh

auto weightsPointer = cluster->GetControlPointWeights();

if (cluster->GetControlPointIndicesCount() != controlPointCount
|| weightsPointer == nullptr) {
if (weightsPointer == nullptr) {
std::cerr << "Error: skin cluster has no weights." << std::endl;
return false;
}

if (cluster->GetControlPointIndicesCount() != controlPointCount) {
std::cerr << "Error: skin cluster weight count did not match control point count." << std::endl;
return false;
}
Expand Down

0 comments on commit 5dc1f15

Please sign in to comment.