mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
dsq detection filters
This commit is contained in:
parent
891ede5d59
commit
9bcf8a90b2
2 changed files with 28 additions and 13 deletions
|
|
@ -1359,16 +1359,19 @@ static bool enumDTSForImport(const char* shapePath, GuiTreeViewCtrl* tree)
|
||||||
stats.numMeshes++;
|
stats.numMeshes++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get material count
|
if (dtsShape->materialList)
|
||||||
for (S32 i = 0; i < dtsShape->materialList->size(); i++)
|
|
||||||
{
|
{
|
||||||
S32 matId = tree->insertItem(matsID, dtsShape->materialList->getMaterialName(i).c_str(), "", "", 0, 0);
|
// Get material count
|
||||||
stats.numMaterials++;
|
for (S32 i = 0; i < dtsShape->materialList->size(); i++)
|
||||||
|
|
||||||
GFXTextureObject* difTex = dtsShape->materialList->getDiffuseTexture(i);
|
|
||||||
if (difTex)
|
|
||||||
{
|
{
|
||||||
tree->insertItem(matId, difTex->getPath().c_str(), "", "", 0, 0);
|
S32 matId = tree->insertItem(matsID, dtsShape->materialList->getMaterialName(i).c_str(), "", "", 0, 0);
|
||||||
|
stats.numMaterials++;
|
||||||
|
|
||||||
|
GFXTextureObject* difTex = dtsShape->materialList->getDiffuseTexture(i);
|
||||||
|
if (difTex)
|
||||||
|
{
|
||||||
|
tree->insertItem(matId, difTex->getPath().c_str(), "", "", 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -610,7 +610,8 @@ bool AssimpShapeLoader::canLoadCachedDTS(const Torque::Path& path)
|
||||||
{
|
{
|
||||||
// Generate the cached filename
|
// Generate the cached filename
|
||||||
Torque::Path cachedPath(path);
|
Torque::Path cachedPath(path);
|
||||||
cachedPath.setExtension("cached.dts");
|
if (String::compare(path.getExtension(), "dsq") != 0)
|
||||||
|
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
|
||||||
FileTime cachedModifyTime;
|
FileTime cachedModifyTime;
|
||||||
|
|
@ -626,7 +627,6 @@ bool AssimpShapeLoader::canLoadCachedDTS(const Torque::Path& path)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -914,7 +914,8 @@ 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);
|
||||||
cachedPath.setExtension("cached.dts");
|
if ( String::compare(path.getExtension(),"dsq") != 0)
|
||||||
|
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
|
||||||
// if so, use that instead.
|
// if so, use that instead.
|
||||||
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue