瀏覽代碼

Completely removed FBX as we no longer support it (and we have a lot of alternatives)

David Catuhe 7 年之前
父節點
當前提交
549a195547
共有 100 個文件被更改,包括 0 次插入9075 次删除
  1. 0 66
      Exporters/FBX/BabylonFBXExporter.sln
  2. 0 33
      Exporters/FBX/BabylonFbxNative/BabylonAbstractMesh.cpp
  3. 0 48
      Exporters/FBX/BabylonFbxNative/BabylonAbstractMesh.h
  4. 0 8
      Exporters/FBX/BabylonFbxNative/BabylonAnimation.cpp
  5. 0 231
      Exporters/FBX/BabylonFbxNative/BabylonAnimation.h
  6. 0 200
      Exporters/FBX/BabylonFbxNative/BabylonCamera.cpp
  7. 0 86
      Exporters/FBX/BabylonFbxNative/BabylonCamera.h
  8. 0 233
      Exporters/FBX/BabylonFbxNative/BabylonFbxNative.vcxproj
  9. 0 132
      Exporters/FBX/BabylonFbxNative/BabylonFbxNative.vcxproj.filters
  10. 0 254
      Exporters/FBX/BabylonFbxNative/BabylonLight.cpp
  11. 0 112
      Exporters/FBX/BabylonFbxNative/BabylonLight.h
  12. 0 385
      Exporters/FBX/BabylonFbxNative/BabylonMaterial.cpp
  13. 0 126
      Exporters/FBX/BabylonFbxNative/BabylonMaterial.h
  14. 0 891
      Exporters/FBX/BabylonFbxNative/BabylonMesh.cpp
  15. 0 129
      Exporters/FBX/BabylonFbxNative/BabylonMesh.h
  16. 0 69
      Exporters/FBX/BabylonFbxNative/BabylonNode.cpp
  17. 0 70
      Exporters/FBX/BabylonFbxNative/BabylonNode.h
  18. 0 258
      Exporters/FBX/BabylonFbxNative/BabylonScene.cpp
  19. 0 94
      Exporters/FBX/BabylonFbxNative/BabylonScene.h
  20. 0 41
      Exporters/FBX/BabylonFbxNative/BabylonSkeleton.cpp
  21. 0 48
      Exporters/FBX/BabylonFbxNative/BabylonSkeleton.h
  22. 0 412
      Exporters/FBX/BabylonFbxNative/BabylonVertex.h
  23. 0 11
      Exporters/FBX/BabylonFbxNative/FbxDeleter.h
  24. 0 22
      Exporters/FBX/BabylonFbxNative/FbxLoadException.cpp
  25. 0 17
      Exporters/FBX/BabylonFbxNative/FbxLoadException.h
  26. 0 12
      Exporters/FBX/BabylonFbxNative/FbxMeshHandler.cpp
  27. 0 8
      Exporters/FBX/BabylonFbxNative/FbxMeshHandler.h
  28. 0 56
      Exporters/FBX/BabylonFbxNative/FbxSceneLoader.cpp
  29. 0 61
      Exporters/FBX/BabylonFbxNative/FbxSceneLoader.h
  30. 0 13
      Exporters/FBX/BabylonFbxNative/GlobalSettings.cpp
  31. 0 17
      Exporters/FBX/BabylonFbxNative/GlobalSettings.h
  32. 0 33
      Exporters/FBX/BabylonFbxNative/MatrixDecomposition.h
  33. 0 45
      Exporters/FBX/BabylonFbxNative/NodeHelpers.h
  34. 0 37
      Exporters/FBX/BabylonFbxNative/ReadMe.txt
  35. 0 227
      Exporters/FBX/BabylonFbxNative/SkinInfo.cpp
  36. 0 79
      Exporters/FBX/BabylonFbxNative/SkinInfo.h
  37. 0 21
      Exporters/FBX/BabylonFbxNative/StringUtils.h
  38. 0 50
      Exporters/FBX/BabylonFbxNative/babylon_boundingbox.cpp
  39. 0 11
      Exporters/FBX/BabylonFbxNative/packages.config
  40. 0 8
      Exporters/FBX/BabylonFbxNative/stdafx.cpp
  41. 0 18
      Exporters/FBX/BabylonFbxNative/stdafx.h
  42. 0 8
      Exporters/FBX/BabylonFbxNative/targetver.h
  43. 0 179
      Exporters/FBX/FbxExporter/FbxExporter.cpp
  44. 0 207
      Exporters/FBX/FbxExporter/FbxExporter.vcxproj
  45. 0 39
      Exporters/FBX/FbxExporter/FbxExporter.vcxproj.filters
  46. 0 40
      Exporters/FBX/FbxExporter/ReadMe.txt
  47. 0 11
      Exporters/FBX/FbxExporter/packages.config
  48. 0 8
      Exporters/FBX/FbxExporter/stdafx.cpp
  49. 0 15
      Exporters/FBX/FbxExporter/stdafx.h
  50. 0 8
      Exporters/FBX/FbxExporter/targetver.h
  51. 0 11
      Exporters/FBX/FbxRerouteSkeleton/FbxDeleter.h
  52. 0 274
      Exporters/FBX/FbxRerouteSkeleton/FbxRerouteSkeleton.cpp
  53. 0 169
      Exporters/FBX/FbxRerouteSkeleton/FbxRerouteSkeleton.vcxproj
  54. 0 39
      Exporters/FBX/FbxRerouteSkeleton/FbxRerouteSkeleton.vcxproj.filters
  55. 0 40
      Exporters/FBX/FbxRerouteSkeleton/ReadMe.txt
  56. 0 8
      Exporters/FBX/FbxRerouteSkeleton/stdafx.cpp
  57. 0 15
      Exporters/FBX/FbxRerouteSkeleton/stdafx.h
  58. 0 8
      Exporters/FBX/FbxRerouteSkeleton/targetver.h
  59. 0 25
      Exporters/FBX/FbxTests/FbxTests.cpp
  60. 0 123
      Exporters/FBX/FbxTests/FbxTests.vcxproj
  61. 0 39
      Exporters/FBX/FbxTests/FbxTests.vcxproj.filters
  62. 0 40
      Exporters/FBX/FbxTests/ReadMe.txt
  63. 0 4
      Exporters/FBX/FbxTests/packages.config
  64. 0 8
      Exporters/FBX/FbxTests/stdafx.cpp
  65. 0 15
      Exporters/FBX/FbxTests/stdafx.h
  66. 0 8
      Exporters/FBX/FbxTests/targetver.h
  67. 0 31
      Exporters/FBX/readme.md
  68. 二進制
      Exporters/Unsupported/BabylonExporter.zip
  69. 0 92
      Exporters/Unsupported/ExportToBabylon.sln
  70. 0 236
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/BabylonExport.Core.csproj
  71. 0 35
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonAnimation.cs
  72. 0 14
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonAnimationKey.cs
  73. 0 24
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonBone.cs
  74. 0 82
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonCamera.cs
  75. 0 20
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonLensFlare.cs
  76. 0 17
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonLensFlareSystem.cs
  77. 0 39
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonLight.cs
  78. 0 68
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonMaterial.cs
  79. 0 114
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonMesh.cs
  80. 0 17
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonMultiMaterial.cs
  81. 0 86
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonParticleSystem.cs
  82. 0 163
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonScene.cs
  83. 0 22
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonShadowGenerator.cs
  84. 0 18
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonSkeleton.cs
  85. 0 24
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonSubMesh.cs
  86. 0 84
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonTexture.cs
  87. 0 15
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/IDumpable.cs
  88. 0 14
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/IQueryable.cs
  89. 0 138
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Mesh.cs
  90. 0 69
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/PositionNormalTextured.cs
  91. 0 75
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/PositionNormalTexturedWeights.cs
  92. 0 42
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/ProxyMesh.cs
  93. 0 81
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/StandardMaterial.cs
  94. 0 13
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/IExporter.cs
  95. 0 468
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/MXB/NovaExporter.Materials.cs
  96. 0 705
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/MXB/NovaExporter.cs
  97. 0 28
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/ThroughXNA/DAE/DAEExporter.cs
  98. 0 28
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/ThroughXNA/FBX/FBXExporter.cs
  99. 0 200
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/ThroughXNA/XNA/ContentBuilder.cs
  100. 0 0
      Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/ThroughXNA/XNA/ErrorLogger.cs

+ 0 - 66
Exporters/FBX/BabylonFBXExporter.sln

@@ -1,66 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BabylonFbxNative", "BabylonFbxNative\BabylonFbxNative.vcxproj", "{6C145CFB-31AC-4B28-8B74-26680D26A6E3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FbxExporter", "FbxExporter\FbxExporter.vcxproj", "{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FbxRerouteSkeleton", "FbxRerouteSkeleton\FbxRerouteSkeleton.vcxproj", "{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{61044500-24C7-454A-9E06-79ED84EB199E}"
-	ProjectSection(SolutionItems) = preProject
-		readme.md = readme.md
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Profile|Win32 = Profile|Win32
-		Profile|x64 = Profile|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Debug|Win32.Build.0 = Debug|Win32
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Debug|x64.ActiveCfg = Debug|x64
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Debug|x64.Build.0 = Debug|x64
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Profile|Win32.ActiveCfg = Release|Win32
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Profile|Win32.Build.0 = Release|Win32
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Profile|x64.ActiveCfg = Release|x64
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Profile|x64.Build.0 = Release|x64
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Release|Win32.ActiveCfg = Release|Win32
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Release|Win32.Build.0 = Release|Win32
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Release|x64.ActiveCfg = Release|x64
-		{6C145CFB-31AC-4B28-8B74-26680D26A6E3}.Release|x64.Build.0 = Release|x64
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Debug|Win32.Build.0 = Debug|Win32
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Debug|x64.ActiveCfg = Debug|x64
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Debug|x64.Build.0 = Debug|x64
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Profile|Win32.ActiveCfg = Release|Win32
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Profile|Win32.Build.0 = Release|Win32
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Profile|x64.ActiveCfg = Release|x64
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Profile|x64.Build.0 = Release|x64
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Release|Win32.ActiveCfg = Release|Win32
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Release|Win32.Build.0 = Release|Win32
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Release|x64.ActiveCfg = Release|x64
-		{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}.Release|x64.Build.0 = Release|x64
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Debug|Win32.Build.0 = Debug|Win32
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Debug|x64.ActiveCfg = Debug|x64
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Debug|x64.Build.0 = Debug|x64
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Profile|Win32.ActiveCfg = Release|Win32
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Profile|Win32.Build.0 = Release|Win32
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Profile|x64.ActiveCfg = Release|Win32
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Release|Win32.ActiveCfg = Release|Win32
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Release|Win32.Build.0 = Release|Win32
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Release|x64.ActiveCfg = Release|x64
-		{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

+ 0 - 33
Exporters/FBX/BabylonFbxNative/BabylonAbstractMesh.cpp

@@ -1,33 +0,0 @@
-#include "stdafx.h"
-#include "BabylonAbstractMesh.h"
-
-
-BabylonAbstractMesh::BabylonAbstractMesh()
-	:_position(0, 0, 0), _rotationQuaternion(0, 0, 0,0), _scaling(1,1,1)
-{
-}
-
-BabylonAbstractMesh::BabylonAbstractMesh(BabylonNode* node)
-{
-	auto localTransform = node->GetLocal();
-	_position = localTransform.translation();
-	_rotationQuaternion = localTransform.rotationQuaternion();
-	_scaling = localTransform.scaling();
-	auto n = node->name();
-	_name = std::wstring(n.begin(), n.end());
-}
-
-
-web::json::value BabylonAbstractMesh::toJson() 
-{
-	auto jobj = web::json::value::object();
-	jobj[L"name"] = web::json::value::string(_name);
-	writeVector3(jobj, L"position", position());
-	writeVector4(jobj, L"rotationQuaternion", rotationQuaternion());
-	writeVector3(jobj, L"scaling", scaling());
-	return jobj;
-}
-
-BabylonAbstractMesh::~BabylonAbstractMesh()
-{
-}

+ 0 - 48
Exporters/FBX/BabylonFbxNative/BabylonAbstractMesh.h

@@ -1,48 +0,0 @@
-#pragma once
-#include <string>
-#include <cpprest\json.h>
-#include "BabylonVertex.h"
-#include "BabylonNode.h"
-
-// base class for meshes and mesh instances (instances not implemented yet)
-class BabylonAbstractMesh
-{
-private:
-	std::wstring _name;
-	babylon_vector3 _position;
-	babylon_vector4 _rotationQuaternion;
-	babylon_vector3 _scaling;
-public:
-	const std::wstring& name() const{
-		return _name;
-	}
-	void name(const std::wstring& value){
-		_name = value;
-	}
-	babylon_vector3 position() const{
-		return _position;
-	}
-	void position(babylon_vector3 value){
-		_position = value;
-	}
-	babylon_vector4 rotationQuaternion() const{
-		return _rotationQuaternion;
-	}
-	void rotationQuaternion(babylon_vector4 value){
-		_rotationQuaternion = value;
-	}
-	babylon_vector3 scaling() const{
-		return _scaling;
-	}
-	void scaling(babylon_vector3 value){
-		_scaling = value;
-	}
-	BabylonAbstractMesh();
-
-	BabylonAbstractMesh(BabylonNode* node);
-	BabylonAbstractMesh(const BabylonAbstractMesh& ) = default;
-
-	virtual web::json::value toJson() ;
-	virtual ~BabylonAbstractMesh();
-};
-

+ 0 - 8
Exporters/FBX/BabylonFbxNative/BabylonAnimation.cpp

@@ -1,8 +0,0 @@
-#include "stdafx.h"
-#include "BabylonAnimation.h"
-
-
-BabylonAnimationBase::BabylonAnimationBase(int loopBehavior, int fps, const std::wstring& name, const std::wstring& animatedProperty, bool autoAnimate, int autoAnimateFrom, int autoAnimateTo, bool autoAnimateLoop) :
-loopBehavior(loopBehavior), framePerSecond(fps), name(name), property(animatedProperty), autoAnimate(autoAnimate), autoAnimateFrom(autoAnimateFrom), autoAnimateTo(autoAnimateTo), autoAnimateLoop(autoAnimateLoop)
-{
-}

+ 0 - 231
Exporters/FBX/BabylonFbxNative/BabylonAnimation.h

@@ -1,231 +0,0 @@
-#pragma once
-#include <string>
-#include <vector>
-#include "BabylonVertex.h"
-#include <cpprest\json.h>
-
-// base class representing babylon animations
-class BabylonAnimationBase
-{
-public:
-
-	static const int dataType_Float = 0;
-	static const int dataType_Vector3 = 1;
-	static const int dataType_Quaternion = 2;
-	static const int dataType_Matrix = 3;
-	static const int loopBehavior_Relative = 0;
-	static const int loopBehavior_Cycle = 1;
-	static const int loopBehavior_Constant = 2;
-	int dataType;
-	int loopBehavior;
-	int framePerSecond;
-	std::wstring name;
-	std::wstring property;
-	bool autoAnimate;
-	int autoAnimateFrom;
-	int autoAnimateTo;
-	bool autoAnimateLoop;
-	BabylonAnimationBase(int loopBehavior, int fps, const std::wstring& name, const std::wstring& animatedProperty, bool autoAnimate, int autoAnimateFrom, int autoAnimateTo, bool autoAnimateLoop);
-	virtual ~BabylonAnimationBase(){}
-
-
-	virtual bool isConstant() = 0;
-
-	virtual web::json::value toJson() const = 0;
-};
-
-// key frame data
-template<typename T>
-struct babylon_animation_key{
-	int frame;
-	T values;
-};
-
-// traits for animated babylon data types (must contain : 
-// static const int dataType
-// static web::json::value jsonify(const T& value)
-template<typename T>
-struct bab_anim_traits{
-
-};
-
-// specialization for vectors 3D
-template<>
-struct bab_anim_traits < babylon_vector3 >
-{
-	static const int dataType = BabylonAnimationBase::dataType_Vector3;
-
-	static web::json::value jsonify(const babylon_vector3& value){
-		auto jarray = web::json::value::array();
-		jarray[0] = web::json::value::number(value.x);
-		jarray[1] = web::json::value::number(value.y);
-		jarray[2] = web::json::value::number(value.z);
-		return jarray;
-	}
-};
-
-// specialization for quaternions
-template<>
-struct bab_anim_traits < babylon_vector4 >
-{
-	static const int dataType = BabylonAnimationBase::dataType_Quaternion;
-
-	static web::json::value jsonify(const babylon_vector4& value){
-		auto jarray = web::json::value::array();
-		jarray[0] = web::json::value::number(value.x);
-		jarray[1] = web::json::value::number(value.y);
-		jarray[2] = web::json::value::number(value.z);
-		jarray[3] = web::json::value::number(value.w);
-		return jarray;
-	}
-};
-
-// specialization for matrices
-template<>
-struct bab_anim_traits < FbxMatrix >
-{
-	static const int dataType = BabylonAnimationBase::dataType_Matrix;
-
-	static web::json::value jsonify(const FbxMatrix& value){
-		auto jmat = web::json::value::array();
-		for (auto x = 0; x < 4; ++x){
-			for (auto y = 0; y < 4; ++y){
-				jmat[x * 4 + y] = web::json::value::number(value[x][y]);
-			}
-		}
-		return jmat;
-	}
-};
-
-// specialization for scalar floats
-template<>
-struct bab_anim_traits < float >
-{
-	static const int dataType = BabylonAnimationBase::dataType_Float;
-
-	static web::json::value jsonify(float value){
-		auto jarray = web::json::value::array();
-		jarray[0] = web::json::value::number(value);
-		return jarray;
-	}
-};
-
-// used for interpolation simplification
-template<typename T>
-bool isNear(const T& lhs, const T& rhs);
-
-template <>
-inline bool isNear<float>(const float& lhs, const float& rhs){
-	auto diff = lhs - rhs;
-	return diff >= -0.000001f && diff <= 0.000001f;
-}
-
-template <>
-inline bool isNear<FbxMatrix>(const FbxMatrix& lhs, const FbxMatrix& rhs){
-	return lhs == rhs;
-}
-
-template <>
-inline bool isNear<babylon_vector3>(const babylon_vector3& lhs, const babylon_vector3& rhs){
-	return isNear(lhs.x, rhs.x)
-		&& isNear(lhs.y, rhs.y)
-		&& isNear(lhs.z, rhs.z);
-}
-template <>
-inline bool isNear<babylon_vector4>(const babylon_vector4& lhs, const babylon_vector4& rhs){
-	return isNear(lhs.x, rhs.x)
-		&& isNear(lhs.y, rhs.y)
-		&& isNear(lhs.z, rhs.z)
-		&& isNear(lhs.w, rhs.w);
-}
-
-template<typename T>
-inline T lerp(const T& start, const T& end, float factor){
-	return start + (end - start)*factor;
-}
-
-template<typename T>
-bool isLinearInterpolation(const babylon_animation_key<T>& key0, const babylon_animation_key<T>& key1, const babylon_animation_key<T>& key2){
-	auto testVal = lerp(key0.values, key2.values, static_cast<float>(key1.frame - key0.frame) / static_cast<float>(key2.frame - key0.frame));
-	return isNear(testVal, key1.values);
-}
-// typed babylon animation.
-// requires bab_anim_traits<T>, isNear<T> and basic arithmetic operators
-template<typename T>
-class BabylonAnimation : public BabylonAnimationBase
-{
-public:
-	std::vector<babylon_animation_key<T>> keys;
-	BabylonAnimation(int loopBehavior, int fps, const std::wstring& name, const std::wstring& animatedProperty, bool autoAnimate, int autoAnimateFrom, int autoAnimateTo, bool autoAnimateLoop) :
-		BabylonAnimationBase(loopBehavior, fps, name, animatedProperty, autoAnimate, autoAnimateFrom, autoAnimateTo, autoAnimateLoop)
-		
-	{
-		dataType = bab_anim_traits<T>::dataType;
-	}
-
-	void appendKey(const babylon_animation_key<T>& key){
-		if (keys.size() <= 1){
-			// nothing to simplify
-			keys.push_back(key);
-		}
-		else{
-			if (isNear(key.values, keys[keys.size() - 1].values) && isNear(key.values, keys[keys.size() - 2].values)){
-				// if 3 times the same value, eliminate intermediate key
-				keys.resize(keys.size() - 1);
-				keys.push_back(key);
-			}
-			else if (isLinearInterpolation(keys[keys.size() - 2], keys[keys.size() - 1], key)){
-				// if the 3 last values are linearly interpolated, eliminate the intermediate key
-				keys.resize(keys.size() - 1);
-				keys.push_back(key);
-
-			}
-			else{
-
-				keys.push_back(key);
-			}
-
-		}
-	}
-
-	virtual bool isConstant() override{
-		if (keys.size() < 2){
-			return true;
-		}
-		if (keys.size() > 2){
-			return false;
-		}
-
-		return isNear(keys[0].values, keys[1].values);
-	}
-
-	virtual web::json::value toJson() const override {
-		auto jobj = web::json::value::object();
-
-
-		jobj[L"dataType"] = web::json::value::number(dataType);
-		jobj[L"framePerSecond"] = web::json::value::number(framePerSecond);
-		jobj[L"loopBehavior"] = web::json::value::number(loopBehavior);
-		jobj[L"name"] = web::json::value::string(name);
-		jobj[L"property"] = web::json::value::string(property);
-		jobj[L"autoAnimate"] = web::json::value::boolean(autoAnimate);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(autoAnimateFrom);
-		jobj[L"autoAnimateTo"] = web::json::value::number(autoAnimateTo);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(autoAnimateLoop);
-
-		auto jkeys = web::json::value::array();
-
-		for (auto ix = 0u; ix < keys.size(); ++ix){
-			auto jkey = web::json::value::object();
-			jkey[L"frame"] = keys[ix].frame;
-			jkey[L"values"] = bab_anim_traits<T>::jsonify(keys[ix].values);
-			jkeys[jkeys.size()] = jkey;
-		}
-
-		jobj[L"keys"] = jkeys;
-
-		return jobj;
-	}
-};
-
-

+ 0 - 200
Exporters/FBX/BabylonFbxNative/BabylonCamera.cpp

@@ -1,200 +0,0 @@
-#include "stdafx.h"
-#include "BabylonCamera.h"
-#include "NodeHelpers.h"
-#include "GlobalSettings.h"
-
-web::json::value BabylonCamera::toJson() const
-{
-	auto jobj = web::json::value::object();
-	jobj[L"name"] = web::json::value::string(name);
-	jobj[L"id"] = web::json::value::string(id);
-	if(parentId.size()>0)
-		jobj[L"parentId"] = web::json::value::string(parentId);
-	if(lockedTargetId.size()>0)
-		jobj[L"lockedTargetId"] = web::json::value::string(lockedTargetId);
-	jobj[L"type"] = web::json::value::string(type);
-	writeVector3(jobj, L"position", position);
-	writeVector3(jobj, L"rotation", babylon_vector3(0,0,0));
-	writeVector4(jobj, L"rotationQuaternion", rotationQuaternion);
-	if(lockedTargetId.size()==0)
-		writeVector3(jobj, L"target", target);
-
-	jobj[L"fov"] = web::json::value::number(fov);
-	jobj[L"minZ"] = web::json::value::number(minZ);
-	jobj[L"maxZ"] = web::json::value::number(maxZ);
-	jobj[L"speed"] = web::json::value::number(speed);
-	jobj[L"inertia"] = web::json::value::number(inertia);
-	jobj[L"checkCollisions"] = web::json::value::boolean(checkCollisions);
-	jobj[L"applyGravity"] = web::json::value::boolean(applyGravity);
-	writeVector3(jobj, L"ellipsoid", ellipsoid);
-	if (animations.size() == 0 && quatAnimations.size() == 0){
-
-		jobj[L"autoAnimate"] = web::json::value::boolean(false);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(false);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(0);
-		jobj[L"autoAnimateTo"] = web::json::value::number(0);
-
-	}
-	else if (animations.size()>0){
-
-		jobj[L"autoAnimate"] = web::json::value::boolean(animations[0]->autoAnimate);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(animations[0]->autoAnimateLoop);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(animations[0]->autoAnimateFrom);
-		jobj[L"autoAnimateTo"] = web::json::value::number(animations[0]->autoAnimateTo);
-	}
-	else{
-		jobj[L"autoAnimate"] = web::json::value::boolean(quatAnimations[0]->autoAnimate);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(quatAnimations[0]->autoAnimateLoop);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(quatAnimations[0]->autoAnimateFrom);
-		jobj[L"autoAnimateTo"] = web::json::value::number(quatAnimations[0]->autoAnimateTo);
-	}
-
-	auto janimations = web::json::value::array();
-	for (const auto& anim : animations){
-		janimations[janimations.size()] = anim->toJson();
-	}for (const auto& anim : quatAnimations){
-		janimations[janimations.size()] = anim->toJson();
-	}
-	jobj[L"animations"] = janimations;
-	return jobj;
-}
-
-BabylonCamera::BabylonCamera()
-{
-}
-
-
-BabylonCamera buildCameraFromBoundingBox(const babylon_boundingbox& box){
-	BabylonCamera result;
-	result.name = L"defaultcamera";
-	result.id = L"defaultcamera";
-
-	result.target = box.getCenter();
-	result.position = babylon_vector3(result.target.x, result.target.y, result.target.z - 2 * std::max(box.getWidth(), std::max(box.getHeight(), box.getDepth())));
-	result.fov = 0.8576f;
-	result.minZ = -0.01f*result.position.z;
-	result.maxZ = -5 * result.position.z;
-	result.speed = (-result.position.z - result.target.z) / 10;
-	result.inertia = 0.9f;
-	result.checkCollisions = false;
-	result.applyGravity = false;
-	result.ellipsoid = babylon_vector3(.2f, .9f, .2f);
-	return result;
-}
-
-BabylonCamera::BabylonCamera(BabylonNode& babnode)
-{
-	auto node = babnode.fbxNode();
-	std::string ansiName = node->GetName();
-	name = std::wstring(ansiName.begin(), ansiName.end());
-	id = getNodeId(node);
-	auto parent = node->GetParent();
-	if (parent) {
-		parentId = getNodeId(parent);
-	}
-	auto camera = node->GetCamera();
-	if (!camera) {
-		return;
-	}
-	type = L"FreeCamera";
-	auto targetNode = node->GetTarget();
-	if (targetNode) {
-		lockedTargetId = getNodeId(targetNode);
-	}
-	else {
-		target = camera->InterestPosition.Get();
-	}
-	auto localTransformAtStart = babnode.GetLocal();
-	position = localTransformAtStart.translation();
-	rotationQuaternion = localTransformAtStart.rotationQuaternion();
-	
-	fov = static_cast<float>(camera->FieldOfViewY * Euler2Rad);
-	
-	
-	minZ = static_cast<float>(camera->NearPlane.Get());
-	maxZ = static_cast<float>(camera->FarPlane.Get());
-
-	auto hasAnimStack = node->GetScene()->GetSrcObjectCount<FbxAnimStack>() > 0;
-	if (!hasAnimStack){
-		return;
-	}
-	auto animStack = node->GetScene()->GetCurrentAnimationStack();
-	FbxString animStackName = animStack->GetName();
-	//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
-	auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
-	auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
-	auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
-	auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
-	auto animLengthInFrame = endFrame - startFrame + 1;
-
-	auto posAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"position", L"position", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto rotAnim = std::make_shared<BabylonAnimation<babylon_vector4>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"rotation", L"rotation", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto targetAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"target", L"target", true, 0, static_cast<int>(animLengthInFrame), true);
-	if (node->LclRotation.GetCurveNode() || node->LclScaling.GetCurveNode() || node->LclTranslation.GetCurveNode() || camera->InterestPosition.GetCurveNode()) {
-		for (auto ix = 0; ix < animLengthInFrame; ix++) {
-			FbxTime currTime;
-			currTime.SetFrame(startFrame + ix, animTimeMode);
-
-			babylon_animation_key<babylon_vector3> poskey;
-			babylon_animation_key<babylon_vector4> rotkey;
-			poskey.frame = ix;
-			rotkey.frame = ix;
-
-
-			auto transformAtT = babnode.GetLocal(currTime);
-
-			poskey.values = transformAtT.translation();
-			rotkey.values = transformAtT.rotationQuaternion();
-			posAnim->appendKey(poskey);
-			rotAnim->appendKey(rotkey);
-
-			if (lockedTargetId.size() == 0) {
-
-				babylon_animation_key<babylon_vector3> targetKey;
-				targetKey.frame = ix;
-				targetKey.values = camera->InterestPosition.EvaluateValue(currTime);
-				targetAnim->appendKey(targetKey);
-			}
-		}
-	}
-	if (!posAnim->isConstant()){
-		animations.push_back(posAnim);
-	}
-	if (!rotAnim->isConstant()){
-		quatAnimations.push_back(rotAnim);
-	}
-	if (!targetAnim->isConstant()){
-		animations.push_back(targetAnim);
-	}
-}
-
-
-BabylonCamera::BabylonCamera(BabylonCamera && moved) : 
-	name(std::move(moved.name)),
-	id(std::move(moved.id)),
-	parentId(std::move(moved.parentId)),
-	lockedTargetId(std::move(moved.lockedTargetId)),
-	type(std::move(moved.type)),
-	position(std::move(moved.position)),
-	rotationQuaternion(std::move(moved.rotationQuaternion)),
-	target(std::move(moved.target)),
-	fov(std::move(moved.fov)),
-	minZ(std::move(moved.minZ)),
-	maxZ(std::move(moved.maxZ)),
-	speed(std::move(moved.speed)),
-	inertia(std::move(moved.inertia)),
-	checkCollisions(std::move(moved.checkCollisions)),
-	applyGravity(std::move(moved.applyGravity)),
-	ellipsoid(std::move(moved.ellipsoid)),
-	autoAnimate(std::move(moved.autoAnimate)),
-	autoAnimateFrom(std::move(moved.autoAnimateFrom)),
-	autoAnimateTo(std::move(moved.autoAnimateTo)),
-	autoAnimateLoop(std::move(moved.autoAnimateLoop)),
-	animations(std::move(moved.animations)),
-	quatAnimations(std::move(moved.quatAnimations))
-{
-}
-
-BabylonCamera::~BabylonCamera()
-{
-}

+ 0 - 86
Exporters/FBX/BabylonFbxNative/BabylonCamera.h

@@ -1,86 +0,0 @@
-#pragma once
-#include <cpprest\json.h>
-#include <string>
-#include "BabylonVertex.h"
-#include <fbxsdk.h>
-#include "BabylonNode.h"
-#include "BabylonAnimation.h"
-#include <memory>
-class BabylonCamera
-{
-public:
-	
-	std::wstring name;
-
-		
-	std::wstring id;
-
-		
-	std::wstring parentId;
-
-		
-	std::wstring lockedTargetId;
-
-		
-	std::wstring type;
-
-		
-	babylon_vector3 position;
-
-		
-	babylon_vector4 rotationQuaternion = babylon_vector4(0,0,0,1);
-
-		
-	babylon_vector3 target;
-
-		
-	float fov =.8f;
-
-		
-	float minZ = .1f;
-
-		
-	float maxZ = 5000;
-
-		
-	float speed = 1;
-
-		
-	float inertia = .9f;
-
-		
-	bool checkCollisions = false;
-
-		
-	bool applyGravity = false;
-
-		
-	babylon_vector3 ellipsoid;
-
-		
-	bool autoAnimate = false;
-
-		
-	int autoAnimateFrom = 0;
-
-		
-	int autoAnimateTo = 0;
-
-		
-	bool autoAnimateLoop = false;
-
-
-	std::vector<std::shared_ptr < BabylonAnimation<babylon_vector3>>> animations;
-
-	std::vector<std::shared_ptr < BabylonAnimation<babylon_vector4>>> quatAnimations;
-	web::json::value toJson() const;
-
-	BabylonCamera();
-	BabylonCamera(BabylonNode& babnode);
-	BabylonCamera(const BabylonCamera& ) = default;
-	BabylonCamera(BabylonCamera&& moved);
-	~BabylonCamera();
-};
-
-
-BabylonCamera buildCameraFromBoundingBox(const babylon_boundingbox& box);

+ 0 - 233
Exporters/FBX/BabylonFbxNative/BabylonFbxNative.vcxproj

@@ -1,233 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{6C145CFB-31AC-4B28-8B74-26680D26A6E3}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>BabylonFbxNative</RootNamespace>
-    <SccProjectName>SAK</SccProjectName>
-    <SccAuxPath>SAK</SccAuxPath>
-    <SccLocalPath>SAK</SccLocalPath>
-    <SccProvider>SAK</SccProvider>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
-    <RestorePackages>true</RestorePackages>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-    <Import Project="..\packages\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x86\debug;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x86\release;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x64\debug;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x64\release;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <AdditionalDependencies>libfbxsdk-md.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <Lib>
-      <AdditionalDependencies>libfbxsdk-md.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-    <Lib>
-      <AdditionalDependencies>libfbxsdk-md.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-    <Lib>
-      <AdditionalDependencies>libfbxsdk-md.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Lib>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Text Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="BabylonAbstractMesh.h" />
-    <ClInclude Include="BabylonAnimation.h" />
-    <ClInclude Include="BabylonCamera.h" />
-    <ClInclude Include="BabylonLight.h" />
-    <ClInclude Include="BabylonMaterial.h" />
-    <ClInclude Include="BabylonMesh.h" />
-    <ClInclude Include="BabylonNode.h" />
-    <ClInclude Include="BabylonScene.h" />
-    <ClInclude Include="BabylonSkeleton.h" />
-    <ClInclude Include="BabylonVertex.h" />
-    <ClInclude Include="FbxDeleter.h" />
-    <ClInclude Include="FbxLoadException.h" />
-    <ClInclude Include="FbxSceneLoader.h" />
-    <ClInclude Include="GlobalSettings.h" />
-    <ClInclude Include="MatrixDecomposition.h" />
-    <ClInclude Include="NodeHelpers.h" />
-    <ClInclude Include="SkinInfo.h" />
-    <ClInclude Include="stdafx.h" />
-    <ClInclude Include="StringUtils.h" />
-    <ClInclude Include="targetver.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="BabylonAbstractMesh.cpp" />
-    <ClCompile Include="BabylonAnimation.cpp" />
-    <ClCompile Include="BabylonCamera.cpp" />
-    <ClCompile Include="BabylonLight.cpp" />
-    <ClCompile Include="BabylonMaterial.cpp" />
-    <ClCompile Include="BabylonMesh.cpp" />
-    <ClCompile Include="BabylonNode.cpp" />
-    <ClCompile Include="BabylonScene.cpp" />
-    <ClCompile Include="BabylonSkeleton.cpp" />
-    <ClCompile Include="babylon_boundingbox.cpp" />
-    <ClCompile Include="FbxLoadException.cpp" />
-    <ClCompile Include="FbxSceneLoader.cpp" />
-    <ClCompile Include="GlobalSettings.cpp" />
-    <ClCompile Include="SkinInfo.cpp" />
-    <ClCompile Include="stdafx.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
-  </Target>
-</Project>

+ 0 - 132
Exporters/FBX/BabylonFbxNative/BabylonFbxNative.vcxproj.filters

@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <Text Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="targetver.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="FbxDeleter.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="FbxLoadException.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="FbxSceneLoader.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonVertex.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonNode.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonAbstractMesh.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonMesh.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonScene.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonMaterial.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonCamera.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="NodeHelpers.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonLight.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonAnimation.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="SkinInfo.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="BabylonSkeleton.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="GlobalSettings.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="MatrixDecomposition.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="StringUtils.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="FbxLoadException.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="FbxSceneLoader.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="babylon_boundingbox.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonNode.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonAbstractMesh.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonMesh.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonScene.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonMaterial.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonCamera.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonLight.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonAnimation.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="SkinInfo.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="BabylonSkeleton.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="GlobalSettings.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-</Project>

+ 0 - 254
Exporters/FBX/BabylonFbxNative/BabylonLight.cpp

@@ -1,254 +0,0 @@
-#include "stdafx.h"
-#include "BabylonLight.h"
-#include "NodeHelpers.h"
-#include "GlobalSettings.h"
-
-web::json::value BabylonLight::toJson() const
-{
-	auto jobj = web::json::value::object();
-	jobj[L"name"] = web::json::value::string(name);
-	jobj[L"id"] = web::json::value::string(id);
-	if (parentId.size() > 0)
-		jobj[L"parentId"] = web::json::value::string(parentId);
-
-	writeVector3(jobj, L"position", position);
-	writeVector3(jobj, L"direction", direction);
-	jobj[L"type"] = web::json::value::number(type);
-	writeVector3(jobj, L"diffuse", diffuse);
-	writeVector3(jobj, L"specular", specular);
-	jobj[L"intensity"] = web::json::value::number(intensity);
-	jobj[L"range"] = web::json::value::number(range);
-	jobj[L"exponent"] = web::json::value::number(exponent);
-	jobj[L"angle"] = web::json::value::number(angle);
-	writeVector3(jobj, L"groundColor", groundColor);
-
-	if (animations.size() == 0) {
-
-		jobj[L"autoAnimate"] = web::json::value::boolean(false);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(false);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(0);
-		jobj[L"autoAnimateTo"] = web::json::value::number(0);
-
-	}
-	else {
-
-		jobj[L"autoAnimate"] = web::json::value::boolean(animations[0]->autoAnimate);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(animations[0]->autoAnimateLoop);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(animations[0]->autoAnimateFrom);
-		jobj[L"autoAnimateTo"] = web::json::value::number(animations[0]->autoAnimateTo);
-	}
-
-	auto janimations = web::json::value::array();
-	for (const auto& anim : animations) {
-		janimations[janimations.size()] = anim->toJson();
-	}
-	jobj[L"animations"] = janimations;
-
-	auto jarray = web::json::value::array();
-	for (auto& id : excludedMeshesIds) {
-		jarray[jarray.size()] = web::json::value::string(id);
-	}
-	jobj[L"excludedMeshesIds"] = jarray;
-
-	jarray = web::json::value::array();
-	for (auto& id : includedOnlyMeshesIds) {
-		jarray[jarray.size()] = web::json::value::string(id);
-	}
-	jobj[L"includedOnlyMeshesIds"] = jarray;
-
-	return jobj;
-}
-
-BabylonLight::BabylonLight() :
-	diffuse(1, 1, 1),
-	specular(1, 1, 1)
-{
-}
-
-BabylonLight::BabylonLight(BabylonNode & babnode) :
-	diffuse(1, 1, 1),
-	specular(1, 1, 1)
-{
-	auto node = babnode.fbxNode();
-	std::string ansiName = node->GetName();
-	name = std::wstring(ansiName.begin(), ansiName.end());
-	id = getNodeId(node);
-	auto parent = node->GetParent();
-	if (parent) {
-		parentId = getNodeId(parent);
-	}
-	auto localTransform = babnode.GetLocal();
-	position = localTransform.translation();
-	auto light = node->GetLight();
-	switch (light->LightType)
-	{
-	case FbxLight::ePoint:
-		type = type_omni;
-		break;
-	case FbxLight::eDirectional:
-		type = type_direct;
-		{
-			FbxDouble3 vDir(0, -1, 0);
-			FbxAMatrix rotM;
-			rotM.SetIdentity();
-
-			rotM.SetQ(localTransform.fbxrot());
-			auto transDir = rotM.MultT(vDir);
-			direction = transDir;
-
-		}
-		break;
-	case FbxLight::eSpot:
-		type = type_Spot;
-		{
-			FbxDouble3 vDir(0, -1, 0);
-			FbxAMatrix rotM;
-			rotM.SetIdentity();
-			rotM.SetQ(localTransform.fbxrot());
-			auto transDir = rotM.MultT(vDir);
-			direction = transDir;
-			exponent = 1;
-			angle = static_cast<float>(light->OuterAngle*Euler2Rad);
-
-		}
-		break;
-	default:
-		break;
-	}
-	diffuse = light->Color.Get();
-	intensity = static_cast<float>(light->Intensity.Get() / 100.0);
-	if (light->EnableFarAttenuation.Get()) {
-		range = static_cast<float>(light->FarAttenuationEnd.Get());
-	}
-	auto hasAnimStack = node->GetScene()->GetSrcObjectCount<FbxAnimStack>() > 0;
-	if (!hasAnimStack) {
-		return;
-	}
-	castShadows = light->CastShadows.Get();
-	if (castShadows) {
-		shadowGenerator = std::make_shared<BabylonShadowGenerator>(node);
-	}
-	auto animStack = node->GetScene()->GetCurrentAnimationStack();
-	FbxString animStackName = animStack->GetName();
-	//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
-	auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
-	auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
-	auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
-	auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
-	auto animLengthInFrame = endFrame - startFrame + 1;
-	auto posAnimName = getNodeId(node);
-	auto dirAnimName = getNodeId(node);
-	posAnimName.append(L"_position");
-	dirAnimName.append(L"_direction");
-	auto posAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), posAnimName, L"position", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto dirAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), dirAnimName, L"direction", true, 0, static_cast<int>(animLengthInFrame), true);
-	if (node->LclRotation.GetCurveNode() || node->LclTranslation.GetCurveNode()) {
-		for (auto ix = 0; ix < animLengthInFrame; ix++) {
-			babylon_animation_key<babylon_vector3> key;
-			key.frame = ix;
-			FbxTime currTime;
-			currTime.SetFrame(startFrame + ix, animTimeMode);
-			auto currTransform = babnode.GetLocal(currTime);
-			key.values = currTransform.translation();
-			posAnim->appendKey(key);
-
-			if (type == type_direct || type == type_Spot) {
-				babylon_animation_key<babylon_vector3> dirkey;
-				dirkey.frame = ix;
-				FbxDouble3 vDir(0, -1, 0);
-				FbxAMatrix rotM;
-				rotM.SetIdentity();
-				rotM.SetQ(currTransform.fbxrot());
-				auto transDir = rotM.MultT(vDir);
-				dirkey.values = transDir;
-				dirAnim->appendKey(dirkey);
-			}
-		}
-	}
-	if (!posAnim->isConstant()) {
-		animations.push_back(posAnim);
-	}
-	if (!dirAnim->isConstant()) {
-		animations.push_back(dirAnim);
-	}
-}
-
-
-BabylonLight::BabylonLight(BabylonLight && moved)  : 
-name(std::move(moved.name)),
-id(std::move(moved.id)),
-parentId(std::move(moved.parentId)),
-position(std::move(moved.position)),
-direction(std::move(moved.direction)),
-type(std::move(moved.type)),
-diffuse(std::move(moved.diffuse)),
-specular(std::move(moved.specular)),
-intensity(std::move(moved.intensity)),
-range(std::move(moved.range)),
-exponent(std::move(moved.exponent)),
-angle(std::move(moved.angle)),
-groundColor(std::move(moved.groundColor)),
-castShadows(std::move(moved.castShadows)),
-includedOnlyMeshesIds(std::move(moved.includedOnlyMeshesIds)),
-excludedMeshesIds(std::move(moved.excludedMeshesIds)),
-shadowGenerator(std::move(moved.shadowGenerator)),
-animations(std::move(moved.animations))
-{
-}
-
-BabylonLight::~BabylonLight()
-{
-}
-
-BabylonShadowGenerator::BabylonShadowGenerator(FbxNode * lightNode)
-{
-	auto light = lightNode->GetLight();
-	lightId = getNodeId(lightNode);
-	mapSize = 2048;
-	bias = 0.00005f;
-	useBlurVarianceShadowMap = true;
-	blurScale = 2;
-	blurBoxOffset = 1;
-	useVarianceShadowMap = false;
-	usePoissonSampling = false;
-	auto nodeCount = lightNode->GetScene()->GetNodeCount();
-	for (auto ix = 0;ix < nodeCount;++ix) {
-		auto mnode = lightNode->GetScene()->GetNode(ix);
-		auto mesh = mnode->GetMesh();
-		if (mesh && mesh->CastShadow.Get()) {
-			renderList.push_back(getNodeId(mnode));
-		}
-	}
-
-}
-
-BabylonShadowGenerator::BabylonShadowGenerator(BabylonShadowGenerator && moved) : 
-	mapSize(std::move(moved.mapSize)),
-	bias(std::move(moved.bias)),
-	lightId(std::move(moved.lightId)),
-	useVarianceShadowMap(std::move(moved.useVarianceShadowMap)),
-	usePoissonSampling(std::move(moved.usePoissonSampling)),
-	useBlurVarianceShadowMap(std::move(moved.useBlurVarianceShadowMap)),
-	blurScale(std::move(moved.blurScale)),
-	blurBoxOffset(std::move(moved.blurBoxOffset)),
-	renderList(std::move(moved.renderList))
-{
-}
-
-web::json::value BabylonShadowGenerator::toJson()
-{
-	auto jobj =web::json::value::object();
-	jobj[L"mapSize"] = web::json::value::number(mapSize);
-	jobj[L"lightId"] = web::json::value::string(lightId);
-	jobj[L"useVarianceShadowMap"] = web::json::value::boolean(useVarianceShadowMap);
-	jobj[L"usePoissonSampling"] = web::json::value::boolean(usePoissonSampling);
-	/*jobj[L"useBlurVarianceShadowMap"] = web::json::value::boolean(useBlurVarianceShadowMap);
-	jobj[L"blurScale"] = web::json::value::number(blurScale);
-	jobj[L"blurBoxOffset"] = web::json::value::number(blurBoxOffset);*/
-	auto jarr = web::json::value::array();
-	for (auto& id : renderList) {
-		jarr[jarr.size()] = web::json::value::string(id);
-	}
-	jobj[L"renderList"] = jarr;
-	return jobj;
-}

