mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Implements ignore filter for assimp fbx dummy nodes.
Adds gltf binary to list of supported extensions.
This commit is contained in:
parent
4f7806fe8e
commit
90577661dc
2 changed files with 15 additions and 3 deletions
|
|
@ -103,7 +103,8 @@ MODULE_BEGIN( AssimpShapeLoader )
|
||||||
TSShapeLoader::addFormat("3D GameStudio (3DGS)", "mdl");
|
TSShapeLoader::addFormat("3D GameStudio (3DGS)", "mdl");
|
||||||
TSShapeLoader::addFormat("3D GameStudio (3DGS) Terrain", "hmp");
|
TSShapeLoader::addFormat("3D GameStudio (3DGS) Terrain", "hmp");
|
||||||
TSShapeLoader::addFormat("Izware Nendo", "ndo");
|
TSShapeLoader::addFormat("Izware Nendo", "ndo");
|
||||||
TSShapeLoader::addFormat("gltf", "gltf");
|
TSShapeLoader::addFormat("gltf", "gltf");
|
||||||
|
TSShapeLoader::addFormat("gltf binary", "glb");
|
||||||
}
|
}
|
||||||
MODULE_END;
|
MODULE_END;
|
||||||
|
|
||||||
|
|
@ -146,7 +147,7 @@ void AssimpShapeLoader::enumerateScene()
|
||||||
Con::getBoolVariable("$Assimp::OptimizeMeshes", false) ? aiProcess_OptimizeMeshes | aiProcess_OptimizeGraph : 0 |
|
Con::getBoolVariable("$Assimp::OptimizeMeshes", false) ? aiProcess_OptimizeMeshes | aiProcess_OptimizeGraph : 0 |
|
||||||
0;
|
0;
|
||||||
|
|
||||||
if(Con::getBoolVariable("$Assimp::Triangulate", false))
|
if(Con::getBoolVariable("$Assimp::Triangulate", true))
|
||||||
ppsteps |= aiProcess_Triangulate;
|
ppsteps |= aiProcess_Triangulate;
|
||||||
|
|
||||||
if (Con::getBoolVariable("$Assimp::OptimizeMeshes", false))
|
if (Con::getBoolVariable("$Assimp::OptimizeMeshes", false))
|
||||||
|
|
@ -276,6 +277,15 @@ bool AssimpShapeLoader::canLoadCachedDTS(const Torque::Path& path)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AssimpShapeLoader::ignoreNode(const String& name)
|
||||||
|
{
|
||||||
|
// Do not add AssimpFbx dummy nodes to the TSShape. See: Assimp::FBX::ImportSettings::preservePivots
|
||||||
|
// https://github.com/assimp/assimp/blob/master/code/FBXImportSettings.h#L116-L135
|
||||||
|
if (name.find("_$AssimpFbx$_") != String::NPos)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/// This function is invoked by the resource manager based on file extension.
|
/// This function is invoked by the resource manager based on file extension.
|
||||||
TSShape* assimpLoadShape(const Torque::Path &path)
|
TSShape* assimpLoadShape(const Torque::Path &path)
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ class AssimpShapeLoader : public TSShapeLoader
|
||||||
protected:
|
protected:
|
||||||
const struct aiScene* mScene;
|
const struct aiScene* mScene;
|
||||||
|
|
||||||
|
virtual bool ignoreNode(const String& name);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AssimpShapeLoader();
|
AssimpShapeLoader();
|
||||||
~AssimpShapeLoader();
|
~AssimpShapeLoader();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue