glTF: move mesh splitting to constructor to cover GLB
parent
c9f28192d9
commit
3052f35824
|
@ -80,20 +80,9 @@ namespace Assimp {
|
||||||
// Worker function for exporting a scene to GLTF. Prototyped and registered in Exporter.cpp
|
// Worker function for exporting a scene to GLTF. Prototyped and registered in Exporter.cpp
|
||||||
void ExportSceneGLTF(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties)
|
void ExportSceneGLTF(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties)
|
||||||
{
|
{
|
||||||
aiScene* sceneCopy_tmp;
|
|
||||||
SceneCombiner::CopyScene(&sceneCopy_tmp, pScene);
|
|
||||||
std::unique_ptr<aiScene> sceneCopy(sceneCopy_tmp);
|
|
||||||
|
|
||||||
SplitLargeMeshesProcess_Triangle tri_splitter;
|
|
||||||
tri_splitter.SetLimit(0xffff);
|
|
||||||
tri_splitter.Execute(sceneCopy.get());
|
|
||||||
|
|
||||||
SplitLargeMeshesProcess_Vertex vert_splitter;
|
|
||||||
vert_splitter.SetLimit(0xffff);
|
|
||||||
vert_splitter.Execute(sceneCopy.get());
|
|
||||||
|
|
||||||
// invoke the exporter
|
// invoke the exporter
|
||||||
glTFExporter exporter(pFile, pIOSystem, sceneCopy.get(), pProperties, false);
|
glTFExporter exporter(pFile, pIOSystem, pScene, pProperties, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -112,9 +101,22 @@ glTFExporter::glTFExporter(const char* filename, IOSystem* pIOSystem, const aiSc
|
||||||
const ExportProperties* pProperties, bool isBinary)
|
const ExportProperties* pProperties, bool isBinary)
|
||||||
: mFilename(filename)
|
: mFilename(filename)
|
||||||
, mIOSystem(pIOSystem)
|
, mIOSystem(pIOSystem)
|
||||||
, mScene(pScene)
|
|
||||||
, mProperties(pProperties)
|
, mProperties(pProperties)
|
||||||
{
|
{
|
||||||
|
aiScene* sceneCopy_tmp;
|
||||||
|
SceneCombiner::CopyScene(&sceneCopy_tmp, pScene);
|
||||||
|
std::unique_ptr<aiScene> sceneCopy(sceneCopy_tmp);
|
||||||
|
|
||||||
|
SplitLargeMeshesProcess_Triangle tri_splitter;
|
||||||
|
tri_splitter.SetLimit(0xffff);
|
||||||
|
tri_splitter.Execute(sceneCopy.get());
|
||||||
|
|
||||||
|
SplitLargeMeshesProcess_Vertex vert_splitter;
|
||||||
|
vert_splitter.SetLimit(0xffff);
|
||||||
|
vert_splitter.Execute(sceneCopy.get());
|
||||||
|
|
||||||
|
mScene = sceneCopy.get();
|
||||||
|
|
||||||
std::unique_ptr<Asset> asset();
|
std::unique_ptr<Asset> asset();
|
||||||
mAsset.reset( new glTF::Asset( pIOSystem ) );
|
mAsset.reset( new glTF::Asset( pIOSystem ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue