mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-18 17:37:30 +02:00
we now read frame zero of the animation to override the bind pose in fbxs that are before version 7500
This commit is contained in:
parent
98eec6b74d
commit
2300fe471d
1 changed files with 10 additions and 2 deletions
|
@ -441,6 +441,7 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr
|
|||
QString hifiGlobalNodeID;
|
||||
unsigned int meshIndex = 0;
|
||||
haveReportedUnhandledRotationOrder = false;
|
||||
int fbxVersionNumber = -1;
|
||||
foreach (const FBXNode& child, node.children) {
|
||||
|
||||
if (child.name == "FBXHeaderExtension") {
|
||||
|
@ -463,6 +464,9 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if (object.name == "FBXVersion") {
|
||||
fbxVersionNumber = object.properties.at(0).toInt();
|
||||
qCDebug(modelformat) << "the fbx version number " << fbxVersionNumber;
|
||||
}
|
||||
}
|
||||
} else if (child.name == "GlobalSettings") {
|
||||
|
@ -1309,8 +1313,6 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr
|
|||
|
||||
joint.bindTransformFoundInCluster = false;
|
||||
|
||||
hfmModel.joints.append(joint);
|
||||
|
||||
QString rotationID = localRotations.value(modelID);
|
||||
AnimationCurve xRotCurve = animationCurves.value(xComponents.value(rotationID));
|
||||
AnimationCurve yRotCurve = animationCurves.value(yComponents.value(rotationID));
|
||||
|
@ -1333,7 +1335,13 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr
|
|||
xPosCurve.values.isEmpty() ? defaultPosValues.x : xPosCurve.values.at(i % xPosCurve.values.size()),
|
||||
yPosCurve.values.isEmpty() ? defaultPosValues.y : yPosCurve.values.at(i % yPosCurve.values.size()),
|
||||
zPosCurve.values.isEmpty() ? defaultPosValues.z : zPosCurve.values.at(i % zPosCurve.values.size()));
|
||||
if ((fbxVersionNumber < 7500) && (i == 0)) {
|
||||
joint.translation = hfmModel.animationFrames[i].translations[jointIndex];
|
||||
joint.rotation = hfmModel.animationFrames[i].rotations[jointIndex];
|
||||
}
|
||||
|
||||
}
|
||||
hfmModel.joints.append(joint);
|
||||
}
|
||||
|
||||
// NOTE: shapeVertices are in joint-frame
|
||||
|
|
Loading…
Reference in a new issue