+ 0 - 112
Exporters/FBX/BabylonFbxNative/BabylonLight.h

@@ -1,112 +0,0 @@
-#pragma once
-#include "BabylonVertex.h"
-#include <limits>
-#include "BabylonNode.h"
-#include "BabylonAnimation.h"
-#include <memory>
-#include <string>
-#undef max
-
-class BabylonShadowGenerator
-{
-public:
-
-	int mapSize;
-
-		
-	float bias;
-
-		
-	std::wstring lightId;
-
-		
-	bool useVarianceShadowMap;
-
-		
-	bool usePoissonSampling;
-
-		
-	bool useBlurVarianceShadowMap;
-
-		
-	float blurScale;
-
-		
-	float blurBoxOffset;
-
-		
-	std::vector<std::wstring> renderList;
-
-	BabylonShadowGenerator(FbxNode* lightNode);
-	BabylonShadowGenerator(const BabylonShadowGenerator&) = default;
-	BabylonShadowGenerator(BabylonShadowGenerator&& moved);
-	web::json::value toJson();
-
-};
-
-
-class BabylonLight
-{
-public:
-	const int type_omni = 0;
-	const int type_Spot = 2;
-
-	const int type_direct = 1;
-
-	const int type_ambient = 3;
-	
-	std::wstring name;
-
-		
-	std::wstring id;
-
-		
-	std::wstring parentId;
-
-		
-	babylon_vector3 position;
-
-		
-	babylon_vector3 direction;
-
-		
-	int type = 0;
-
-		
-	babylon_vector3 diffuse;
-
-		
-	babylon_vector3 specular;
-
-		
-	float intensity = 1;
-
-		
-	float range = std::numeric_limits<float>::max();
-
-		
-	float exponent = 0;
-
-		
-	float angle = 0;
-
-		
-	babylon_vector3 groundColor;
-
-	bool castShadows;
-	std::vector<std::wstring> includedOnlyMeshesIds;
-	std::vector<std::wstring> excludedMeshesIds;
-
-		
-	std::shared_ptr<BabylonShadowGenerator> shadowGenerator;
-	std::vector<std::shared_ptr < BabylonAnimation<babylon_vector3>>> animations;
-
-	web::json::value toJson() const;
-
-	BabylonLight();
-	BabylonLight(BabylonNode& babnode);
-	BabylonLight(const BabylonLight&) = default;
-	BabylonLight(BabylonLight&& moved);
-	~BabylonLight();
-};
-

+ 0 - 385
Exporters/FBX/BabylonFbxNative/BabylonMaterial.cpp

@@ -1,385 +0,0 @@
-#include "stdafx.h"
-#include "BabylonMaterial.h"
-#include <Windows.h>
-#include "NodeHelpers.h"
-#include "GlobalSettings.h"
-#include "StringUtils.h"
-
-web::json::value BabylonMaterial::toJson() const
-{
-	auto jobj = web::json::value::object();
-	jobj[L"name"] = web::json::value::string(name);
-	jobj[L"id"] = web::json::value::string(id);
-	jobj[L"backFaceCulling"] = web::json::value::boolean(backFaceCulling);
-	jobj[L"wireframe"] = web::json::value::boolean(wireframe);
-	writeVector3(jobj, L"ambient", ambient);
-	writeVector3(jobj, L"diffuse", diffuse);
-	writeVector3(jobj, L"specular", specular);
-	writeVector3(jobj, L"emissive", emissive);
-	jobj[L"specularPower"] = web::json::value::number(specularPower);
-	jobj[L"alpha"] = web::json::value::number(alpha);
-
-	if (diffuseTexture){
-		jobj[L"diffuseTexture"] = diffuseTexture->toJson();
-	}
-	if (ambientTexture){
-		jobj[L"ambientTexture"] = ambientTexture->toJson();
-
-	}
-	if (opacityTexture){
-		jobj[L"opacityTexture"] = opacityTexture->toJson();
-
-	}
-	if (reflectionTexture){
-		jobj[L"reflectionTexture"] = reflectionTexture->toJson();
-
-	}
-	if (emissiveTexture){
-		jobj[L"emissiveTexture"] = emissiveTexture->toJson();
-
-	}
-	if (specularTexture){
-		jobj[L"specularTexture"] = specularTexture->toJson();
-
-	}
-	if (bumpTexture){
-		jobj[L"bumpTexture"] = bumpTexture->toJson();
-
-	}
-
-
-	// todo : textures
-	return jobj;
-}
-
-BabylonMaterial::BabylonMaterial():
-ambient(1,1,1),
-diffuse(1,1,1),
-specular(1,1,1),
-emissive(0,0,0),
-specularPower(64),
-alpha(1)
-{
-}
-
-
-
-
-FbxDouble3 GetMaterialProperty(const FbxSurfaceMaterial * pMaterial,
-	const char * pPropertyName,
-	const char * pFactorPropertyName,
-	FbxFileTexture*& pTexture)
-{
-	FbxDouble3 lResult(0, 0, 0);
-	const FbxProperty lProperty = pMaterial->FindProperty(pPropertyName);
-	const FbxProperty lFactorProperty = pMaterial->FindProperty(pFactorPropertyName);
-	if (lProperty.IsValid() && lFactorProperty.IsValid())
-	{
-		lResult = lProperty.Get<FbxDouble3>();
-		double lFactor = lFactorProperty.Get<FbxDouble>();
-		if (lFactor != 1)
-		{
-			lResult[0] *= lFactor;
-			lResult[1] *= lFactor;
-			lResult[2] *= lFactor;
-		}
-	}
-
-	if (lProperty.IsValid())
-	{
-		const int lTextureCount = lProperty.GetSrcObjectCount<FbxFileTexture>();
-		if (lTextureCount)
-		{
-			FbxFileTexture* lTexture = lProperty.GetSrcObject<FbxFileTexture>();
-			pTexture = lTexture;
-		}
-	}
-
-	return lResult;
-}
-
-
-
-BabylonMaterial::BabylonMaterial(FbxSurfaceMaterial* mat) :
-ambient(1, 1, 1),
-diffuse(1, 1, 1),
-specular(1, 1, 1),
-emissive(0, 0, 0),
-specularPower(64),
-alpha(1){
-	std::string ansiName = mat->GetName();
-	name = std::wstring(ansiName.begin(), ansiName.end());
-	auto rawId = mat->GetUniqueID();
-	id = getMaterialId(mat);
-	FbxFileTexture* ambientTex = nullptr;
-	FbxFileTexture* diffuseTex = nullptr;
-	FbxFileTexture* specularTex = nullptr;
-	FbxFileTexture* emissiveTex = nullptr;
-	FbxFileTexture* reflectionTex = nullptr;
-	FbxFileTexture* opacityTex = nullptr;
-	FbxFileTexture* bumpTex = nullptr;
-	GetMaterialProperty(mat, FbxSurfaceMaterial::sTransparentColor, FbxSurfaceMaterial::sTransparencyFactor, opacityTex)[0];
-
-	FbxDouble3 transcolor;
-	FbxDouble transfactor;
-	auto transFactorProp = mat->FindProperty(FbxSurfaceMaterial::sTransparencyFactor);
-	auto transColorProp = mat->FindProperty(FbxSurfaceMaterial::sTransparentColor);
-	if (transFactorProp.IsValid() && transColorProp.IsValid()){
-		transfactor = transFactorProp.Get<FbxDouble>();
-		transcolor = transColorProp.Get<FbxDouble3>();
-		if (transfactor== 1.0){ // from Maya .fbx
-			if (transcolor[0] >= DBL_MIN) {
-				alpha = static_cast<float>(1 - transcolor[0]);
-			}
-			else {
-				alpha = 1;
-			}
-		}
-		else { // from 3dsmax .fbx
-			if (transfactor>=DBL_MIN){
-				alpha = static_cast<float>(1 - transfactor);
-			}
-			else {
-				alpha = 1;
-			}
-		}
-	}
-
-	ambient = GetMaterialProperty(mat, FbxSurfaceMaterial::sAmbient, FbxSurfaceMaterial::sAmbientFactor, ambientTex);
-	diffuse = GetMaterialProperty(mat, FbxSurfaceMaterial::sDiffuse, FbxSurfaceMaterial::sDiffuseFactor, diffuseTex);
-	specular = GetMaterialProperty(mat, FbxSurfaceMaterial::sSpecular, FbxSurfaceMaterial::sSpecularFactor, specularTex);
-	emissive = GetMaterialProperty(mat, FbxSurfaceMaterial::sEmissive, FbxSurfaceMaterial::sEmissiveFactor, emissiveTex);
-	GetMaterialProperty(mat, FbxSurfaceMaterial::sReflection, FbxSurfaceMaterial::sReflectionFactor, reflectionTex);
-	auto shininessProp = mat->FindProperty(FbxSurfaceMaterial::sShininess);
-	if (shininessProp.IsValid()){
-		specularPower = static_cast<float>(shininessProp.Get<FbxDouble>())*12;
-	}
-
-	auto normalMapProp = mat->FindProperty(FbxSurfaceMaterial::sNormalMap);
-	if (normalMapProp.IsValid()){
-		const int lTextureCount = normalMapProp.GetSrcObjectCount<FbxFileTexture>();
-		if (lTextureCount)
-		{
-			FbxFileTexture* lTexture = normalMapProp.GetSrcObject<FbxFileTexture>();
-			if (lTexture)
-			{
-				bumpTex = lTexture;
-			}
-		}
-	}
-	else{
-		auto bumpProp = mat->FindProperty(FbxSurfaceMaterial::sBump);
-		if (bumpProp.IsValid()){
-			const int lTextureCount = bumpProp.GetSrcObjectCount<FbxFileTexture>();
-			if (lTextureCount)
-			{
-				FbxFileTexture* lTexture = bumpProp.GetSrcObject<FbxFileTexture>();
-				if (lTexture)
-				{
-					bumpTex = lTexture;
-				}
-			}
-		}
-	}
-
-	if (ambientTex){
-		ambientTexture = std::make_shared<BabylonTexture>(ambientTex);
-	}
-	if (diffuseTex){
-		diffuseTexture = std::make_shared<BabylonTexture>(diffuseTex);
-	}
-	if (specularTex){
-		specularTexture = std::make_shared<BabylonTexture>(specularTex);
-	}
-	if (emissiveTex){
-		emissiveTexture = std::make_shared<BabylonTexture>(emissiveTex);
-	}
-	if (reflectionTex){
-		reflectionTexture = std::make_shared<BabylonTexture>(reflectionTex);
-	}
-	if (bumpTex){
-		bumpTexture = std::make_shared<BabylonTexture>(bumpTex);
-	}
-
-	if (opacityTex){
-		opacityTexture = std::make_shared<BabylonTexture>(opacityTex);
-	}
-
-}
-
-
-BabylonMaterial::BabylonMaterial(BabylonMaterial && moved) : 
-	name(std::move(moved.name)),
-	id(std::move(moved.id)),
-	backFaceCulling(std::move(moved.backFaceCulling)),
-	wireframe(std::move(moved.wireframe)),
-	ambient(std::move(moved.ambient)),
-	diffuse(std::move(moved.diffuse)),
-	specular(std::move(moved.specular)),
-	emissive(std::move(moved.emissive)),
-	specularPower(std::move(moved.specularPower)),
-	alpha(std::move(moved.alpha)),
-	diffuseTexture(std::move(moved.diffuseTexture)),
-	ambientTexture(std::move(moved.ambientTexture)),
-	opacityTexture(std::move(moved.opacityTexture)),
-	reflectionTexture(std::move(moved.reflectionTexture)),
-	emissiveTexture(std::move(moved.emissiveTexture)),
-	specularTexture(std::move(moved.specularTexture)),
-	bumpTexture(std::move(moved.bumpTexture))
-{
-}
-
-BabylonMaterial::~BabylonMaterial()
-{
-}
-
-BabylonMultiMaterial::BabylonMultiMaterial(BabylonMultiMaterial && moved) :
-	name(std::move(moved.name)),
-	id(std::move(moved.id)),
-	materials(std::move(moved.materials))
-{
-}
-
-web::json::value BabylonMultiMaterial::toJson() const
-{
-	auto jobj = web::json::value::object();
-	jobj[L"name"] = web::json::value::string(name);
-	jobj[L"id"] = web::json::value::string(id);
-
-	auto jarray = web::json::value::array();
-	for (auto& mat : materials) {
-		jarray[jarray.size()] = web::json::value::string(mat);
-	}
-	jobj[L"materials"] = jarray;
-	return jobj;
-}
-
-
-BabylonTexture::BabylonTexture(BabylonTexture && moved) : 
-	name(std::move(moved.name)),
-	fullPath(std::move(moved.fullPath)),
-	uvset(std::move(moved.uvset)),
-	level(std::move(moved.level)),
-	hasAlpha(std::move(moved.hasAlpha)),
-	getAlphaFromRGB(std::move(moved.getAlphaFromRGB)),
-	coordinatesMode(std::move(moved.coordinatesMode)),
-	isCube(std::move(moved.isCube)),
-	uOffset(std::move(moved.uOffset)),
-	vOffset(std::move(moved.vOffset)),
-	uScale(std::move(moved.uScale)),
-	vScale(std::move(moved.vScale)),
-	uAng(std::move(moved.uAng)),
-	vAng(std::move(moved.vAng)),
-	wAng(std::move(moved.wAng)),
-	wrapU(std::move(moved.wrapU)),
-	wrapV(std::move(moved.wrapV)),
-	coordinatesIndex(std::move(moved.coordinatesIndex)),
-	isRenderTarget(std::move(moved.isRenderTarget)),
-	animations(std::move(moved.animations))
-{
-}
-
-web::json::value BabylonTexture::toJson(){
-	auto jobj = web::json::value::object();
-	jobj[L"name"] = web::json::value::string(name);
-	jobj[L"level"] = web::json::value::number(level);
-	jobj[L"hasAlpha"] = web::json::value::boolean(hasAlpha);
-	jobj[L"getAlphaFromRGB"] = web::json::value::boolean(getAlphaFromRGB);
-	jobj[L"coordinatesMode"] = web::json::value::number(coordinatesMode);
-	jobj[L"isCube"] = web::json::value::boolean(isCube);
-	jobj[L"uOffset"] = web::json::value::number(uOffset);
-	jobj[L"vOffset"] = web::json::value::number(vOffset);
-	jobj[L"uScale"] = web::json::value::number(uScale);
-	jobj[L"vScale"] = web::json::value::number(vScale);
-	jobj[L"uAng"] = web::json::value::number(uAng);
-	jobj[L"vAng"] = web::json::value::number(vAng);
-	jobj[L"wAng"] = web::json::value::number(wAng);
-	jobj[L"wrapU"] = web::json::value::boolean(wrapU);
-	jobj[L"wrapV"] = web::json::value::boolean(wrapV);
-	jobj[L"coordinatesIndex"] = web::json::value::number(coordinatesIndex);
-	jobj[L"isRenderTarget"] = web::json::value::boolean(isRenderTarget);
-	auto janims = web::json::value::array();
-	for (auto& anim : animations) {
-		janims[janims.size()] = anim->toJson();
-	}
-	jobj[L"animations"] = janims;
-	return jobj;
-}
-BabylonTexture::BabylonTexture(FbxFileTexture* texture){
-	fullPath = utf8ToWstring(texture->GetFileName());
-	auto indexOfLastBackslash = fullPath.find_last_of(L'\\');
-	name = std::wstring(fullPath.begin() + indexOfLastBackslash + 1, fullPath.end());
-	auto mappingType = texture->GetMappingType();
-	switch (mappingType)
-	{
-	case fbxsdk::FbxTexture::eNull:
-		break;
-	case fbxsdk::FbxTexture::ePlanar:
-		coordinatesMode = 2;
-		break;
-	case fbxsdk::FbxTexture::eSpherical:
-		coordinatesMode = 1;
-		break;
-	case fbxsdk::FbxTexture::eCylindrical:
-		break;
-	case fbxsdk::FbxTexture::eBox:
-		coordinatesMode = 5;
-		break;
-	case fbxsdk::FbxTexture::eFace:
-		break;
-	case fbxsdk::FbxTexture::eUV:
-		break;
-	case fbxsdk::FbxTexture::eEnvironment:
-		break;
-	default:
-		break;
-	}
-	auto alphaSource = texture->GetAlphaSource();
-
-	switch (alphaSource)
-	{
-	case fbxsdk::FbxTexture::eNone:
-		hasAlpha = false;
-		getAlphaFromRGB = false;
-		break;
-	case fbxsdk::FbxTexture::eRGBIntensity:
-		hasAlpha = true;
-		getAlphaFromRGB = true;
-		break;
-	case fbxsdk::FbxTexture::eBlack:
-		hasAlpha = true;
-		getAlphaFromRGB = false;
-		break;
-	default:
-		break;
-	}
-
-	babylon_vector3 rot = texture->Rotation.Get();
-	babylon_vector3 scaling = texture->Scaling.Get();
-
-	babylon_vector2 trans((float)texture->GetTranslationU(), (float)texture->GetTranslationV());
-	
-	
-	uOffset = trans.x;
-	vOffset = trans.y;
-	uScale = scaling.x;
-	vScale = scaling.y;
-	std::string strFileName = texture->GetFileName();
-	auto lastDot = strFileName.find_last_of('.');
-	auto ext = strFileName.substr(lastDot);
-	if (_stricmp(ext.c_str(), ".dds") == 0) {
-		vScale *= -1;
-	}
-	uAng = static_cast<float>(rot.x * Euler2Rad);
-	vAng = static_cast<float>(rot.y * Euler2Rad);
-	wAng = static_cast<float>(rot.z * Euler2Rad);
-	auto uwrapMode = texture->GetWrapModeU();
-	auto vwrapMode = texture->GetWrapModeV();
-	wrapU = uwrapMode == FbxTexture::eRepeat;
-	wrapV = vwrapMode == FbxTexture::eRepeat;
-
-	uvset = texture->UVSet.Get();
-	
-	
-
-}

+ 0 - 126
Exporters/FBX/BabylonFbxNative/BabylonMaterial.h

@@ -1,126 +0,0 @@
-#pragma once
-#include <string>
-#include <sstream>
-#include <memory>
-#include "BabylonVertex.h"
-#include <vector>
-#include <fbxsdk.h>
-#include "BabylonAnimation.h"
-
-
-class BabylonTexture{
-public:
-	
-	 std::wstring name;
-	 std::wstring fullPath;
-	 std::string uvset;
-		
-	 float level = 1.0f;
-
-		
-	 bool hasAlpha = false;
-
-		
-	 bool getAlphaFromRGB = false;
-
-		
-	 int coordinatesMode =0;
-
-		
-	 bool isCube = false;
-
-		
-	 float uOffset = 0;
-
-		
-	 float vOffset = 0;
-
-		
-	 float uScale = 1;
-
-		
-	 float vScale = 1;
-
-		
-	 float uAng = 0;
-
-		
-	 float vAng = 0;
-
-		
-	 float wAng = 0;
-
-		
-	 bool wrapU = true;
-
-		
-	 bool wrapV = true;
-
-		
-	 int coordinatesIndex = 0;
-
-		
-	 bool isRenderTarget = false;
-	 std::vector<std::shared_ptr<BabylonAnimationBase>> animations;
-
-	 BabylonTexture(FbxFileTexture* texture);
-
-	 BabylonTexture(const BabylonTexture&) = default;
-	 BabylonTexture(BabylonTexture&&);
-
-	 web::json::value toJson();
-	
-};
-
-
-inline std::wstring getMaterialId(FbxSurfaceMaterial* mat){
-	std::wstringstream strstream;
-	strstream <<mat->GetUniqueID();
-	return strstream.str();
-}
-
-class BabylonMaterial
-{
-public:
-	std::wstring name;
-	std::wstring id;
-	bool backFaceCulling = true;
-	bool wireframe = false;
-	babylon_vector3 ambient;
-	babylon_vector3 diffuse;
-	babylon_vector3 specular;
-	babylon_vector3 emissive;
-	float specularPower;
-	float alpha;
-	std::shared_ptr<BabylonTexture> diffuseTexture;
-
-	std::shared_ptr<BabylonTexture> ambientTexture;
-
-	std::shared_ptr<BabylonTexture> opacityTexture;
-
-	std::shared_ptr<BabylonTexture> reflectionTexture;
-
-	std::shared_ptr<BabylonTexture> emissiveTexture;
-
-	std::shared_ptr<BabylonTexture> specularTexture;
-
-	std::shared_ptr<BabylonTexture> bumpTexture;
-
-	web::json::value toJson() const;
-	BabylonMaterial();
-	BabylonMaterial(FbxSurfaceMaterial* mat);
-	BabylonMaterial(const BabylonMaterial&) = default;
-	BabylonMaterial(BabylonMaterial&& moved);
-	~BabylonMaterial();
-};
-
-class BabylonMultiMaterial{
-public:
-	std::wstring name;
-	std::wstring id;
-	std::vector<std::wstring> materials;
-	BabylonMultiMaterial() = default;
-	BabylonMultiMaterial(const BabylonMultiMaterial&) = default;
-	BabylonMultiMaterial(BabylonMultiMaterial&& moved) ;
-	web::json::value toJson() const;
-};

+ 0 - 891
Exporters/FBX/BabylonFbxNative/BabylonMesh.cpp

