Stop hardcoding skeleton type to flex (#3397)

This commit is contained in:
Garrett Cox 2023-11-14 15:36:05 -06:00 committed by GitHub
parent 4e9040d761
commit bf31f2b330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,38 +103,42 @@ void SkeletonFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shared_p
{
std::shared_ptr<Skeleton> skel = std::static_pointer_cast<Skeleton>(resource);
std::string skeletonType = reader->Attribute("Type");
// std::string skeletonLimbType = reader->Attribute("LimbType");
int numLimbs = reader->IntAttribute("LimbCount");
int numDLs = reader->IntAttribute("DisplayListCount");
skel->type = SkeletonType::Flex; // Default to Flex for legacy reasons
if (reader->FindAttribute("Type")) {
std::string skeletonType = reader->Attribute("Type");
if (skeletonType == "Flex") {
skel->type = SkeletonType::Flex;
} else if (skeletonType == "Curve") {
skel->type = SkeletonType::Curve;
} else if (skeletonType == "Normal") {
skel->type = SkeletonType::Normal;
if (skeletonType == "Flex") {
skel->type = SkeletonType::Flex;
} else if (skeletonType == "Curve") {
skel->type = SkeletonType::Curve;
} else if (skeletonType == "Normal") {
skel->type = SkeletonType::Normal;
}
}
skel->type = SkeletonType::Flex;
skel->limbType = LimbType::LOD;
skel->limbType = LimbType::LOD; // Default to LOD for legacy reasons
if (reader->FindAttribute("LimbType")) {
std::string skeletonLimbType = reader->Attribute("LimbType");
// if (skeletonLimbType == "Standard")
// skel->limbType = LimbType::Standard;
// else if (skeletonLimbType == "LOD")
// skel->limbType = LimbType::LOD;
// else if (skeletonLimbType == "Curve")
// skel->limbType = LimbType::Curve;
// else if (skeletonLimbType == "Skin")
// skel->limbType = LimbType::Skin;
// else if (skeletonLimbType == "Legacy")
// Sskel->limbType = LimbType::Legacy;
if (skeletonLimbType == "Standard") {
skel->limbType = LimbType::Standard;
} else if (skeletonLimbType == "LOD") {
skel->limbType = LimbType::LOD;
} else if (skeletonLimbType == "Curve") {
skel->limbType = LimbType::Curve;
} else if (skeletonLimbType == "Skin") {
skel->limbType = LimbType::Skin;
} else if (skeletonLimbType == "Legacy") {
skel->limbType = LimbType::Legacy;
}
}
skel->limbCount = reader->IntAttribute("LimbCount");
skel->dListCount = reader->IntAttribute("DisplayListCount");
auto child = reader->FirstChildElement();
skel->limbCount = numLimbs;
skel->dListCount = numDLs;
while (child != nullptr) {
std::string childName = child->Name();