Merge pull request #8 from Azaezel/dsqFilters

dsq detection filters
This commit is contained in:
marauder2k7 2025-11-26 01:09:41 +00:00 committed by GitHub
commit e345120d81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 13 deletions

View file

@ -1359,6 +1359,8 @@ static bool enumDTSForImport(const char* shapePath, GuiTreeViewCtrl* tree)
stats.numMeshes++; stats.numMeshes++;
} }
if (dtsShape->materialList)
{
// Get material count // Get material count
for (S32 i = 0; i < dtsShape->materialList->size(); i++) for (S32 i = 0; i < dtsShape->materialList->size(); i++)
{ {
@ -1371,6 +1373,7 @@ static bool enumDTSForImport(const char* shapePath, GuiTreeViewCtrl* tree)
tree->insertItem(matId, difTex->getPath().c_str(), "", "", 0, 0); tree->insertItem(matId, difTex->getPath().c_str(), "", "", 0, 0);
} }
} }
}
// Get animation count // Get animation count
for (S32 i = 0; i < dtsShape->sequences.size(); i++) for (S32 i = 0; i < dtsShape->sequences.size(); i++)
@ -2003,7 +2006,7 @@ void AssetImporter::processShapeAsset(AssetImportObject* assetItem)
{ {
enumColladaForImport(filePath, shapeInfo, false); enumColladaForImport(filePath, shapeInfo, false);
} }
else if (fileExt.compare("dts") == 0) else if ((fileExt.compare("dts") == 0) || (fileExt.compare("dsq") == 0))
{ {
enumDTSForImport(filePath, shapeInfo); enumDTSForImport(filePath, shapeInfo);
} }
@ -2097,7 +2100,7 @@ void AssetImporter::processShapeAnimationAsset(AssetImportObject* assetItem)
{ {
enumColladaForImport(filePath, shapeInfo, false); enumColladaForImport(filePath, shapeInfo, false);
} }
else if (fileExt.compare("dts") == 0) else if ((fileExt.compare("dts") == 0)|| (fileExt.compare("dsq") == 0))
{ {
enumDTSForImport(filePath, shapeInfo); enumDTSForImport(filePath, shapeInfo);
} }

View file

@ -610,6 +610,7 @@ bool AssimpShapeLoader::canLoadCachedDTS(const Torque::Path& path)
{ {
// Generate the cached filename // Generate the cached filename
Torque::Path cachedPath(path); Torque::Path cachedPath(path);
if (String::compare(path.getExtension(), "dsq") != 0)
cachedPath.setExtension("cached.dts"); cachedPath.setExtension("cached.dts");
// Check if a cached DTS newer than this file is available // Check if a cached DTS newer than this file is available
@ -626,7 +627,6 @@ bool AssimpShapeLoader::canLoadCachedDTS(const Torque::Path& path)
return true; return true;
} }
} }
return false; return false;
} }
@ -914,6 +914,7 @@ TSShape* assimpLoadShape(const Torque::Path &path)
// TODO: add .cached.dts generation. // TODO: add .cached.dts generation.
// Generate the cached filename // Generate the cached filename
Torque::Path cachedPath(path); Torque::Path cachedPath(path);
if ( String::compare(path.getExtension(),"dsq") != 0)
cachedPath.setExtension("cached.dts"); cachedPath.setExtension("cached.dts");
// Check if an up-to-date cached DTS version of this file exists, and // Check if an up-to-date cached DTS version of this file exists, and
@ -925,6 +926,17 @@ TSShape* assimpLoadShape(const Torque::Path &path)
if (cachedStream.getStatus() == Stream::Ok) if (cachedStream.getStatus() == Stream::Ok)
{ {
TSShape *shape = new TSShape; TSShape *shape = new TSShape;
if (String::compare(path.getExtension(), "dsq") == 0)
{
if (!shape->importSequences(&cachedStream, cachedPath.getFullPath()))
{
Con::errorf("assimpLoadShape: Load sequence file '%s' failed", cachedPath.getFullPath().c_str());
delete shape;
shape = NULL;
}
cachedStream.close();
return shape;
}
bool readSuccess = shape->read(&cachedStream); bool readSuccess = shape->read(&cachedStream);
cachedStream.close(); cachedStream.close();