@@ -1,891 +0,0 @@
-#include "stdafx.h"
-#include "BabylonMesh.h"
-#include <map>
-#include <vector>
-#include <iostream>
-#include <sstream>
-#include "NodeHelpers.h"
-#include "GlobalSettings.h"
-
-struct BabylonVertex {
-	babylon_vector3 position;
-	babylon_vector3 normal;
-	babylon_vector2 uv;
-	babylon_vector2 uv2;
-	babylon_vector2 uv3;
-	babylon_vector2 uv4;
-	babylon_vector2 uv5;
-	babylon_vector2 uv6;
-	babylon_color color;
-	std::uint32_t boneIndices[4];
-	float boneWeights[4];
-
-	BabylonVertex() {
-		boneIndices[0] = 0;
-		boneIndices[1] = 0;
-		boneIndices[2] = 0;
-		boneIndices[3] = 0;
-
-		boneWeights[0] = 0;
-		boneWeights[1] = 0;
-		boneWeights[2] = 0;
-		boneWeights[3] = 0;
-	}
-};
-
-struct triangle {
-	std::uint32_t indices[3];
-};
-inline bool operator <(const triangle& lhs, const triangle& rhs) {
-	if (lhs.indices[0] < rhs.indices[0]) {
-		return true;
-	}
-	else if (rhs.indices[0] < lhs.indices[0]) {
-		return false;
-	}
-
-	if (lhs.indices[1] < rhs.indices[1]) {
-		return true;
-	}
-	else if (rhs.indices[1] < lhs.indices[1]) {
-		return false;
-	}
-	return lhs.indices[2] < rhs.indices[2];
-}
-
-inline bool operator <(const BabylonVertex& lhs, const BabylonVertex& rhs) {
-	if (lhs.position < rhs.position) {
-		return true;
-	}
-	else if (rhs.position < lhs.position) {
-		return false;
-	}
-
-	if (lhs.normal < rhs.normal) {
-		return true;
-	}
-	else if (rhs.normal < lhs.normal) {
-		return false;
-	}
-
-	if (lhs.uv < rhs.uv) {
-		return true;
-	}
-	else if (rhs.uv < lhs.uv) {
-		return false;
-	}
-
-	if (lhs.uv2 < rhs.uv2) {
-		return true;
-	}
-	else if (rhs.uv2 < lhs.uv2) {
-		return false;
-	}
-
-
-	if (lhs.uv3 < rhs.uv3) {
-		return true;
-	}
-	else if (rhs.uv3 < lhs.uv3) {
-		return false;
-	}
-
-
-	if (lhs.uv4 < rhs.uv4) {
-		return true;
-	}
-	else if (rhs.uv4 < lhs.uv4) {
-		return false;
-	}
-
-
-	if (lhs.uv5 < rhs.uv5) {
-		return true;
-	}
-	else if (rhs.uv5 < lhs.uv5) {
-		return false;
-	}
-
-
-	if (lhs.uv6 < rhs.uv6) {
-		return true;
-	}
-	else if (rhs.uv6 < lhs.uv6) {
-		return false;
-	}
-
-	if (lhs.color < rhs.color) {
-		return true;
-	}
-	else if (rhs.color < lhs.color) {
-		return false;
-	}
-
-	if (lhs.boneIndices[0] < rhs.boneIndices[0]) {
-		return true;
-	}
-	else if (rhs.boneIndices[0] < lhs.boneIndices[0]) {
-		return false;
-	}
-
-	if (lhs.boneIndices[1] < rhs.boneIndices[1]) {
-		return true;
-	}
-	else if (rhs.boneIndices[1] < lhs.boneIndices[1]) {
-		return false;
-	}
-
-	if (lhs.boneIndices[2] < rhs.boneIndices[2]) {
-		return true;
-	}
-	else if (rhs.boneIndices[2] < lhs.boneIndices[2]) {
-		return false;
-	}
-
-	if (lhs.boneIndices[3] < rhs.boneIndices[3]) {
-		return true;
-	}
-	else if (rhs.boneIndices[3] < lhs.boneIndices[3]) {
-		return false;
-	}
-
-	if (lhs.boneWeights[0] < rhs.boneWeights[0]) {
-		return true;
-	}
-	else if (rhs.boneWeights[0] < lhs.boneWeights[0]) {
-		return false;
-	}
-
-	if (lhs.boneWeights[1] < rhs.boneWeights[1]) {
-		return true;
-	}
-	else if (rhs.boneWeights[1] < lhs.boneWeights[1]) {
-		return false;
-	}
-
-	if (lhs.boneWeights[2] < rhs.boneWeights[2]) {
-		return true;
-	}
-	else if (rhs.boneWeights[2] < lhs.boneWeights[2]) {
-		return false;
-	}
-
-	if (lhs.boneWeights[3] < rhs.boneWeights[3]) {
-		return true;
-	}
-	else if (rhs.boneWeights[3] < lhs.boneWeights[3]) {
-		return false;
-	}
-
-	return false;
-}
-
-
-struct SubmeshData {
-	std::map<BabylonVertex, std::uint32_t> knownVertices;
-	std::set<triangle> knownTriangles;
-	std::vector<BabylonVertex> vertices;
-	std::vector<std::uint32_t> indices;
-};
-
-web::json::value convertToJson(const std::vector<babylon_vector3>& v) {
-	auto result = web::json::value::array();
-	for (auto ix = 0u;ix < v.size();++ix) {
-		result[ix * 3] = web::json::value::number(v[ix].x);
-		result[ix * 3 + 1] = web::json::value::number(v[ix].y);
-		result[ix * 3 + 2] = web::json::value::number(v[ix].z);
-	}
-	return result;
-}
-
-
-web::json::value convertToJson(const std::vector<babylon_vector2>& v) {
-	auto result = web::json::value::array();
-	for (auto ix = 0u;ix < v.size();++ix) {
-		result[ix * 2] = web::json::value::number(v[ix].x);
-		result[ix * 2 + 1] = web::json::value::number(v[ix].y);
-	}
-	return result;
-}
-
-web::json::value convertToJson(const std::vector<babylon_color>& v) {
-	auto result = web::json::value::array();
-	for (auto ix = 0u;ix < v.size();++ix) {
-		result[ix * 4] = web::json::value::number(v[ix].r);
-		result[ix * 4 + 1] = web::json::value::number(v[ix].g);
-		result[ix * 4 + 2] = web::json::value::number(v[ix].b);
-		result[ix * 4 + 3] = web::json::value::number(v[ix].a);
-	}
-	return result;
-}
-
-web::json::value convertToJson(const std::vector<babylon_vector4>& v) {
-	auto result = web::json::value::array();
-	for (auto ix = 0u; ix < v.size(); ++ix) {
-		result[ix * 4] = web::json::value::number(v[ix].x);
-		result[ix * 4 + 1] = web::json::value::number(v[ix].y);
-		result[ix * 4 + 2] = web::json::value::number(v[ix].z);
-		result[ix * 4 + 3] = web::json::value::number(v[ix].w);
-	}
-	return result;
-}
-
-
-web::json::value convertToJson(const std::vector<std::uint32_t>& v){
-	auto result = web::json::value::array();
-	for (auto ix = 0u; ix < v.size() ; ++ix) {
-		result[ix ] = web::json::value::number(v[ix ]);
-	}
-	return result;
-}
-web::json::value convertToJson(const std::vector<std::uint32_t>& v, bool changeVertexOrder) {
-	if (changeVertexOrder) {
-		auto result = web::json::value::array();
-		for (auto ix = 0u;ix < v.size() / 3;++ix) {
-			result[ix * 3] = web::json::value::number(v[ix * 3]);
-			result[ix * 3 + 1] = web::json::value::number(v[ix * 3 + 2]);
-			result[ix * 3 + 2] = web::json::value::number(v[ix * 3 + 1]);
-		}
-		return result;
-	}
-	else {
-		auto result = web::json::value::array();
-		for (auto ix = 0u;ix < v.size() / 3;++ix) {
-			result[ix * 3] = web::json::value::number(v[ix * 3]);
-			result[ix * 3 + 1] = web::json::value::number(v[ix * 3 + 1]);
-			result[ix * 3 + 2] = web::json::value::number(v[ix * 3 + 2]);
-		}
-		return result;
-	}
-}
-
-web::json::value convertToJson(const std::vector<BabylonSubmesh>& v) {
-	auto result = web::json::value::array();
-
-	for (auto ix = 0u;ix < v.size();++ix) {
-		auto jsubmesh = web::json::value::object();
-
-		jsubmesh[L"materialIndex"] = web::json::value::number(v[ix].materialIndex);
-		jsubmesh[L"verticesStart"] = web::json::value::number(v[ix].verticesStart);
-		jsubmesh[L"verticesCount"] = web::json::value::number(v[ix].verticesCount);
-		jsubmesh[L"indexStart"] = web::json::value::number(v[ix].indexStart);
-		jsubmesh[L"indexCount"] = web::json::value::number(v[ix].indexCount);
-
-		result[result.size()] = jsubmesh;
-	}
-	return result;
-}
-
-web::json::value BabylonSubmesh::toJson(){
-	auto jobj = web::json::value::object();
-	jobj[L"materialIndex"] = web::json::value::number(materialIndex);
-	jobj[L"verticesStart"] = web::json::value::number(verticesStart);
-	jobj[L"verticesCount"] = web::json::value::number(verticesCount);
-	jobj[L"indexStart"] = web::json::value::number(indexStart);
-	jobj[L"indexCount"] = web::json::value::number(indexCount);
-	return jobj;
-}
-
-web::json::value BabylonMesh::toJson()
-{
-	auto jobj = BabylonAbstractMesh::toJson();
-	jobj[L"id"] = web::json::value::string(_id);
-	jobj[L"name"] = web::json::value::string(_id);
-	if (_parentId.size() > 0)
-		jobj[L"parentId"] = web::json::value::string(_parentId);
-	if (_materialId.size() > 0)
-		jobj[L"materialId"] = web::json::value::string(_materialId);
-
-
-	jobj[L"isEnabled"] = web::json::value::boolean(_isEnabled);
-	jobj[L"isVisible"] = web::json::value::boolean(_isVisible);
-	jobj[L"pickable"] = web::json::value::boolean(_pickable);
-	jobj[L"hasVertexAlpha"] = web::json::value::boolean(_hasVertexAlpha);
-	jobj[L"checkCollision"] = web::json::value::boolean(_checkCollision);
-	jobj[L"receiveShadows"] = web::json::value::boolean(_receiveShadows);
-	jobj[L"infiniteDistance"] = web::json::value::boolean(_infiniteDistance);
-	jobj[L"billboardMode"] = web::json::value::number(_billboardMode);
-	jobj[L"visibility"] = web::json::value::number(_visibility);
-	jobj[L"skeletonId"] = web::json::value::number(_skeletonId);
-
-	auto submeshesArray = web::json::value::array();
-	for (auto ix = 0u; ix < submeshes().size(); ++ix){
-		submeshesArray[ix] = submeshes()[ix].toJson();
-	}
-	jobj[L"subMeshes"] = submeshesArray;
-	jobj[L"showBoundingBox"] = web::json::value::boolean(_showBoundingBox);
-	jobj[L"showSubMeshesBoundingBox"] = web::json::value::boolean(_showSubMeshesBoundingBox);
-	jobj[L"applyFog"] = web::json::value::boolean(_applyFog);
-	jobj[L"alphaIndex"] = web::json::value::number(_alphaIndex);
-	if (_positions.size() > 0)
-		jobj[L"positions"] = convertToJson(_positions);
-	if (_normals.size() > 0)
-		jobj[L"normals"] = convertToJson(_normals);
-	if (_uvs.size() > 0)
-		jobj[L"uvs"] = convertToJson(_uvs);
-	if (_uvs2.size() > 0)
-		jobj[L"uvs2"] = convertToJson(_uvs2);
-	if (_uvs3.size() > 0)
-		jobj[L"uvs3"] = convertToJson(_uvs3);
-	if (_uvs4.size() > 0)
-		jobj[L"uvs4"] = convertToJson(_uvs4);
-	if (_uvs5.size() > 0)
-		jobj[L"uvs5"] = convertToJson(_uvs5);
-	if (_uvs6.size() > 0)
-		jobj[L"uvs6"] = convertToJson(_uvs6);
-	if (_colors.size() > 0)
-		jobj[L"colors"] = convertToJson(_colors);
-	if (_indices.size() > 0)
-		jobj[L"indices"] = convertToJson(_indices, false);
-	if (_boneIndices.size() > 0){
-		jobj[L"matricesIndices"] = convertToJson(_boneIndices);
-	}
-	if (_boneWeights.size() > 0){
-		jobj[L"matricesWeights"] = convertToJson(_boneWeights);
-	}
-	if (animations.size() == 0 && !associatedSkeleton){
-
-		jobj[L"autoAnimate"] = web::json::value::boolean(false);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(false);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(0);
-		jobj[L"autoAnimateTo"] = web::json::value::number(0);
-
-	}
-	else if (animations.size()>0){
-
-		jobj[L"autoAnimate"] = web::json::value::boolean(animations[0]->autoAnimate);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(animations[0]->autoAnimateLoop);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(animations[0]->autoAnimateFrom);
-		jobj[L"autoAnimateTo"] = web::json::value::number(animations[0]->autoAnimateTo);
-	}
-	
-	else{
-
-		jobj[L"autoAnimate"] = web::json::value::boolean(associatedSkeleton->bones[0].animation->autoAnimate);
-		jobj[L"autoAnimateLoop"] = web::json::value::boolean(associatedSkeleton->bones[0].animation->autoAnimateLoop);
-		jobj[L"autoAnimateFrom"] = web::json::value::number(associatedSkeleton->bones[0].animation->autoAnimateFrom);
-		jobj[L"autoAnimateTo"] = web::json::value::number(associatedSkeleton->bones[0].animation->autoAnimateTo);
-	}
-
-	auto janimations = web::json::value::array();
-	for (const auto& anim : animations){
-		janimations[janimations.size()] = anim->toJson();
-	}
-	jobj[L"animations"] = janimations;
-	FbxMatrix identity;
-	identity.SetIdentity();
-	if (pivotMatrix != identity){
-		auto jpivot = web::json::value::array();
-		for (auto x = 0; x < 4; ++x){
-			for (auto y = 0; y < 4; ++y){
-				jpivot[x * 4 + y] = web::json::value::number( pivotMatrix[x][y]);
-			}
-		}
-		jobj[L"pivotMatrix"] = jpivot;
-	}
-
-	auto jinstances = web::json::value::array();
-	for (auto& instance : _instances) {
-		jinstances[jinstances.size()] = instance.toJson();
-	}
-	jobj[L"instances"] = jinstances;
-	return jobj;
-}
-
-BabylonMesh::BabylonMesh() :
-	_isEnabled(true),
-	_isVisible(true),
-	_billboardMode(0),
-	_visibility(1),
-	_skeletonId(-1),
-	_pickable(true)
-{
-	pivotMatrix.SetIdentity();
-}
-
-
-
-
-BabylonMesh::BabylonMesh(BabylonNode* node) :
-	BabylonAbstractMesh(node),
-	_isEnabled(true),
-	_isVisible(true),
-	_billboardMode(0),
-	_visibility(1),
-	_skeletonId(-1),
-	_pickable(true),
-	_hasVertexAlpha(false),
-	_checkCollision(false),
-	_receiveShadows(false),
-	_infiniteDistance(false),
-	_autoAnimate(false),
-	_autoAnimateFrom(0),
-	_autoAnimateTo(0),
-	_autoAnimateLoop(false),
-	_showBoundingBox(false),
-	_showSubMeshesBoundingBox(false),
-	_applyFog(false),
-	_alphaIndex(0)
-{
-
-	pivotMatrix.SetIdentity();
-	auto fbxNode = node->fbxNode();
-	
-	std::string ansiName = fbxNode->GetName();
-	name(std::wstring(ansiName.begin(), ansiName.end()));
-	id(getNodeId(fbxNode));
-	auto parent = fbxNode->GetParent();
-	if (parent) {
-		parentId(getNodeId(parent));
-	}
-	pivotMatrix = ConvertToBabylonCoordinateSystem( GetGeometryTransformation(fbxNode));
-
-	auto mesh = fbxNode->GetMesh();
-	auto animStack = fbxNode->GetScene()->GetCurrentAnimationStack();
-
-	if (animStack) {
-		FbxString animStackName = animStack->GetName();
-		//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
-		auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
-		auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
-		auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
-		auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
-		auto animLengthInFrame = endFrame - startFrame + 1;
-		_visibility = static_cast<float>(node->fbxNode()->Visibility.Get());
-		auto posAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"position", L"position", true, 0, static_cast<int>(animLengthInFrame), true);
-		auto rotAnim = std::make_shared<BabylonAnimation<babylon_vector4>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"rotationQuaternion", L"rotationQuaternion", true, 0, static_cast<int>(animLengthInFrame), true);
-		auto scaleAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"scaling", L"scaling", true, 0, static_cast<int>(animLengthInFrame), true);
-		auto visibilityAnim = std::make_shared<BabylonAnimation<float>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"visibility", L"visibility", true, 0, static_cast<int>(animLengthInFrame), true);
-
-		_isVisible = fbxNode->Show.Get();
-
-		auto rotCurveNode = fbxNode->LclRotation.GetCurveNode();
-		auto translateCurveNode = fbxNode->LclTranslation.GetCurveNode();
-		auto scalingCurveNode = fbxNode->LclScaling.GetCurveNode();
-		auto visibilityCurveNode = fbxNode->Visibility.GetCurveNode();
-		if (rotCurveNode || translateCurveNode || scalingCurveNode) {
-			for (auto ix = 0; ix < animLengthInFrame; ix++) {
-				FbxTime currTime;
-				currTime.SetFrame(startFrame + ix, animTimeMode);
-
-				babylon_animation_key<babylon_vector3> poskey;
-				babylon_animation_key<babylon_vector4> rotkey;
-				babylon_animation_key<babylon_vector3> scalekey;
-				poskey.frame = ix;
-				rotkey.frame = ix;
-				scalekey.frame = ix;
-				auto currTransform = node->GetLocal(currTime);
-				poskey.values = currTransform.translation();
-				rotkey.values = currTransform.rotationQuaternion();
-				scalekey.values = currTransform.scaling();
-				posAnim->appendKey(poskey);
-				rotAnim->appendKey(rotkey);
-				scaleAnim->appendKey(scalekey);
-
-
-			}
-		}
-		if (visibilityCurveNode) {
-			for (auto ix = 0; ix < animLengthInFrame; ix++) {
-				FbxTime currTime;
-				currTime.SetFrame(startFrame + ix, animTimeMode);
-
-				babylon_animation_key<float> visibilityKey;
-
-				visibilityKey.frame = ix;
-
-				visibilityKey.values = static_cast<float>(node->fbxNode()->Visibility.EvaluateValue(currTime));
-
-				visibilityAnim->appendKey(visibilityKey);
-
-
-			}
-		}
-
-		if (!posAnim->isConstant()){
-			animations.push_back(posAnim);
-		}
-		if (!rotAnim->isConstant()){
-			animations.push_back(rotAnim);
-		}
-		if (!scaleAnim->isConstant()){
-			animations.push_back(scaleAnim);
-		}
-		if (!visibilityAnim->isConstant()) {
-			animations.push_back(visibilityAnim);
-		}
-	}
-
-	if (!mesh) {
-		return;
-	}
-	if (mesh->GetPolygonCount() == 0){
-		return;
-	}
-
-	_receiveShadows =  mesh->ReceiveShadow.Get();
-	FbxGeometryConverter conv(mesh->GetFbxManager());
-	conv.ComputePolygonSmoothingFromEdgeSmoothing(mesh);
-	if (!mesh->IsTriangleMesh()) {
-		mesh = (FbxMesh*) conv.Triangulate(mesh, true);
-	}
-
-
-	mesh->RemoveBadPolygons();
-	mesh->GenerateNormals();
-
-	FbxStringList uvSetNameList;
-	mesh->GetUVSetNames(uvSetNameList);
-	std::vector<std::string> uniqueUVSets;
-
-	int uvCount = uvSetNameList.GetCount();
-	for (int i = 0; i < uvCount; ++i) {
-		std::string value = uvSetNameList.GetStringAt(i);
-		if (std::find(uniqueUVSets.begin(), uniqueUVSets.end(), value) == uniqueUVSets.end()) {
-			uniqueUVSets.push_back(value);
-		}
-	}
-	uvsets = uniqueUVSets;
-	bool hasUv = uniqueUVSets.size() > 0;
-	bool hasUv2 = uniqueUVSets.size() > 1;
-	bool hasUv3 = uniqueUVSets.size() > 2;
-	bool hasUv4 = uniqueUVSets.size() > 3;
-	bool hasUv5 = uniqueUVSets.size() > 4;
-	bool hasUv6 = uniqueUVSets.size() > 5;
-	std::string uvSetName;
-	std::string uv2SetName;
-	std::string uv3SetName;
-	std::string uv4SetName;
-	std::string uv5SetName;
-	std::string uv6SetName;
-	if (hasUv) {
-		uvSetName = uniqueUVSets[0];
-	}
-	if (hasUv2) {
-		uv2SetName = uniqueUVSets[1];
-	}
-	if (hasUv3) {
-		uv3SetName = uniqueUVSets[2];
-	}
-	if (hasUv4) {
-		uv4SetName = uniqueUVSets[3];
-	}
-	if (hasUv5) {
-		uv5SetName = uniqueUVSets[4];
-	}
-	if (hasUv6) {
-		uv6SetName = uniqueUVSets[5];
-	}
-	auto colors = mesh->GetElementVertexColor();
-	FbxLayerElement::EMappingMode colorMappingMode;
-	FbxLayerElement::EReferenceMode colorReferenceMode;
-	if (colors) {
-		colorMappingMode = colors->GetMappingMode();
-		colorReferenceMode = colors->GetReferenceMode();
-	}
-	auto normals = mesh->GetElementNormal();
-	FbxGeometryElementUV* uvs = nullptr;
-	FbxGeometryElementUV* uvs2 = nullptr;
-	FbxGeometryElementUV* uvs3 = nullptr;
-	FbxGeometryElementUV* uvs4 = nullptr;
-	FbxGeometryElementUV* uvs5 = nullptr;
-	FbxGeometryElementUV* uvs6 = nullptr;
-	FbxLayerElement::EMappingMode uvsMappingMode;
-	FbxLayerElement::EReferenceMode uvsReferenceMode;
-	FbxLayerElement::EMappingMode uvs2MappingMode;
-	FbxLayerElement::EReferenceMode uvs2ReferenceMode;
-	FbxLayerElement::EMappingMode uvs3MappingMode;
-	FbxLayerElement::EReferenceMode uvs3ReferenceMode;
-	FbxLayerElement::EMappingMode uvs4MappingMode;
-	FbxLayerElement::EReferenceMode uvs4ReferenceMode;
-	FbxLayerElement::EMappingMode uvs5MappingMode;
-	FbxLayerElement::EReferenceMode uvs5ReferenceMode;
-	FbxLayerElement::EMappingMode uvs6MappingMode;
-	FbxLayerElement::EReferenceMode uvs6ReferenceMode;
-	if (hasUv) {
-		uvs = mesh->GetElementUV(uvSetName.c_str());
-		uvsMappingMode = uvs->GetMappingMode();
-		uvsReferenceMode = uvs->GetReferenceMode();
-	}
-	if (hasUv2) {
-		uvs2 = mesh->GetElementUV(uv2SetName.c_str());
-		uvs2MappingMode = uvs2->GetMappingMode();
-		uvs2ReferenceMode = uvs2->GetReferenceMode();
-	}
-	if (hasUv3) {
-		uvs3 = mesh->GetElementUV(uv3SetName.c_str());
-		uvs3MappingMode = uvs3->GetMappingMode();
-		uvs3ReferenceMode = uvs3->GetReferenceMode();
-	}
-	if (hasUv4) {
-		uvs4 = mesh->GetElementUV(uv4SetName.c_str());
-		uvs4MappingMode = uvs4->GetMappingMode();
-		uvs4ReferenceMode = uvs4->GetReferenceMode();
-	}
-	if (hasUv5) {
-		uvs5 = mesh->GetElementUV(uv5SetName.c_str());
-		uvs5MappingMode = uvs5->GetMappingMode();
-		uvs5ReferenceMode = uvs5->GetReferenceMode();
-	}
-	if (hasUv6) {
-		uvs6 = mesh->GetElementUV(uv6SetName.c_str());
-		uvs6MappingMode = uvs6->GetMappingMode();
-		uvs6ReferenceMode = uvs6->GetReferenceMode();
-	}
-
-	auto normalMappingMode = normals->GetMappingMode();
-	auto normalReferenceMode = normals->GetReferenceMode();
-	std::vector<SubmeshData> submeshes;
-
-	auto materialCount = node->fbxNode()->GetMaterialCount();
-	if (materialCount == 0) {
-		materialCount = 1;
-	}
-	submeshes.resize(materialCount);
-	auto baseLayer = mesh->GetLayer(0);
-	auto materials = baseLayer->GetMaterials();
-	FbxLayerElement::EMappingMode materialMappingMode = materials ?
-		materials->GetMappingMode() : FbxLayerElement::eByPolygon;
-
-	// extract deformers
-	SkinInfo skinInfo(fbxNode);
-	if (skinInfo.hasSkin()){
-		associatedSkeleton = std::make_shared<BabylonSkeleton>();
-		skinInfo.buildBabylonSkeleton(*associatedSkeleton);
-	}
-
-	auto triangleCount = mesh->GetPolygonCount();
-	for (int triangleIndex = 0; triangleIndex < triangleCount; ++triangleIndex) {
-
-		int materialIndex = 0;
-		if (materialCount > 0 && materials) {
-			switch (materialMappingMode) {
-			case FbxLayerElement::eAllSame:
-				materialIndex = materials->GetIndexArray().GetAt(0);
-				break;
-			case FbxLayerElement::eByPolygon:
-				materialIndex = materials->GetIndexArray().GetAt(triangleIndex);
-			}
-			if (materialIndex < 0 || materialIndex >= materialCount) {
-				materialIndex = 0;
-			}
-		}
-
-		auto& submesh = submeshes[materialIndex];
-		triangle t;
-		for (int cornerIndex = 0; cornerIndex < 3; ++cornerIndex) {
-			auto controlPointIndex = mesh->GetPolygonVertex(triangleIndex, cornerIndex);
-			auto vertexIndex = triangleIndex * 3 + cornerIndex;
-			auto position = mesh->GetControlPoints()[controlPointIndex];
-			position[2] = -position[2];
-
-			BabylonVertex v;
-			v.position = position;
-			if (normals) {
-				int normalMapIndex = (normalMappingMode == FbxLayerElement::eByControlPoint) ?
-				controlPointIndex : vertexIndex;
-				int normalValueIndex = (normalReferenceMode == FbxLayerElement::eDirect) ?
-				normalMapIndex : normals->GetIndexArray().GetAt(normalMapIndex);
-				v.normal = normals->GetDirectArray().GetAt(normalValueIndex);
-				v.normal.z = -v.normal.z;
-			}
-			if (colors) {
-				int mappingIndex = (colorMappingMode == FbxLayerElement::eByControlPoint) ?
-				controlPointIndex : vertexIndex;
-				int valueIndex = (colorReferenceMode == FbxLayerElement::eDirect) ?
-				mappingIndex : colors->GetIndexArray().GetAt(mappingIndex);
-				v.color = colors->GetDirectArray().GetAt(valueIndex);
-			}
-			if (uvs) {
-				int mappingIndex = (uvsMappingMode == FbxLayerElement::eByControlPoint) ?
-				controlPointIndex : vertexIndex;
-				int valueIndex = (uvsReferenceMode == FbxLayerElement::eDirect) ?
-				mappingIndex : uvs->GetIndexArray().GetAt(mappingIndex);
-				v.uv = uvs->GetDirectArray().GetAt(valueIndex);
-				//v.uv.y = 1 - v.uv.y;
-			}
-
-			if (uvs2) {
-				int mappingIndex = (uvs2MappingMode == FbxLayerElement::eByControlPoint) ?
-					controlPointIndex : vertexIndex;
-				int valueIndex = (uvs2ReferenceMode == FbxLayerElement::eDirect) ?
-					mappingIndex : uvs2->GetIndexArray().GetAt(mappingIndex);
-				v.uv2 = uvs2->GetDirectArray().GetAt(valueIndex);
-			}
-			if (uvs3) {
-				int mappingIndex = (uvs3MappingMode == FbxLayerElement::eByControlPoint) ?
-					controlPointIndex : vertexIndex;
-				int valueIndex = (uvs3ReferenceMode == FbxLayerElement::eDirect) ?
-					mappingIndex : uvs3->GetIndexArray().GetAt(mappingIndex);
-				v.uv3 = uvs3->GetDirectArray().GetAt(valueIndex);
-			}
-			if (uvs4) {
-				int mappingIndex = (uvs4MappingMode == FbxLayerElement::eByControlPoint) ?
-					controlPointIndex : vertexIndex;
-				int valueIndex = (uvs4ReferenceMode == FbxLayerElement::eDirect) ?
-					mappingIndex : uvs4->GetIndexArray().GetAt(mappingIndex);
-				v.uv4 = uvs4->GetDirectArray().GetAt(valueIndex);
-			}
-			if (uvs5) {
-				int mappingIndex = (uvs5MappingMode == FbxLayerElement::eByControlPoint) ?
-					controlPointIndex : vertexIndex;
-				int valueIndex = (uvs5ReferenceMode == FbxLayerElement::eDirect) ?
-					mappingIndex : uvs5->GetIndexArray().GetAt(mappingIndex);
-				v.uv5 = uvs5->GetDirectArray().GetAt(valueIndex);
-			}
-			if (uvs6) {
-				int mappingIndex = (uvs6MappingMode == FbxLayerElement::eByControlPoint) ?
-					controlPointIndex : vertexIndex;
-				int valueIndex = (uvs6ReferenceMode == FbxLayerElement::eDirect) ?
-					mappingIndex : uvs6->GetIndexArray().GetAt(mappingIndex);
-				v.uv6 = uvs6->GetDirectArray().GetAt(valueIndex);
-			}
-			if (skinInfo.hasSkin()){
-				auto& skinData = skinInfo.controlPointBoneIndicesAndWeights(controlPointIndex);
-				for (std::size_t boneix = 0; boneix < skinData.size()&&boneix< (size_t)4; ++boneix){
-					v.boneIndices[boneix] = skinData[boneix].index;
-					v.boneWeights[boneix] = static_cast<float>(skinData[boneix].weight);
-				}
-				for (auto boneix = skinData.size(); boneix < 4; ++boneix){
-
-					v.boneIndices[boneix] = skinInfo.bonesCount();
-					v.boneWeights[boneix] = 0;
-				}
-			}
-			auto foundVertex = submesh.knownVertices.find(v);
-			if (foundVertex != submesh.knownVertices.end()) {
-				//submesh.indices.push_back(foundVertex->second);
-				t.indices[cornerIndex] = foundVertex->second;
-			}
-			else {
-				auto index = static_cast<int>(submesh.vertices.size());
-				submesh.vertices.push_back(v);
-				//submesh.indices.push_back(index);
-				submesh.knownVertices[v] = index;
-				t.indices[cornerIndex] = index;
-			}
-		}
-		if (submesh.knownTriangles.insert(t).second) {
-			submesh.indices.push_back(t.indices[0]);
-			submesh.indices.push_back(t.indices[1]);
-			submesh.indices.push_back(t.indices[2]);
-		}
-		else {
-			std::cout << "duplicate triangle found (and eliminated) in " << fbxNode->GetName() << std::endl;
-		}
-
-	}
-	std::uint32_t vertexOffset = 0;
-
-	for (auto matIndex = 0u; matIndex < submeshes.size(); ++matIndex) {
-		auto& submesh = submeshes[matIndex];
-		BabylonSubmesh babsubmesh;
-		babsubmesh.indexCount = static_cast<int>(submesh.indices.size());
-		babsubmesh.indexStart = static_cast<int>(_indices.size());
-		babsubmesh.materialIndex = matIndex;
-		babsubmesh.verticesCount = static_cast<int>(submesh.vertices.size());
-		babsubmesh.verticesStart = static_cast<int>(_positions.size());
-		for (auto& v : submesh.vertices) {
-			_positions.push_back(v.position);
-			if (normals) {
-				_normals.push_back(v.normal);
-			}
-			if (colors) {
-				_colors.push_back(v.color);
-			}
-			if (uvs) {
-				_uvs.push_back(v.uv);
-			}
-			if (uvs2) {
-				_uvs2.push_back(v.uv2);
-			}
-			if (uvs3) {
-				_uvs3.push_back(v.uv3);
-			}
-			if (uvs4) {
-				_uvs4.push_back(v.uv4);
-			}
-			if (uvs5) {
-				_uvs5.push_back(v.uv5);
-			}
-			if (uvs6) {
-				_uvs6.push_back(v.uv6);
-			}
-			if (skinInfo.hasSkin()){
-				 float weight0 = v.boneWeights[0];
-				 float weight1 = v.boneWeights[1];
-				 float weight2 = v.boneWeights[2];
-				 int bone0 = v.boneIndices[0];
-				 int bone1 = v.boneIndices[1];
-				 int bone2 = v.boneIndices[2];
-				 int bone3 = v.boneIndices[3];
-               
-				_boneWeights.push_back(babylon_vector4( weight0, weight1, weight2, 1.0f - weight0 - weight1 - weight2));
-                _boneIndices.push_back((bone3 << 24) | (bone2 << 16) | (bone1 << 8) | bone0);
-			}
-		}
-		for (auto i : submesh.indices) {
-			_indices.push_back(i + vertexOffset);
-		}
-
-		vertexOffset = static_cast<int>(_positions.size());
-		_submeshes.push_back(babsubmesh);
-	}
-
-
-
-}
-
-
-BabylonMesh::BabylonMesh(BabylonMesh && moved) : 
-	BabylonAbstractMesh(moved),
-	_id(std::move(moved._id)),
-	_parentId(std::move(moved._parentId)),
-	_materialId(std::move(moved._materialId)),
-	_isEnabled(std::move(moved._isEnabled)),
-	_isVisible(std::move(moved._isVisible)),
-	_pickable(std::move(moved._pickable)),
-	_positions(std::move(moved._positions)),
-	_normals(std::move(moved._normals)),
-	_uvs(std::move(moved._uvs)),
-	_uvs2(std::move(moved._uvs2)),
-	_uvs3(std::move(moved._uvs3)),
-	_uvs4(std::move(moved._uvs4)),
-	_uvs5(std::move(moved._uvs5)),
-	_uvs6(std::move(moved._uvs6)),
-	_colors(std::move(moved._colors)),
-	_hasVertexAlpha(std::move(moved._hasVertexAlpha)),
-	_boneIndices(std::move(moved._boneIndices)),
-	_boneWeights(std::move(moved._boneWeights)),
-	_indices(std::move(moved._indices)),
-	_checkCollision(std::move(moved._checkCollision)),
-	_receiveShadows(std::move(moved._receiveShadows)),
-	_infiniteDistance(std::move(moved._infiniteDistance)),
-	_billboardMode(std::move(moved._billboardMode)),
-	_visibility(std::move(moved._visibility)),
-	_submeshes(std::move(moved._submeshes)),
-	_instances(std::move(moved._instances)),
-	_skeletonId(std::move(moved._skeletonId)),
-	_autoAnimate(std::move(moved._autoAnimate)),
-	_autoAnimateFrom(std::move(moved._autoAnimateFrom)),
-	_autoAnimateTo(std::move(moved._autoAnimateTo)),
-	_autoAnimateLoop(std::move(moved._autoAnimateLoop)),
-	_showBoundingBox(std::move(moved._showBoundingBox)),
-	_showSubMeshesBoundingBox(std::move(moved._showSubMeshesBoundingBox)),
-	_applyFog(std::move(moved._applyFog)),
-	_alphaIndex(std::move(moved._alphaIndex)),
-	uvsets(std::move(moved.uvsets)),
-	associatedSkeleton(std::move(moved.associatedSkeleton)),
-	animations(std::move(moved.animations)),
-	pivotMatrix(std::move(moved.pivotMatrix))
-{
-}
-
-void BabylonMesh::addInstance(BabylonNode * node)
-{
-	_instances.emplace_back(node);
-}
-
-BabylonMesh::~BabylonMesh()
-{
-}

+ 0 - 129
Exporters/FBX/BabylonFbxNative/BabylonMesh.h

@@ -1,129 +0,0 @@
-#pragma once
-#include "BabylonAbstractMesh.h"
-#include <vector>
-#include <cstdint>
-#include "BabylonAnimation.h"
-#include "SkinInfo.h"
-
-struct BabylonSubmesh{
-	int materialIndex;
-	int verticesStart;
-	int verticesCount;
-	int indexStart;
-	int indexCount;
-
-
-	web::json::value toJson();
-};
-
-class BabylonMesh :
-	public BabylonAbstractMesh
-{
-private:
-	std::wstring _id;
-	std::wstring _parentId;
-	std::wstring _materialId;
-	bool _isEnabled;
-	bool _isVisible;
-	bool _pickable;
-	std::vector<babylon_vector3> _positions;
-	std::vector<babylon_vector3> _normals;
-	std::vector<babylon_vector2> _uvs;
-	std::vector<babylon_vector2> _uvs2;
-	std::vector<babylon_vector2> _uvs3;
-	std::vector<babylon_vector2> _uvs4;
-	std::vector<babylon_vector2> _uvs5;
-	std::vector<babylon_vector2> _uvs6;
-	std::vector<babylon_color> _colors;
-	bool _hasVertexAlpha;
-	std::vector<std::uint32_t> _boneIndices;
-	std::vector<babylon_vector4> _boneWeights;
-	std::vector<std::uint32_t> _indices;
-	bool _checkCollision;
-	bool _receiveShadows;
-	bool _infiniteDistance;
-	int _billboardMode;
-	float _visibility;
-	std::vector<BabylonSubmesh> _submeshes;
-	std::vector<BabylonAbstractMesh> _instances;
-	int _skeletonId;
-	bool _autoAnimate;
-	int _autoAnimateFrom;
-	int _autoAnimateTo;
-	bool _autoAnimateLoop;
-	bool _showBoundingBox;
-	bool _showSubMeshesBoundingBox;
-	bool _applyFog;
-	int _alphaIndex;
-public:
-	std::shared_ptr<BabylonSkeleton> associatedSkeleton;
-
-	std::vector<std::shared_ptr < BabylonAnimationBase>> animations;
-	FbxMatrix pivotMatrix;
-	std::vector<std::string> uvsets;
-	const std::wstring& id(){ return _id; }
-	const std::wstring& parentId(){ return _parentId; }
-	const std::wstring& materialId(){ return _materialId; }
-	bool isEnabled(){ return _isEnabled; }
-	bool isVisible(){ return _isVisible; }
-	bool pickable(){ return _pickable; }
-	std::vector<babylon_vector3>& positions(){ return _positions; }
-	std::vector<babylon_vector3>& normals(){ return _normals; }
-	std::vector<babylon_vector2>& uvs(){ return _uvs; }
-	std::vector<babylon_vector2>& uvs2(){ return _uvs2; }
-	std::vector<babylon_color>& colors(){ return _colors; }
-	bool hasVertexAlpha(){ return _hasVertexAlpha; }
-	std::vector<std::uint32_t>& boneIndices(){ return _boneIndices; }
-	std::vector<babylon_vector4>& boneWeights(){ return _boneWeights; }
-	std::vector<std::uint32_t>& indices(){ return _indices; }
-	bool checkCollision(){ return _checkCollision; }
-	bool receiveShadows(){ return _receiveShadows; }
-	bool infiniteDistance(){ return _infiniteDistance; }
-	int billboardMode(){ return _billboardMode; }
-	float visibility(){ return _visibility; }
-	std::vector<BabylonSubmesh>& submeshes(){ return _submeshes; }
-	std::vector<BabylonAbstractMesh>& instances(){ return _instances; }
-	int skeletonId(){ return _skeletonId; }
-	bool autoAnimate(){ return _autoAnimate; }
-	int autoAnimateFrom(){ return _autoAnimateFrom; }
-	int autoAnimateTo(){ return _autoAnimateTo; }
-	bool autoAnimateLoop(){ return _autoAnimateLoop; }
-	bool showBoundingBox(){ return _showBoundingBox; }
-	bool showSubMeshesBoundingBox(){ return _showSubMeshesBoundingBox; }
-	bool applyFog(){ return _applyFog; }
-	int alphaIndex(){ return _alphaIndex; }
-
-	void id(const std::wstring& value){ _id = value; }
-	void parentId(const std::wstring& value){ _parentId = value; }
-	void materialId(const std::wstring& value){ _materialId = value; }
-	void isEnabled(bool value){ _isEnabled = value; }
-	void isVisible(bool value){ _isVisible = value; }
-	void pickable(bool value){ _pickable = value; }
-	void hasVertexAlpha(bool value){ _hasVertexAlpha = value; }
-	void checkCollision(bool value){ _checkCollision = value; }
-	void receiveShadows(bool value){ _receiveShadows = value; }
-	void infiniteDistance(bool value){ _infiniteDistance = value; }
-	void billboardMode(int value){ _billboardMode = value; }
-	void visibility(float value){ _visibility = value; }
-	void skeletonId(int value){ _skeletonId = value; }
-	void autoAnimate(bool value){ _autoAnimate = value; }
-	void autoAnimateFrom(int value){ _autoAnimateFrom = value; }
-	void autoAnimateTo(int value){ _autoAnimateTo = value; }
-	void autoAnimateLoop(bool value){ _autoAnimateLoop = value; }
-	void showBoundingBox(bool value){ _showBoundingBox = value; }
-	void showSubMeshesBoundingBox(bool value){ _showSubMeshesBoundingBox = value; }
-	void applyFog(bool value){ _applyFog = value; }
-	void alphaIndex(int value){ _alphaIndex = value; }
-
-
-	
-
-	virtual web::json::value toJson() override;
-	BabylonMesh();
-	BabylonMesh(BabylonNode* node);
-	BabylonMesh(const BabylonMesh&) = default;
-	BabylonMesh(BabylonMesh&& moved);
-	void addInstance(BabylonNode* node);
-	virtual ~BabylonMesh();
-};
-

+ 0 - 69
Exporters/FBX/BabylonFbxNative/BabylonNode.cpp

@@ -1,69 +0,0 @@
-#include "stdafx.h"
-#include "BabylonNode.h"
-#include "NodeHelpers.h"
-
-BabylonNode::BabylonNode(FbxNode* fbxNode) : _node(fbxNode){
-	auto childCount = fbxNode->GetChildCount();
-	for (int i = 0; i < childCount; ++i){
-		_children.emplace_back(fbxNode->GetChild(i));
-	}
-}
-
-BabylonNode::BabylonNode(BabylonNode && moved) :
-	 _node(moved._node),
-	_children(std::move(moved._children))
-{
-}
-
-BabylonNodeType BabylonNode::nodeType(){
-	if (_node->GetMesh()){
-		return BabylonNodeType::Mesh;
-	}
-	if (_node->GetCamera()){
-		return BabylonNodeType::Camera;
-	}
-	if (_node->GetSkeleton()){
-		return BabylonNodeType::Skeleton;
-	}
-	if (_node->GetLight()) {
-		return BabylonNodeType::Light;
-	}
-	return BabylonNodeType::Empty;
-}
-
-bool BabylonNode::isEmptySkeletonOrEmptyMesh()
-{
-	auto type = nodeType();
-	switch (type)
-	{
-	case BabylonNodeType::Mesh:
-	{
-		auto mesh = _node->GetMesh();
-		if (mesh->GetPolygonCount() == 0) {
-			return true;
-		}
-		else {
-			return false;
-		}
-	}
-	case BabylonNodeType::Skeleton:
-	case BabylonNodeType::Empty:
-		return true;
-	default:
-		return false;
-	}
-}
-
-bool BabylonNode::isEmptySkeletonOrEmptyMeshRecursive()
-{
-	if (!isEmptySkeletonOrEmptyMesh()) {
-		return false;
-	}
-
-	for (auto& c : children()) {
-		if (!c.isEmptySkeletonOrEmptyMeshRecursive()) {
-			return false;
-		}
-	}
-	return true;
-}

+ 0 - 70
Exporters/FBX/BabylonFbxNative/BabylonNode.h

@@ -1,70 +0,0 @@
-#pragma once
-#include <fbxsdk.h>
-#include <vector>
-#include <cstdint>
-#include "NodeHelpers.h"
-#include "BabylonVertex.h"
-#include "MatrixDecomposition.h"
-enum class BabylonNodeType{
-	Camera,
-	Mesh,
-	Skeleton,
-	Light,
-	Empty
-};
-class BabylonNode;
-class BabylonNode
-{
-private:
-	FbxNode* _node;
-	std::vector<BabylonNode> _children;
-public:
-	BabylonNode() :_node(nullptr){}
-	
-
-
-	explicit BabylonNode(FbxNode* fbxNode);
-	BabylonNode(const BabylonNode&) = default;
-	BabylonNode(BabylonNode&& moved);
-
-	std::vector<BabylonNode>& children(){
-		return _children;
-	}
-	BabylonNodeType nodeType();
-
-	FbxNode* fbxNode(){ return _node; }
-	
-	bool isEmptySkeletonOrEmptyMesh();
-	bool isEmptySkeletonOrEmptyMeshRecursive();
-	void appendChild(FbxNode* fbxNode){
-		_children.emplace_back(fbxNode);
-	}
-
-	std::uint64_t uniqueId()const{
-		return _node->GetUniqueID();
-	}
-
-	std::string name() const{
-		return std::string(_node->GetName());
-	}
-
-	bool hasOnlySkeletonDescendants(){
-		if (nodeType() != BabylonNodeType::Skeleton){
-			return false;
-		}
-		for (auto& child : _children){
-			if (!child.hasOnlySkeletonDescendants()){
-				return false;
-			}
-		}
-		return true;
-	}
-
-	MatrixDecomposition GetLocal() {
-		return MatrixDecomposition(ConvertToBabylonCoordinateSystem(_node->EvaluateLocalTransform()));
-	}
-	MatrixDecomposition GetLocal(const FbxTime& time) {
-		return MatrixDecomposition(ConvertToBabylonCoordinateSystem(_node->EvaluateLocalTransform(time)));
-	}
-
-};

+ 0 - 258
Exporters/FBX/BabylonFbxNative/BabylonScene.cpp

