Fix for importing animated skinned meshes.

Scale is negated in inverse bind matrices.
Vertex weights are normalized (glTF importer is limited to 4 weights per vert).
Fixed interpolation for animations where the first frame is not at 0.0.
Allows cached.dts version of assimp imported shapes to be loaded.
This commit is contained in:
OTHGMars 2019-04-25 16:02:22 -04:00
parent 6be2989bbc
commit 6660f253b5
4 changed files with 35 additions and 14 deletions

View file

@ -329,8 +329,6 @@ void AssimpShapeLoader::updateMaterialsScript(const Torque::Path &path)
/// Check if an up-to-date cached DTS is available for this DAE file
bool AssimpShapeLoader::canLoadCachedDTS(const Torque::Path& path)
{
return false;
// Generate the cached filename
Torque::Path cachedPath(path);
cachedPath.setExtension("cached.dts");
@ -339,13 +337,13 @@ bool AssimpShapeLoader::canLoadCachedDTS(const Torque::Path& path)
FileTime cachedModifyTime;
if (Platform::getFileTimes(cachedPath.getFullPath(), NULL, &cachedModifyTime))
{
bool forceLoadDAE = Con::getBoolVariable("$assimp::forceLoad", false);
bool forceLoad = Con::getBoolVariable("$assimp::forceLoad", false);
FileTime daeModifyTime;
if (!Platform::getFileTimes(path.getFullPath(), NULL, &daeModifyTime) ||
(!forceLoadDAE && (Platform::compareFileTimes(cachedModifyTime, daeModifyTime) >= 0) ))
(!forceLoad && (Platform::compareFileTimes(cachedModifyTime, daeModifyTime) >= 0) ))
{
// DAE not found, or cached DTS is newer
// Original file not found, or cached DTS is newer
return true;
}
}