mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
reinforce dsq or dts filter
This commit is contained in:
parent
a8d370038a
commit
f5875dd5a2
|
|
@ -985,14 +985,6 @@ TSShape* assimpLoadShape(const Torque::Path &path)
|
|||
TSShapeLoader::updateProgress(TSShapeLoader::Load_Complete, "Import complete");
|
||||
Con::printf("[ASSIMP] Shape created successfully.");
|
||||
|
||||
// Cache the model to a DTS file for faster loading next time.
|
||||
FileStream dtsStream;
|
||||
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
|
||||
{
|
||||
Con::printf("Writing cached shape to %s", cachedPath.getFullPath().c_str());
|
||||
tss->write(&dtsStream);
|
||||
}
|
||||
|
||||
if (tss->meshes.empty())
|
||||
{
|
||||
Torque::Path dsqPath(cachedPath);
|
||||
|
|
@ -1012,6 +1004,16 @@ TSShape* assimpLoadShape(const Torque::Path &path)
|
|||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cache the model to a DTS file for faster loading next time.
|
||||
FileStream dtsStream;
|
||||
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
|
||||
{
|
||||
Con::printf("Writing cached shape to %s", cachedPath.getFullPath().c_str());
|
||||
tss->write(&dtsStream);
|
||||
}
|
||||
}
|
||||
|
||||
loader.updateMaterialsScript(path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -724,18 +724,6 @@ TSShape* loadColladaShape(const Torque::Path &path)
|
|||
if (tss)
|
||||
{
|
||||
#ifndef DAE2DTS_TOOL
|
||||
// Cache the Collada model to a DTS file for faster loading next time.
|
||||
FileStream dtsStream;
|
||||
|
||||
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
|
||||
{
|
||||
Torque::FS::FileSystemRef ref = Torque::FS::GetFileSystem(daePath);
|
||||
if (ref && !String::compare("Zip", ref->getTypeStr().c_str()))
|
||||
Con::errorf("No cached dts file found in archive for %s. Forcing cache to disk.", daePath.getFullFileName().c_str());
|
||||
|
||||
Con::printf("Writing cached COLLADA shape to %s", cachedPath.getFullPath().c_str());
|
||||
tss->write(&dtsStream);
|
||||
}
|
||||
|
||||
if (tss->meshes.empty())
|
||||
{
|
||||
|
|
@ -756,6 +744,20 @@ TSShape* loadColladaShape(const Torque::Path &path)
|
|||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cache the Collada model to a DTS file for faster loading next time.
|
||||
FileStream dtsStream;
|
||||
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
|
||||
{
|
||||
Torque::FS::FileSystemRef ref = Torque::FS::GetFileSystem(daePath);
|
||||
if (ref && !String::compare("Zip", ref->getTypeStr().c_str()))
|
||||
Con::errorf("No cached dts file found in archive for %s. Forcing cache to disk.", daePath.getFullFileName().c_str());
|
||||
|
||||
Con::printf("Writing cached COLLADA shape to %s", cachedPath.getFullPath().c_str());
|
||||
tss->write(&dtsStream);
|
||||
}
|
||||
}
|
||||
#endif // DAE2DTS_TOOL
|
||||
|
||||
// Add collada materials to materials.tscript
|
||||
|
|
|
|||
Loading…
Reference in a new issue