@@ -1,258 +0,0 @@
-#include "stdafx.h"
-#include "BabylonScene.h"
-
-
-web::json::value BabylonScene::toJson() 
-{
-	auto jobj = web::json::value::object();
-	jobj[L"autoClear"] = web::json::value::boolean(_autoClear);
-	writeVector3(jobj, L"clearColor", _clearColor);
-	writeVector3(jobj, L"ambientColor", _ambientColor);
-	jobj[L"fogMode"] = web::json::value::number(_fogMode);
-	writeVector3(jobj, L"fogColor", _fogColor);
-	jobj[L"fogStart"] = web::json::value::number(_fogStart);
-	jobj[L"fogEnd"] = web::json::value::number(_fogEnd);
-	jobj[L"fogDensity"] = web::json::value::number(_fogDensity);
-	writeVector3(jobj, L"gravity", _gravity);
-	jobj[L"activeCameraID"] = web::json::value::string(_activeCameraID);
-
-	auto jcameras = web::json::value::array();
-
-	for (auto& cam : _cameras) {
-		jcameras[jcameras.size()] = cam.toJson();
-	}
-
-	jobj[L"cameras"] = jcameras;
-
-	auto jmeshes = web::json::value::array();
-	for (auto& mesh : _meshes) {
-		jmeshes[jmeshes.size()] = mesh.toJson();
-	}
-	jobj[L"meshes"] = jmeshes;
-
-
-	auto jmats = web::json::value::array();
-	for (auto& mat : _materials) {
-		jmats[jmats.size()] = mat.toJson();
-	}
-	jobj[L"materials"] = jmats;
-
-	auto jmulmats = web::json::value::array();
-	for (auto& mat : _multiMaterials) {
-		jmulmats[jmulmats.size()] = mat.toJson();
-	}
-	jobj[L"multiMaterials"] = jmulmats;
-
-	auto jlights = web::json::value::array();
-	for (auto& light : _lights) {
-		jlights[jlights.size()] = light.toJson();
-	}
-	jobj[L"lights"] = jlights;
-
-	auto jskeletons = web::json::value::array();
-	for (auto& skel : _skeletons){
-		jskeletons[jskeletons.size()] = skel->toJson();
-	}
-	jobj[L"skeletons"] = jskeletons;
-	auto jshadowGenerators = web::json::value::array();
-	for (auto& sg : _shadowGenerators) {
-		jshadowGenerators[jshadowGenerators.size()] = sg->toJson();
-	}
-	jobj[L"shadowGenerators"] = jshadowGenerators;
-	return jobj;
-}
-
-BabylonScene::BabylonScene() :
-_autoClear(true),
-_clearColor(.2f, .2f, .3f),
-_ambientColor(0,0,0),
-_gravity(0,0,-.9f)
-{
-}
-
-BabylonScene::BabylonScene(BabylonNode & rootNode, bool skipEmptyNodes) :
-	_autoClear(true),
-	_clearColor(.2f, .2f, .3f),
-	_ambientColor(0, 0, 0),
-	_gravity(0, 0, -.9f)
-{
-	std::map<FbxMesh*, size_t> meshInstanceMap;
-	exploreNodes(rootNode, skipEmptyNodes, meshInstanceMap);
-	if (_cameras.size() == 0) {
-		babylon_boundingbox bbox(rootNode.fbxNode()->GetScene());
-		auto cam = buildCameraFromBoundingBox(bbox);
-		_activeCameraID = cam.id;
-		_cameras.push_back(std::move(cam));
-	}
-	if (_lights.size() == 0) {
-		BabylonLight light;
-		light.diffuse = babylon_vector3(1, 1, 1);
-		light.specular = babylon_vector3(1, 1, 1);
-		light.position = babylon_vector3(0, 0, 0);
-		light.parentId = _activeCameraID;
-		light.type = 0;
-		light.id = L"default_light";
-		light.name = L"default_light";
-		light.intensity = 1;
-		_lights.push_back(std::move(light));
-	}
-}
-
-
-BabylonScene::BabylonScene(BabylonScene && moved) : 
-	_autoClear(std::move(moved._autoClear)),
-	_clearColor(std::move(moved._clearColor)),
-	_ambientColor(std::move(moved._ambientColor)),
-	_fogMode(std::move(moved._fogMode)),
-	_fogColor(std::move(moved._fogColor)),
-	_fogStart(std::move(moved._fogStart)),
-	_fogEnd(std::move(moved._fogEnd)),
-	_fogDensity(std::move(moved._fogDensity)),
-	_gravity(std::move(moved._gravity)),
-	_cameras(std::move(moved._cameras)),
-	_activeCameraID(std::move(moved._activeCameraID)),
-	_meshes(std::move(moved._meshes)),
-	_materials(std::move(moved._materials)),
-	_multiMaterials(std::move(moved._multiMaterials)),
-	_lights(std::move(moved._lights)),
-	_shadowGenerators(std::move(moved._shadowGenerators)),
-	_skeletons(std::move(moved._skeletons))
-{
-}
-
-BabylonScene::~BabylonScene()
-{
-}
-
-
-void fixupTextureCoordinateIndices(BabylonMaterial& mat, BabylonMesh& mesh) {
-	std::vector<std::shared_ptr<BabylonTexture>> textures;
-	if (mat.ambientTexture) {
-		textures.push_back(mat.ambientTexture);
-	}
-	if (mat.diffuseTexture) {
-		textures.push_back(mat.diffuseTexture);
-	}
-	if (mat.specularTexture) {
-		textures.push_back(mat.specularTexture);
-	}
-	if (mat.emissiveTexture) {
-		textures.push_back(mat.emissiveTexture);
-	}
-	if (mat.reflectionTexture) {
-		textures.push_back(mat.reflectionTexture);
-	}
-	if (mat.bumpTexture) {
-		textures.push_back(mat.bumpTexture);
-	}
-	for (auto& tex : textures) {
-		auto found = std::find(mesh.uvsets.begin(), mesh.uvsets.end(), tex->uvset);
-		if (found != mesh.uvsets.end()) {
-			tex->coordinatesIndex = static_cast<int>(found - mesh.uvsets.begin());
-		}
-	}
-}
-bool isAlreadyInstanciatedMesh(FbxNode* node, std::map<FbxMesh*, size_t>& meshInstanceMap, size_t* oIndex) {
-	auto mesh = node->GetMesh();
-	if (!mesh) {
-		return false;
-	}
-	auto found = meshInstanceMap.find(mesh);
-	if (found == meshInstanceMap.end()) {
-		return false;
-	}
-
-	*oIndex = found->second;
-	return true;
-}
-void BabylonScene::exploreNodes(BabylonNode & node, bool skipEmptyNodes, std::map<FbxMesh*, size_t>& meshInstanceMap)
-{
-	if (node.nodeType() == BabylonNodeType::Skeleton && node.hasOnlySkeletonDescendants()) {
-		return;
-	}
-	if (skipEmptyNodes && node.isEmptySkeletonOrEmptyMeshRecursive()) {
-		return;
-	}
-	// append mesh
-	switch (node.nodeType())
-	{
-	case BabylonNodeType::Empty:
-	case BabylonNodeType::Mesh:
-	case BabylonNodeType::Skeleton:
-	{
-		size_t instanceOwnerIndex;
-		if (isAlreadyInstanciatedMesh(node.fbxNode(), meshInstanceMap, &instanceOwnerIndex)) {
-			_meshes[instanceOwnerIndex].addInstance(&node);
-		}
-		else {
-			BabylonMesh mesh(&node);
-
-			auto matCount = node.fbxNode()->GetMaterialCount();
-			BabylonMultiMaterial multiMat;
-			for (auto i = 0; i < matCount; ++i) {
-				auto mat = node.fbxNode()->GetMaterial(i);
-				if (mat) {
-
-					auto id = getMaterialId(mat);
-					auto existing = std::find_if(_materials.begin(), _materials.end(), [id](const BabylonMaterial& e) {
-						return e.id == id;
-					});
-					if (existing == _materials.end()) {
-						auto babMat = BabylonMaterial(mat);
-						fixupTextureCoordinateIndices(babMat, mesh);
-						_materials.push_back(std::move(babMat));
-					}
-
-					multiMat.materials.push_back(id);
-
-				}
-			}
-
-			if (mesh.associatedSkeleton) {
-				mesh.associatedSkeleton->id = static_cast<int>(_skeletons.size() + 1);
-				mesh.skeletonId(static_cast<int>(_skeletons.size() + 1));
-				_skeletons.push_back(mesh.associatedSkeleton);
-			}
-			if (multiMat.materials.size() > 0) {
-
-				multiMat.id = mesh.id();
-				multiMat.name = mesh.name();
-				mesh.materialId(multiMat.id);
-				_multiMaterials.push_back(std::move(multiMat));
-			}
-
-			auto fbxMesh = node.fbxNode()->GetMesh();
-			if (fbxMesh) {
-				meshInstanceMap[fbxMesh] = _meshes.size();
-			}
-			_meshes.push_back(std::move(mesh));
-		}
-	}
-	break;
-	case BabylonNodeType::Camera:
-	{
-		_cameras.emplace_back(node);
-		if (_cameras.size() == 1) {
-			activeCameraID(_cameras[0].id);
-		}
-	}
-	break;
-	case BabylonNodeType::Light:
-	{
-		_lights.emplace_back(node);
-		auto& l = _lights[_lights.size() - 1];
-		if (l.shadowGenerator) {
-			_shadowGenerators.push_back(l.shadowGenerator);
-		}
-	}
-	break;
-	default:
-		break;
-	}
-
-
-	for (auto& child : node.children()) {
-		exploreNodes(child, skipEmptyNodes, meshInstanceMap);
-	}
-
-}

+ 0 - 94
Exporters/FBX/BabylonFbxNative/BabylonScene.h

@@ -1,94 +0,0 @@
-#pragma once
-#include <cpprest\json.h>
-#include "BabylonVertex.h"
-#include "BabylonMesh.h"
-#include "BabylonMaterial.h"
-#include "BabylonCamera.h"
-#include "BabylonLight.h"
-#include "BabylonSkeleton.h"
-#include <memory>
-#include "BabylonNode.h"
-
-class BabylonScene
-{
-private:
-	bool _autoClear;
-	babylon_vector3 _clearColor;
-	babylon_vector3 _ambientColor;
-	int _fogMode;
-	babylon_vector3 _fogColor;
-	float _fogStart;
-	float _fogEnd;
-	float _fogDensity;
-	babylon_vector3 _gravity;
-	std::vector<BabylonCamera> _cameras;
-	std::wstring _activeCameraID;
-	std::vector<BabylonMesh> _meshes;
-	std::vector<BabylonMaterial> _materials;
-	std::vector<BabylonMultiMaterial> _multiMaterials;
-	std::vector<BabylonLight> _lights;
-	std::vector<std::shared_ptr<BabylonShadowGenerator>> _shadowGenerators;
-	std::vector<std::shared_ptr<BabylonSkeleton>> _skeletons;
-	// particleSystems
-	// lensFlareSystems
-	// shadowGenerators
-	// skeletons
-
-public:
-
-	bool autoClear(){ return _autoClear; }
-	babylon_vector3 clearColor(){ return _clearColor; }
-	babylon_vector3 ambientColor(){ return _ambientColor; }
-	int fogMode(){ return _fogMode; }
-	babylon_vector3 fogColor(){ return _fogColor; }
-	float fogStart(){ return _fogStart; }
-	float fogEnd(){ return _fogEnd; }
-	float fogDensity(){ return _fogDensity; }
-	babylon_vector3 gravity(){ return _gravity; }
-
-	std::vector<BabylonCamera>& cameras() { return _cameras; }
-	const std::wstring& activeCameraID() { return _activeCameraID; }
-	// lights
-	std::vector<BabylonMesh>& meshes() { return _meshes; }
-	std::vector<BabylonMaterial>& materials(){ return _materials; }
-	std::vector<BabylonMultiMaterial>& multiMaterials(){ return _multiMaterials; }
-
-	std::vector<BabylonLight>& lights() { return _lights; }
-	std::vector<std::shared_ptr<BabylonShadowGenerator>>& shadowGenerators() { return _shadowGenerators; }
-	std::vector<std::shared_ptr<BabylonSkeleton>>& skeletons() { return _skeletons; }
-	// particleSystems
-	// lensFlareSystems
-	// shadowGenerators
-	// skeletons
-
-	void autoClear(bool value){ _autoClear = value; }
-	void clearColor(babylon_vector3 value){ _clearColor = value; }
-	void ambientColor(babylon_vector3 value){ _ambientColor = value; }
-	void fogMode(int value){ _fogMode = value; }
-	void fogColor(babylon_vector3 value){ _fogColor = value; }
-	void fogStart(float value){ _fogStart = value; }
-	void fogEnd(float value){ _fogEnd = value; }
-	void fogDensity(float value){ _fogDensity = value; }
-	void gravity(babylon_vector3 value){ _gravity = value; }
-
-
-	void activeCameraID(const std::wstring& value) { _activeCameraID = value; }
-	// lights
-	// materials
-	// multiMaterials
-	// particleSystems
-	// lensFlareSystems
-	// shadowGenerators
-	// skeletons
-
-	web::json::value toJson() ;
-
-	BabylonScene();
-	BabylonScene(BabylonNode& rootNode, bool skipEmptyNodes);
-	BabylonScene(const BabylonScene&) = default;
-	BabylonScene(BabylonScene&& moved);
-	~BabylonScene();
-private:
-	void exploreNodes(BabylonNode& node, bool skipEmptyNodes, std::map<FbxMesh*, size_t>& meshInstanceMap);
-};
-

+ 0 - 41
Exporters/FBX/BabylonFbxNative/BabylonSkeleton.cpp

@@ -1,41 +0,0 @@
-#include "stdafx.h"
-#include "BabylonSkeleton.h"
-
-
-BabylonSkeleton::BabylonSkeleton()
-{
-}
-
-
-
-web::json::value BabylonBone::toJson(){
-	auto jobj = web::json::value::object();
-	jobj[L"name"] = web::json::value::string(name);
-	jobj[L"index"] = web::json::value::number(index);
-	jobj[L"parentBoneIndex"] = web::json::value::number(parentBoneIndex);
-
-	auto jmat = web::json::value::array();
-	for (auto x = 0; x < 4; ++x){
-		for (auto y = 0; y < 4; ++y){
-			jmat[x * 4 + y] = web::json::value::number(matrix[x][y]);
-		}
-	}
-	jobj[L"matrix"] = jmat;
-	if (animation){
-		jobj[L"animation"] = animation->toJson();
-	}
-	return jobj;
-}
-
-
-web::json::value BabylonSkeleton::toJson(){
-	auto jobj = web::json::value::object();
-	jobj[L"name"] = web::json::value::string(name);
-	jobj[L"id"] = web::json::value::number(id);
-	auto jbones = web::json::value::array();
-	for (auto ix = 0u; ix < bones.size(); ++ix){
-		jbones[ix] = bones[ix].toJson();
-	}
-	jobj[L"bones"] = jbones;
-	return jobj;
-}

+ 0 - 48
Exporters/FBX/BabylonFbxNative/BabylonSkeleton.h

@@ -1,48 +0,0 @@
-#pragma once
-#include <string>
-#include <vector>
-#include <fbxsdk.h>
-#include <cpprest\json.h>
-#include "BabylonAnimation.h"
-
-class BabylonBone{
-public:
-
-	std::wstring name;
-	int index;
-	int parentBoneIndex = -1;
-	FbxMatrix matrix;
-	std::shared_ptr<BabylonAnimation<FbxMatrix>> animation;
-	web::json::value toJson();
-	BabylonBone() = default;
-	BabylonBone(const BabylonBone&) = default;
-	BabylonBone(BabylonBone&& moved) :
-		name(std::move(moved.name)),
-		index(std::move(moved.index)),
-		parentBoneIndex(std::move(moved.parentBoneIndex)),
-		matrix(std::move(moved.matrix)),
-		animation(std::move(moved.animation))
-	{}
-	//public BabylonAnimation animation{ get; set; }
-};
-class BabylonSkeleton
-{
-public:
-	int id;
-
-	std::wstring name;
-
-	std::vector<BabylonBone> bones;
-
-	web::json::value toJson();
-	BabylonSkeleton();
-	BabylonSkeleton(const BabylonSkeleton&) = default;
-	BabylonSkeleton(BabylonSkeleton&& moved) :
-		id(std::move(moved.id)),
-		name(std::move(moved.name)),
-		bones(std::move(moved.bones))
-	{
-
-	}
-};
-

+ 0 - 412
Exporters/FBX/BabylonFbxNative/BabylonVertex.h

@@ -1,412 +0,0 @@
-#pragma once
-#include <vector>
-#include <set>
-#include <string>
-#include <memory>
-#include <fbxsdk.h>
-#include <cpprest\json.h>
-
-struct babylon_vector4{
-	float x;
-	float y;
-	float z;
-	float w;
-	babylon_vector4() :x(0), y(0), z(0), w(0){}
-	babylon_vector4(float x, float y, float z, float w) :x(x), y(y), z(z), w(w){}
-	babylon_vector4(const babylon_vector4& v) :x(v.x), y(v.y), z(v.z), w(v.w) {}
-	babylon_vector4(const FbxQuaternion& v) :x(static_cast<float>(v[0])), y(static_cast<float>(v[1])), z(static_cast<float>(v[2])), w(static_cast<float>(v[3])) {}
-};
-struct babylon_vector3{
-	float x;
-	float y;
-	float z;
-	babylon_vector3() :x(0), y(0), z(0){}
-	babylon_vector3(float x, float y, float z) :x(x), y(y), z(z){}
-	babylon_vector3(const babylon_vector3& v) :x(v.x), y(v.y), z(v.z){}
-	babylon_vector3(const FbxDouble3& v) : x((float) v[0]), y((float) v[1]), z((float) v[2]){}
-	babylon_vector3(const FbxDouble4& v) : x((float) v[0]), y((float) v[1]), z((float) v[2]){}
-};
-
-inline babylon_vector3 operator *(const babylon_vector3& v, float factor){
-	return babylon_vector3(v.x*factor, v.y*factor, v.z*factor);
-}
-inline babylon_vector3 operator *(float factor, const babylon_vector3& v){
-	return v*factor;
-}
-
-inline babylon_vector3 operator + (const  babylon_vector3& lhs, const  babylon_vector3& rhs){
-	return babylon_vector3(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z);
-}
-inline babylon_vector3 operator - (const  babylon_vector3& lhs, const  babylon_vector3& rhs){
-	return babylon_vector3(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);
-}
-
-
-
-inline babylon_vector4 operator *(const babylon_vector4& v, float factor){
-	return babylon_vector4(v.x*factor, v.y*factor, v.z*factor, v.w*factor);
-}
-inline babylon_vector4 operator *(float factor, const babylon_vector4& v){
-	return v*factor;
-}
-
-inline babylon_vector4 operator + (const  babylon_vector4& lhs, const  babylon_vector4& rhs){
-	return babylon_vector4(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w+rhs.w);
-}
-inline babylon_vector4 operator - (const  babylon_vector4& lhs, const  babylon_vector4& rhs){
-	return babylon_vector4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w);
-}
-
-
-
-
-inline bool operator <(const babylon_vector3& lhs, const babylon_vector3& rhs){
-	if (lhs.x < rhs.x){
-		return true;
-	}
-	else if (lhs.x > rhs.x){
-		return false;
-	}
-
-	if (lhs.y < rhs.y){
-		return true;
-	}
-	else if (lhs.y > rhs.y){
-		return false;
-	}
-
-	return lhs.z < rhs.z;
-}
-
-
-struct babylon_vector2{
-	float x;
-	float y;
-	babylon_vector2() :x(0), y(0){}
-	babylon_vector2(float x, float y) :x(x), y(y){}
-	babylon_vector2(const babylon_vector2& v) :x(v.x), y(v.y){}
-	babylon_vector2(const FbxDouble2& v) :x(static_cast<float>(v[0])), y(static_cast<float>(v[1])){}
-
-};
-
-inline bool operator <(const babylon_vector2& lhs, const babylon_vector2& rhs){
-	if (lhs.x < rhs.x){
-		return true;
-	}
-	else if (lhs.x > rhs.x){
-		return false;
-	}
-
-
-
-	return lhs.y < rhs.y;
-}
-
-struct babylon_vertex_normal_uv_color{
-	float pos_x;
-	float pos_y;
-	float pos_z;
-	float normal_x;
-	float normal_y;
-	float normal_z;
-	float uv_x;
-	float uv_y;
-	float color_r;
-	float color_g;
-	float color_b;
-	float color_a;
-
-	babylon_vector3 getTransformedPosition(const FbxAMatrix& transform) const{
-		auto result = transform.MultT(FbxVector4(pos_x, pos_y, pos_z));
-		return babylon_vector3((float) result[0], (float) result[1], (float) result[2]);
-	}
-};
-
-class babylon_boundingbox
-{
-private:
-	float _minX;
-	float _minY;
-	float _minZ;
-	float _maxX;
-	float _maxY;
-	float _maxZ;
-public:
-	void addPosition(float x, float y, float z);
-
-	void addPosition(const babylon_vector3& v){
-		addPosition(v.x, v.y, v.z);
-	}
-	float getMinX() const{
-		return _minX;
-	}
-	float getMinY() const{
-		return _minY;
-	}
-	float getMinZ() const{
-		return _minZ;
-	}
-
-
-	float getMaxX() const{
-		return _maxX;
-	}
-	float getMaxY() const{
-		return _maxY;
-	}
-	float getMaxZ() const{
-		return _maxZ;
-	}
-	float getWidth() const{
-		return _maxX - _minX;
-	}
-	float getHeight() const{
-		return _maxY - _minY;
-	}
-	float getDepth() const{
-		return _maxZ - _minZ;
-	}
-	babylon_vector3 getMin() const{
-		return babylon_vector3(getMinX(), getMinY(), getMinZ());
-	}
-	babylon_vector3 getMax() const{
-		return babylon_vector3(getMaxX(), getMaxY(), getMaxZ());
-	}
-	babylon_vector3 getCenter() const{
-		return babylon_vector3(
-			0.5f*(_maxX + _minX),
-			0.5f*(_maxY + _minY),
-			0.5f*(_maxZ + _minZ));
-	}
-	babylon_boundingbox();
-
-	babylon_boundingbox(FbxScene* scene);
-	~babylon_boundingbox();
-};
-
-
-babylon_boundingbox mergeBoundingBoxes(const std::vector<babylon_boundingbox>& boxes);
-
-struct babylon_submesh{
-	std::string material_id;
-	int index_start;
-	int index_count;
-};
-template<typename TVertex>
-class babylon_mesh{
-private:
-	std::string _name;
-	std::vector<TVertex> _vertices;
-	std::vector<int> _indices;
-	std::vector<babylon_submesh> _submeshes;
-	FbxAMatrix _transform;
-	babylon_boundingbox _boundingBox;
-public:
-
-	babylon_mesh(const char* name, std::vector<TVertex>&& vertices, std::vector<int>&& indices, std::vector<babylon_submesh>&& submeshes, FbxAMatrix transform) :
-		_name(name),
-		_vertices(std::move(vertices)),
-		_indices(std::move(indices)),
-		_submeshes(std::move(submeshes)),
-		_transform(transform)
-	{
-		for (const auto& v : _vertices){
-			babylon_vector3 pos = v.getTransformedPosition(_transform);
-			_boundingBox.addPosition(pos.x, pos.y, pos.z);
-		}
-	}
-
-	babylon_mesh() :_materialIndex(-1){
-
-	}
-
-	babylon_mesh(babylon_mesh&& mesh) :
-		_name(std::move(mesh._name)),
-		_vertices(std::move(mesh._vertices)),
-		_indices(std::move(mesh._indices)),
-		_transform(mesh._transform),
-		_submeshes(std::move(mesh._submeshes)),
-		_boundingBox(mesh._boundingBox)
-	{
-
-	}
-	babylon_boundingbox getBoundingBox()const{
-		return _boundingBox;
-	}
-	const FbxAMatrix& getTransform() const{ return _transform; }
-	const std::string& getName() const{ return _name; }
-	const std::vector<TVertex>& getVertices() const{ return _vertices; }
-	const std::vector<int>& getIndices() const{ return _indices; }
-	const std::vector<babylon_submesh>& getSubmeshes() const { return _submeshes; }
-	int getUniqueIndexCount(const babylon_submesh& subMesh) const{
-		std::set<int> knownIndices;
-		for (int i = 0; i < subMesh.index_count; ++i){
-			knownIndices.insert(_indices[i + subMesh.index_start]);
-		}
-		return knownIndices.size();
-	}
-};
-
-struct babylon_color{
-	float r;
-	float g;
-	float b;
-	float a;
-
-	babylon_color() :r(0), g(0), b(0), a(0){}
-	babylon_color(const FbxColor& v) : r(static_cast<float>(v.mRed)), g(static_cast<float>(v.mGreen)), b(static_cast<float>(v.mBlue)), a(static_cast<float>(v.mAlpha)){}
-};
-
-inline bool operator <(const babylon_color& lhs, const babylon_color& rhs){
-	if (lhs.r < rhs.r){
-		return true;
-	}
-	else if (lhs.r > rhs.r){
-		return false;
-	}
-	if (lhs.g < rhs.g){
-		return true;
-	}
-	else if (lhs.g > rhs.g){
-		return false;
-	}
-	if (lhs.b < rhs.b){
-		return true;
-	}
-	else if (lhs.b > rhs.b){
-		return false;
-	}
-
-
-
-	return lhs.a < rhs.a;
-}
-
-struct babylon_texture{
-	std::string name;
-	bool hasAlpha;
-};
-
-
-struct babylon_material{
-	std::string id;
-	std::string name;
-	bool backFaceCulling;
-	babylon_vector3 ambient;
-	babylon_vector3 diffuse;
-	babylon_vector3 specular;
-	babylon_vector3 emissive;
-	float specularPower;
-	float alpha;
-	std::shared_ptr<babylon_texture> diffuseTexture;
-	std::shared_ptr<babylon_texture> ambientTexture;
-	std::shared_ptr<babylon_texture> opacityTexture;
-	std::shared_ptr<babylon_texture> reflectionTexture;
-	std::shared_ptr<babylon_texture> emissiveTexture;
-	std::shared_ptr<babylon_texture> specularTexture;
-	std::shared_ptr<babylon_texture> bumpTexture;
-
-};
-
-struct babylon_global_settings{
-	bool autoClear;
-	babylon_vector3 clearColor;
-	babylon_vector3 ambientColor;
-	babylon_vector3 gravity;
-	int fogMode;
-	babylon_vector3 fogColor;
-	float fogStart;
-	float fogEnd;
-	float fogDensity;
-	babylon_global_settings(){
-		autoClear = true;
-		clearColor = babylon_vector3(0.2f, 0.2f, 0.3f);
-		ambientColor = babylon_vector3(0.0f, 0.0f, 0.0f);
-		gravity = babylon_vector3(0.0f, 0.0f, -0.9f);
-		fogMode = 0;
-		fogColor = babylon_vector3(0.0f, 0.0f, 0.0f);
-		fogStart = 0;
-		fogEnd = 0;
-		fogDensity = 0;
-	}
-};
-
-struct babylon_camera{
-	std::string name;
-	std::string id;
-	babylon_vector3 position;
-	babylon_vector3 target;
-	babylon_vector3 rotation;
-	float fov;
-	float minZ;
-	float maxZ;
-	float speed;
-	float inertia;
-	bool checkCollisions;
-	bool applyGravity;
-	babylon_vector3 ellipsoid;
-
-
-};
-
-
-
-
-inline void writeVector3(web::json::value& obj, const wchar_t* name, const babylon_vector3& v) {
-	obj[name] = web::json::value::array();
-	obj[name][0] = v.x;
-	obj[name][1] = v.y;
-	obj[name][2] = v.z;
-}inline void writeVector4(web::json::value& obj, const wchar_t* name, const babylon_vector4& v) {
-	obj[name] = web::json::value::array();
-	obj[name][0] = v.x;
-	obj[name][1] = v.y;
-	obj[name][2] = v.z;
-	obj[name][3] = v.w;
-}
-
-inline void writeVector2(web::json::value& obj, const wchar_t* name, const babylon_vector2& v) {
-	obj[name] = web::json::value::array();
-	obj[name][0] = v.x;
-	obj[name][1] = v.y;
-}
-
-inline void writeFbxQuaterntion(web::json::value& obj, const wchar_t* name, const FbxQuaternion& v) {
-	obj[name] = web::json::value::array();
-	obj[name][0] = (float) v[0];
-	obj[name][1] = (float) v[1];
-	obj[name][2] = (float) v[2];
-	obj[name][3] = (float) v[3];
-}
-
-inline void writeVector3IntoStream(web::json::value& array, const babylon_vector3& v) {
-	auto size = array.size();
-	array[size] = v.x;
-	array[size + 1] = v.y;
-	array[size + 2] = v.z;
-}
-inline void writeVector2IntoStream(web::json::value& array, float x, float y) {
-	auto size = array.size();
-	array[size] = x;
-	array[size + 1] = y;
-}
-
-inline void writeMatrix(web::json::value& obj, const wchar_t* name, const FbxMatrix& v) {
-	obj[name] = web::json::value::array();
-	obj[name][0] = v.mData[0][0];
-	obj[name][1] = v.mData[1][0];
-	obj[name][2] = v.mData[2][0];
-	obj[name][3] = v.mData[3][0];
-	obj[name][4] = v.mData[0][1];
-	obj[name][5] = v.mData[1][1];
-	obj[name][6] = v.mData[2][1];
-	obj[name][7] = v.mData[3][1];
-	obj[name][8] = v.mData[0][2];
-	obj[name][9] = v.mData[1][2];
-	obj[name][10] = v.mData[2][2];
-	obj[name][11] = v.mData[3][2];
-	obj[name][12] = v.mData[0][3];
-	obj[name][13] = v.mData[1][3];
-	obj[name][14] = v.mData[2][3];
-	obj[name][15] = v.mData[3][3];
-}

+ 0 - 11
Exporters/FBX/BabylonFbxNative/FbxDeleter.h

@@ -1,11 +0,0 @@
-#pragma once
-#include <fbxsdk.h>
-template <typename T>
-struct FbxBaseDeleter{
-	void operator()(T* fbxObject){
-		fbxObject->Destroy();
-	}
-};
-
-struct FbxManagerDeleter : public FbxBaseDeleter<FbxManager>{};
-struct FbxDeleter : public FbxBaseDeleter<FbxObject>{};

+ 0 - 22
Exporters/FBX/BabylonFbxNative/FbxLoadException.cpp

@@ -1,22 +0,0 @@
-#include "stdafx.h"
-#include "FbxLoadException.h"
-
-
-FbxLoadException::FbxLoadException(const char* message) : std::exception(message)
-{
-}
-
-
-FbxLoadException::~FbxLoadException()
-{
-}
-
-
-UnknownVertexTypeException::UnknownVertexTypeException(const char* message) : std::exception(message)
-{
-}
-
-
-UnknownVertexTypeException::~UnknownVertexTypeException()
-{
-}

+ 0 - 17
Exporters/FBX/BabylonFbxNative/FbxLoadException.h

@@ -1,17 +0,0 @@
-#pragma once
-#include <exception>
-
-class FbxLoadException : public std::exception
-{
-public:
-	explicit FbxLoadException(const char* message);
-	~FbxLoadException();
-};
-
-class UnknownVertexTypeException : public std::exception{
-
-public:
-	explicit UnknownVertexTypeException(const char* message);
-	~UnknownVertexTypeException();
-};
-

+ 0 - 12
Exporters/FBX/BabylonFbxNative/FbxMeshHandler.cpp

@@ -1,12 +0,0 @@
-#include "stdafx.h"
-#include "FbxMeshHandler.h"
-
-
-FbxMeshHandler::FbxMeshHandler()
-{
-}
-
-
-FbxMeshHandler::~FbxMeshHandler()
-{
-}

+ 0 - 8
Exporters/FBX/BabylonFbxNative/FbxMeshHandler.h

@@ -1,8 +0,0 @@
-#pragma once
-class FbxMeshHandler
-{
-public:
-	FbxMeshHandler();
-	~FbxMeshHandler();
-};
-

+ 0 - 56
Exporters/FBX/BabylonFbxNative/FbxSceneLoader.cpp

@@ -1,56 +0,0 @@
-#include "stdafx.h"
-#include "FbxSceneLoader.h"
-#include "FbxLoadException.h"
-#include <vector>
-
-
-void MapNodes(std::map<std::uint64_t, BabylonNode*> map, BabylonNode* node){
-	map[node->uniqueId()] = node;
-	for (auto& child : node->children()){
-		MapNodes(map, &child);
-	}
-}
-
-FbxSceneLoader::FbxSceneLoader(const std::string& filePath) :_scene(nullptr), _filePath(filePath), _fbxMgr(FbxManager::Create())
-{
-	std::unique_ptr<FbxIOSettings, FbxDeleter> iosettings(FbxIOSettings::Create(_fbxMgr.get(), IOSROOT));
-
-	iosettings->SetBoolProp(IMP_FBX_MATERIAL, true);
-	iosettings->SetBoolProp(IMP_FBX_TEXTURE, true);
-	iosettings->SetBoolProp(IMP_FBX_LINK, true);
-	iosettings->SetBoolProp(IMP_FBX_SHAPE, true);
-	iosettings->SetBoolProp(IMP_FBX_GOBO, true);
-	iosettings->SetBoolProp(IMP_FBX_ANIMATION, true);
-	iosettings->SetBoolProp(IMP_SKINS, true);
-	iosettings->SetBoolProp(IMP_DEFORMATION, true);
-	iosettings->SetBoolProp(IMP_FBX_GLOBAL_SETTINGS, true);
-	iosettings->SetBoolProp(IMP_TAKE, true);
-	_fbxMgr->SetIOSettings(iosettings.get());
-
-	std::unique_ptr<FbxImporter, FbxDeleter> importer(FbxImporter::Create(_fbxMgr.get(), "SceneImporter"));
-	if (!importer->Initialize(_filePath.c_str())){
-		throw FbxLoadException(importer->GetStatus().GetErrorString());
-	}
-	_scene = FbxScene::Create(_fbxMgr.get(), filePath.c_str());
-	importer->Import(_scene);
-
-	
-	
-	_rootNode = std::make_unique<BabylonNode>(_scene->GetRootNode());
-	MapNodes(_nodesMap, _rootNode.get());
-}
-
-
-
-FbxSceneLoader::~FbxSceneLoader()
-{
-	_scene->Destroy(true);
-}
-
-
-babylon_global_settings FbxSceneLoader::getGlobalSettings(){
-	babylon_global_settings result;
-	auto& settings = _scene->GetGlobalSettings();
-	
-	return result;
-}

+ 0 - 61
Exporters/FBX/BabylonFbxNative/FbxSceneLoader.h

@@ -1,61 +0,0 @@
-#pragma once
-#include "FbxDeleter.h"
-#include <fbxsdk.h>
-#include <string>
-#include <vector>
-#include <memory>
-#include "BabylonNode.h"
-#include "BabylonVertex.h"
-#include <map>
-
-class FbxSceneLoader
-{
-private:
-	std::string _filePath;
-	std::unique_ptr<FbxManager, FbxManagerDeleter> _fbxMgr;
-	FbxScene* _scene;
-	std::unique_ptr<BabylonNode> _rootNode;
-	std::map<std::uint64_t, BabylonNode*> _nodesMap;
-public:
-	FbxSceneLoader(const std::string& filePath);
-	~FbxSceneLoader();
-	FbxScene* getScene(){
-		
-		return _scene;
-	}
-
-	BabylonNode* rootNode() const{
-		return _rootNode.get();
-	}
-
-	std::map<std::uint64_t, BabylonNode*>& getNodeMap(){
-		return _nodesMap;
-	}
-
-	
-	FbxScene* getScene() const{
-		return _scene;
-	}
-	FbxCamera* GetDefaultCamera() const{
-		const int nodeCount = _scene->GetSrcObjectCount<FbxNode>();
-
-		for (int index = 0; index < nodeCount; index++)
-		{
-			auto node = _scene->GetSrcObject<FbxNode>(index);
-			auto camera = node->GetCamera();
-			if (!camera){
-				// not a geometry node, go to next
-				continue;
-			}
-			return camera;
-			// ignore skinned meshes
-			/*if (mesh->GetDeformerCount(FbxDeformer::eSkin) == 0){
-			this->_meshes.push_back(mesh);
-			}*/
-
-		}
-		return nullptr;
-	}
-	babylon_global_settings getGlobalSettings();
-};
-

+ 0 - 13
Exporters/FBX/BabylonFbxNative/GlobalSettings.cpp

@@ -1,13 +0,0 @@
-#include "stdafx.h"
-#include "GlobalSettings.h"
-
-
-
-GlobalSettings::GlobalSettings()
-{
-}
-
-GlobalSettings& GlobalSettings::Current(){
-	static GlobalSettings settings;
-	return settings;
-}

+ 0 - 17
Exporters/FBX/BabylonFbxNative/GlobalSettings.h

@@ -1,17 +0,0 @@
-#pragma once
-#include <cstdint>
-#include <fbxsdk.h>
-
-class GlobalSettings
-{
-private:
-
-	GlobalSettings();
-public:
-	FbxTime::EMode AnimationsTimeMode = FbxTime::eFrames24;
-	double AnimationsFrameRate(){
-		return FbxTime::GetFrameRate(AnimationsTimeMode);
-	}
-	std::uint32_t AnimStackIndex = 0;
-	static GlobalSettings& Current();
-};

+ 0 - 33
Exporters/FBX/BabylonFbxNative/MatrixDecomposition.h

