FbxTests.cpp 966 B

12345678910111213141516171819202122232425
  1. // FbxTests.cpp : Defines the entry point for the console application.
  2. //
  3. #include "stdafx.h"
  4. #include "..\BabylonFbxNative\FbxSceneLoader.h"
  5. #include "..\BabylonFbxNative\FbxMeshLoader.h"
  6. #include "..\BabylonFbxNative\Export.h"
  7. int _tmain(int argc, _TCHAR* argv[])
  8. {
  9. std::vector<babylon_mesh<babylon_vertex_normal_uv_color>> meshes;
  10. FbxSceneLoader sceneLoader("C:\\ws\\babylon\\BabylonExport\\Test scenes\\Dude\\dude.fbx");
  11. auto camera = sceneLoader.GetDefaultCamera();
  12. auto spaceshipSettings = sceneLoader.getGlobalSettings();
  13. FbxMaterialStore materials(L"C:\\ws\\babylon\\BabylonExport\\Test scenes\\Dude", L".", TextureFormat::Dds);
  14. for (int i = 0; i < sceneLoader.getMeshCount(); ++i){
  15. meshes.push_back(loadStaticMesh<babylon_vertex_normal_uv_color>(sceneLoader.getFbxMesh(i), sceneLoader.getScene(), materials));
  16. }
  17. auto json = exportScene(spaceshipSettings, materials.buildMaterialVector(), meshes);
  18. auto text = json.serialize();
  19. return 0;
  20. }