@@ -1,33 +0,0 @@
-#pragma once
-#include <fbxsdk.h>
-#include "BabylonVertex.h"
-class MatrixDecomposition
-{
-	babylon_vector3 _trans;
-	babylon_vector4 _quat;
-	babylon_vector3 _scaling;
-
-	FbxVector4 _fbxtrans;
-	FbxQuaternion _fbxrot;
-	FbxVector4 _fbxshearing;
-	FbxVector4 _fbxscaling;
-public:
-	const babylon_vector3& translation() { return _trans; }
-	const babylon_vector4& rotationQuaternion() { return _quat; }
-	const babylon_vector3& scaling() { return _scaling; }
-
-
-	const FbxVector4& fbxtrans() { return _fbxtrans; };
-	const FbxQuaternion& fbxrot() { return _fbxrot; };
-	const FbxVector4& fbxshearing() { return _fbxshearing; };
-	const FbxVector4& fbxscaling() { return _fbxscaling; };
-	MatrixDecomposition(const FbxMatrix& mat){
-		
-		double sign;
-		mat.GetElements(_fbxtrans, _fbxrot, _fbxshearing, _fbxscaling, sign);
-		_trans = _fbxtrans;
-		_quat = _fbxrot;
-		_scaling = _fbxscaling;
-	}
-};
-

+ 0 - 45
Exporters/FBX/BabylonFbxNative/NodeHelpers.h

@@ -1,45 +0,0 @@
-#pragma once
-#include <string>
-#include <sstream>
-#include <fbxsdk.h>
-#include <DirectXMath.h>
-
-inline std::wstring getNodeId(FbxNode* node) {
-	auto nId = node->GetUniqueID();
-	std::wstringstream strstream;
-	strstream << nId;
-	auto name = node->GetName();
-	if (name) {
-		strstream << L"_" << name;
-	}
-	return strstream.str();
-}
-
-const double Euler2Rad = 3.141592653589793238462 / 180;
-
-inline FbxMatrix GetGeometryTransformation(FbxNode* inNode)
-{
-	if (!inNode)
-	{
-		throw std::exception("Null for mesh geometry");
-	}
-
-	const FbxVector4 lT = inNode->GetGeometricTranslation(FbxNode::eSourcePivot);
-	const FbxVector4 lR = inNode->GetGeometricRotation(FbxNode::eSourcePivot);
-	const FbxVector4 lS = inNode->GetGeometricScaling(FbxNode::eSourcePivot);
-
-	return FbxMatrix(lT, lR, lS);
-}
-
-inline FbxMatrix ConvertToBabylonCoordinateSystem(const FbxMatrix& origin){
-	FbxVector4 trans;
-	FbxQuaternion rot;
-	FbxVector4 shearing;
-	FbxVector4 scaling;
-	double sign;
-	origin.GetElements(trans, rot, shearing, scaling, sign);
-	trans[2] = -trans[2]; // This negate Z of Translation Component of the matrix
-	rot[0] = -rot[0];
-	rot[1] = -rot[1];
-	return FbxMatrix (trans, rot, scaling);
-}

+ 0 - 37
Exporters/FBX/BabylonFbxNative/ReadMe.txt

@@ -1,37 +0,0 @@
-========================================================================
-    STATIC LIBRARY : BabylonFbxNative Project Overview
-========================================================================
-
-AppWizard has created this BabylonFbxNative library project for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your BabylonFbxNative application.
-
-
-BabylonFbxNative.vcxproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-BabylonFbxNative.vcxproj.filters
-    This is the filters file for VC++ projects generated using an Application Wizard. 
-    It contains information about the association between the files in your project 
-    and the filters. This association is used in the IDE to show grouping of files with
-    similar extensions under a specific node (for e.g. ".cpp" files are associated with the
-    "Source Files" filter).
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named BabylonFbxNative.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

+ 0 - 227
Exporters/FBX/BabylonFbxNative/SkinInfo.cpp

@@ -1,227 +0,0 @@
-#include "stdafx.h"
-#include <iostream>
-#include "SkinInfo.h"
-#include "NodeHelpers.h"
-#include "GlobalSettings.h"
-
-void ComputeBoneHierarchy(const std::vector<FbxNode*>& unsortedFlatListOfNodes,
-	const std::vector<FbxCluster*>& unsortedFlatListOfClusters,
-	std::vector<BoneInfo>& output, std::map<int, int>& clusterIndexToBoneIndex, std::map<int, std::vector<BoneIndexAndWeight>>& controlPointsData, FbxNode* currentRoot = nullptr, int currentRootIndex = -1){
-	for (auto ix = 0u; ix < unsortedFlatListOfNodes.size(); ++ix){
-		auto node = unsortedFlatListOfNodes[ix];
-		auto nodeParent = node->GetParent();
-		if (currentRoot == nullptr){
-			// node is a match if its parent is not in the flat list
-			auto foundParent = std::find(unsortedFlatListOfNodes.begin(), unsortedFlatListOfNodes.end(), nodeParent);
-			if (foundParent != unsortedFlatListOfNodes.end()){
-				continue;
-			}
-		}
-		else{
-			// node is a match if its parent is current root
-			if (currentRoot != nodeParent){
-				continue;
-			}
-		}
-
-		// create boneInfo
-		BoneInfo info;
-		info.cluster = unsortedFlatListOfClusters[ix];
-		info.FbxClusterIndex = ix;
-		info.linkNode = unsortedFlatListOfNodes[ix];
-		info.parentBoneIndex = currentRootIndex;
-		info.name = getNodeId(node);
-		auto boneIndex = static_cast<int>(output.size());
-		output.push_back(info);
-		clusterIndexToBoneIndex[ix] = boneIndex;
-
-		auto controlledPointsCount = info.cluster->GetControlPointIndicesCount();
-		for (auto cpIndex = 0; cpIndex < controlledPointsCount; ++cpIndex){
-			auto controlPoint = info.cluster->GetControlPointIndices()[cpIndex];
-			auto weight = info.cluster->GetControlPointWeights()[cpIndex];
-			BoneIndexAndWeight biw;
-			biw.index = boneIndex;
-			biw.weight = weight;
-			controlPointsData[controlPoint].push_back(biw);
-		}
-		// recursively parse children
-		ComputeBoneHierarchy(unsortedFlatListOfNodes, unsortedFlatListOfClusters, output, clusterIndexToBoneIndex, controlPointsData, node, static_cast<int>(boneIndex));
-	}
-}
-FbxAMatrix NotDecomposedMultiply(const FbxAMatrix& lhs, const FbxAMatrix& rhs){
-	FbxMatrix matL(lhs);
-	FbxMatrix matR(rhs);
-	auto result = matL*matR;
-	return *(FbxAMatrix*) (double*) &result;
-}
-//FbxAMatrix ComputeTotalMatrix(FbxNode* node, FbxTime time = FBXSDK_TIME_INFINITE){
-//
-//}
-SkinInfo::SkinInfo(FbxNode* meshNode) :
-_node(meshNode), _mesh(meshNode->GetMesh()), _skin(nullptr)
-{
-	int deformerCount = _mesh->GetDeformerCount();
-	for (auto ix = 0; ix < deformerCount; ++ix){
-		auto skin = reinterpret_cast<FbxSkin*>(_mesh->GetDeformer(ix, FbxDeformer::eSkin));
-		if (skin){
-			_skin = skin;
-			break;
-		}
-	}
-	if (!_skin){
-		return;
-	}
-
-	std::vector<FbxPose*> bindPoses;
-	auto poseCount = _node->GetScene()->GetPoseCount();
-	for (auto ix = 0; ix < poseCount; ++ix){
-		auto pose = _node->GetScene()->GetPose(ix);
-		if (pose->IsBindPose()){
-			bindPoses.push_back(pose);
-		}
-	}
-
-	std::vector<FbxNode*> unsortedFlatListOfNodes;
-	std::vector<FbxCluster*> unsortedFlatListOfClusters;
-	auto clusterCount = _skin->GetClusterCount();
-	for (auto ix = 0; ix < clusterCount; ++ix){
-		auto cluster = _skin->GetCluster(ix);
-		if (!cluster)
-		{
-			std::cout << "Invalid skin" << std::endl;
-			_skin = nullptr;
-			return;
-		}
-		auto linkNode = cluster->GetLink();
-		if (!linkNode){
-			std::cout << "Invalid skin" << std::endl;
-			_skin = nullptr;
-			return;
-		}
-		unsortedFlatListOfClusters.push_back(cluster);
-		unsortedFlatListOfNodes.push_back(linkNode);
-	}
-
-	ComputeBoneHierarchy(unsortedFlatListOfNodes, unsortedFlatListOfClusters, _bones, _fbxClusterIndexToBoneIndex, _controlPointToBoneIndicesAndWeights);
-	auto deformType = _skin->GetDeformerType();
-
-	auto geometryTransform = GetGeometryTransformation(meshNode);
-	// compute all bones global inverse and global matrix
-	for (auto& bone : _bones){
-		FbxAMatrix transformMatrix;
-		FbxAMatrix transformLinkMatrix;
-		FbxMatrix globalBindposeInverseMatrix;
-
-		bone.cluster->GetTransformMatrix(transformMatrix);	// The transformation of the mesh at binding time
-		bone.cluster->GetTransformLinkMatrix(transformLinkMatrix);	// The transformation of the cluster(joint) at binding time from joint space to world space
-		/*for (auto pose : bindPoses){
-			auto inPoseIndex = pose->Find(bone.linkNode);
-			if (inPoseIndex >= 0){
-				auto tempMat = pose->GetMatrix(inPoseIndex);
-				transformLinkMatrix = *(FbxAMatrix*) (double*) &tempMat;
-				break;
-			}
-		}*/
-		globalBindposeInverseMatrix = FbxMatrix(transformLinkMatrix.Inverse()) * FbxMatrix(transformMatrix) * geometryTransform;
-
-
-		bone.matrixGlobalBindPose = ConvertToBabylonCoordinateSystem(globalBindposeInverseMatrix.Inverse());
-	
-
-		if (bone.parentBoneIndex == -1){
-			bone.matrixLocalBindPose = bone.matrixGlobalBindPose;
-		}
-		else{
-			bone.matrixLocalBindPose =
-				_bones[bone.parentBoneIndex].matrixGlobalBindPose.Inverse()* bone.matrixGlobalBindPose;
-			
-		}
-	}
-
-
-	// compute anim
-	auto animStack = _node->GetScene()->GetCurrentAnimationStack();
-	FbxString animStackName = animStack->GetName();
-	//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
-	auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
-	auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
-	auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
-	auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
-	auto animLengthInFrame = endFrame - startFrame + 1;
-
-
-	for (auto ix = 0; ix < animLengthInFrame; ix++){
-		FbxTime currTime;
-		currTime.SetFrame(startFrame + ix, animTimeMode);
-
-
-		auto currTransformOffset = FbxMatrix(meshNode->EvaluateGlobalTransform(currTime)) * geometryTransform;
-		auto currTransformOffsetInverse = currTransformOffset.Inverse();
-
-		// compute global transform and local
-		for (auto& bone : _bones){
-			BoneAnimKeyFrame kf;
-			kf.frame = ix;
-			kf.matrixGlobal = ConvertToBabylonCoordinateSystem(currTransformOffsetInverse*bone.linkNode->EvaluateGlobalTransform(currTime));
-			
-
-
-			if (bone.parentBoneIndex == -1){
-				kf.matrixLocal = kf.matrixGlobal;
-			}
-			else{
-				auto& parentBone = _bones[bone.parentBoneIndex];
-				
-				kf.matrixLocal = //bone.matrixLocalBindPose;
-					parentBone.keyFrames[parentBone.keyFrames.size() - 1].matrixGlobal.Inverse()* kf.matrixGlobal;
-
-			}
-
-
-			bone.keyFrames.push_back(kf);
-		}
-
-	}
-}
-
-
-void SkinInfo::buildBabylonSkeleton(BabylonSkeleton& skel){
-	if (!hasSkin()){
-		return;
-	}
-	skel.name = getNodeId(_node) + L"_skeleton";
-	for (auto& b : _bones){
-		BabylonBone babbone;
-		babbone.index = static_cast<int>(skel.bones.size());
-		//babbone.matrix = ConvertToBabylonCoordinateSystem( b.matrixLocalBindPose);
-		babbone.matrix = b.matrixLocalBindPose;
-		babbone.name = b.name;
-		babbone.parentBoneIndex = b.parentBoneIndex;
-
-		auto animStack = _node->GetScene()->GetCurrentAnimationStack();
-		FbxString animStackName = animStack->GetName();
-		//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
-		auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
-		auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
-		auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
-		auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
-		auto animLengthInFrame = endFrame - startFrame + 1;
-
-		auto matrixAnim = std::make_shared<BabylonAnimation<FbxMatrix>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"_matrix", L"_matrix", true, 0, static_cast<int>(animLengthInFrame), true);
-		for (auto& kf : b.keyFrames){
-
-			babylon_animation_key<FbxMatrix> key;
-			key.frame = kf.frame;
-			//key.values = ConvertToBabylonCoordinateSystem(kf.matrixLocal);
-			key.values = kf.matrixLocal;
-			matrixAnim->appendKey(key);
-		}
-
-		babbone.animation = matrixAnim;
-
-
-		skel.bones.push_back(babbone);
-	}
-}
-
-

+ 0 - 79
Exporters/FBX/BabylonFbxNative/SkinInfo.h

@@ -1,79 +0,0 @@
-#pragma once
-#include <fbxsdk.h>
-#include <memory>
-#include <vector>
-#include <map>
-#include <string>
-#include "BabylonSkeleton.h"
-
-struct BoneAnimKeyFrame{
-	int frame;
-	FbxMatrix matrixLocal;
-	FbxMatrix matrixGlobal;
-};
-struct BoneInfo{
-	FbxNode*  linkNode;
-	FbxCluster* cluster;
-	int FbxClusterIndex;
-	int parentBoneIndex;
-	std::wstring name;
-
-	FbxMatrix matrixGlobalBindPose;
-	FbxMatrix matrixLocalBindPose;
-	std::vector<BoneAnimKeyFrame> keyFrames;
-	BoneInfo(const BoneInfo&) = default;
-	BoneInfo(BoneInfo&& moved) :
-		linkNode(std::move(moved.linkNode)),
-		cluster(std::move(moved.cluster)),
-		FbxClusterIndex(std::move(moved.FbxClusterIndex)),
-		parentBoneIndex(std::move(moved.parentBoneIndex)),
-		name(std::move(moved.name)),
-		matrixGlobalBindPose(std::move(moved.matrixGlobalBindPose)),
-		matrixLocalBindPose(std::move(moved.matrixLocalBindPose)),
-		keyFrames(std::move(moved.keyFrames))
-	{
-	}
-	BoneInfo() = default;
-};
-
-struct BoneIndexAndWeight{
-	int index;
-	double weight;
-};
-
-class SkinInfo
-{
-private:
-	FbxNode* _node;
-	FbxMesh* _mesh;
-	FbxSkin* _skin;
-	std::vector<BoneInfo> _bones;
-	std::map<int, int> _fbxClusterIndexToBoneIndex;
-	std::map<int, std::vector<BoneIndexAndWeight>> _controlPointToBoneIndicesAndWeights;
-	
-public:
-	SkinInfo(FbxNode* meshNode);
-
-	SkinInfo(const SkinInfo&) = default;
-	SkinInfo(SkinInfo&& moved) : 
-		_node(std::move(moved._node)),
-		_mesh(std::move(moved._mesh)),
-		_skin(std::move(moved._skin)),
-		_bones(std::move(moved._bones)),
-		_fbxClusterIndexToBoneIndex(std::move(moved._fbxClusterIndexToBoneIndex)),
-		_controlPointToBoneIndicesAndWeights(std::move(moved._controlPointToBoneIndicesAndWeights))
-	{}
-	bool hasSkin() const{
-		return _skin != nullptr;
-	}
-	const std::vector<BoneIndexAndWeight>& controlPointBoneIndicesAndWeights(int cpIndex)const {
-		return _controlPointToBoneIndicesAndWeights.find(cpIndex)->second;
-	}
-
-	int bonesCount() const{
-		return static_cast<int>( _bones.size());
-	}
-
-	void buildBabylonSkeleton(BabylonSkeleton& skel);
-};
-

+ 0 - 21
Exporters/FBX/BabylonFbxNative/StringUtils.h

@@ -1,21 +0,0 @@
-#pragma once
-#include <string>
-#include <Windows.h>
-
-inline std::string wstringToUtf8(const std::wstring& src) {
-	auto size = WideCharToMultiByte(CP_UTF8, 0, src.c_str(), static_cast<int>(src.size()), nullptr, 0, nullptr, nullptr);
-	std::string result;
-	result.resize(size, ' ');
-	WideCharToMultiByte(CP_UTF8, 0, src.c_str(), static_cast<int>(src.size()), &result[0], size, nullptr, nullptr);
-	return result;
-}
-
-
-
-inline std::wstring utf8ToWstring(const std::string& src) {
-	auto size = MultiByteToWideChar(CP_UTF8, 0, src.c_str(), static_cast<int>(src.size()), nullptr, 0);
-	std::wstring result;
-	result.resize(size, ' ');
-	MultiByteToWideChar(CP_UTF8, 0, src.c_str(), static_cast<int>(src.size()), &result[0], size);
-	return result;
-}

+ 0 - 50
Exporters/FBX/BabylonFbxNative/babylon_boundingbox.cpp

@@ -1,50 +0,0 @@
-#include "stdafx.h"
-#include "BabylonVertex.h"
-#include <numeric>
-#include <algorithm>
-#include "BabylonCamera.h"
-
-
-babylon_boundingbox::babylon_boundingbox()
-	: _minX(std::numeric_limits<float>::max()),
-	  _minY(std::numeric_limits<float>::max()),
-	  _minZ(std::numeric_limits<float>::max()),
-	  _maxX(std::numeric_limits<float>::min()),
-	  _maxY(std::numeric_limits<float>::min()),
-	  _maxZ(std::numeric_limits<float>::min())
-{
-}
-
-
-babylon_boundingbox::babylon_boundingbox(FbxScene* scene){
-	FbxVector4 vmin, vmax, vcenter;
-	scene->ComputeBoundingBoxMinMaxCenter(vmin, vmax, vcenter);
-	_minX = static_cast<float>(vmin[0]);
-	_minY = static_cast<float>(vmin[1]);
-	_minZ = static_cast<float>(vmin[2]);
-	_maxX = static_cast<float>(vmax[0]);
-	_maxY = static_cast<float>(vmax[1]);
-	_maxZ = static_cast<float>(vmax[2]);
-
-}
-void babylon_boundingbox::addPosition(float x, float y, float z){
-	_minX = std::min(x, _minX);
-	_minY = std::min(y, _minY);
-	_minZ = std::min(z, _minZ);
-
-	_maxX = std::max(x, _maxX);
-	_maxY = std::max(y, _maxY);
-	_maxZ = std::max(z, _maxZ);
-}
-
-babylon_boundingbox::~babylon_boundingbox()
-{
-}
-babylon_boundingbox mergeBoundingBoxes(const std::vector<babylon_boundingbox>& boxes){
-	babylon_boundingbox result;
-	for (const auto& b : boxes){
-		result.addPosition(b.getMin());
-		result.addPosition(b.getMax());
-	}
-	return result;
-}

+ 0 - 11
Exporters/FBX/BabylonFbxNative/packages.config

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="cpprestsdk" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-</packages>

+ 0 - 8
Exporters/FBX/BabylonFbxNative/stdafx.cpp

@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// BabylonFbxNative.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file

+ 0 - 18
Exporters/FBX/BabylonFbxNative/stdafx.h

@@ -1,18 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
-
-#include <fbxsdk.h>
-#include <string>
-#include <memory>
-
-
-
-// TODO: reference additional headers your program requires here

+ 0 - 8
Exporters/FBX/BabylonFbxNative/targetver.h

@@ -1,8 +0,0 @@
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>

+ 0 - 179
Exporters/FBX/FbxExporter/FbxExporter.cpp

@@ -1,179 +0,0 @@
-// FbxExporter.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include "..\BabylonFbxNative\FbxSceneLoader.h"
-#include <iostream>
-#include <fstream>
-#include <Windows.h>
-#include <string>
-#include <sstream>
-#include "..\BabylonFbxNative\BabylonScene.h"
-#include "..\BabylonFbxNative\GlobalSettings.h"
-#include "..\BabylonFbxNative\StringUtils.h"
-
-
-
-
-void exportTexture(const std::shared_ptr<BabylonTexture>& tex, const std::wstring& wOutputPath){
-	if (!tex){
-		return;
-	}
-	auto fullPath = tex->fullPath;
-	for (;;){
-		auto indexOfSlash = fullPath.find(L'/');
-		if (indexOfSlash == fullPath.npos){
-			break;
-		}
-		fullPath[indexOfSlash] = L'\\';
-	}
-	auto outputPath = tex->name;
-	for (;;){
-		auto indexOfSlash = outputPath.find(L'/');
-		if (indexOfSlash == outputPath.npos){
-			break;
-		}
-		outputPath[indexOfSlash] = L'\\';
-	}
-	size_t start = 0;
-	for (;;){
-		auto indexOfSlash = outputPath.find(L'\\', start);
-		if (indexOfSlash == outputPath.npos){
-			break;
-		}
-		auto pathToCreate = wOutputPath;
-		if (pathToCreate[pathToCreate.size() - 1] != L'\\'){
-			pathToCreate.push_back(L'\\');
-		}
-		pathToCreate.append(outputPath.begin(), outputPath.begin() + indexOfSlash);
-		CreateDirectory(pathToCreate.c_str(), nullptr);
-		start = indexOfSlash + 1;
-	}
-	auto fullOutputPath = wOutputPath;
-	if (fullOutputPath[fullOutputPath.size() - 1] != L'\\'){
-		fullOutputPath.push_back(L'\\');
-	}
-	fullOutputPath.append(outputPath);
-	CopyFile(fullPath.c_str(), fullOutputPath.c_str(), false);
-}
-
-int _tmain(int argc, _TCHAR* argv[])
-{
-	std::wcout << L"version : 2015.09.14" << std::endl;
-	std::wcout << L"Usage : FbxExporter <path to fbx file> <outdir> [/fps:60|30|24] [/skipemptynodes] [/animstack:\"animstack name\"]" << std::endl;
-	if (argc < 3) {
-		std::wcerr << L"Invalid argument count" << std::endl;
-		return -1;
-	}
-	std::wstring wInputPath(argv[1]);
-	std::wstring wInputDir(argv[1]);
-	std::wstring wInputFileName(argv[1]);
-	auto lastDirSeparator = wInputDir.find_last_of(L'\\');
-	if (lastDirSeparator == wInputDir.npos) {
-		wInputDir = L".";
-	}
-	else {
-		wInputDir.erase(lastDirSeparator);
-		wInputFileName.erase(0, lastDirSeparator + 1);
-	}
-	std::wstring wOutputPath(argv[2]);
-	CreateDirectory(wOutputPath.c_str(), nullptr);
-	bool skipEmptyNodes = false;
-	std::wstring animStackName;
-	for (int i = 3; i < argc; ++i){
-		std::wstring warg = argv[i];
-		if (warg == L"/skipemptynodes") {
-			skipEmptyNodes = true;
-		}
-		else if (warg.find(L"/fps:") == 0){
-			if (warg == L"/fps:60"){
-				GlobalSettings::Current().AnimationsTimeMode = FbxTime::EMode::eFrames60;
-			}
-			else if (warg == L"/fps:30"){
-				GlobalSettings::Current().AnimationsTimeMode = FbxTime::EMode::eFrames30;
-			}
-			else if (warg == L"/fps:24"){
-				GlobalSettings::Current().AnimationsTimeMode = FbxTime::EMode::eFrames24;
-			}
-			else{
-				std::wcerr << L"Unrecognized fps parameter" << std::endl;
-				return -2;
-			}
-		}
-		else if (warg.find(L"/animstack:") == 0) {
-			animStackName = warg.substr(11);
-			
-			if (animStackName.size()>0 && animStackName[0] == L'\"') {
-				animStackName.erase(0, 1);
-			}
-			if (animStackName.size() > 0 && animStackName[animStackName.size() - 1] == L'\"') {
-				animStackName.erase(animStackName.size() - 1, 1);
-			}
-		}
-		
-	}
-	
-
-	FbxSceneLoader sceneLoader(wstringToUtf8(wInputPath));
-	auto animStackCount = sceneLoader.getScene()->GetSrcObjectCount<FbxAnimStack>();
-	if (animStackName.size() == 0) {
-		GlobalSettings::Current().AnimStackIndex = 0;
-	}
-	else {
-		for (auto ix = 0; ix < animStackCount; ++ix) {
-			auto animStack = sceneLoader.getScene()->GetSrcObject<FbxAnimStack>(ix);
-			if (utf8ToWstring(animStack->GetName()) == animStackName) {
-				GlobalSettings::Current().AnimStackIndex = ix;
-			}
-		}
-	}
-	std::wcout << L"Animation stacks : " << std::endl;
-	for (auto ix = 0; ix < animStackCount; ++ix) {
-		auto animStack = sceneLoader.getScene()->GetSrcObject<FbxAnimStack>(ix);
-		if (ix == GlobalSettings::Current().AnimStackIndex) {
-			std::wcout << L"[X] ";
-			sceneLoader.getScene()->SetCurrentAnimationStack(animStack);
-		}
-		else {
-			std::wcout << L"[ ] ";
-		}
-		
-		std::wcout << utf8ToWstring(animStack->GetName());
-		auto ts=animStack->GetLocalTimeSpan();
-		auto start = ts.GetStart();
-		auto stop = ts.GetStop();
-		std::wcout << L"(" << start.GetMilliSeconds() << L" - " << stop.GetMilliSeconds() << L")" << std::endl;
-	}
-
-	auto root = sceneLoader.rootNode();
-
-	BabylonScene babScene(*root, skipEmptyNodes);
-
-	for (auto& mat : babScene.materials()){
-		exportTexture(mat.ambientTexture, wOutputPath);
-		exportTexture(mat.diffuseTexture, wOutputPath);
-		exportTexture(mat.specularTexture, wOutputPath);
-		exportTexture(mat.emissiveTexture, wOutputPath);
-		exportTexture(mat.reflectionTexture, wOutputPath);
-		exportTexture(mat.bumpTexture, wOutputPath);
-		
-	}
-	
-	
-
-	auto json = babScene.toJson();
-	if (L'\\' != *wOutputPath.crbegin()) {
-		wOutputPath.append(L"\\");
-	}
-	wOutputPath.append(wInputFileName);
-
-	auto lastDot = wOutputPath.find_last_of(L'.');
-	wOutputPath.erase(lastDot);
-	wOutputPath.append(L".babylon");
-	DeleteFile(wOutputPath.c_str());
-	std::ofstream stream(wOutputPath);
-	json.serialize(stream);
-	stream.flush();
-	return 0;
-}
-

+ 0 - 207
Exporters/FBX/FbxExporter/FbxExporter.vcxproj

@@ -1,207 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{DF8C65DD-1E5C-44BE-8FD2-457C72AA46FC}</ProjectGuid>
-    <SccProjectName>SAK</SccProjectName>
-    <SccAuxPath>SAK</SccAuxPath>
-    <SccLocalPath>SAK</SccLocalPath>
-    <SccProvider>SAK</SccProvider>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>FbxExporter</RootNamespace>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
-    <RestorePackages>true</RestorePackages>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-    <Import Project="..\packages\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.targets')" />
-    <Import Project="..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x86\debug;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x86\release;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x64\debug;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x64\release;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Text Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h" />
-    <ClInclude Include="targetver.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="FbxExporter.cpp" />
-    <ClCompile Include="stdafx.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\BabylonFbxNative\BabylonFbxNative.vcxproj">
-      <Project>{6c145cfb-31ac-4b28-8b74-26680d26a6e3}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn.targets'))" />
-    <Error Condition="!Exists('..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.6.0\build\native\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
-  </Target>
-</Project>

+ 0 - 39
Exporters/FBX/FbxExporter/FbxExporter.vcxproj.filters

@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <Text Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="targetver.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="FbxExporter.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-</Project>

+ 0 - 40
Exporters/FBX/FbxExporter/ReadMe.txt

@@ -1,40 +0,0 @@
-========================================================================
-    CONSOLE APPLICATION : FbxExporter Project Overview
-========================================================================
-
-AppWizard has created this FbxExporter application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your FbxExporter application.
-
-
-FbxExporter.vcxproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-FbxExporter.vcxproj.filters
-    This is the filters file for VC++ projects generated using an Application Wizard. 
-    It contains information about the association between the files in your project 
-    and the filters. This association is used in the IDE to show grouping of files with
-    similar extensions under a specific node (for e.g. ".cpp" files are associated with the
-    "Source Files" filter).
-
-FbxExporter.cpp
-    This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named FbxExporter.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

+ 0 - 11
Exporters/FBX/FbxExporter/packages.config

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="cpprestsdk" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.winapp.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.windesktop.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.winphone.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.winphonesl.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v120.winxp.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v140.winapp.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-  <package id="cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn" version="2.6.0" targetFramework="native" userInstalled="true" />
-</packages>

+ 0 - 8
Exporters/FBX/FbxExporter/stdafx.cpp

@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// FbxExporter.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file

+ 0 - 15
Exporters/FBX/FbxExporter/stdafx.h

@@ -1,15 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include <stdio.h>
-#include <tchar.h>
-
-
-
-// TODO: reference additional headers your program requires here

+ 0 - 8
Exporters/FBX/FbxExporter/targetver.h

@@ -1,8 +0,0 @@
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>

+ 0 - 11
Exporters/FBX/FbxRerouteSkeleton/FbxDeleter.h

@@ -1,11 +0,0 @@
-#pragma once
-#include <fbxsdk.h>
-template <typename T>
-struct FbxBaseDeleter{
-	void operator()(T* fbxObject){
-		fbxObject->Destroy();
-	}
-};
-
-struct FbxManagerDeleter : public FbxBaseDeleter<FbxManager>{};
-struct FbxDeleter : public FbxBaseDeleter<FbxObject>{};

+ 0 - 274
Exporters/FBX/FbxRerouteSkeleton/FbxRerouteSkeleton.cpp

@@ -1,274 +0,0 @@
-// FbxRerouteSkeleton.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include <fbxsdk.h>
-#include <iostream>
-#include <string>
-#include <vector>
-#include <Windows.h>
-#include <map>
-#include "FbxDeleter.h"
-#include <memory>
-
-std::string wstringToUtf8(const std::wstring& src){
-	auto size = WideCharToMultiByte(CP_UTF8, 0, src.c_str(), static_cast<int>(src.size()), nullptr, 0, nullptr, nullptr);
-	std::string result;
-	result.resize(size, ' ');
-	WideCharToMultiByte(CP_UTF8, 0, src.c_str(), static_cast<int>(src.size()), &result[0], size, nullptr, nullptr);
-	return result;
-}
-
-void populateNodeMap(std::map<std::string, FbxNode*>& m, FbxNode* currNode){
-	if (currNode == nullptr){
-		return;
-	}
-	m[currNode->GetName()] = currNode;
-	auto mesh = currNode->GetMesh();
-	if (mesh) {
-		currNode->SetNodeAttribute(nullptr);
-	}
-	for (auto ix = 0; ix < currNode->GetChildCount(); ++ix){
-		populateNodeMap(m, currNode->GetChild(ix));
-	}
-}
-
-struct ScopedScene{
-	FbxScene* scene = nullptr;
-	ScopedScene(FbxManager* mgr) :scene(FbxScene::Create(mgr, "TempScene")){}
-	~ScopedScene(){
-		if (scene){
-			scene->Destroy(true);
-		}
-	}
-};
-
-void DeepClone(FbxNode* n, FbxNode* container){
-	auto cloned = n->Clone(FbxObject::ECloneType::eDeepClone, container);
-	for (auto ix = 0; ix < n->GetChildCount(); ++ix){
-		DeepClone(n->GetChild(ix), (FbxNode*) cloned);
-	}
-}
-
-void importAdditionalFile(FbxScene* globalScene, FbxImporter* importer, const std::string& file){
-	importer->Initialize(file.c_str());
-	ScopedScene tempScene(globalScene->GetFbxManager());
-	importer->Import(tempScene.scene);
-	auto tempRootNode = tempScene.scene->GetRootNode();
-
-	std::vector<FbxNode*> childrenToMove;
-	int lNumChildren = tempRootNode->GetChildCount();
-	for (int i = 0; i < lNumChildren; i++) {
-
-		// Obtain a child node from the currently loaded scene.
-		FbxNode* lChildNode = tempRootNode->GetChild(i);
-
-		if (lChildNode){
-			childrenToMove.push_back(lChildNode);
-		}
-	}
-	for (auto item : childrenToMove){
-		//DeepClone(item, globalScene->GetRootNode());
-		globalScene->GetRootNode()->AddChild(item);
-	}
-
-	// Remove the children from the root node.
-	tempScene.scene->GetRootNode()->DisconnectAllSrcObject();
-
-
-	std::vector<FbxObject* > objsToMove;
-	// Move other objects to the reference scene.
-	int lNumSceneObjects = tempScene.scene->GetSrcObjectCount();
-	for (int i = 0; i < lNumSceneObjects; i++) {
-		FbxObject* lObj = tempScene.scene->GetSrcObject(i);
-		auto isAnimStack = lObj->GetClassId() == FbxAnimStack::ClassId;
-		if (lObj == tempScene.scene->GetRootNode() || *lObj == tempScene.scene->GetGlobalSettings() || isAnimStack){
-			// Don't move the root node or the scene's global settings; these
-			// objects are created for every scene.
-			continue;
-		}
-
-		objsToMove.push_back(lObj);
-	}
-
-	for (auto obj : objsToMove){
-		obj->ConnectDstObject(globalScene);
-	}
-
-	tempScene.scene->DisconnectAllSrcObject();
-}
-
-void patchSkins(FbxNode* currentRoot, const std::map<std::string, FbxNode*>& animatedNodes, const std::string& prefix){
-	auto mesh = currentRoot->GetMesh();
-	if (mesh){
-		auto skinCount = mesh->GetDeformerCount(FbxDeformer::EDeformerType::eSkin);
-		for (auto ix = 0; ix < skinCount; ++ix){
-			auto skin = (FbxSkin*) mesh->GetDeformer(ix, FbxDeformer::EDeformerType::eSkin);
-			if (skin){
-				std::vector<FbxCluster*> replacements;
-				auto clusterCount = skin->GetClusterCount();
-				for (auto clusterIx = 0; clusterIx < clusterCount; ++clusterIx){
-					auto cluster = skin->GetCluster(clusterIx);
-					if (cluster){
-						auto linkNode = cluster->GetLink();
-						if (linkNode){
-							auto candidateName = prefix;
-							candidateName.append(linkNode->GetName());
-							auto found = animatedNodes.find(candidateName);
-							if (found != animatedNodes.end()){
-								FbxCluster* newCluster = FbxCluster::Create(currentRoot->GetScene(), "");
-								newCluster->SetLink(found->second);
-								newCluster->SetLinkMode(cluster->GetLinkMode());
-								FbxAMatrix mat;
-								newCluster->SetTransformAssociateModelMatrix(cluster->GetTransformAssociateModelMatrix(mat));
-								newCluster->SetAssociateModel(cluster->GetAssociateModel());
-								newCluster->SetTransformLinkMatrix(cluster->GetTransformLinkMatrix(mat));
-								newCluster->SetTransformMatrix(cluster->GetTransformMatrix(mat));
-								newCluster->SetTransformParentMatrix(cluster->GetTransformParentMatrix(mat));
-
-								auto indicesAndWeightsCount = cluster->GetControlPointIndicesCount();
-								for (auto ix = 0; ix < indicesAndWeightsCount; ++ix){
-									newCluster->AddControlPointIndex(cluster->GetControlPointIndices()[ix], cluster->GetControlPointWeights()[ix]);
-
-								}
-
-
-								replacements.push_back(newCluster);
-							}
-						}
-					}
-				}
-				if (replacements.size() == clusterCount){
-					while (skin->GetClusterCount()>0){
-						auto oldCluster = skin->GetCluster(skin->GetClusterCount() - 1);
-						skin->RemoveCluster(oldCluster);
-						oldCluster->Destroy();
-					}
-					for (auto c : replacements){
-						skin->AddCluster(c);
-					}
-				}
-				else{
-					for (auto c : replacements){
-						c->Destroy();
-					}
-				}
-			}
-		}
-	}
-
-	for (auto ix = 0; ix < currentRoot->GetChildCount(); ++ix){
-		patchSkins(currentRoot->GetChild(ix), animatedNodes, prefix);
-	}
-}
-
-int _tmain(int argc, _TCHAR* argv [])
-{
-	std::cout << "usage : FbxRerouteSkeleton.exe /m:<origin mesh and skeleton data.fbx> /m:<other origin mesh and skeleton data.fbx> /a:<animated skeleton.fbx> /o:<output fbx> [/prefix:<prefix added to each bone in animated skeleton.fbx>]" << std::endl;
-	std::vector<std::string> meshFiles;
-	std::string skeletonFile;
-	std::string outputPath;
-	std::string prefix;
-	for (auto ix = 1; ix < argc; ++ix){
-		std::wstring warg = argv[ix];
-		if (warg.find(L"/m:") == 0){
-			meshFiles.push_back(wstringToUtf8(warg.substr(3)));
-		}
-		else if (warg.find(L"/a:") == 0)
-		{
-			if (skeletonFile.size()>0){
-
-				std::wcout << L"only one animated skeleton file is allowed" << std::endl;
-				return -2;
-			}
-			skeletonFile = wstringToUtf8(warg.substr(3));
-		}
-		else if (warg.find(L"/o:") == 0){
-			if (outputPath.size() > 0){
-
-				std::wcout << L"only one output file is allowed" << std::endl;
-				return -3;
-			}
-
-			CloseHandle(CreateFile(warg.substr(3).c_str(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr));
-			outputPath = wstringToUtf8(warg.substr(3));
-		}
-		else if (warg.find(L"/prefix:") == 0){
-			if (prefix.size() > 0){
-
-				std::wcout << L"only one prefix is allowed" << std::endl;
-				return -4;
-			}
-			prefix = wstringToUtf8(warg.substr(8));
-		}
-		else{
-			std::wcout << L"unrecognized parameter " << warg << std::endl;
-			return -1;
-		}
-	}
-	if (meshFiles.size() == 0){
-
-		std::wcout << L"no origin mesh file" << std::endl;
-		return -5;
-	}
-	if (skeletonFile.size() == 0){
-
-		std::wcout << L"skeleton file unspecified" << std::endl;
-		return -6;
-	}
-	if (outputPath.size() == 0){
-
-		std::wcout << L"output file unspecified" << std::endl;
-		return -7;
-	}
-
-	auto fbxManager = std::unique_ptr<FbxManager, FbxManagerDeleter>( FbxManager::Create());
-	auto iosettings = std::unique_ptr<FbxIOSettings, FbxDeleter>(FbxIOSettings::Create(fbxManager.get(), IOSROOT));
-
-	iosettings->SetBoolProp(IMP_FBX_MATERIAL, true);
-	iosettings->SetBoolProp(IMP_FBX_TEXTURE, true);
-	iosettings->SetBoolProp(IMP_FBX_LINK, true);
-	iosettings->SetBoolProp(IMP_FBX_SHAPE, true);
-	iosettings->SetBoolProp(IMP_FBX_GOBO, true);
-	iosettings->SetBoolProp(IMP_FBX_ANIMATION, true);
-	iosettings->SetBoolProp(IMP_SKINS, true);
-	iosettings->SetBoolProp(IMP_DEFORMATION, true);
-	iosettings->SetBoolProp(IMP_FBX_GLOBAL_SETTINGS, true);
-	iosettings->SetBoolProp(IMP_TAKE, true);
-
-
-	iosettings->SetBoolProp(EXP_FBX_MATERIAL, true);
-	iosettings->SetBoolProp(EXP_FBX_TEXTURE, true);
-	iosettings->SetBoolProp(EXP_MESHPOLY, true);
-	iosettings->SetBoolProp(EXP_FBX_SHAPE, true);
-	iosettings->SetBoolProp(EXP_FBX_GOBO, true);
-	iosettings->SetBoolProp(EXP_FBX_ANIMATION, true);
-	iosettings->SetBoolProp(EXP_SKINS, true);
-	iosettings->SetBoolProp(EXP_DEFORMATION, true);
-	iosettings->SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, true);
-	iosettings->SetBoolProp(EXP_MESHTRIANGLE, true);
-	iosettings->SetBoolProp(EXP_EMBEDTEXTURE, true);
-	fbxManager->SetIOSettings(iosettings.get());
-
-	auto importer = std::unique_ptr<FbxImporter, FbxDeleter> (FbxImporter::Create(fbxManager.get(), "SceneImporter"));
-	importer->Initialize(skeletonFile.c_str(), -1, iosettings.get());
-	auto globalScene = std::unique_ptr<FbxScene, FbxDeleter>(FbxScene::Create(fbxManager.get(), "merged scene"));
-	importer->Import(globalScene.get());
-
-	std::map<std::string, FbxNode*> animatedSkeletonNodesMap;
-	populateNodeMap(animatedSkeletonNodesMap, globalScene->GetRootNode());
-
-	for (auto& f : meshFiles){
-		importAdditionalFile(globalScene.get(), importer.get(), f);
-	}
-
-	patchSkins(globalScene->GetRootNode(), animatedSkeletonNodesMap, prefix);
-
-	auto exporter = std::unique_ptr<FbxExporter, FbxDeleter>(FbxExporter::Create(fbxManager.get(), "SceneExporter"));
-	auto res = exporter->Initialize(outputPath.c_str(), -1, iosettings.get());
-	res = exporter->Export(globalScene.get());
-	auto status = exporter->GetStatus();
-
-	return 0;
-}
-

+ 0 - 169
Exporters/FBX/FbxRerouteSkeleton/FbxRerouteSkeleton.vcxproj

@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{C4B4FC3F-B13B-4919-A412-15CF0C2A1E5C}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>FbxRerouteSkeleton</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x86\debug;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x86\release;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x64\debug;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2017.0.1\include;$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\3rdParty\Fbx2017.0.1\lib\vs2015\x64\release;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>libfbxsdk-md.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>libfbxsdk-md.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>libfbxsdk-md.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>libfbxsdk-md.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Text Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="FbxDeleter.h" />
-    <ClInclude Include="stdafx.h" />
-    <ClInclude Include="targetver.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="FbxRerouteSkeleton.cpp" />
-    <ClCompile Include="stdafx.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
-    </ClCompile>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 39
Exporters/FBX/FbxRerouteSkeleton/FbxRerouteSkeleton.vcxproj.filters

@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <Text Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="targetver.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="FbxDeleter.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="FbxRerouteSkeleton.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>

+ 0 - 40
Exporters/FBX/FbxRerouteSkeleton/ReadMe.txt

@@ -1,40 +0,0 @@
-========================================================================
-    CONSOLE APPLICATION : FbxRerouteSkeleton Project Overview
-========================================================================
-
-AppWizard has created this FbxRerouteSkeleton application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your FbxRerouteSkeleton application.
-
-
-FbxRerouteSkeleton.vcxproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-FbxRerouteSkeleton.vcxproj.filters
-    This is the filters file for VC++ projects generated using an Application Wizard. 
-    It contains information about the association between the files in your project 
-    and the filters. This association is used in the IDE to show grouping of files with
-    similar extensions under a specific node (for e.g. ".cpp" files are associated with the
-    "Source Files" filter).
-
-FbxRerouteSkeleton.cpp
-    This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named FbxRerouteSkeleton.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

+ 0 - 8
Exporters/FBX/FbxRerouteSkeleton/stdafx.cpp

@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// FbxRerouteSkeleton.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file

+ 0 - 15
Exporters/FBX/FbxRerouteSkeleton/stdafx.h

@@ -1,15 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include <stdio.h>
-#include <tchar.h>
-
-
-
-// TODO: reference additional headers your program requires here

+ 0 - 8
Exporters/FBX/FbxRerouteSkeleton/targetver.h

@@ -1,8 +0,0 @@
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>

+ 0 - 25
Exporters/FBX/FbxTests/FbxTests.cpp

@@ -1,25 +0,0 @@
-// FbxTests.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include "..\BabylonFbxNative\FbxSceneLoader.h"
-#include "..\BabylonFbxNative\FbxMeshLoader.h"
-#include "..\BabylonFbxNative\Export.h"
-
-
-int _tmain(int argc, _TCHAR* argv[])
-{
-	std::vector<babylon_mesh<babylon_vertex_normal_uv_color>> meshes;
-	
-	FbxSceneLoader sceneLoader("C:\\ws\\babylon\\BabylonExport\\Test scenes\\Dude\\dude.fbx");
-	auto camera = sceneLoader.GetDefaultCamera();
-	auto spaceshipSettings = sceneLoader.getGlobalSettings();
-	FbxMaterialStore materials(L"C:\\ws\\babylon\\BabylonExport\\Test scenes\\Dude", L".", TextureFormat::Dds);
-	for (int i = 0; i < sceneLoader.getMeshCount(); ++i){
-		meshes.push_back(loadStaticMesh<babylon_vertex_normal_uv_color>(sceneLoader.getFbxMesh(i), sceneLoader.getScene(), materials));
-	}
-	auto json = exportScene(spaceshipSettings, materials.buildMaterialVector(), meshes);
-	auto text = json.serialize();
-	return 0;
-}
-

+ 0 - 123
Exporters/FBX/FbxTests/FbxTests.vcxproj

@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\packages\cpprestsdk.2.0.1\build\native\cpprestsdk.props" Condition="Exists('..\packages\cpprestsdk.2.0.1\build\native\cpprestsdk.props')" />
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{F86E88E6-D8E0-4CC6-8B9B-F4CF2363EE20}</ProjectGuid>
-    <SccProjectName>SAK</SccProjectName>
-    <SccAuxPath>SAK</SccAuxPath>
-    <SccLocalPath>SAK</SccLocalPath>
-    <SccProvider>SAK</SccProvider>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>FbxTests</RootNamespace>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
-    <RestorePackages>true</RestorePackages>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v140</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2015\include;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-    <IncludePath>$(SolutionDir)\3rdParty\Fbx2015\include;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <SDLCheck>true</SDLCheck>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <Text Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h" />
-    <ClInclude Include="targetver.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="FbxTests.cpp" />
-    <ClCompile Include="stdafx.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\3rdParty\DirectXTex\DirectXTex_Desktop_2013.vcxproj">
-      <Project>{371b9fa9-4c90-4ac6-a123-aced756d6c77}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\BabylonFbxNative\BabylonFbxNative.vcxproj">
-      <Project>{6c145cfb-31ac-4b28-8b74-26680d26a6e3}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-    <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
-    <Import Project="..\packages\cpprestsdk.2.0.1\build\native\cpprestsdk.targets" Condition="Exists('..\packages\cpprestsdk.2.0.1\build\native\cpprestsdk.targets')" />
-  </ImportGroup>
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
-  </Target>
-</Project>

+ 0 - 39
Exporters/FBX/FbxTests/FbxTests.vcxproj.filters

@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <Text Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="targetver.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="FbxTests.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-</Project>

+ 0 - 40
Exporters/FBX/FbxTests/ReadMe.txt

@@ -1,40 +0,0 @@
-========================================================================
-    CONSOLE APPLICATION : FbxTests Project Overview
-========================================================================
-
-AppWizard has created this FbxTests application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your FbxTests application.
-
-
-FbxTests.vcxproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-FbxTests.vcxproj.filters
-    This is the filters file for VC++ projects generated using an Application Wizard. 
-    It contains information about the association between the files in your project 
-    and the filters. This association is used in the IDE to show grouping of files with
-    similar extensions under a specific node (for e.g. ".cpp" files are associated with the
-    "Source Files" filter).
-
-FbxTests.cpp
-    This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named FbxTests.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

+ 0 - 4
Exporters/FBX/FbxTests/packages.config

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="cpprestsdk" version="2.0.1" targetFramework="Native" />
-</packages>

+ 0 - 8
Exporters/FBX/FbxTests/stdafx.cpp

@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// FbxTests.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file

+ 0 - 15
Exporters/FBX/FbxTests/stdafx.h

@@ -1,15 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include <stdio.h>
-#include <tchar.h>
-
-
-
-// TODO: reference additional headers your program requires here

+ 0 - 8
Exporters/FBX/FbxTests/targetver.h

@@ -1,8 +0,0 @@
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>

+ 0 - 31
Exporters/FBX/readme.md

@@ -1,31 +0,0 @@
-#FBX Exporter
-FBX Exporter produces a babylon scene file from an FBX asset
-##Supported features
-- cameras
-- lights (including shadowcasting info)
-- meshes (with or without associated skeletons)
-- mesh instancing (make sure "preserve instances" is checked when exporting from 3DS Max)
-- bone hierarchies
-- materials (with any number of textures)
-- animations (transforms / opacities / hierarchical) except on materials / textures
-
-##Prerequisites
-To use this tool, you need to download the Visual C++ 2015 redistribuable package : http://www.microsoft.com/en-us/download/details.aspx?id=48145
-
-To build from source you need to install the Autodesk FBX SDK 2017.0.1 and copy the lib folder from the SDK install location to 3rdParty\Fbx2017.0.1\
-##Usage
-FbxExporter.exe "fbx file" "outdir" [/fps:60|30|24] [/skipemptynodes]
-- fbx file : path to the source FBX asset
-- outdir : directory where the resulting files are produced
-- fps : specify the granularity of sampling used for animation exports. It only affects non-linear interpolated animations and bones animations (Babylon supports linear interpolated animation frames)
-- skipemptynodes : avoid to export nodes containing only empty meshes. carefull : if you use an empty node as a camera or light locked target, do not use this argument
-
-#FBX Reroute Skeleton
-This tool can be used to merge multiple FBX files together : n files with meshes associated to a common skeleton and 1 file containing an animation on this skeleton.
-
-##Usage
-FbxRerouteSkeleton.exe /m:"mesh fbx file 1" [/m:"mesh fbx file 2" ...] /a:"animated skeleton fbx file" /o:"output fbx file" [/prefix:"bone name prefix in animated skeleton"]
-- m: fbx files containing meshes linked to a common skeleton
-- a: fbx file containing an animated version of the skeleton
-- o: output fbx file
-- prefix: prefix added to each bone name in the animated skeleton

二進制
Exporters/Unsupported/BabylonExporter.zip


+ 0 - 92
Exporters/Unsupported/ExportToBabylon.sln

@@ -1,92 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-<<<<<<< HEAD
-# Visual Studio 2013
-=======
-# Visual Studio Express 2013 for Windows Desktop
->>>>>>> cfb69ce8199c03d8c1e9b84a890218e1645564d5
-VisualStudioVersion = 12.0.30723.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BabylonExport.Core", "XNA - OBJ\BabylonExport.Core\BabylonExport.Core.csproj", "{CE70B051-FB63-420D-80C0-51CC03A214BA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BabylonExport.Interface", "XNA - OBJ\BabylonExport.Interface\BabylonExport.Interface.csproj", "{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BabylonExport", "XNA - OBJ\BabylonExport\BabylonExport.csproj", "{1E0A8EB2-7022-42E2-8970-F0374188A09D}"
-EndProject
-<<<<<<< HEAD
-=======
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinaryConverter", "BinaryConverter\BinaryConverter.csproj", "{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}"
-EndProject
->>>>>>> cfb69ce8199c03d8c1e9b84a890218e1645564d5
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Debug|Mixed Platforms = Debug|Mixed Platforms
-		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
-		Release|Any CPU = Release|Any CPU
-		Release|Mixed Platforms = Release|Mixed Platforms
-		Release|x64 = Release|x64
-		Release|x86 = Release|x86
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Release|Any CPU.Build.0 = Release|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Release|x64.ActiveCfg = Release|Any CPU
-		{CE70B051-FB63-420D-80C0-51CC03A214BA}.Release|x86.ActiveCfg = Release|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Release|Any CPU.Build.0 = Release|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Release|x64.ActiveCfg = Release|Any CPU
-		{DEC52846-FFCB-4A66-9F13-64F65B61EDBA}.Release|x86.ActiveCfg = Release|Any CPU
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Debug|Mixed Platforms.Build.0 = Debug|x86
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Debug|x64.ActiveCfg = Debug|x64
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Debug|x64.Build.0 = Debug|x64
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Debug|x86.ActiveCfg = Debug|x86
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Debug|x86.Build.0 = Debug|x86
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Release|Any CPU.Build.0 = Release|Any CPU
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Release|Mixed Platforms.ActiveCfg = Release|x86
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Release|Mixed Platforms.Build.0 = Release|x86
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Release|x64.ActiveCfg = Release|x64
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Release|x64.Build.0 = Release|x64
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Release|x86.ActiveCfg = Release|x86
-		{1E0A8EB2-7022-42E2-8970-F0374188A09D}.Release|x86.Build.0 = Release|x86
-<<<<<<< HEAD
-=======
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Release|Any CPU.Build.0 = Release|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Release|x64.ActiveCfg = Release|Any CPU
-		{78DEBAD0-4265-4237-9FB3-2AEB63EED7EF}.Release|x86.ActiveCfg = Release|Any CPU
->>>>>>> cfb69ce8199c03d8c1e9b84a890218e1645564d5
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

+ 0 - 236
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/BabylonExport.Core.csproj

@@ -1,236 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{CE70B051-FB63-420D-80C0-51CC03A214BA}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>BabylonExport.Core</RootNamespace>
-    <AssemblyName>BabylonExport.Core</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <SccProjectName>SAK</SccProjectName>
-    <SccLocalPath>SAK</SccLocalPath>
-    <SccAuxPath>SAK</SccAuxPath>
-    <SccProvider>SAK</SccProvider>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="Microsoft.Build">
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Microsoft.Build.Engine">
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Microsoft.Build.Framework">
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
-    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\BabylonExport\Refs\Microsoft.Xna.Framework.Content.Pipeline.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\BabylonExport\Refs\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\BabylonExport\Refs\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\BabylonExport\Refs\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\BabylonExport\Refs\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\BabylonExport\Refs\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\BabylonExport\Refs\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
-    <Reference Include="Microsoft.Xna.Framework.Tools.Packaging.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\BabylonExport\Refs\Microsoft.Xna.Framework.Tools.Packaging.Tasks.dll</HintPath>
-    </Reference>
-    <Reference Include="SharpDX">
-      <HintPath>..\BabylonExport\Refs\SharpDX.dll</HintPath>
-    </Reference>
-    <Reference Include="SharpDX.Direct3D9">
-      <HintPath>..\BabylonExport\Refs\SharpDX.Direct3D9.dll</HintPath>
-    </Reference>
-    <Reference Include="SharpDX.DXGI">
-      <HintPath>..\BabylonExport\Refs\SharpDX.DXGI.dll</HintPath>
-    </Reference>
-    <Reference Include="SkinnedModel">
-      <HintPath>..\BabylonExport\Refs\SkinnedModel.dll</HintPath>
-    </Reference>
-    <Reference Include="SkinnedModelPipeline">
-      <HintPath>..\BabylonExport\Refs\SkinnedModelPipeline.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Data.Linq" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Runtime.Serialization" />
-    <Reference Include="System.ServiceModel" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-    <Reference Include="Vertice.Core">
-      <HintPath>..\BabylonExport\Refs\Vertice.Core.dll</HintPath>
-    </Reference>
-    <Reference Include="Vertice.Nova">
-      <HintPath>..\BabylonExport\Refs\Vertice.Nova.dll</HintPath>
-    </Reference>
-    <Reference Include="Vertice.Nova.Core.DirectX10">
-      <HintPath>..\BabylonExport\Refs\Vertice.Nova.Core.DirectX10.dll</HintPath>
-    </Reference>
-    <Reference Include="Vertice.Nova.Core.DirectX9">
-      <HintPath>..\BabylonExport\Refs\Vertice.Nova.Core.DirectX9.dll</HintPath>
-    </Reference>
-    <Reference Include="Vertice.Nova.Interop">
-      <HintPath>..\BabylonExport\Refs\Vertice.Nova.Interop.dll</HintPath>
-    </Reference>
-    <Reference Include="Vertice.Wrappers.DirectX">
-      <HintPath>..\BabylonExport\Refs\Vertice.Wrappers.DirectX.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Entities\Export\BabylonAnimation.cs" />
-    <Compile Include="Entities\Export\BabylonAnimationKey.cs" />
-    <Compile Include="Entities\Export\BabylonBone.cs" />
-    <Compile Include="Entities\Export\BabylonCamera.cs" />
-    <Compile Include="Entities\Export\BabylonLensFlare.cs" />
-    <Compile Include="Entities\Export\BabylonLight.cs" />
-    <Compile Include="Entities\Export\BabylonMaterial.cs" />
-    <Compile Include="Entities\Export\BabylonMesh.cs" />
-    <Compile Include="Entities\Export\BabylonMultiMaterial.cs" />
-    <Compile Include="Entities\Export\BabylonLensFlareSystem.cs" />
-    <Compile Include="Entities\Export\BabylonParticleSystem.cs" />
-    <Compile Include="Entities\Export\BabylonScene.cs" />
-    <Compile Include="Entities\Export\BabylonShadowGenerator.cs" />
-    <Compile Include="Entities\Export\BabylonSkeleton.cs" />
-    <Compile Include="Entities\Export\BabylonSubMesh.cs" />
-    <Compile Include="Entities\Export\BabylonTexture.cs" />
-    <Compile Include="Entities\IDumpable.cs" />
-    <Compile Include="Entities\IQueryable.cs" />
-    <Compile Include="Entities\Mesh.cs" />
-    <Compile Include="Entities\PositionNormalTextured.cs" />
-    <Compile Include="Entities\PositionNormalTexturedWeights.cs" />
-    <Compile Include="Entities\ProxyMesh.cs" />
-    <Compile Include="Entities\StandardMaterial.cs" />
-    <Compile Include="Exporters\ThroughXNA\DAE\DAEExporter.cs" />
-    <Compile Include="Exporters\ThroughXNA\FBX\FBXExporter.cs" />
-    <Compile Include="Exporters\ThroughXNA\XNAExporter.cs" />
-    <Compile Include="Exporters\ThroughXNA\XNA\ContentBuilder.cs" />
-    <Compile Include="Exporters\ThroughXNA\XNA\ErrorLogger.cs" />
-    <Compile Include="Exporters\ThroughXNA\XNA\GraphicsDeviceService.cs" />
-    <Compile Include="Exporters\ThroughXNA\XNA\ServiceContainer.cs" />
-    <Compile Include="Exporters\IExporter.cs" />
-    <Compile Include="Exporters\MXB\NovaExporter.cs" />
-    <Compile Include="Exporters\MXB\NovaExporter.Materials.cs" />
-    <Compile Include="Exporters\OBJ\Document.cs" />
-    <Compile Include="Exporters\OBJ\Line.cs" />
-    <Compile Include="Exporters\OBJ\MtlHeader.cs" />
-    <Compile Include="Exporters\OBJ\MtlLine.cs" />
-    <Compile Include="Exporters\OBJ\ObjExporter.cs" />
-    <Compile Include="Exporters\OBJ\ObjExporter.Material.cs" />
-    <Compile Include="Exporters\OBJ\ObjHeader.cs" />
-    <Compile Include="Exporters\OBJ\ObjLine.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Tools.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\Microsoft.Xna.GameStudio.ContentPipelineExtensions.targets">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\Microsoft.Xna.GameStudio.targets">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\v4.0\Microsoft.Xna.GameStudio.AvailablePlatforms.targets">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\v4.0\Microsoft.Xna.GameStudio.Common.targets">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\v4.0\Microsoft.Xna.GameStudio.Content.targets">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\v4.0\Microsoft.Xna.GameStudio.ContentPipeline.targets">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\v4.0\Microsoft.Xna.GameStudio.Windows.targets">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\v4.0\Microsoft.Xna.GameStudio.Xbox 360.targets">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Refs\xnafx40_redist.msi" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Exporters\ThroughXNA\XNA\XNA Game Studio\v4.0\Microsoft.Xna.Framework.Tools.Packaging.Tasks.dll">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Refs\ColladaXnaBase.dll" />
-    <Content Include="Refs\ColladaXnaImporter.dll" />
-    <Content Include="Refs\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll" />
-    <Content Include="Refs\Microsoft.Xna.Framework.Content.Pipeline.dll" />
-    <Content Include="Refs\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll" />
-    <Content Include="Refs\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll" />
-    <Content Include="Refs\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll" />
-    <Content Include="Refs\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll" />
-    <Content Include="Refs\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll" />
-    <Content Include="Refs\Microsoft.Xna.Framework.Tools.Packaging.Tasks.dll" />
-    <Content Include="Refs\SharpDX.Direct3D9.dll" />
-    <Content Include="Refs\SharpDX.dll" />
-    <Content Include="Refs\SharpDX.DXGI.dll" />
-    <Content Include="Refs\SkinnedModel.dll" />
-    <Content Include="Refs\SkinnedModelPipeline.dll" />
-    <Content Include="Refs\Vertice.Core.dll" />
-    <Content Include="Refs\Vertice.Nova.Core.DirectX10.dll" />
-    <Content Include="Refs\Vertice.Nova.Core.DirectX9.dll" />
-    <Content Include="Refs\Vertice.Nova.dll" />
-    <Content Include="Refs\Vertice.Nova.Interop.dll" />
-    <Content Include="Refs\Vertice.Wrappers.DirectX.dll" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>

+ 0 - 35
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonAnimation.cs

@@ -1,35 +0,0 @@
-using System.Runtime.Serialization;
-using Vertice.Nova.Animations;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonAnimation
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string property { get; set; }
-
-        [DataMember]
-        public DataType dataType { get; set; }
-
-        [DataMember]
-        public InterpolationLoop loopBehavior { get; set; }
-
-        [DataMember]
-        public int framePerSecond { get; set; }
-
-        [DataMember]
-        public BabylonAnimationKey[] keys { get; set; }
-
-        public enum DataType
-        {
-            Float = 0,
-            Vector3 = 1,
-            Quaternion = 2,
-            Matrix = 3
-        }
-    }
-}

+ 0 - 14
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonAnimationKey.cs

@@ -1,14 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonAnimationKey
-    {
-        [DataMember]
-        public float frame { get; set; }
-
-        [DataMember]
-        public float[] values { get; set; }
-    }
-}

+ 0 - 24
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonBone.cs

@@ -1,24 +0,0 @@
-using System.Runtime.Serialization;
-using Vertice.Nova.Animations;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonBone
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public int index { get; set; }
-
-        [DataMember]
-        public int parentBoneIndex { get; set; }
-
-        [DataMember]
-        public float[] matrix { get; set; }
-
-        [DataMember]
-        public BabylonAnimation animation { get; set; }
-    }
-}

+ 0 - 82
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonCamera.cs

@@ -1,82 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonCamera
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string id { get; set; }
-
-        [DataMember]
-        public string parentId { get; set; }
-
-        [DataMember]
-        public string lockedTargetId { get; set; }
-
-        [DataMember]
-        public float[] position { get; set; }
-
-        [DataMember]
-        public float[] rotation { get; set; }
-
-        [DataMember]
-        public float[] target { get; set; }
-
-        [DataMember]
-        public float fov { get; set; }
-
-        [DataMember]
-        public float minZ { get; set; }
-
-        [DataMember]
-        public float maxZ { get; set; }
-
-        [DataMember]
-        public float speed { get; set; }
-
-        [DataMember]
-        public float inertia { get; set; }
-
-        [DataMember]
-        public bool checkCollisions { get; set; }
-
-        [DataMember]
-        public bool applyGravity { get; set; }
-
-        [DataMember]
-        public float[] ellipsoid { get; set; }
-
-        [DataMember]
-        public bool autoAnimate { get; set; }
-
-        [DataMember]
-        public int autoAnimateFrom { get; set; }
-
-        [DataMember]
-        public int autoAnimateTo { get; set; }
-
-        [DataMember]
-        public bool autoAnimateLoop { get; set; }
-
-        [DataMember]
-        public BabylonAnimation[] animations { get; set; }
-
-
-        public BabylonCamera()
-        {
-            position = new[] { 0f, 0f, 0f };
-            rotation = new[] { 0f, 0f, 0f };
-
-            // Default values
-            fov = 0.8f;
-            minZ = 0.1f;
-            maxZ = 5000.0f;
-            speed = 1.0f;
-            inertia = 0.9f;
-        }
-    }
-}

+ 0 - 20
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonLensFlare.cs

@@ -1,20 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonLensFlare
-    {
-        [DataMember]
-        public float position { get; set; }
-
-        [DataMember]
-        public float size { get; set; }
-
-        [DataMember]
-        public float[] color { get; set; }
-
-        [DataMember]
-        public string textureName { get; set; }
-    }
-}

+ 0 - 17
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonLensFlareSystem.cs

@@ -1,17 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonLensFlareSystem
-    {
-        [DataMember]
-        public string emitterId { get; set; }
-
-        [DataMember]
-        public int borderLimit { get; set; }
-
-        [DataMember]
-        public BabylonLensFlare[] flares { get; set; }
-    }
-}

+ 0 - 39
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonLight.cs

@@ -1,39 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonLight
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string id { get; set; }
-
-        [DataMember]
-        public float[] position { get; set; }
-
-        [DataMember]
-        public float[] direction { get; set; }
-
-        [DataMember]
-        public int type { get; set; }
-
-        [DataMember]
-        public float[] diffuse { get; set; }
-
-        [DataMember]
-        public float[] specular { get; set; }
-
-        [DataMember]
-        public float intensity { get; set; }
-
-        public BabylonLight()
-        {
-            diffuse = new[] {1.0f, 1.0f, 1.0f};
-            specular = new[] { 1.0f, 1.0f, 1.0f };
-            intensity = 1.0f;
-        }
-    }
-}

+ 0 - 68
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonMaterial.cs

@@ -1,68 +0,0 @@
-using System.Runtime.Serialization;
-using BabylonExport.Core.Exporters;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonMaterial
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string id { get; set; }
-
-        [DataMember]
-        public bool backFaceCulling { get; set; }
-
-        [DataMember]
-        public float[] ambient { get; set; }
-
-        [DataMember]
-        public float[] diffuse { get; set; }
-
-        [DataMember]
-        public float[] specular { get; set; }
-
-        [DataMember]
-        public float[] emissive { get; set; }
-
-        [DataMember]
-        public float specularPower { get; set; }
-
-        [DataMember]
-        public float alpha { get; set; }
-
-        [DataMember]
-        public BabylonTexture diffuseTexture { get; set; }
-
-        [DataMember]
-        public BabylonTexture ambientTexture { get; set; }
-
-        [DataMember]
-        public BabylonTexture opacityTexture { get; set; }
-
-        [DataMember]
-        public BabylonTexture reflectionTexture { get; set; }
-
-        [DataMember]
-        public BabylonTexture emissiveTexture { get; set; }
-
-        [DataMember]
-        public BabylonTexture specularTexture { get; set; }
-
-        [DataMember]
-        public BabylonTexture bumpTexture { get; set; }
-
-        public BabylonMaterial()
-        {
-            backFaceCulling = true;
-            ambient = new[] {1.0f, 1.0f, 1.0f};
-            diffuse = new[] { 1.0f, 1.0f, 1.0f };
-            specular = new[] { 1.0f, 1.0f, 1.0f };
-            emissive = new[] { 0f, 0f, 0f };
-            specularPower = 64;
-            alpha = 1.0f;
-        }
-    }
-}

+ 0 - 114
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonMesh.cs

@@ -1,114 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonMesh
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string id { get; set; }
-
-        [DataMember]
-        public string parentId { get; set; }
-
-        [DataMember]
-        public string materialId { get; set; }
-
-        [DataMember]
-        public bool isEnabled { get; set; }
-
-        [DataMember]
-        public bool isVisible { get; set; }
-
-        [DataMember]
-        public float[] position { get; set; }
-
-        [DataMember]
-        public float[] rotation { get; set; }
-
-        [DataMember]
-        public float[] scaling { get; set; }
-
-        [DataMember]
-        public float[] localMatrix { get; set; }
-
-        [DataMember]
-        public float[] positions { get; set; }
-
-        [DataMember]
-        public float[] normals { get; set; }
-
-        [DataMember]
-        public float[] uvs { get; set; }
-
-        [DataMember]
-        public float[] uvs2 { get; set; }
-
-        [DataMember]
-        public float[] colors { get; set; }
-
-        [DataMember]
-        public int[] matricesIndices { get; set; }
-
-        [DataMember]
-        public float[] matricesWeights { get; set; }
-
-        [DataMember]
-        public int[] indices { get; set; }
-
-        [DataMember]
-        public bool checkCollisions { get; set; }
-
-        [DataMember]
-        public bool receiveShadows { get; set; }    
-    
-        [DataMember]
-        public bool infiniteDistance { get; set; }
-        
-        [DataMember]
-        public int billboardMode { get; set; }
-
-        [DataMember]
-        public float visibility { get; set; }
-
-        [DataMember]
-        public BabylonSubMesh[] subMeshes { get; set; }
-
-        [DataMember]
-        public int skeletonId { get; set; }
-
-        [DataMember]
-        public bool autoAnimate { get; set; }
-
-        [DataMember]
-        public int autoAnimateFrom { get; set; }
-
-        [DataMember]
-        public int autoAnimateTo { get; set; }
-
-        [DataMember]
-        public bool autoAnimateLoop { get; set; }
-
-        [DataMember]
-        public BabylonAnimation[] animations { get; set; }
-
-        public BabylonMesh()
-        {
-            isEnabled = true;
-            isVisible = true;
-
-            position = new[] { 0f, 0f, 0f };
-            rotation = new[] { 0f, 0f, 0f };
-            scaling = new[] { 1f, 1f, 1f };
-
-            billboardMode = 0;
-
-            visibility = 1.0f;
-
-            skeletonId = -1;
-        }
-    }
-}

+ 0 - 17
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonMultiMaterial.cs

@@ -1,17 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonMultiMaterial
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string id { get; set; }
-
-        [DataMember]
-        public string[] materials { get; set; }        
-    }
-}

+ 0 - 86
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonParticleSystem.cs

@@ -1,86 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonParticleSystem
-    {
-        [DataMember]
-        public string emitterId { get; set; }
-
-        [DataMember]
-        public float[] gravity { get; set; }
-
-        [DataMember]
-        public float[] direction1 { get; set; }
-
-        [DataMember]
-        public float[] direction2 { get; set; }
-
-        [DataMember]
-        public float[] minEmitBox { get; set; }
-
-        [DataMember]
-        public float[] maxEmitBox { get; set; }
-
-        [DataMember]
-        public float[] color1 { get; set; }
-
-        [DataMember]
-        public float[] color2 { get; set; }
-
-        [DataMember]
-        public float[] colorDead { get; set; }
-
-        [DataMember]
-        public float deadAlpha { get; set; }
-
-        [DataMember]
-        public float emitRate { get; set; }
-
-        [DataMember]
-        public float updateSpeed { get; set; }
-
-        [DataMember]
-        public int targetStopFrame { get; set; }
-
-        [DataMember]
-        public float minEmitPower { get; set; }
-
-        [DataMember]
-        public float maxEmitPower { get; set; }
-
-        [DataMember]
-        public float minLifeTime { get; set; }
-
-        [DataMember]
-        public float maxLifeTime { get; set; }
-
-        [DataMember]
-        public float minSize { get; set; }
-
-        [DataMember]
-        public float maxSize { get; set; }
-
-        [DataMember]
-        public float minAngularSpeed { get; set; }
-
-        [DataMember]
-        public float maxAngularSpeed { get; set; }
-
-        [DataMember]
-        public string textureName { get; set; }
-
-        [DataMember]
-        public int blendMode { get; set; }
-
-        [DataMember]
-        public int capacity { get; set; }
-
-        [DataMember]
-        public float[] textureMask { get; set; }
-
-        [DataMember]
-        public bool linkToEmitter { get; set; }
-    }
-}

+ 0 - 163
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonScene.cs

@@ -1,163 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Runtime.Serialization;
-using SharpDX;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonScene
-    {
-        [DataMember]
-        public bool autoClear { get; set; }
-
-        [DataMember]
-        public float[] clearColor { get; set; }
-
-        [DataMember]
-        public float[] ambientColor { get; set; }
-
-        [DataMember]
-        public int fogMode { get; set; }
-
-        [DataMember]
-        public float[] fogColor { get; set; }
-
-        [DataMember]
-        public float fogStart { get; set; }
-
-        [DataMember]
-        public float fogEnd { get; set; }
-
-        [DataMember]
-        public float fogDensity { get; set; }
-
-        [DataMember]
-        public float[] gravity { get; set; }
-
-        [DataMember]
-        public BabylonCamera[] cameras { get; set; }
-
-        [DataMember]
-        public string activeCameraID { get; set; }
-
-        [DataMember]
-        public BabylonLight[] lights { get; set; }
-
-        [DataMember]
-        public BabylonMesh[] meshes { get; set; }
-
-        [DataMember]
-        public BabylonMaterial[] materials { get; set; }
-
-        [DataMember]
-        public BabylonMultiMaterial[] multiMaterials { get; set; }
-
-        [DataMember]
-        public BabylonParticleSystem[] particleSystems { get; set; }
-
-        [DataMember]
-        public BabylonLensFlareSystem[] lensFlareSystems { get; set; }
-
-        [DataMember]
-        public BabylonShadowGenerator[] shadowGenerators { get; set; }
-
-        [DataMember]
-        public BabylonSkeleton[] skeletons { get; set; }
-        
-        public Vector3 MaxVector { get; set; }
-        public Vector3 MinVector { get; set; }
-
-        public string OutputPath { get; private set; }
-
-        internal List<BabylonMesh> MeshesList { get; private set; }
-        internal List<BabylonCamera> CamerasList { get; private set; }
-        internal List<BabylonLight> LightsList { get; private set; }
-        internal List<BabylonMaterial> MaterialsList { get; private set; }
-        internal List<BabylonMultiMaterial> MultiMaterialsList { get; private set; }
-        internal List<BabylonShadowGenerator> ShadowGeneratorsList { get; private set; }
-        internal List<BabylonSkeleton> SkeletonsList { get; private set; }
-
-        readonly List<string> exportedTextures = new List<string>();
-
-        public BabylonScene(string outputPath)
-        {
-            OutputPath = outputPath;
-
-            MeshesList = new List<BabylonMesh>();
-            MaterialsList = new List<BabylonMaterial>();
-            CamerasList = new List<BabylonCamera>();
-            LightsList = new List<BabylonLight>();
-            MultiMaterialsList = new List<BabylonMultiMaterial>();
-            ShadowGeneratorsList = new List<BabylonShadowGenerator>();
-            SkeletonsList = new List<BabylonSkeleton>();
-
-            // Default values
-            autoClear = true;
-            clearColor = new[] { 0.2f, 0.2f, 0.3f };
-            ambientColor = new[] {0f, 0f, 0f };
-            gravity = new[] {0f, 0f, -0.9f};
-        }
-
-        public void Prepare(bool generateDefaultLight = true)
-        {
-            meshes = MeshesList.ToArray();
-
-            materials = MaterialsList.ToArray();
-            multiMaterials = MultiMaterialsList.ToArray();
-            shadowGenerators = ShadowGeneratorsList.ToArray();
-            skeletons = SkeletonsList.ToArray();
-
-            if (CamerasList.Count == 0)
-            {
-                var camera = new BabylonCamera {name = "Default camera", id = Guid.NewGuid().ToString()};
-
-                var distanceVector = MaxVector - MinVector;
-                var midPoint = MinVector +distanceVector / 2;
-                camera.target = midPoint.ToArray();
-                camera.position = (midPoint + distanceVector).ToArray();
-
-                var distance = distanceVector.Length();
-                camera.speed =  distance/ 50.0f;
-                camera.maxZ = distance * 4f;
-
-                camera.minZ = distance < 100.0f ? 0.1f : 1.0f;
-
-                CamerasList.Add(camera);
-            }
-
-            if (LightsList.Count == 0 && generateDefaultLight)
-            {
-                var light = new BabylonLight {name = "Default light", id = Guid.NewGuid().ToString()};
-
-                var midPoint = MinVector + (MaxVector - MinVector) / 2;
-                light.type = 0;
-                light.position = (midPoint + (MaxVector - MinVector)).ToArray();
-
-                light.diffuse = new Vector3(1, 1, 1).ToArray();
-                light.specular = new Vector3(1, 1, 1).ToArray();
-
-                LightsList.Add(light);
-            }
-            
-            cameras = CamerasList.ToArray();
-            lights = LightsList.ToArray();
-
-            if (activeCameraID == null)
-            {
-                activeCameraID = CamerasList[0].id;
-            }
-        }
-
-        public void AddTexture(string diffuseTexture)
-        {
-            if (exportedTextures.Contains(diffuseTexture))
-                return;
-
-            exportedTextures.Add(diffuseTexture);
-
-            File.Copy(diffuseTexture, Path.Combine(OutputPath, Path.GetFileName(diffuseTexture)), true);
-        }
-    }
-}

+ 0 - 22
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonShadowGenerator.cs

@@ -1,22 +0,0 @@
-using System.Runtime.Serialization;
-using Vertice.Nova.Animations;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonShadowGenerator
-    {
-        [DataMember]
-        public int mapSize { get; set; }
-
-        [DataMember]
-        public string lightId { get; set; }
-
-        [DataMember]
-        public bool useVarianceShadowMap { get; set; }
-
-        [DataMember]
-        public string[] renderList { get; set; }
-
-    }
-}

+ 0 - 18
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonSkeleton.cs

@@ -1,18 +0,0 @@
-using System.Runtime.Serialization;
-using Vertice.Nova.Animations;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonSkeleton
-    {
-        [DataMember]
-        public int id { get; set; }
-        
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public BabylonBone[] bones { get; set; }
-    }
-}

+ 0 - 24
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonSubMesh.cs

@@ -1,24 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonSubMesh
-    {
-        [DataMember]
-        public int materialIndex { get; set; }
-
-        [DataMember]
-        public int verticesStart { get; set; }
-
-        [DataMember]
-        public int verticesCount { get; set; }
-
-        [DataMember]
-        public int indexStart { get; set; }
-
-        [DataMember]
-        public int indexCount { get; set; }
-
-    }
-}

+ 0 - 84
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Export/BabylonTexture.cs

@@ -1,84 +0,0 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Core
-{
-    [DataContract]
-    public class BabylonTexture
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public float level { get; set; }
-
-        [DataMember]
-        public bool hasAlpha { get; set; }
-
-        [DataMember]
-        public int coordinatesMode { get; set; }
-        
-        [DataMember]
-        public bool isCube { get; set; }
-
-        [DataMember]
-        public float uOffset { get; set; }
-
-        [DataMember]
-        public float vOffset { get; set; }
-
-        [DataMember]
-        public float uScale { get; set; }
-
-        [DataMember]
-        public float vScale { get; set; }
-
-        [DataMember]
-        public float uAng { get; set; }
-
-        [DataMember]
-        public float vAng { get; set; }
-
-        [DataMember]
-        public float wAng { get; set; }
-
-        [DataMember]
-        public int wrapU { get; set; }
-
-        [DataMember]
-        public int wrapV { get; set; }
-
-        [DataMember]
-        public int coordinatesIndex { get; set; }
-
-        [DataMember]
-        public bool isRenderTarget { get; set; }
-
-        [DataMember]
-        public int renderTargetSize { get; set; }
-
-        [DataMember]
-        public float[] mirrorPlane { get; set; }
-
-        [DataMember]
-        public string[] renderList { get; set; }
-
-        [DataMember]
-        public BabylonAnimation[] animations { get; set; }
-        
-        public BabylonTexture()
-        {
-            level = 1.0f;
-            uOffset = 0;
-            vOffset = 0;
-            uScale = 1.0f;
-            vScale = 1.0f;
-            uAng = 0;
-            vAng = 0;
-            wAng = 0;
-            wrapU = 1;
-            wrapV = 1;
-            hasAlpha = false;
-            coordinatesIndex = 0;
-        }
-    }
-}

+ 0 - 15
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/IDumpable.cs

@@ -1,15 +0,0 @@
-using System.Collections.Generic;
-
-namespace BabylonExport.Core
-{
-    public interface IDumpable
-    {
-        void DumpPositions(List<float> list);
-        void DumpNormals(List<float> list);
-        void DumpUVs(List<float> list);
-        void DumpUVs2(List<float> list);
-        void DumpColors(List<float> list);
-        void DumpMatricesIndices(List<int> list);
-        void DumpMatricesWeights(List<float> list);
-    }
-}

+ 0 - 14
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/IQueryable.cs

@@ -1,14 +0,0 @@
-using SharpDX;
-
-namespace BabylonExport.Core
-{
-    public interface IQueryable
-    {
-        bool HasWeights
-        {
-            get;
-        }
-
-        Vector3 GetPosition();
-    }
-}

+ 0 - 138
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/Mesh.cs

@@ -1,138 +0,0 @@
-using System;
-using System.Collections.Generic;
-using BabylonExport.Core.Exporters;
-using SharpDX;
-
-namespace BabylonExport.Core
-{
-    public class Mesh<T> where T : struct, IDumpable, IQueryable
-    {
-        readonly List<T> vertices = new List<T>();
-        readonly List<int> indices = new List<int>();
-        string concatenatedName = "";
-
-        public Guid ID 
-        {
-            get;
-            private set;
-        }
-
-        public StandardMaterial Material { get; private set; }
-        
-        public Mesh(StandardMaterial material)
-        {
-            ID = Guid.NewGuid();
-            Material = material;
-        }
-
-        public void AddPart(string name, List<T> addedVertices, List<int> addedIndices)
-        {
-            if (concatenatedName == "")
-                concatenatedName += "#"; // ProfessorF-Removed spaces before and after #
-
-            concatenatedName += name;
-
-            var offset = vertices.Count;
-            vertices.AddRange(addedVertices);
-
-            foreach (int index in addedIndices)
-            {
-                indices.Add(index + offset);
-            }
-        }
-
-        public void CreateBabylonMesh(BabylonScene scene, Guid? parentID = null, BabylonSkeleton skeleton = null)
-        {
-            var babylonMesh = new BabylonMesh();
-            scene.MeshesList.Add(babylonMesh);
-
-            // Guid
-            babylonMesh.id = ID.ToString();
-
-            // Name
-            babylonMesh.name = concatenatedName;
-
-            // Parent
-            if (parentID.HasValue)
-                babylonMesh.parentId = parentID.Value.ToString();
-            else
-                babylonMesh.parentId = "";
-
-            // Material ID
-            if (Material == null)
-            {
-                babylonMesh.materialId = "";
-            }
-            else
-            {
-                babylonMesh.materialId = Material.ID.ToString();
-            }
-
-            // Skeleton ID
-            if (skeleton != null)
-            {
-                babylonMesh.skeletonId = skeleton.id;
-            }
-
-            // Position
-            babylonMesh.position = Vector3.Zero.ToArray();
-
-            // Vertices
-            var positions = new List<float>();
-            var normals = new List<float>();
-            var uvs = new List<float>();
-            var uvs2 = new List<float>();
-            var colors = new List<float>();
-            var matricesIndices = new List<int>();
-            var matricesWeights = new List<float>();
-
-            for (int index = 0; index < vertices.Count; index++)
-            {
-                var position = vertices[index].GetPosition();
-
-                scene.MinVector = Vector3.Min(scene.MinVector, position);
-                scene.MaxVector = Vector3.Max(scene.MaxVector, position);
-
-                vertices[index].DumpPositions(positions);
-                vertices[index].DumpNormals(normals);
-                vertices[index].DumpUVs(uvs);
-                vertices[index].DumpUVs2(uvs2);
-                vertices[index].DumpColors(colors);
-                vertices[index].DumpMatricesIndices(matricesIndices);
-                vertices[index].DumpMatricesWeights(matricesWeights);
-            }
-
-            if (positions.Count > 0)
-            {
-                babylonMesh.positions = positions.ToArray();
-            }
-            if (normals.Count > 0)
-            {
-                babylonMesh.normals = normals.ToArray();
-            }
-            if (uvs.Count > 0)
-            {
-                babylonMesh.uvs = uvs.ToArray();
-            }
-            if (uvs2.Count > 0)
-            {
-                babylonMesh.uvs2 = uvs2.ToArray();
-            }
-            if (colors.Count > 0)
-            {
-                babylonMesh.colors = colors.ToArray();
-            }
-            if (matricesIndices.Count > 0)
-            {
-                babylonMesh.matricesIndices = matricesIndices.ToArray();
-            }
-            if (matricesWeights.Count > 0)
-            {
-                babylonMesh.matricesWeights = matricesWeights.ToArray();
-            }
-
-            // Faces
-            babylonMesh.indices = indices.ToArray();
-        }
-    }
-}

+ 0 - 69
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/PositionNormalTextured.cs

@@ -1,69 +0,0 @@
-using System.Collections.Generic;
-using System.Globalization;
-using SharpDX;
-
-namespace BabylonExport.Core
-{
-    public struct PositionNormalTextured : IDumpable, IQueryable
-    {
-        public const int Stride = 32;
-        public Vector3 Position;
-        public Vector3 Normal;
-        public Vector2 TextureCoordinates;
-
-        public PositionNormalTextured(Vector3 position, Vector3 normal, Vector2 textureCoordinates)
-        {
-            Position = position;
-            Normal = normal;
-            TextureCoordinates = textureCoordinates;
-        }
-
-        public override string ToString()
-        {
-            return string.Format(CultureInfo.CurrentCulture, "P:{0} N:{1} TV:{2}", Position, Normal, TextureCoordinates);
-        }
-
-        public bool HasWeights
-        {
-            get { return false; }
-        }
-
-        public Vector3 GetPosition()
-        {
-            return Position;
-        }
-
-        public void DumpPositions(List<float> list)
-        {
-            list.Add(Position.X); list.Add(Position.Y); list.Add(Position.Z);
-        }
-
-        public void DumpNormals(List<float> list)
-        {
-            Normal.Normalize();
-            list.Add(Normal.X); list.Add(Normal.Y); list.Add(Normal.Z);
-        }
-
-        public void DumpUVs(List<float> list)
-        {
-            list.Add(TextureCoordinates.X); list.Add(TextureCoordinates.Y);
-        }
-
-        public void DumpUVs2(List<float> list)
-        {
-        }
-
-        public void DumpColors(List<float> list)
-        {
-        }
-
-
-        public void DumpMatricesIndices(List<int> list)
-        {
-        }
-
-        public void DumpMatricesWeights(List<float> list)
-        {
-        }
-    }
-}

+ 0 - 75
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/PositionNormalTexturedWeights.cs

@@ -1,75 +0,0 @@
-using System.Collections.Generic;
-using System.Globalization;
-using SharpDX;
-
-namespace BabylonExport.Core
-{
-    public struct PositionNormalTexturedWeights : IDumpable, IQueryable
-    {
-        public const int Stride = 52; // Maya returning >=52 for PNTW vertex, not 64
-        public Vector3 Position;
-        public int Indices;
-        public Vector4 Weights;
-        public Vector3 Normal;
-        public Vector2 TextureCoordinates;
-
-        public PositionNormalTexturedWeights(Vector3 position, Vector3 normal, Vector4 weights, int indices, Vector2 textureCoordinates)
-        {
-            Position = position;
-            Normal = normal;
-            Weights = weights;
-            Indices = indices;
-            TextureCoordinates = textureCoordinates;
-        }
-
-        public override string ToString()
-        {
-            return string.Format(CultureInfo.CurrentCulture, "P:{0} N:{1} TV:{4} W:{2} I:{3}", Position, Normal, Weights, Indices, TextureCoordinates);
-        }
-
-        public bool HasWeights
-        {
-            get { return true; }
-        }
-
-        public Vector3 GetPosition()
-        {
-            return Position;
-        }
-
-        public void DumpPositions(List<float> list)
-        {
-            list.Add(Position.X); list.Add(Position.Y); list.Add(Position.Z);
-        }
-
-        public void DumpNormals(List<float> list)
-        {
-            Normal.Normalize();
-            list.Add(Normal.X); list.Add(Normal.Y); list.Add(Normal.Z);
-        }
-
-        public void DumpUVs(List<float> list)
-        {
-            list.Add(TextureCoordinates.X); list.Add(TextureCoordinates.Y);
-        }
-
-        public void DumpUVs2(List<float> list)
-        {
-        }
-
-        public void DumpColors(List<float> list)
-        {
-        }
-
-
-        public void DumpMatricesIndices(List<int> list)
-        {
-            list.Add(Indices);
-        }
-
-        public void DumpMatricesWeights(List<float> list)
-        {
-            list.Add(Weights.X); list.Add(Weights.Y); list.Add(Weights.Z); list.Add(Weights.W);
-        }
-    }
-}

+ 0 - 42
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/ProxyMesh.cs

@@ -1,42 +0,0 @@
-using System;
-using BabylonExport.Core.Exporters;
-using SharpDX;
-
-namespace BabylonExport.Core
-{
-    public class ProxyMesh
-    {
-        public static Guid CreateBabylonMesh(string name, BabylonScene scene)
-        {
-            var babylonMesh = new BabylonMesh();
-            scene.MeshesList.Add(babylonMesh);
-
-            // Guid
-            var id = Guid.NewGuid();
-            babylonMesh.id = id.ToString();
-
-            // Name
-            babylonMesh.name = name;
-
-            // Parent
-            babylonMesh.parentId = "";
-
-            // Visible
-            babylonMesh.isVisible = false;
-
-            // Material ID
-            babylonMesh.materialId = "";
-
-            // Position
-            babylonMesh.position = Vector3.Zero.ToArray();
-
-            // Vertices
-            babylonMesh.positions = null;
-
-            // Faces
-            babylonMesh.indices = null;
-
-            return id;
-        }
-    }
-}

+ 0 - 81
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Entities/StandardMaterial.cs

@@ -1,81 +0,0 @@
-using System;
-using System.IO;
-using BabylonExport.Core.Exporters;
-using SharpDX;
-
-namespace BabylonExport.Core
-{
-    public class StandardMaterial
-    {
-        public string Name { get; set; }
-
-        public Color3 Diffuse { get; set; }
-        public Color3 Emissive { get; set; }
-        public Color3 Specular { get; set; }
-
-        public float Alpha { get; set; }
-        public float SpecularPower { get; set; }
-
-        public string DiffuseTexture { get; set; }
-
-        public bool BackFaceCulling { get; set; }
-
-        public Guid ID
-        {
-            get;
-            private set;
-        }
-
-        public StandardMaterial(string name)
-        {
-            ID = Guid.NewGuid();
-            Name = name;
-            DiffuseTexture = "";
-
-            Diffuse = new Color3(1, 1, 1);
-            Specular = new Color3(1, 1, 1);
-
-            SpecularPower = 32;
-
-            Alpha = 1.0f;
-
-            BackFaceCulling = true;
-        }
-
-        public void CreateBabylonMaterial(BabylonScene scene)
-        {
-            var babylonMaterial = new BabylonMaterial();
-            scene.MaterialsList.Add(babylonMaterial);
-
-            // Guid
-            babylonMaterial.id = ID.ToString();
-
-            // Name
-            babylonMaterial.name = Name;
-
-            // Data
-            babylonMaterial.backFaceCulling = BackFaceCulling;
-            babylonMaterial.diffuse = Diffuse.ToArray();
-            babylonMaterial.emissive = Emissive.ToArray();
-            babylonMaterial.specular = Specular.ToArray();
-            babylonMaterial.specularPower = SpecularPower;
-            babylonMaterial.alpha = Alpha;
-
-            if (string.IsNullOrEmpty(DiffuseTexture))
-            {
-                babylonMaterial.diffuseTexture = null;
-                return;
-            }
-
-            babylonMaterial.diffuseTexture = new BabylonTexture();
-            babylonMaterial.diffuseTexture.name = Path.GetFileName(DiffuseTexture);
-
-            if (babylonMaterial.diffuseTexture.name.ToLower().EndsWith(".png"))
-            {
-                babylonMaterial.diffuseTexture.hasAlpha = true;
-            }
-
-            scene.AddTexture(DiffuseTexture);
-        }
-    }
-}

+ 0 - 13
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/IExporter.cs

@@ -1,13 +0,0 @@
-using System;
-
-namespace BabylonExport.Core
-{
-    public interface IExporter
-    {
-        event Action<int> OnImportProgressChanged;
-
-        string SupportedExtensions { get; }
-
-        void GenerateBabylonFile(string file, string outputFile, bool skinned, bool rightToLeft);
-    }
-}

+ 0 - 468
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/MXB/NovaExporter.Materials.cs

@@ -1,468 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.IO;
-using System.Linq;
-using BabylonExport;
-using SharpDX.Direct3D9;
-using Vertice.Core;
-using Vertice.Nova;
-using Vertice.Nova.Core;
-using Vertice.Nova.Materials;
-using System.Windows.Forms;
-
-namespace BabylonExport.Core.Exporters
-{
-    partial class NovaExporter
-    {
-        void DumpMaterials(BabylonScene babylonScene)
-        {
-            var count = 0;
-            foreach (NovaMaterial material in materialsToExport)
-            {
-                var stdMaterial = material as NovaStandardMaterial;
-
-                if (stdMaterial != null)
-                {
-                    DumpStandardMaterial(stdMaterial, babylonScene);
-                    continue;
-                }
-
-                var perPixelShader = material as NovaPerPixelShader;
-
-                if (perPixelShader != null)
-                {
-                    DumpPerPixelShader(perPixelShader, babylonScene);
-                    continue;
-                }
-
-                var multiMaterial = material as NovaMultiMaterial;
-
-                if (multiMaterial != null)
-                {
-                    DumpMultiMaterial(multiMaterial, babylonScene);
-                }
-
-                ReportProgressChanged(75 + (count++ * 25) / materialsToExport.Count);
-            }
-        }
-
-        void AttachMirrorPlane(BabylonTexture babylonTexture, NovaObject novaObject)
-        {
-            // Mirror plane
-            int f1, f2, f3;
-
-            if (novaObject.Is32bits)
-            {
-                f1 = novaObject.Indices32[2];
-                f2 = novaObject.Indices32[1];
-                f3 = novaObject.Indices32[0];
-            }
-            else
-            {
-                f1 = novaObject.Indices[2];
-                f2 = novaObject.Indices[1];
-                f3 = novaObject.Indices[0];
-            }
-            Vector3 a = novaObject.PositionOnlyVertices[f1];
-            Vector3 b = novaObject.PositionOnlyVertices[f2];
-            Vector3 c = novaObject.PositionOnlyVertices[f3];
-
-            var mainPlane = new Plane(a, b, c);
-
-            Matrix matrix = Matrix.Invert(novaObject.WorldMatrix);
-            matrix = Matrix.Transpose(matrix);
-            Plane plane = Plane.Transform(mainPlane, matrix);
-
-            babylonTexture.mirrorPlane = new[] { plane.Normal.X, plane.Normal.Y, plane.Normal.Z, plane.D };
-        }
-
-        void DumpStandardMaterial(NovaStandardMaterial stdMaterial, BabylonScene babylonScene)
-        {
-            var babylonMaterial = new BabylonMaterial();
-            babylonScene.MaterialsList.Add(babylonMaterial);
-
-            babylonMaterial.name = stdMaterial.Name;
-            babylonMaterial.id = stdMaterial.ID.ToString();
-            babylonMaterial.alpha = stdMaterial.Alpha;
-            babylonMaterial.ambient = (stdMaterial.Ambient * (1.0f - stdMaterial.SelfIllumination)).ToArray();
-            babylonMaterial.diffuse = (stdMaterial.Diffuse * (1.0f - stdMaterial.SelfIllumination)).ToArray();
-            babylonMaterial.emissive = (stdMaterial.Emissive * stdMaterial.SelfIllumination).ToArray();
-            babylonMaterial.specular = stdMaterial.Specular.ToArray();
-            babylonMaterial.specularPower = stdMaterial.SpecularSharpness;
-            babylonMaterial.backFaceCulling = (stdMaterial.CullMode == NovaCull.CounterClockwise);
-
-            if (stdMaterial.DiffuseTexture != null && stdMaterial.DiffuseTexture.HasTextureData && stdMaterial.OpacityTexture != null && stdMaterial.OpacityTexture.HasTextureData)
-            {
-                if (stdMaterial.DiffuseTexture.LoadedTexture == stdMaterial.OpacityTexture.LoadedTexture)
-                {
-                    stdMaterial.DiffuseTexture = stdMaterial.OpacityTexture;
-                    stdMaterial.OpacityTexture = null;
-                }
-            }
-
-            if (stdMaterial.DiffuseTexture != null && stdMaterial.DiffuseTexture.HasTextureData && !stdMaterial.DiffuseTexture.IsVideo && !stdMaterial.DiffuseTexture.IsCubeRender)
-            {
-                babylonMaterial.diffuseTexture = new BabylonTexture();
-                DumpTexture(stdMaterial.DiffuseTexture, babylonMaterial.diffuseTexture, babylonScene);
-            }
-
-            if (stdMaterial.AmbientTexture != null && stdMaterial.AmbientTexture.HasTextureData && !stdMaterial.AmbientTexture.IsVideo && !stdMaterial.AmbientTexture.IsCubeRender)
-            {
-                babylonMaterial.ambientTexture = new BabylonTexture();
-                DumpTexture(stdMaterial.AmbientTexture, babylonMaterial.ambientTexture, babylonScene);
-            }
-
-            if (stdMaterial.OpacityTexture != null && stdMaterial.OpacityTexture.HasTextureData && !stdMaterial.OpacityTexture.IsVideo && !stdMaterial.OpacityTexture.IsCubeRender)
-            {
-                babylonMaterial.opacityTexture = new BabylonTexture();
-                DumpTexture(stdMaterial.OpacityTexture, babylonMaterial.opacityTexture, babylonScene);
-            }
-
-            if (mirrorsMaterials.ContainsKey(stdMaterial))
-            {
-                babylonMaterial.reflectionTexture = new BabylonTexture();
-                var novaObject = mirrorsMaterials[stdMaterial];
-                DumpRenderTargetTexture(stdMaterial.ReflectionTexture, babylonMaterial.reflectionTexture, novaObject.MirrorMapSize, novaObject.MirrorLevel, novaObject.MirroredObjects);
-
-                AttachMirrorPlane(babylonMaterial.reflectionTexture, novaObject);
-            }
-            else if (stdMaterial.ReflectionTexture != null && stdMaterial.ReflectionTexture.HasTextureData && !stdMaterial.ReflectionTexture.IsVideo && !stdMaterial.ReflectionTexture.IsCubeRender)
-            {
-                babylonMaterial.reflectionTexture = new BabylonTexture();
-                DumpTexture(stdMaterial.ReflectionTexture, babylonMaterial.reflectionTexture, babylonScene);
-            }
-
-            if (stdMaterial.EmissiveTexture != null && stdMaterial.EmissiveTexture.HasTextureData && !stdMaterial.EmissiveTexture.IsVideo && !stdMaterial.EmissiveTexture.IsCubeRender)
-            {
-                babylonMaterial.emissiveTexture = new BabylonTexture();
-                DumpTexture(stdMaterial.EmissiveTexture, babylonMaterial.emissiveTexture, babylonScene);
-            }
-
-            if (stdMaterial.SpecularTexture != null && stdMaterial.SpecularTexture.HasTextureData && !stdMaterial.SpecularTexture.IsVideo && !stdMaterial.SpecularTexture.IsCubeRender)
-            {
-                babylonMaterial.specularTexture = new BabylonTexture();
-                DumpTexture(stdMaterial.SpecularTexture, babylonMaterial.specularTexture, babylonScene);
-            }
-
-            if (stdMaterial.BumpTexture != null && stdMaterial.BumpTexture.HasTextureData && !stdMaterial.BumpTexture.IsVideo && !stdMaterial.BumpTexture.IsCubeRender)
-            {
-                babylonMaterial.bumpTexture = new BabylonTexture();
-                DumpTexture(stdMaterial.BumpTexture, babylonMaterial.bumpTexture, babylonScene);
-                babylonMaterial.bumpTexture.level /= 2.0f;
-            }
-        }
-
-        void DumpPerPixelShader(NovaPerPixelShader ppShader, BabylonScene babylonScene)
-        {
-            var babylonMaterial = new BabylonMaterial();
-            babylonScene.MaterialsList.Add(babylonMaterial);
-
-            babylonMaterial.name = ppShader.Name;
-            babylonMaterial.id = ppShader.ID.ToString();
-            babylonMaterial.alpha = ppShader.Alpha;
-            babylonMaterial.ambient = (ppShader.Ambient * (1.0f - ppShader.SelfIllumination)).ToArray();
-            babylonMaterial.diffuse = (ppShader.Diffuse * (1.0f - ppShader.SelfIllumination)).ToArray();
-            babylonMaterial.emissive = (ppShader.Emissive * ppShader.SelfIllumination).ToArray();
-            babylonMaterial.specular = ppShader.Specular.ToArray();
-            babylonMaterial.specularPower = ppShader.SpecularSharpness;
-            babylonMaterial.backFaceCulling = (ppShader.CullMode == NovaCull.CounterClockwise);
-
-            if (ppShader.DiffuseTexture != null && ppShader.DiffuseTexture.HasTextureData && ppShader.OpacityTexture != null && ppShader.OpacityTexture.HasTextureData)
-            {
-                if (ppShader.DiffuseTexture.LoadedTexture == ppShader.OpacityTexture.LoadedTexture)
-                {
-                    ppShader.DiffuseTexture = ppShader.OpacityTexture;
-                    ppShader.OpacityTexture = null;
-                }
-            }
-
-            if (ppShader.DiffuseTexture != null && ppShader.DiffuseTexture.HasTextureData && !ppShader.DiffuseTexture.IsVideo && !ppShader.DiffuseTexture.IsCubeRender)
-            {
-                babylonMaterial.diffuseTexture = new BabylonTexture();
-                DumpTexture(ppShader.DiffuseTexture, babylonMaterial.diffuseTexture, babylonScene);
-            }
-
-            if (ppShader.AmbientTexture != null && ppShader.AmbientTexture.HasTextureData && !ppShader.AmbientTexture.IsVideo && !ppShader.AmbientTexture.IsCubeRender)
-            {
-                babylonMaterial.ambientTexture = new BabylonTexture();
-                DumpTexture(ppShader.AmbientTexture, babylonMaterial.ambientTexture, babylonScene);
-            }
-
-            if (ppShader.OpacityTexture != null && ppShader.OpacityTexture.HasTextureData && !ppShader.OpacityTexture.IsVideo && !ppShader.OpacityTexture.IsCubeRender)
-            {
-                babylonMaterial.opacityTexture = new BabylonTexture();
-                DumpTexture(ppShader.OpacityTexture, babylonMaterial.opacityTexture, babylonScene);
-            }
-
-            if (mirrorsMaterials.ContainsKey(ppShader))
-            {
-                babylonMaterial.reflectionTexture = new BabylonTexture();
-                var novaObject = mirrorsMaterials[ppShader];
-                DumpRenderTargetTexture(ppShader.ReflectionTexture, babylonMaterial.reflectionTexture, novaObject.MirrorMapSize, novaObject.MirrorLevel, novaObject.MirroredObjects);
-
-                AttachMirrorPlane(babylonMaterial.reflectionTexture, novaObject);
-            }
-            else if (ppShader.ReflectionTexture != null && ppShader.ReflectionTexture.HasTextureData && !ppShader.ReflectionTexture.IsVideo && !ppShader.ReflectionTexture.IsCubeRender)
-            {
-                babylonMaterial.reflectionTexture = new BabylonTexture();
-                DumpTexture(ppShader.ReflectionTexture, babylonMaterial.reflectionTexture, babylonScene);
-            }
-
-            // Refraction
-            if (ppShader.RefractionLevel > 0)
-            {
-                babylonMaterial.alpha = 1.0f - ppShader.RefractionLevel;
-            }
-
-            if (ppShader.EmissiveTexture != null && ppShader.EmissiveTexture.HasTextureData && !ppShader.EmissiveTexture.IsVideo && !ppShader.EmissiveTexture.IsCubeRender)
-            {
-                babylonMaterial.emissiveTexture = new BabylonTexture();
-                DumpTexture(ppShader.EmissiveTexture, babylonMaterial.emissiveTexture, babylonScene);
-            }
-
-            if (ppShader.SpecularTexture != null && ppShader.SpecularTexture.HasTextureData && !ppShader.SpecularTexture.IsVideo && !ppShader.SpecularTexture.IsCubeRender)
-            {
-                babylonMaterial.specularTexture = new BabylonTexture();
-                DumpTexture(ppShader.SpecularTexture, babylonMaterial.specularTexture, babylonScene);
-            }
-
-            if (ppShader.BumpTexture != null && ppShader.BumpTexture.HasTextureData && !ppShader.BumpTexture.IsVideo && !ppShader.BumpTexture.IsCubeRender)
-            {
-                babylonMaterial.bumpTexture = new BabylonTexture();
-                DumpTexture(ppShader.BumpTexture, babylonMaterial.bumpTexture, babylonScene);
-                babylonMaterial.bumpTexture.level /= 2.0f;
-            }
-        }
-
-        static void DumpMultiMaterial(NovaMultiMaterial multiMaterial, BabylonScene babylonScene)
-        {
-            var babylonMultiMaterial = new BabylonMultiMaterial();
-            babylonScene.MultiMaterialsList.Add(babylonMultiMaterial);
-
-            babylonMultiMaterial.name = multiMaterial.Name;
-            babylonMultiMaterial.id = multiMaterial.ID.ToString();
-
-            babylonMultiMaterial.materials = multiMaterial.Materials.Select(material => (material != null ? material.ID.ToString() : "")).ToArray();
-        }
-
-        void DumpTextureAnimation(NovaTexture texture, BabylonTexture babylonTexture)
-        {
-            var animations = new List<BabylonAnimation>();
-
-            DumpInterpolator("Texture UOffset", "uOffset", texture.UOffsetInterpolator, texture.ParentScene, animations);
-            DumpInterpolator("Texture VOffset", "vOffset", texture.VOffsetInterpolator, texture.ParentScene, animations);
-            DumpInterpolator("Texture UScale", "uScale", texture.UScaleInterpolator, texture.ParentScene, animations);
-            DumpInterpolator("Texture VScale", "vScale", texture.VScaleInterpolator, texture.ParentScene, animations);
-
-            babylonTexture.animations = animations.ToArray();
-        }
-
-        private void DumpCubeTexture(NovaTexture texture, BabylonTexture babylonTexture, BabylonScene babylonScene)
-        {
-            var textureFilename = Path.Combine(texture.LoadedTexture.Directory, texture.LoadedTexture.Filename);
-            var baseName = Path.GetFileNameWithoutExtension(texture.LoadedTexture.Filename);
-
-            babylonTexture.isCube = true;
-            babylonTexture.name = baseName;
-
-            baseName = Path.Combine(babylonScene.OutputPath, baseName);
-
-            if (!File.Exists(textureFilename))
-            {
-                texture.LoadedTexture.SaveToDDS(false, textureFilename);
-            }
-
-            if (!alreadyExportedTextures.Contains(textureFilename))
-            {
-                alreadyExportedTextures.Add(textureFilename);
-
-                // Use SharpDX to extract face images
-                var form = new Form { ClientSize = new Size(64, 64) };
-                var device = new Device(new Direct3D(), 0, DeviceType.Hardware, form.Handle,
-                                        CreateFlags.HardwareVertexProcessing,
-                                        new PresentParameters(form.ClientSize.Width, form.ClientSize.Height));
-
-                var cubeTexture = CubeTexture.FromFile(device, textureFilename);
-
-                using (var surface = cubeTexture.GetCubeMapSurface(CubeMapFace.PositiveX, 0))
-                {
-                    Surface.ToFile(surface, baseName + "_px.jpg", ImageFileFormat.Jpg);
-                }
-                using (var surface = cubeTexture.GetCubeMapSurface(CubeMapFace.PositiveY, 0))
-                {
-                    Surface.ToFile(surface, baseName + "_py.jpg", ImageFileFormat.Jpg);
-                }
-                using (var surface = cubeTexture.GetCubeMapSurface(CubeMapFace.PositiveZ, 0))
-                {
-                    Surface.ToFile(surface, baseName + "_pz.jpg", ImageFileFormat.Jpg);
-                }
-                using (var surface = cubeTexture.GetCubeMapSurface(CubeMapFace.NegativeX, 0))
-                {
-                    Surface.ToFile(surface, baseName + "_nx.jpg", ImageFileFormat.Jpg);
-                }
-                using (var surface = cubeTexture.GetCubeMapSurface(CubeMapFace.NegativeY, 0))
-                {
-                    Surface.ToFile(surface, baseName + "_ny.jpg", ImageFileFormat.Jpg);
-                }
-                using (var surface = cubeTexture.GetCubeMapSurface(CubeMapFace.NegativeZ, 0))
-                {
-                    Surface.ToFile(surface, baseName + "_nz.jpg", ImageFileFormat.Jpg);
-                }
-
-                cubeTexture.Dispose();
-                device.Dispose();
-                form.Dispose();
-            }
-        }
-
-        private void DumpRenderTargetTexture(NovaTexture texture, BabylonTexture babylonTexture, int renderSize, float level, NovaMirroredObjectsList renderList)
-        {
-            babylonTexture.level = level;
-            babylonTexture.hasAlpha = false;
-            babylonTexture.coordinatesMode = (int)NovaTexture.NovaTextureMapType.Projection;
-
-            babylonTexture.name = texture.Name;
-            babylonTexture.uOffset = texture.UOffset;
-            babylonTexture.vOffset = texture.VOffset;
-            babylonTexture.uScale = texture.UScale;
-            babylonTexture.vScale = texture.VScale;
-            babylonTexture.uAng = texture.UAng;
-            babylonTexture.vAng = texture.VAng;
-            babylonTexture.wAng = texture.WAng;
-            switch (texture.UAddressMode)
-            {
-                case NovaTextureAddress.Wrap:
-                    babylonTexture.wrapU = 1;
-                    break;
-                case NovaTextureAddress.Mirror:
-                    babylonTexture.wrapU = 2;
-                    break;
-                case NovaTextureAddress.Clamp:
-                    babylonTexture.wrapU = 0;
-                    break;
-            }
-            switch (texture.VAddressMode)
-            {
-                case NovaTextureAddress.Wrap:
-                    babylonTexture.wrapV = 1;
-                    break;
-                case NovaTextureAddress.Mirror:
-                    babylonTexture.wrapV = 2;
-                    break;
-                case NovaTextureAddress.Clamp:
-                    babylonTexture.wrapV = 0;
-                    break;
-            }
-            babylonTexture.coordinatesIndex = texture.MapCoordinateIndex;
-
-            DumpTextureAnimation(texture, babylonTexture);
-
-            babylonTexture.isRenderTarget = true;
-            babylonTexture.renderTargetSize = renderSize;
-
-            babylonTexture.renderList = renderList.Select(o => o.ID.ToString()).ToArray();
-        }
-
-        void DumpTexture(NovaTexture texture, BabylonTexture babylonTexture, BabylonScene babylonScene)
-        {
-            babylonTexture.level = texture.Level;
-            babylonTexture.hasAlpha = texture.HasAlpha;
-            babylonTexture.coordinatesMode = (int)texture.MapType;
-
-            if (texture.LoadedTexture.IsCube)
-            {
-                DumpCubeTexture(texture, babylonTexture, babylonScene);
-                return;
-            }
-
-            babylonTexture.name = texture.Name;
-            babylonTexture.uOffset = texture.UOffset;
-            babylonTexture.vOffset = texture.VOffset;
-            babylonTexture.uScale = texture.UScale;
-            babylonTexture.vScale = texture.VScale;
-            babylonTexture.uAng = texture.UAng;
-            babylonTexture.vAng = texture.VAng;
-            babylonTexture.wAng = texture.WAng;
-            switch (texture.UAddressMode)
-            {
-                case NovaTextureAddress.Wrap:
-                    babylonTexture.wrapU = 1;
-                    break;
-                case NovaTextureAddress.Mirror:
-                    babylonTexture.wrapU = 2;
-                    break;
-                case NovaTextureAddress.Clamp:
-                    babylonTexture.wrapU = 0;
-                    break;
-            }
-            switch (texture.VAddressMode)
-            {
-                case NovaTextureAddress.Wrap:
-                    babylonTexture.wrapV = 1;
-                    break;
-                case NovaTextureAddress.Mirror:
-                    babylonTexture.wrapV = 2;
-                    break;
-                case NovaTextureAddress.Clamp:
-                    babylonTexture.wrapV = 0;
-                    break;
-            }
-            babylonTexture.coordinatesIndex = texture.MapCoordinateIndex;
-
-            DumpTextureAnimation(texture, babylonTexture);
-
-            babylonTexture.name = CopyTexture(texture, babylonScene);
-        }
-
-        string CopyTexture(NovaTexture texture, BabylonScene babylonScene)
-        {
-            string name = texture.Name;
-            // Data
-            if (!alreadyExportedTextures.Contains(texture.Name + texture.HasAlpha))
-            {
-                alreadyExportedTextures.Add(texture.Name + texture.HasAlpha);
-
-                if (Path.GetExtension(texture.Name).ToLower() == ".dds" || Path.GetExtension(texture.Name).ToLower() == ".bmp")
-                {
-                    name = Path.GetFileNameWithoutExtension(texture.Name) + ".png";
-                    var alreadyExists = File.Exists(Path.Combine(babylonScene.OutputPath, name));
-
-                    texture.LoadedTexture.SaveToPNG(Path.Combine(babylonScene.OutputPath, name));
-
-                    if (!texture.HasAlpha)
-                    {
-                        var oldPath = Path.Combine(babylonScene.OutputPath, name);
-                        var bmp = Image.FromFile(oldPath);
-
-                        name = Path.GetFileNameWithoutExtension(texture.Name) + ".jpg";
-
-                        bmp.Save(Path.Combine(babylonScene.OutputPath, name), ImageFormat.Jpeg);
-                        bmp.Dispose();
-
-                        if (!alreadyExists)
-                        {
-                            File.Delete(oldPath);
-                        }
-                    }
-                }
-                else
-                {
-                    var sourceFile = Path.Combine(texture.Directory, texture.Filename);
-                    File.Copy(sourceFile, Path.Combine(babylonScene.OutputPath, Path.GetFileName(sourceFile)), true);
-                }
-            }
-            else
-            {
-                if (Path.GetExtension(texture.Name).ToLower() == ".dds" ||
-                    Path.GetExtension(texture.Name).ToLower() == ".bmp")
-                {
-                    name = Path.GetFileNameWithoutExtension(texture.Name) + (texture.HasAlpha ? ".png" : ".jpg");
-                }
-            }
-
-            return name;
-        }
-    }
-}

+ 0 - 705
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/MXB/NovaExporter.cs

@@ -1,705 +0,0 @@
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.IO;
-using System.Runtime.Serialization.Json;
-using Vertice.Core;
-using Vertice.Nova;
-using Vertice.Nova.Core;
-using Vertice.Nova.Core.DirectX9;
-using Vertice.Nova.Materials;
-using Vertice.Nova.Animations;
-using Vertice.Nova.Core.DirectX10;
-
-namespace BabylonExport.Core.Exporters
-{
-    public partial class NovaExporter : IExporter
-    {
-        readonly List<string> alreadyExportedTextures = new List<string>();
-        readonly List<NovaMaterial> materialsToExport = new List<NovaMaterial>();
-        readonly List<NovaParticleSystem> particleSystemsToExport = new List<NovaParticleSystem>();
-        readonly List<NovaLensFlares> lensFlareSystemToExport = new List<NovaLensFlares>();
-        readonly Dictionary<NovaMaterial, NovaObject> mirrorsMaterials = new Dictionary<NovaMaterial, NovaObject>();
-
-        public event Action<int> OnImportProgressChanged;
-
-        public string SupportedExtensions
-        {
-            get
-            {
-                return ".mxb .mxc";
-            }
-        }
-
-        void ReportProgressChanged(int progress)
-        {
-            if (OnImportProgressChanged != null)
-            {
-                OnImportProgressChanged(progress);
-            }
-        }
-
-        public void GenerateBabylonFile(string file, string outputFile, bool skinned, bool rightToLeft)
-        {
-            try
-            {
-                ReportProgressChanged(0);
-                NovaEngine.Launch<DirectX9Provider>("", 128, 128);
-                NovaScene novaScene = NovaEngine.CreateScene("TempScene");
-
-                if (file.EndsWith(".mxc"))
-                {
-                    NovaEngine.ResourceManager.ArchivePath = Path.GetFullPath(file);
-
-                    // Get the mbx file name
-                    file = NovaEngine.ResourceManager.GetStartSceneFilename();
-                }
-
-                novaScene.Load(file);
-                novaScene.Render(false);
-
-                Generate(novaScene, outputFile);
-            }
-
-            finally
-            {
-                NovaEngine.Stop();
-            }
-        }
-
-        void Generate(NovaScene scene, string outputFile)
-        {
-            ReportProgressChanged(25);
-            var babylonScene = new BabylonScene(Path.GetDirectoryName(outputFile));
-            alreadyExportedTextures.Clear();
-
-            babylonScene.autoClear = scene.AutoClear;
-            babylonScene.clearColor = scene.ClearColor.ToArray();
-            babylonScene.ambientColor = scene.AmbientColor.ToArray();
-            babylonScene.gravity = ((scene.Gravity == Vector3.Zero) ? new Vector3(0, -9.0f, 0) : scene.Gravity).ToArray();
-
-            // Fog
-            babylonScene.fogMode = (int)scene.FogMode;
-            babylonScene.fogColor = scene.FogColor.ToArray();
-            babylonScene.fogStart = scene.ActiveCamera.NearClip;
-            babylonScene.fogEnd = scene.ActiveCamera.FarClip;
-            babylonScene.fogDensity = scene.FogDensity;
-
-            // Cameras
-            DumpCameras(scene, babylonScene);
-
-            // Lights
-            DumpLights(scene, babylonScene);
-            ReportProgressChanged(50);
-
-            // Objects
-            DumpObjects(scene, babylonScene);
-
-            // Materials
-            DumpMaterials(babylonScene);
-
-            // Particles
-            DumpParticles(babylonScene);
-
-            // Lens flares
-            DumpLensFlares(babylonScene);
-
-            // Output
-            babylonScene.Prepare(false);
-            using (var outputStream = new FileStream(outputFile, FileMode.Create, FileAccess.Write))
-            {
-                var ser = new DataContractJsonSerializer(typeof(BabylonScene));
-                ser.WriteObject(outputStream, babylonScene);
-            }
-            ReportProgressChanged(100);
-        }
-
-
-        void DumpLensFlares(BabylonScene babylonScene)
-        {
-            if (lensFlareSystemToExport.Count == 0)
-                return;
-
-            babylonScene.lensFlareSystems = new BabylonLensFlareSystem[lensFlareSystemToExport.Count];
-
-            var index = 0;
-            foreach (var lensFlareSystem in lensFlareSystemToExport)
-            {
-                var flares = new List<BabylonLensFlare>();
-                foreach (var flare in lensFlareSystem.Flares)
-                {
-                    flares.Add(new BabylonLensFlare
-                    {
-                        color = flare.Color.ToArray(),
-                        position = flare.Position,
-                        size = flare.Size / 1000.0f,
-                        textureName = CopyTexture(flare.Texture, babylonScene)
-                    });
-                }
-
-                babylonScene.lensFlareSystems[index] = new BabylonLensFlareSystem
-                {
-                    emitterId = (lensFlareSystem.Tag as NovaLight).ID.ToString(),
-                    borderLimit = lensFlareSystem.BorderLimit,
-                    flares = flares.ToArray()
-                };
-
-                index++;
-            }
-        }
-
-        private void DumpParticles(BabylonScene babylonScene)
-        {
-            if (particleSystemsToExport.Count == 0)
-                return;
-
-            babylonScene.particleSystems = new BabylonParticleSystem[particleSystemsToExport.Count];
-
-            var index = 0;
-            foreach (var particleSystem in particleSystemsToExport)
-            {
-                babylonScene.particleSystems[index] = new BabylonParticleSystem
-                    {
-                        capacity = particleSystem.BufferSize,
-                        emitterId = particleSystem.Emitter.ID.ToString(),
-                        gravity = particleSystem.Gravity.ToArray(),
-                        direction1 = Vector3.TransformNormal(particleSystem.Direction1, particleSystem.Emitter.LocalMatrix).ToArray(),
-                        direction2 = Vector3.TransformNormal(particleSystem.Direction2, particleSystem.Emitter.LocalMatrix).ToArray(),
-                        minEmitBox = particleSystem.MinEmitBox.ToArray(),
-                        maxEmitBox = particleSystem.MaxEmitBox.ToArray(),
-                        color1 = particleSystem.Color1.ToArray(),
-                        color2 = particleSystem.Color2.ToArray(),
-                        colorDead = new RGBAColor(particleSystem.ColorDead.Red, particleSystem.ColorDead.Green, particleSystem.ColorDead.Blue, particleSystem.DeadAlpha).ToArray(),
-                        emitRate = particleSystem.EmitRate,
-                        updateSpeed = particleSystem.UpdateSpeed,
-                        targetStopFrame = particleSystem.TargetStopFrame,
-                        minEmitPower = particleSystem.MinEmitPower,
-                        maxEmitPower = particleSystem.MaxEmitPower,
-                        minLifeTime = particleSystem.MinLifeTime,
-                        maxLifeTime = particleSystem.MaxLifeTime,
-                        minSize = particleSystem.MinSize,
-                        maxSize = particleSystem.MaxSize,
-                        minAngularSpeed = particleSystem.MinAngularSpeed,
-                        maxAngularSpeed = particleSystem.MaxAngularSpeed,
-                        textureName = CopyTexture(particleSystem.Texture, babylonScene),
-                        blendMode = (int)particleSystem.BlendType,
-                        linkToEmitter = particleSystem.LinkToEmitter
-                    };
-
-                Vector4 textureMask = Vector4.Zero;
-
-                switch (particleSystem.TextureUsage)
-                {
-                    case NovaParticleSystem.ParticleTextureUsages.Alpha:
-                        textureMask = new Vector4(0, 0, 0, 1);
-                        break;
-                    case NovaParticleSystem.ParticleTextureUsages.RGB:
-                        textureMask = new Vector4(1, 1, 1, 0);
-                        break;
-                    case NovaParticleSystem.ParticleTextureUsages.ARGB:
-                        textureMask = new Vector4(1, 1, 1, 1);
-                        break;
-                }
-
-                babylonScene.particleSystems[index].textureMask = textureMask.ToArray();
-
-                index++;
-            }
-        }
-
-        bool IsInterpolatorIsEmpty(NovaFloatInterpolator interpolator)
-        {
-            for (int index = 0; index < interpolator.Datas.Length - 1; index++)
-            {
-                if (interpolator.Datas[index].Value != interpolator.Datas[index + 1].Value)
-                {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        bool IsInterpolatorIsEmpty(NovaVector3Interpolator interpolator)
-        {
-            for (int index = 0; index < interpolator.Datas.Length - 1; index++)
-            {
-                if (interpolator.Datas[index].Value != interpolator.Datas[index + 1].Value)
-                {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        bool DumpInterpolator(string name, string property, NovaFloatInterpolator interpolator, NovaScene scene, List<BabylonAnimation> animations, float mult = 1.0f)
-        {
-            if (interpolator.Ready && !IsInterpolatorIsEmpty(interpolator))
-            {
-                var fps = scene.AnimationFramerate < 1 ? 30 : scene.AnimationFramerate;
-                var babylonAnimation = new BabylonAnimation { name = name, property = property, dataType = BabylonAnimation.DataType.Float, framePerSecond = fps };
-
-                babylonAnimation.keys = interpolator.Datas.Select(value => new BabylonAnimationKey { frame = value.Key / scene.AnimationKeyStep, values = new[] { value.Value * mult } }).ToArray();
-
-                babylonAnimation.loopBehavior = interpolator.LoopAfter;
-
-                animations.Add(babylonAnimation);
-                return true;
-            }
-
-            return false;
-        }
-
-        bool DumpInterpolator(string name, string property, NovaVector3Interpolator interpolator, NovaScene scene, List<BabylonAnimation> animations)
-        {
-            if (interpolator.Ready && !IsInterpolatorIsEmpty(interpolator))
-            {
-                var fps = scene.AnimationFramerate < 1 ? 30 : scene.AnimationFramerate;
-                var babylonAnimation = new BabylonAnimation { name = name, property = property, dataType = BabylonAnimation.DataType.Vector3, framePerSecond = fps };
-
-                babylonAnimation.keys = interpolator.Datas.Select(value => new BabylonAnimationKey { frame = value.Key / scene.AnimationKeyStep, values = value.Value.ToArray() }).ToArray();
-
-                babylonAnimation.loopBehavior = interpolator.LoopAfter;
-
-                animations.Add(babylonAnimation);
-                return true;
-            }
-
-            return false;
-        }
-
-        bool DumpInterpolator(string name, string property, NovaQuaternionInterpolator interpolator, NovaScene scene, List<BabylonAnimation> animations)
-        {
-            if (interpolator.Ready)
-            {
-                var fps = scene.AnimationFramerate < 1 ? 30 : scene.AnimationFramerate;
-                var babylonAnimation = new BabylonAnimation { name = name, property = property, dataType = BabylonAnimation.DataType.Quaternion, framePerSecond = fps };
-
-                babylonAnimation.keys = interpolator.Datas.Select(value => new BabylonAnimationKey { frame = value.Key / scene.AnimationKeyStep, values = value.Value.ToArray() }).ToArray();
-
-                babylonAnimation.loopBehavior = interpolator.LoopAfter;
-
-                animations.Add(babylonAnimation);
-                return true;
-            }
-
-            return false;
-        }
-
-        void DumpObjects(NovaScene scene, BabylonScene babylonScene)
-        {
-            int count = 0;
-            foreach (NovaObject novaObject in scene.Objects)
-            {
-                if (novaObject.Is32bits)
-                {
-                    if (novaObject.SubObjects.Count == 1)
-                    {
-                        var total = novaObject.VerticesCount;
-                        const int step = 32000;
-                        var stepsCount = (int)(Math.Floor((float)total / step) + 1);
-
-                        for (var index = 0; index < stepsCount; index++)
-                        {
-                            var start = index * step;
-                            var end = (index + 1) * step;
-                            DumpObject(novaObject, babylonScene, scene, start, end, string.Format("#{0}", index));
-                        }
-                    }
-                }
-                else
-                {
-                    DumpObject(novaObject, babylonScene, scene, 0, novaObject.VerticesCount);
-                }
-
-                ReportProgressChanged(50 + (count++ * 25) / scene.Objects.Count);
-            }
-        }
-
-        void DumpObject(NovaObject novaObject, BabylonScene babylonScene, NovaScene scene, int startIndex, int endIndex, string nameIndex = "")
-        {
-            var babylonMesh = new BabylonMesh();
-            babylonScene.MeshesList.Add(babylonMesh);
-
-            babylonMesh.name = novaObject.Name + nameIndex;
-            babylonMesh.id = novaObject.ID.ToString();
-            babylonMesh.materialId = novaObject.Material == null ? "" : novaObject.Material.ID.ToString();
-            babylonMesh.parentId = novaObject.ParentEntity == null ? "" : novaObject.ParentEntity.ID.ToString();
-            babylonMesh.isEnabled = novaObject.Enabled;
-            babylonMesh.isVisible = novaObject.Renderable;
-            babylonMesh.visibility = novaObject.Visibility;
-            babylonMesh.checkCollisions = novaObject.CheckCollisions;
-            babylonMesh.receiveShadows = novaObject.ReceiveShadows;
-            babylonMesh.infiniteDistance = novaObject.InfiniteDistance;
-
-            if (novaObject.Billboard)
-            {
-                babylonMesh.billboardMode |= (novaObject.BillboardX ? 1 : 0);
-                babylonMesh.billboardMode |= (novaObject.BillboardY ? 2 : 0);
-                babylonMesh.billboardMode |= (novaObject.BillboardZ ? 4 : 0);
-            }
-
-            if (novaObject.ParticleSystem != null)
-            {
-                particleSystemsToExport.Add(novaObject.ParticleSystem);
-            }
-
-            // Mirror
-            if (novaObject.IsMirror && novaObject.Material != null)
-            {
-                mirrorsMaterials.Add(novaObject.Material, novaObject);
-            }
-
-            // World
-            babylonMesh.position = novaObject.Position.ToArray();
-            babylonMesh.rotation = novaObject.Rotation.ToArray();
-            babylonMesh.localMatrix = (Matrix.Scaling(novaObject.Scaling) * novaObject.LocalMatrix).ToArray();
-
-            // Animations
-            var animations = new List<BabylonAnimation>();
-
-            DumpInterpolator("Visibility animation", "visibility", novaObject.VisibilityInterpolator, scene, animations);
-
-            // Position
-            if (!DumpInterpolator("Position animation", "position", novaObject.PositionInterpolator, scene, animations))
-            {
-                DumpInterpolator("PositionX animation", "position.x", novaObject.PositionXInterpolator, scene, animations);
-                DumpInterpolator("PositionY animation", "position.y", novaObject.PositionYInterpolator, scene, animations);
-                DumpInterpolator("PositionZ animation", "position.z", novaObject.PositionZInterpolator, scene, animations);
-            }
-
-            // Rotation
-            if (!DumpInterpolator("Rotation animation", "rotationQuaternion", novaObject.RotationInterpolator, scene, animations))
-            {
-                DumpInterpolator("RotationX animation", "rotation.x", novaObject.RotationXInterpolator, scene,
-                    animations, -novaObject.Determinant);
-                DumpInterpolator("RotationY animation", "rotation.y", novaObject.RotationYInterpolator, scene,
-                    animations, -novaObject.Determinant);
-                DumpInterpolator("RotationZ animation", "rotation.z", novaObject.RotationZInterpolator, scene,
-                    animations, -novaObject.Determinant);
-            }
-            else
-            {
-                babylonMesh.localMatrix = Matrix.Identity.ToArray();
-                babylonMesh.scaling = novaObject.Scaling.ToArray();
-            }
-
-            // Scaling
-            if (!DumpInterpolator("Scaling animation", "scaling", novaObject.ScalingInterpolator, scene, animations))
-            {
-                DumpInterpolator("ScalingX animation", "scaling.x", novaObject.ScalingXInterpolator, scene, animations);
-                DumpInterpolator("ScalingY animation", "scaling.y", novaObject.ScalingYInterpolator, scene, animations);
-                DumpInterpolator("ScalingZ animation", "scaling.z", novaObject.ScalingZInterpolator, scene, animations);
-            }
-            else
-            {
-                babylonMesh.localMatrix = novaObject.LocalMatrix.ToArray();
-                babylonMesh.scaling = novaObject.Scaling.ToArray();
-            }
-
-            babylonMesh.animations = animations.ToArray();
-            babylonMesh.autoAnimate = novaObject.AutoAnimate;
-
-            if (novaObject.AutoAnimate)
-            {
-                babylonMesh.autoAnimateFrom = novaObject.AnimationStartKey;
-                if (novaObject.AnimationEndKey == -1)
-                {
-                    babylonMesh.autoAnimateTo = scene.AnimationKeyMax / scene.AnimationKeyStep;
-                    babylonMesh.autoAnimateLoop = true;
-                }
-                else
-                {
-                    babylonMesh.autoAnimateTo = novaObject.AnimationEndKey;
-                }
-            }
-
-            // Vertices & faces
-            var exportedVerticesCount = DumpObjectGeometry(novaObject, babylonMesh, startIndex, endIndex);
-
-            // Subobjects
-            var subMeshes = new List<BabylonSubMesh>();
-
-            if (novaObject.Is32bits)
-            {
-                var subMesh = new BabylonSubMesh();
-                subMesh.materialIndex = 0;
-                subMesh.verticesStart = 0;
-                subMesh.verticesCount = exportedVerticesCount;
-                subMesh.indexStart = 0;
-                subMesh.indexCount = babylonMesh.indices.Length;
-
-                subMeshes.Add(subMesh);
-            }
-            else
-            {
-                foreach (NovaSubObject subObject in novaObject.SubObjects)
-                {
-                    var subMesh = new BabylonSubMesh();
-                    subMesh.materialIndex = subObject.AttributeRange.AttributeId;
-                    subMesh.verticesStart = subObject.AttributeRange.VertexStart;
-                    subMesh.verticesCount = subObject.AttributeRange.VertexCount;
-                    subMesh.indexStart = subObject.AttributeRange.FaceStart * 3;
-                    subMesh.indexCount = subObject.AttributeRange.FaceCount * 3;
-
-                    subMeshes.Add(subMesh);
-                }
-            }
-            babylonMesh.subMeshes = subMeshes.ToArray();
-
-            if (novaObject.Material != null)
-            {
-                if (!materialsToExport.Contains(novaObject.Material))
-                {
-                    materialsToExport.Add(novaObject.Material);
-                    var multiMat = novaObject.Material as NovaMultiMaterial;
-
-                    if (multiMat != null)
-                    {
-                        foreach (var mat in multiMat.Materials)
-                        {
-                            if (!materialsToExport.Contains(mat))
-                            {
-                                materialsToExport.Add(mat);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        private void DumpVertex(NovaCustomVertexFormat.GlobalVector3 vertex, List<float> positions, List<float> normals, List<float> uvs, List<float> uvs2, List<float> colors, Matrix transformMatrix, NovaObject novaObject)
-        {
-            var position = Vector3.TransformCoordinate(vertex.Position, transformMatrix);
-            var normal = Vector3.TransformNormal(vertex.Normal, transformMatrix);
-
-            positions.Add(position.X); positions.Add(position.Y); positions.Add(position.Z);
-            normals.Add(normal.X); normals.Add(normal.Y); normals.Add(normal.Z);
-            uvs.Add(vertex.Tu); uvs.Add(vertex.Tv);
-
-            if (novaObject.Use2TextureCoordinatesForMeshCreation)
-            {
-                uvs2.Add(vertex.Tu2); uvs2.Add(vertex.Tv2);
-            }
-
-            if (novaObject.VertexPaint)
-            {
-                var color = RGBAColor.FromArgb((int)vertex.Color);
-                colors.Add(color.Red); colors.Add(color.Green); colors.Add(color.Blue);
-            }
-        }
-
-        private int DumpObjectGeometry(NovaObject novaObject, BabylonMesh babylonMesh, int startIndex, int endIndex)
-        {
-            var verticesIndices = new int[novaObject.VerticesCount];
-            for (var index = 0; index < verticesIndices.Length; index++)
-            {
-                verticesIndices[index] = -1;
-            }
-
-            // Vertices
-            var transformMatrix = Matrix.Identity;//.Scaling(novaObject.Scaling) * novaObject.LocalMatrix;
-            var indicesList = new List<int>();
-
-            NovaCustomVertexFormat.GlobalVector3[] vertices = novaObject.InternalMesh.LockVertexBuffer<NovaCustomVertexFormat.GlobalVector3>(NovaLock.ReadOnly, novaObject.VerticesCount);
-
-            // Faces
-            INovaDataStream data = novaObject.InternalMesh.LockIndexBuffer(NovaLock.ReadOnly);
-
-            int[] indices;
-
-            if (novaObject.Is32bits)
-            {
-                indices = data.Read<int>(novaObject.FacesCount * 3 * 4);
-            }
-            else
-            {
-                indices = (data.Read<ushort>(novaObject.FacesCount * 3 * 4)).Select(i => (int)i).ToArray();
-            }
-
-            var positions = new List<float>();
-            var normals = new List<float>();
-            var uvs = new List<float>();
-            var uvs2 = new List<float>();
-            var colors = new List<float>();
-            int exportedVerticesCount = 0;
-            for (var index = 0; index < novaObject.FacesCount; index++)
-            {
-                var v0 = indices[index * 3];
-                var v1 = indices[index * 3 + 1];
-                var v2 = indices[index * 3 + 2];
-
-                if (v0 < startIndex || v1 < startIndex || v2 < startIndex)
-                {
-                    continue;
-                }
-
-                if (v0 >= startIndex && v0 < endIndex || v1 >= startIndex && v1 < endIndex || v2 >= startIndex && v2 < endIndex)
-                {
-                    if (verticesIndices[v0] == -1)
-                    {
-                        verticesIndices[v0] = exportedVerticesCount++;
-                        DumpVertex(vertices[v0], positions, normals, uvs, uvs2, colors, transformMatrix, novaObject);
-                    }
-                    if (verticesIndices[v1] == -1)
-                    {
-                        verticesIndices[v1] = exportedVerticesCount++;
-                        DumpVertex(vertices[v1], positions, normals, uvs, uvs2, colors, transformMatrix, novaObject);
-                    }
-                    if (verticesIndices[v2] == -1)
-                    {
-                        verticesIndices[v2] = exportedVerticesCount++;
-                        DumpVertex(vertices[v2], positions, normals, uvs, uvs2, colors, transformMatrix, novaObject);
-                    }
-
-                    indicesList.Add(verticesIndices[v0]);
-                    indicesList.Add(verticesIndices[v1]);
-                    indicesList.Add(verticesIndices[v2]);
-                }
-            }
-
-            if (positions.Count > 0)
-            {
-                babylonMesh.positions = positions.ToArray();
-            }
-            if (normals.Count > 0)
-            {
-                babylonMesh.normals = normals.ToArray();
-            }
-            if (uvs.Count > 0)
-            {
-                babylonMesh.uvs = uvs.ToArray();
-            }
-            if (uvs2.Count > 0)
-            {
-                babylonMesh.uvs2 = uvs2.ToArray();
-            }
-            if (colors.Count > 0)
-            {
-                babylonMesh.colors = colors.ToArray();
-            }
-            babylonMesh.indices = indicesList.ToArray();
-
-            // Invert normal order
-            for (var index = 0; index < babylonMesh.indices.Length; index += 3)
-            {
-                var temp = babylonMesh.indices[index];
-                babylonMesh.indices[index] = babylonMesh.indices[index + 2];
-                babylonMesh.indices[index + 2] = temp;
-            }
-
-            novaObject.InternalMesh.UnlockIndexBuffer();
-            novaObject.InternalMesh.UnlockVertexBuffer();
-
-            return exportedVerticesCount;
-        }
-
-        void DumpCameras(NovaScene scene, BabylonScene babylonScene)
-        {
-            foreach (NovaCamera camera in scene.Cameras)
-            {
-                var babylonCamera = new BabylonCamera();
-                babylonScene.CamerasList.Add(babylonCamera);
-
-                babylonCamera.name = camera.Name;
-                babylonCamera.id = camera.ID.ToString();
-                babylonCamera.parentId = camera.ParentEntity == null ? "" : camera.ParentEntity.ID.ToString();
-                babylonCamera.lockedTargetId = camera.Target == null ? "" : camera.Target.ID.ToString();
-                babylonCamera.position = camera.Position.ToArray();
-                babylonCamera.rotation = camera.Rotation.ToArray();
-                babylonCamera.fov = camera.FOV;
-                babylonCamera.minZ = camera.NearClip;
-                babylonCamera.maxZ = camera.FarClip;
-                babylonCamera.inertia = camera.Inertia;
-                babylonCamera.speed = camera.Speed;
-                babylonCamera.checkCollisions = camera.CheckCollisions;
-                babylonCamera.applyGravity = camera.ApplyGravity;
-                babylonCamera.ellipsoid = camera.EllipsoidVector.ToArray();
-
-                // Animations
-                var animations = new List<BabylonAnimation>();
-
-                // Position
-                if (!DumpInterpolator("Position animation", "position", camera.PositionInterpolator, scene, animations))
-                {
-                    DumpInterpolator("PositionX animation", "position.x", camera.PositionXInterpolator, scene, animations);
-                    DumpInterpolator("PositionY animation", "position.y", camera.PositionYInterpolator, scene, animations);
-                    DumpInterpolator("PositionZ animation", "position.z", camera.PositionZInterpolator, scene, animations);
-                }
-
-                babylonCamera.animations = animations.ToArray();
-                babylonCamera.autoAnimate = camera.AutoAnimate;
-
-                if (camera.AutoAnimate)
-                {
-                    babylonCamera.autoAnimateFrom = camera.AnimationStartKey;
-                    if (camera.AnimationEndKey == -1)
-                    {
-                        babylonCamera.autoAnimateTo = scene.AnimationKeyMax / scene.AnimationKeyStep;
-                        babylonCamera.autoAnimateLoop = true;
-                    }
-                    else
-                    {
-                        babylonCamera.autoAnimateTo = camera.AnimationEndKey;
-                    }
-                }
-            }
-
-            if (scene.ActiveCamera != null)
-            {
-                babylonScene.activeCameraID = scene.ActiveCamera.ID.ToString();
-            }
-        }
-
-        void DumpLights(NovaScene scene, BabylonScene babylonScene)
-        {
-            foreach (NovaLight light in scene.Lights)
-            {
-                if (light.Enabled)
-                {
-                    var babylonLight = new BabylonLight();
-                    babylonScene.LightsList.Add(babylonLight);
-
-                    babylonLight.name = light.Name;
-                    babylonLight.id = light.ID.ToString();
-                    switch (light.Type)
-                    {
-                        case NovaLightType.Point:
-                            babylonLight.type = 0;
-                            babylonLight.position = light.Position.ToArray();
-                            break;
-                        case NovaLightType.Spot:
-                        case NovaLightType.Directional:
-                            babylonLight.type = 1;
-                            babylonLight.position = light.Position.ToArray();
-                            babylonLight.direction = light.Direction.ToArray();
-                            break;
-                    }
-                    babylonLight.diffuse = light.Diffuse.ToArray();
-                    babylonLight.specular = light.Specular.ToArray();
-                    babylonLight.intensity = light.Multiplicator;
-
-                    if (light.ShadowMembers.Count > 0)
-                    {
-                        var shadowGenerator = new BabylonShadowGenerator
-                        {
-                            useVarianceShadowMap = true,
-                            lightId = light.ID.ToString(),
-                            mapSize = light.ShadowMapSize,
-                            renderList = light.ShadowMembers.Select(m => m.ID.ToString()).ToArray()
-                        };
-                        babylonScene.ShadowGeneratorsList.Add(shadowGenerator);
-                    }
-
-                    if (light.LensFlares != null)
-                    {
-                        light.LensFlares.Tag = light;
-                        lensFlareSystemToExport.Add(light.LensFlares);
-                    }
-                }
-            }
-        }
-
-    }
-}

+ 0 - 28
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/ThroughXNA/DAE/DAEExporter.cs

@@ -1,28 +0,0 @@
-using System.Collections.Generic;
-using BabylonExport.Core.Exporters.XNA;
-
-namespace BabylonExport.Core.Exporters.DAE
-{
-    public class DAEExporter : XNAExporter
-    {
-        public override string SupportedExtensions
-        {
-            get { return ".dae"; }
-        }
-
-        public override string Importer
-        {
-            get { return "ColladaStdModelImporter"; }
-        }
-
-        static readonly string[] extraPipelineAssemblies =
-        {
-            "ColladaXnaImporter",
-        };
-
-        public override IEnumerable<string> ExtraPipelineAssemblies
-        {
-            get { return extraPipelineAssemblies; }
-        }
-    }
-}

+ 0 - 28
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/ThroughXNA/FBX/FBXExporter.cs

@@ -1,28 +0,0 @@
-using System.Collections.Generic;
-using BabylonExport.Core.Exporters.XNA;
-
-namespace BabylonExport.Core.Exporters.FBX
-{
-    public class FBXExporter : XNAExporter
-    {
-        public override string SupportedExtensions
-        {
-            get { return ".fbx"; }
-        }
-
-        public override string Importer
-        {
-            get { return null; } // use default one
-        }
-
-        static readonly string[] extraPipelineAssemblies =
-        {
-            "Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, PublicKeyToken=842cf8be1de50553",
-        };
-
-        public override IEnumerable<string> ExtraPipelineAssemblies 
-        {
-            get { return extraPipelineAssemblies; } 
-        }
-    }
-}

+ 0 - 200
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/ThroughXNA/XNA/ContentBuilder.cs

@@ -1,200 +0,0 @@
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Collections.Generic;
-using Microsoft.Build.Construction;
-using Microsoft.Build.Evaluation;
-using Microsoft.Build.Execution;
-using Microsoft.Build.Framework;
-using System.Windows.Forms;
-
-namespace BabylonExport.Core.Exporters.XNA
-{
-    class ContentBuilder : IDisposable
-    {
-        const string xnaVersion = ", Version=4.0.0.0, PublicKeyToken=842cf8be1de50553";
-
-        static readonly string[] pipelineAssemblies =
-        {
-            "Microsoft.Xna.Framework.Content.Pipeline.XImporter" + xnaVersion,
-            "Microsoft.Xna.Framework.Content.Pipeline.TextureImporter" + xnaVersion,
-            "Microsoft.Xna.Framework.Content.Pipeline.EffectImporter" + xnaVersion,
-            "SkinnedModelPipeline"
-        };
-
-        Project buildProject;
-        ProjectRootElement projectRootElement;
-        BuildParameters buildParameters;
-        readonly List<ProjectItem> projectItems = new List<ProjectItem>();
-        ErrorLogger errorLogger;
-
-        string buildDirectory;
-        string processDirectory;
-        string baseDirectory;
-
-        static int directorySalt;
-
-        public string OutputDirectory
-        {
-            get { return Path.Combine(buildDirectory, "bin"); }
-        }
-
-        public ContentBuilder(IEnumerable<string> extraPipelineAssemblies = null)
-        {
-            CreateTempDirectory();
-            CreateBuildProject(extraPipelineAssemblies);
-        }
-
-        public void Dispose()
-        {
-            DeleteTempDirectory();
-        }
-
-        void CreateBuildProject(IEnumerable<string> extraPipelineAssemblies = null)
-        {
-            string projectPath = Path.Combine(buildDirectory, "content.contentproj");
-            string outputPath = Path.Combine(buildDirectory, "bin");
-
-            // Create the build project.
-            projectRootElement = ProjectRootElement.Create(projectPath);
-
-            // Include the standard targets file that defines how to build XNA Framework content.
-            projectRootElement.AddImport(Application.StartupPath + "\\Exporters\\ThroughXNA\\XNA\\XNA Game Studio\\" +
-                                         "v4.0\\Microsoft.Xna.GameStudio.ContentPipeline.targets");
-
-            buildProject = new Project(projectRootElement);
-
-            buildProject.SetProperty("XnaPlatform", "Windows");
-            buildProject.SetProperty("XnaProfile", "Reach");
-            buildProject.SetProperty("XnaFrameworkVersion", "v4.0");
-            buildProject.SetProperty("Configuration", "Release");
-            buildProject.SetProperty("OutputPath", outputPath);
-            buildProject.SetProperty("ContentRootDirectory", ".");
-            buildProject.SetProperty("ReferencePath", Application.StartupPath);
-
-            // Register any custom importers or processors.
-            foreach (string pipelineAssembly in pipelineAssemblies)
-            {
-                buildProject.AddItem("Reference", pipelineAssembly);
-            }
-            if (extraPipelineAssemblies != null)
-            {
-                foreach (string pipelineAssembly in extraPipelineAssemblies)
-                {
-                    buildProject.AddItem("Reference", pipelineAssembly);
-                }
-            }
-
-            // Hook up our custom error logger.
-            errorLogger = new ErrorLogger();
-
-            buildParameters = new BuildParameters(ProjectCollection.GlobalProjectCollection)
-                                  {Loggers = new ILogger[] {errorLogger}};
-        }
-
-        public void Add(string filename, string name, string importer, string processor)
-        {
-            ProjectItem item = buildProject.AddItem("Compile", filename)[0];
-
-            item.SetMetadataValue("Link", Path.GetFileName(filename));
-            item.SetMetadataValue("Name", name);
-
-            if (!string.IsNullOrEmpty(importer))
-                item.SetMetadataValue("Importer", importer);
-
-            if (!string.IsNullOrEmpty(processor))
-                item.SetMetadataValue("Processor", processor);
-
-            projectItems.Add(item);
-        }
-
-        public void Clear()
-        {
-            buildProject.RemoveItems(projectItems);
-
-            projectItems.Clear();
-        }
-
-        public string Build()
-        {
-            // Clear any previous errors.
-            errorLogger.Errors.Clear();
-
-            // Create and submit a new asynchronous build request.
-            BuildManager.DefaultBuildManager.BeginBuild(buildParameters);
-            
-            var request = new BuildRequestData(buildProject.CreateProjectInstance(), new string[0]);
-            BuildSubmission submission = BuildManager.DefaultBuildManager.PendBuildRequest(request);
-
-            submission.ExecuteAsync(null, null);
-
-            // Wait for the build to finish.
-            submission.WaitHandle.WaitOne();
-
-            BuildManager.DefaultBuildManager.EndBuild();
-
-            // If the build failed, return an error string.
-            if (submission.BuildResult.OverallResult == BuildResultCode.Failure)
-            {
-                return string.Join("\n", errorLogger.Errors.ToArray());
-            }
-
-            return null;
-        }
-
-        void CreateTempDirectory()
-        {
-            baseDirectory = Path.Combine(Path.GetTempPath(), GetType().FullName);
-            int processId = Process.GetCurrentProcess().Id;
-
-            processDirectory = Path.Combine(baseDirectory, processId.ToString());
-            directorySalt++;
-
-            buildDirectory = Path.Combine(processDirectory, directorySalt.ToString());
-
-            Directory.CreateDirectory(buildDirectory);
-
-            PurgeStaleTempDirectories();
-        }
-
-        void DeleteTempDirectory()
-        {
-            Directory.Delete(buildDirectory, true);
-
-            if (Directory.GetDirectories(processDirectory).Length == 0)
-            {
-                Directory.Delete(processDirectory);
-
-                if (Directory.GetDirectories(baseDirectory).Length == 0)
-                {
-                    Directory.Delete(baseDirectory);
-                }
-            }
-        }
-
-
-        void PurgeStaleTempDirectories()
-        {
-            // Check all subdirectories of our base location.
-            foreach (string directory in Directory.GetDirectories(baseDirectory))
-            {
-                // The subdirectory name is the ID of the process which created it.
-                int processId;
-
-                if (int.TryParse(Path.GetFileName(directory), out processId))
-                {
-                    try
-                    {
-                        // Is the creator process still running?
-                        Process.GetProcessById(processId);
-                    }
-                    catch (ArgumentException)
-                    {
-                        // If the process is gone, we can delete its temp directory.
-                        Directory.Delete(directory, true);
-                    }
-                }
-            }
-        }
-    }
-}

+ 0 - 0
Exporters/Unsupported/XNA - OBJ/BabylonExport.Core/Exporters/ThroughXNA/XNA/ErrorLogger.cs


部分文件因文件數量過多而無法顯示