Browse Source

Merge remote-tracking branch 'refs/remotes/BabylonJS/master'

punkoffice 9 years ago
parent
commit
3d2569e63b
100 changed files with 10341 additions and 86805 deletions
  1. 1 0
      .gitattributes
  2. 7 0
      .gitignore
  3. 2 2
      .travis.yml
  4. BIN
      Exporters/3ds Max/Max2Babylon-0.17.zip
  5. BIN
      Exporters/3ds Max/Max2Babylon-0.24.zip
  6. 0 98
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/action.js
  7. 0 234
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/actionkinds.js
  8. 0 141
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/contextmenu.js
  9. 0 152
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/fonts.css
  10. 0 210
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/index.css
  11. 0 207
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/index.html
  12. 0 284
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/list.js
  13. 0 307
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/parametersManager.js
  14. 0 216
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/utils.js
  15. 0 750
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/viewer.js
  16. 0 87
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/viewsertoolbar.js
  17. 14 4
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Animation.cs
  18. 3 1
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Skeleton.cs
  19. 6 0
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Texture.cs
  20. 1 1
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.cs
  21. 1 1
      Exporters/3ds Max/Max2Babylon/Forms/ActionsBuilderForm.cs
  22. 5 5
      Exporters/3ds Max/Max2Babylon/GlobalUtility.cs
  23. BIN
      Exporters/3ds Max/Max2Babylon/Refs/BabylonFileConverter.dll
  24. 16 16
      Exporters/3ds Max/Max2Babylon/Tools/Tools.cs
  25. 2 2
      Exporters/3ds Max/readme.md
  26. 1233 622
      Exporters/Blender/io_export_babylon.py
  27. 8 1
      Exporters/Blender/readme.md
  28. 0 1141
      Exporters/FBX/3rdParty/DirectXTex/BC.cpp
  29. 0 892
      Exporters/FBX/3rdParty/DirectXTex/BC.h
  30. 0 548
      Exporters/FBX/3rdParty/DirectXTex/BC4BC5.cpp
  31. 0 2871
      Exporters/FBX/3rdParty/DirectXTex/BC6HBC7.cpp
  32. 0 604
      Exporters/FBX/3rdParty/DirectXTex/BCDirectCompute.cpp
  33. 0 68
      Exporters/FBX/3rdParty/DirectXTex/BCDirectCompute.h
  34. 0 239
      Exporters/FBX/3rdParty/DirectXTex/DDS.h
  35. 0 616
      Exporters/FBX/3rdParty/DirectXTex/DirectXTex.h
  36. 0 352
      Exporters/FBX/3rdParty/DirectXTex/DirectXTex.inl
  37. 0 809
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexCompress.cpp
  38. 0 402
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexCompressGPU.cpp
  39. 0 4515
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexConvert.cpp
  40. 0 875
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexD3D11.cpp
  41. 0 2002
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexDDS.cpp
  42. 0 331
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexFlipRotate.cpp
  43. 0 821
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexImage.cpp
  44. 0 3051
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexMipmaps.cpp
  45. 0 354
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexMisc.cpp
  46. 0 383
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexNormalMaps.cpp
  47. 0 209
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexP.h
  48. 0 229
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexPMAlpha.cpp
  49. 0 1034
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexResize.cpp
  50. 0 1391
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexTGA.cpp
  51. 0 1029
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexUtil.cpp
  52. 0 1128
      Exporters/FBX/3rdParty/DirectXTex/DirectXTexWIC.cpp
  53. 0 432
      Exporters/FBX/3rdParty/DirectXTex/DirectXTex_Desktop_2012.vcxproj
  54. 0 38
      Exporters/FBX/3rdParty/DirectXTex/DirectXTex_Desktop_2012.vcxproj.filters
  55. 0 436
      Exporters/FBX/3rdParty/DirectXTex/DirectXTex_Desktop_2013.vcxproj
  56. 0 38
      Exporters/FBX/3rdParty/DirectXTex/DirectXTex_Desktop_2013.vcxproj.filters
  57. 0 424
      Exporters/FBX/3rdParty/DirectXTex/Filters.h
  58. 0 2566
      Exporters/FBX/3rdParty/DirectXTex/Shaders/BC6HEncode.hlsl
  59. 0 1907
      Exporters/FBX/3rdParty/DirectXTex/Shaders/BC7Encode.hlsl
  60. 0 37
      Exporters/FBX/3rdParty/DirectXTex/Shaders/CompileShaders.cmd
  61. 0 22215
      Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc
  62. 0 3375
      Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC6HEncode_TryModeG10CS.inc
  63. 0 5103
      Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC6HEncode_TryModeLE10CS.inc
  64. 0 10152
      Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC7Encode_EncodeBlockCS.inc
  65. 0 3824
      Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC7Encode_TryMode02CS.inc
  66. 0 3962
      Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC7Encode_TryMode137CS.inc
  67. 0 3027
      Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC7Encode_TryMode456CS.inc
  68. 0 34
      Exporters/FBX/3rdParty/DirectXTex/scoped.h
  69. 273 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk.h
  70. 419 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxalloc.h
  71. 238 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxarch.h
  72. 93 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxdebug.h
  73. 510 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxnew.h
  74. 97 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxstdcompliant.h
  75. 264 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxtypes.h
  76. 487 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxarray.h
  77. 90 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxbitset.h
  78. 95 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxcharptrset.h
  79. 213 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxcontainerallocators.h
  80. 324 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxdynamicarray.h
  81. 257 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxfile.h
  82. 80 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxfolder.h
  83. 411 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxhashmap.h
  84. 262 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxintrusivelist.h
  85. 408 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxmap.h
  86. 67 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxmemorypool.h
  87. 115 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxmultimap.h
  88. 62 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxpair.h
  89. 1398 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxredblacktree.h
  90. 227 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxset.h
  91. 119 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxstatus.h
  92. 505 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxstring.h
  93. 368 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxstringlist.h
  94. 648 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxtime.h
  95. 99 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxtimecode.h
  96. 168 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxutils.h
  97. 166 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/fbxclassid.h
  98. 312 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/fbxconnectionpoint.h
  99. 267 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/fbxdatatypes.h
  100. 0 0
      Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/fbxemitter.h

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+* -crlf

+ 7 - 0
.gitignore

@@ -116,3 +116,10 @@ UpgradeLog*.XML
 /Exporters/3ds Max/Max2Babylon.sln.ide
 /Exporters/3ds Max/Max2Babylon.sln.ide
 /Exporters/ExportToBabylon.sln.ide
+
+# Do not ignore loaders/obj
+!loaders/*
+node_modules
+
+# for JetBrains IDE
+.idea

+ 2 - 2
.travis.yml

@@ -1,8 +1,8 @@
 language: node_js
 node_js:
-  - "0.10"
+  - "4.1"
 before_script:
   - npm install -g gulp
   - cd ./Tools/Gulp
   - npm install
-script: gulp typescript
+script: gulp typescript

BIN
Exporters/3ds Max/Max2Babylon-0.17.zip


BIN
Exporters/3ds Max/Max2Babylon-0.24.zip


+ 0 - 98
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/action.js

@@ -1,98 +0,0 @@
-/// <reference path="raphael.js" />
-/// <reference path="viewer.js" />
-/// <reference path="actionKinds.js" />
-
-var AB;
-(function (AB) {
-
-    var Node = (function () {
-        function Node() {
-            // Members
-            this.rect = null;
-            this.text = null;
-            this.line = null;
-
-            this.action = null;
-
-            this.detached = false;
-            this.minimized = false;
-        }
-
-        // Get node's object attribute
-        // element: The element to get the attribute
-        // attribute: the attribute name "text, "width", etc.
-        // value: optional, if not reading mode but writing mode
-        Node.prototype.attr = function(element, attribute, value) {
-            if (value)
-                element.attr(attribute, value);
-            else
-                return element.attr(attribute);
-        }
-
-        // Returns the point at (x, y) is inside the node
-        // x: the x position of the point
-        // y: the y position of the point
-        Node.prototype.isPointInside = function (x, y) {
-            return this.rect.isPointInside(x, y) || this.text.isPointInside(x, y);
-        }
-
-        return Node;
-    })();
-
-    var Action = (function() {
-        function Action(node) {
-            // Graph related
-            this.parent = null;
-            this.children = new Array();
-            this.node = node;
-
-            // Action
-            this.name = "";
-            this.type = AB.ActionsBuilder.Type.OBJECT;
-            this.propertiesResults = new Array();
-            this.properties = new Array();
-
-            // Extra
-            this.combine = false;
-            this.combineArray = new Array();
-            this.hub = null;
-        }
-
-        // Adds a child to the action
-        // object: the child
-        Action.prototype.addChild = function (object) {
-            if (object == null)
-                return false;
-
-            this.children.push(object);
-            object.parent = this;
-
-            return true;
-        }
-
-        // Removes a child from the action
-        // object: the child to remove
-        Action.prototype.removeChild = function (object) {
-            var indice = this.children.indexOf(object);
-
-            if (indice != -1) {
-                this.children.splice(indice, 1);
-                return true;
-            }
-
-            return false;
-        }
-
-        // Clears all the children of the action
-        Action.prototype.clearChildren = function () {
-            this.children = new Array();
-        }
-
-        return Action;
-
-    })();
-
-    AB.Action = Action;
-    AB.Node = Node;
-
-})(AB || (AB = { }));

+ 0 - 234
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/actionkinds.js

@@ -1,234 +0,0 @@
-/// <reference path="raphael.js" />
-/// <reference path="viewer.js" />
-/// <reference path="action.js" />
-/// <reference path="babylon.max.js" />
-
-var AB;
-(function (AB) {
-
-    var directActionTemplate = function (parameters, secondArgument) {
-        var template = [
-            { text: "target", value: "Object name?", targetType: "SceneProperties" }
-        ];
-
-        if (secondArgument)
-            template.push({text: secondArgument, value: "value..."});
-
-        if (parameters)
-            template.push.apply(template, parameters);
-
-        return template;
-    }
-
-    var directActionWidthPropertyPath = function (parameters) {
-        return directActionTemplate(parameters, "propertyPath");
-    }
-
-    var ActionsBuilder = (function () {
-        function ActionsBuilder()
-        { }
-
-        var engine = new BABYLON.Engine(document.getElementById("renderCanvas"), false);
-        var scene = new BABYLON.Scene(engine);
-        var camera = new BABYLON.Camera("empty_camera", BABYLON.Vector3.Zero(), scene);
-        var light = new BABYLON.PointLight("empty_light", BABYLON.Vector3.Zero(), scene);
-        var mesh = new BABYLON.Mesh("empty_mesh", scene);
-
-        ActionsBuilder.Engine = function () {
-            return engine;
-        }
-
-        ActionsBuilder.Scene = function () {
-            return scene;
-        }
-
-        ActionsBuilder.Camera = function () {
-            return camera;
-        }
-
-        ActionsBuilder.Light = function () {
-            return light;
-        }
-
-        ActionsBuilder.Mesh = function () {
-            return mesh;
-        }
-
-        //
-        // Types
-        //
-        ActionsBuilder.Type = ActionsBuilder.Type || {};
-        ActionsBuilder.Type.TRIGGER = 0;
-        ActionsBuilder.Type.ACTION = 1;
-        ActionsBuilder.Type.FLOW_CONTROL = 2;
-        ActionsBuilder.Type.OBJECT = 3;
-        ActionsBuilder.Type.SCENE = 4;
-
-        //
-        // Data types names
-        //
-        ActionsBuilder.DataTypesNames = ActionsBuilder.DataTypesNames || new Array();
-        ActionsBuilder.DataTypesNames.push({ name: "Scene", data: "SceneProperties" });
-        ActionsBuilder.DataTypesNames.push({ name: "Camera", data: "CameraProperties" });
-        ActionsBuilder.DataTypesNames.push({ name: "Light", data: "LightProperties" });
-        ActionsBuilder.DataTypesNames.push({ name: "Mesh", data: "MeshProperties" });
-
-        //
-        // Autorized data types
-        //
-        ActionsBuilder.Types = ActionsBuilder.Types || new Array();
-        ActionsBuilder.Types.push("Boolean");
-        ActionsBuilder.Types.push("Number");
-        ActionsBuilder.Types.push("Vector2");
-        ActionsBuilder.Types.push("Vector3");
-        ActionsBuilder.Types.push("String");
-
-        // Tests if the property type is in ActionsBuilder.Types
-        var testInstanceOf = function (object, propertyName) {
-            if (object == null || object.constructor == null)
-                return false;
-
-            if (propertyName.length > 0 && propertyName[0] == "_")
-                return false;
-
-            var name = object.constructor.toString().match(/function (\w*)/)[1];
-
-            for (var i = 0; i < ActionsBuilder.Types.length; i++) {
-                if (name == ActionsBuilder.Types[i])
-                    return true;
-            }
-
-            return false;
-        }
-
-        //
-        // Scene properties
-        //
-        ActionsBuilder.SceneProperties = ActionsBuilder.SceneProperties || new Array();
-        for (var thing in scene) {
-            if (testInstanceOf(scene[thing], thing)) {
-                ActionsBuilder.SceneProperties.push({ name: thing, type: typeof (scene[thing]) });
-            }
-        }
-
-        //
-        // Camera properties
-        //
-        ActionsBuilder.CameraProperties = ActionsBuilder.CameraProperties || new Array();
-        for (var thing in camera) {
-            if (testInstanceOf(camera[thing], thing)) {
-                ActionsBuilder.CameraProperties.push({ name: thing, type: typeof (camera[thing]) });
-            }
-        }
-
-        //
-        // Light properties
-        //
-        ActionsBuilder.LightProperties = ActionsBuilder.LightProperties || new Array();
-        for (var thing in light) {
-            if (testInstanceOf(light[thing], thing)) {
-                ActionsBuilder.LightProperties.push({ name: thing, type: typeof (light[thing]) });
-            }
-        }
-
-        //
-        // Mesh properties
-        //
-        ActionsBuilder.MeshProperties = ActionsBuilder.MeshProperties || new Array();
-        for (var thing in mesh) {
-            if (testInstanceOf(mesh[thing], thing)) {
-                ActionsBuilder.MeshProperties.push({ name: thing, type: typeof (mesh[thing]) });
-            }
-        }
-
-        //
-        // Scene properties (meshes, lights, etc)
-        //
-        ActionsBuilder.MeshesList = ActionsBuilder.MeshesList || new Array();
-        ActionsBuilder.LightsList = ActionsBuilder.LightsList || new Array();
-        ActionsBuilder.CamerasList = ActionsBuilder.CamerasList || new Array();
-        ActionsBuilder.SoundsList = ActionsBuilder.SoundsList || new Array();
-
-        //
-        // Triggers
-        //
-        ActionsBuilder.Trigger = ActionsBuilder.Trigger || {};
-        ActionsBuilder.Trigger[0] = { name: "NothingTrigger", properties: [] };
-        ActionsBuilder.Trigger[1] = { name: "OnPickTrigger", properties: [], description: "When the user clicks" };
-        ActionsBuilder.Trigger[2] = { name: "OnLeftPickTrigger", properties: [], description: "When the user left clicks" };
-        ActionsBuilder.Trigger[3] = { name: "OnRightPickTrigger", properties: [], description: "When the user right clicks" };
-        ActionsBuilder.Trigger[4] = { name: "OnCenterPickTrigger", properties: [], description: "When the user center clicks (mouse wheel)" };
-        ActionsBuilder.Trigger[5] = { name: "OnPointerOverTrigger", properties: [], description: "When the user's mouse is on the object" };
-        ActionsBuilder.Trigger[6] = { name: "OnPointerOutTrigger", properties: [], description: "When the user's mouse is out of the object" };
-        ActionsBuilder.Trigger[7] = { name: "OnEveryFrameTrigger", properties: [], description: "Called each frame (only on scene)" };
-        ActionsBuilder.Trigger[8] = { name: "OnIntersectionEnterTrigger", properties: [{ text: "parameter", value: "Object name?" }], description: "When the object intersects an other object" };
-        ActionsBuilder.Trigger[9] = { name: "OnIntersectionExitTrigger", properties: [{ text: "parameter", value: "Object name?" }], descripton: "When the object exists intersection with an other object" };
-        ActionsBuilder.Trigger[10] = { name: "OnKeyDownTrigger", properties: [{ text: "parameter:", value: "" }], description: "When the user push a key" };
-        ActionsBuilder.Trigger[11] = { name: "OnKeyUpTrigger", properties: [{ text: "parameter:", value: "" }], description: "When the user pushed a key" };
-        ActionsBuilder.Trigger.COUNT = 12;
-
-        //
-        // Actions (direct & interpolate)
-        //
-        ActionsBuilder.Action = ActionsBuilder.Action || {};
-        ActionsBuilder.Action[0] = { name: "SwitchBooleanAction", properties: directActionWidthPropertyPath(), description: "Switches a boolean value for a given parameter of the target object : true to false, or false to true" };
-        ActionsBuilder.Action[1] = { name: "SetStateAction", properties: directActionTemplate(null, "value"), description: "Sets a new state value of the target object (i.e \"off\" or \"on\")" };
-        ActionsBuilder.Action[2] = { name: "SetValueAction", properties: directActionWidthPropertyPath([{ text: "value", value: "value?" }]), description: "Sets a new value to the specified parameter of the object" };
-        ActionsBuilder.Action[3] = { name: "SetParentAction", properties: directActionTemplate([{ text: "parent", value: "object name?" }]), description: "Sets a new parent for the target object" };
-        ActionsBuilder.Action[4] = { name: "IncrementValueAction", properties: directActionWidthPropertyPath([{ text: "value", value: "value?" }]), description: "Increments the value of the given parameter for the target object. The value can be negative" };
-        ActionsBuilder.Action[5] = { name: "PlayAnimationAction", properties: directActionTemplate([{ text: "from", value: "0" }, { text: "to", value: "150" }, { text: "loop", value: "false" }]), description: "Plays the animation of the target object" };
-        ActionsBuilder.Action[6] = { name: "StopAnimationAction", properties: directActionTemplate(), description: "Stops the animation of the target object" };
-        ActionsBuilder.Action[7] = { name: "DoNothingAction", properties: [], description: "Does nothing, can be used to balance the actions graph" };
-        ActionsBuilder.Action[8] = {
-            name: "InterpolateValueAction", properties: directActionWidthPropertyPath([
-                { text: "value", value: "value" },
-                { text: "duration", value: "1000" },
-                { text: "stopOtherAnimations", value: "false" }]),
-            description: "Creates an animation (key frames) that animates the target object by modifying the given parameter to the target value"
-        };
-        ActionsBuilder.Action[9] = { name: "PlaySoundAction", properties: [{ text: "sound", value: "path to sound..." }], description: "Plays a sound giving it's path (name)" };
-        ActionsBuilder.Action[10] = { name: "StopSoundAction", properties: [{ text: "sound", value: "path to sound..." }], description: "Stops a sound giving it's path (name)" };
-        ActionsBuilder.Action[11] = { name: "CombineAction", properties: [], description: "Special action that combines multiple actions" };
-        ActionsBuilder.Action.COUNT = 12;
-
-        //
-        // Flow Control
-        //
-        ActionsBuilder.FlowActionOperators = ActionsBuilder.FlowActionOperators || new Array();
-        ActionsBuilder.FlowActionOperators.push("IsEqual");
-        ActionsBuilder.FlowActionOperators.push("IsDifferent");
-        ActionsBuilder.FlowActionOperators.push("IsGreater");
-        ActionsBuilder.FlowActionOperators.push("IsLesser");
-
-        ActionsBuilder.FlowAction = ActionsBuilder.FlowAction || {};
-        ActionsBuilder.FlowAction[0] = { name: "ValueCondition", properties: directActionWidthPropertyPath([{ text: "value", value: "value?" }, { text: "operator", value: ActionsBuilder.FlowActionOperators[0] }]), description: "A condition" };
-        ActionsBuilder.FlowAction[1] = { name: "StateCondition", properties: directActionTemplate([{ text: "value", value: "value?" }]), description: "A condition, true if the target object state equals the given state" };
-        ActionsBuilder.FlowAction.COUNT = 2;
-        ActionsBuilder.FlowAction.Hub = { name: "Hub", properties: [], description: "" };
-
-        //
-        // Utils
-        //
-        ActionsBuilder.GetDescriptionFromActionName = function (name) {
-            for (var i = 0; i < ActionsBuilder.Trigger.COUNT; i++) {
-                if (ActionsBuilder.Trigger[i].name == name)
-                    return ActionsBuilder.Trigger[i].description;
-            }
-
-            for (var i = 0; i < ActionsBuilder.Action.COUNT; i++) {
-                if (ActionsBuilder.Action[i].name == name)
-                    return ActionsBuilder.Action[i].description;
-            }
-
-            for (var i = 0; i < ActionsBuilder.FlowAction.COUNT; i++) {
-                if (ActionsBuilder.FlowAction[i].name == name)
-                    return ActionsBuilder.FlowAction[i].description;
-            }
-
-        };
-
-        return ActionsBuilder;
-    })();
-
-    AB.ActionsBuilder = ActionsBuilder;
-})(AB || (AB = {}));

+ 0 - 141
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/contextmenu.js

@@ -1,141 +0,0 @@
-/// <reference path="raphael.js" />
-/// <reference path="actionKinds.js" />
-/// <reference path="viewer.js" />
-
-var AB;
-(function (AB) {
-
-    var ContextMenu = (function () {
-
-        function ContextMenu(viewer) {
-            var scope = this;
-
-            // Members
-            this.viewer = viewer;
-
-            this.showing = false;
-            this.savedColor = Raphael.rgb(255, 255, 255);
-            this.overColor = Raphael.rgb(140, 200, 230);
-
-            // Context menu elements
-            this.elements = [
-                { text: "Reduce", rect: null, action: "onReduce" },
-                { text: "Delete", rect: null, action: "onRemoveNode" },
-                { text: "Delete branch", rect: null, action: "onRemoveBranch" },
-                { text: "Connect / Disconnect", rect: null, action: "onDetachNode" },
-                { text: "Copy", rect: null, action: "onCopyStructure" },
-                { text: "Paste", rect: null, action: "onPasteStructure" },
-                // Add other elements here
-                { text: "", rect: null, action: null } // Color separator (top)
-            ];
-
-            // Finish
-            this.attachControl(viewer.graph.canvas);
-        }
-
-        // Attaches controls to the viewer
-        // element: the viewer element (canvas or div or etc.)
-        ContextMenu.prototype.attachControl = function (element) {
-            var scope = this;
-
-            var onClick = function (event) {
-                var x = scope.viewer.mousex;
-                var y = scope.viewer.mousey;
-
-                // Remove all context menu nodes, and run action if selected
-                if (scope.showing) {
-                    for (var i = 0; i < scope.elements.length; i++) {
-                        var el = scope.elements[i];
-
-                        if (el.action && el.rect.isPointInside(x, y))
-                            scope.viewer.utils[el.action]();
-
-                        scope.viewer._removeNode(el.rect);
-                    }
-                }
-                scope.showing = false;
-            };
-
-            var onMouseMove = function (event) {
-                // Override context menu's node color if mouse is inside
-                if (scope.showing) {
-                    for (var i = 0; i < scope.elements.length; i++) {
-                        var el = scope.elements[i];
-
-                        if (el.text == "")
-                            continue;
-
-                        var x = scope.viewer.mousex;
-                        var y = scope.viewer.mousey;
-
-                        if (el.rect.isPointInside(x, y))
-                            el.rect.attr(el.rect.rect, "fill", scope.overColor);
-                        else
-                            el.rect.attr(el.rect.rect, "fill", scope.savedColor);
-                    }
-                }
-            };
-
-            var onRightClick = function (event) {
-                var x = scope.viewer.mousex;
-                var y = scope.viewer.mousey;
-
-                if (y + (AB.Graph.NODE_HEIGHT * scope.elements.length) > scope.viewer.element.offsetHeight + scope.viewer.element.scrollTop)
-                    y = (AB.Graph.NODE_HEIGHT * scope.elements.length);
-                if (x + AB.Graph.NODE_WIDTH > scope.viewer.element.offsetWidth + scope.viewer.element.scrollLeft)
-                    x -= AB.Graph.NODE_WIDTH;
-
-                scope.viewer.onClick(event);
-
-                // Set selected node
-                var result = scope.viewer.traverseGraph(null, x, y);
-                if (result.hit) {
-                    scope.viewer.selectedNode = result.element;
-                }
-
-                if (!scope.showing) {
-                    if (scope.viewer.selectedNode == null)
-                        return;
-
-                    // Create elements
-                    var yOffset = 10;
-
-                    for (var i = 0; i < scope.elements.length - 1; i++) {
-                        var el = scope.elements[i];
-
-                        el.rect = scope.viewer._createNode(el.text, Raphael.rgb(216, 216, 216), true);
-                        scope.viewer._setNodePosition(el.rect, x, y + yOffset);
-
-                        el.rect.text.attr("x", x + 5);
-
-                        yOffset += AB.Graph.NODE_HEIGHT;
-                    }
-
-                    // Color separator
-                    var separator = scope.elements[scope.elements.length - 1];
-                    separator.rect = scope.viewer._createNode("", scope.viewer.getNodeColor(scope.viewer.selectedNode), true);
-                    scope.viewer._setNodePosition(separator.rect, x, y);
-                    separator.rect.attr(separator.rect.rect, "height", 10);
-
-                    // Finish
-                    scope.showing = true;
-                }
-                else {
-                    onClick();
-                    onRightClick(event);
-                }
-
-                window.event.returnValue = false;
-            };
-
-            document.addEventListener("click", onClick);
-            document.addEventListener("mousemove", onMouseMove);
-            element.addEventListener("contextmenu", onRightClick);
-        }
-
-        return ContextMenu;
-    })();
-
-    AB.ContextMenu = ContextMenu;
-
-})(AB || (AB = { }));

+ 0 - 152
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/fonts.css

@@ -1,152 +0,0 @@
-@font-face {
-    font-family: "Sinkin Sans Thin";
-    src: url('fonts/SinkinSans/SinkinSans-100Thin.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-100Thin.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-100Thin.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-100Thin.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-100Thin.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Thin Italic";
-    src: url('fonts/SinkinSans/SinkinSans-100ThinItalic.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-100ThinItalic.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-100ThinItalic.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-100ThinItalic.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-100ThinItalic.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans XLight";
-    src: url('fonts/SinkinSans/SinkinSans-200XLight.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-200XLight.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-200XLight.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-200XLight.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-200XLight.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans XLight Italic";
-    src: url('fonts/SinkinSans/SinkinSans-200XLightItalic.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-200XLightItalic.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-200XLightItalic.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-200XLightItalic.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-200XLightItalic.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Light";
-    src: url('fonts/SinkinSans/SinkinSans-300Light.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-300Light.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-300Light.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-300Light.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-300Light.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Light Italic";
-    src: url('fonts/SinkinSans/SinkinSans-300LightItalic.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-300LightItalic.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-300LightItalic.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-300LightItalic.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-300LightItalic.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Italic";
-    src: url('fonts/SinkinSans/SinkinSans-400Italic.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-400Italic.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-400Italic.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-400Italic.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-400Italic.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Regular";
-    src: url('fonts/SinkinSans/SinkinSans-400Regular.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-400Regular.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-400Regular.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-400Regular.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-400Regular.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Medium";
-    src: url('fonts/SinkinSans/SinkinSans-500Medium.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-500Medium.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-500Medium.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-500Medium.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-500Medium.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Medium Italic";
-    src: url('fonts/SinkinSans/SinkinSans-500MediumItalic.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-500MediumItalic.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-500MediumItalic.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-500MediumItalic.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-500MediumItalic.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Semi-Bold";
-    src: url('fonts/SinkinSans/SinkinSans-600SemiBold.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-600SemiBold.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-600SemiBold.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-600SemiBold.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-600SemiBold.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Semi-Bold Italic";
-    src: url('fonts/SinkinSans/SinkinSans-600SemiBoldItalic.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-600SemiBoldItalic.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-600SemiBoldItalic.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-600SemiBoldItalic.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-600SemiBoldItalic.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Bold";
-    src: url('fonts/SinkinSans/SinkinSans-700Bold.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-700Bold.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-700Bold.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-700Bold.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-700Bold.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Bold Italic";
-    src: url('fonts/SinkinSans/SinkinSans-700BoldItalic.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-700BoldItalic.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-700BoldItalic.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-700BoldItalic.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-700BoldItalic.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans Black";
-    src: url('fonts/SinkinSans/SinkinSans-800Black.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-800Black.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-800Black.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-800Black.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-800Black.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans XBlack";
-    src: url('fonts/SinkinSans/SinkinSans-900XBlack.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-900XBlack.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-900XBlack.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-900XBlack.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-900XBlack.svg#segeoN') format('svg');
-}
-
-@font-face {
-    font-family: "Sinkin Sans XBlack Italic";
-    src: url('fonts/SinkinSans/SinkinSans-900XBlackItalic.ttf');
-    src: url('fonts/SinkinSans/SinkinSans-900XBlackItalic.eot?#iefix') format('embedded-opentype'),
-        url('fonts/SinkinSans/SinkinSans-900XBlackItalic.woff') format('woff'),
-        url('fonts/SinkinSans/SinkinSans-900XBlackItalic.ttf') format('truetype'),
-        url('fonts/SinkinSans/SinkinSans-900XBlackItalic.svg#segeoN') format('svg');
-}

+ 0 - 210
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/index.css

@@ -1,210 +0,0 @@
-html, body {
-  margin: 0;
-  padding: 0;
-  width: 100%;
-  height: 100%;
-  background-color: white;
-  cursor: default;
-}
-
-ul {
-  padding-left: 1em;
-  margin-bottom: 0.5em;
-  margin-top: 0.5em;
-}
-ul li {
-  list-style-type: none;
-  display: inline-block;
-  margin-right: 3em;
-  cursor: pointer;
-}
-ul li:last-child {
-  margin-right: 0;
-}
-
-svg {
-  left: 0 !important;
-}
-
-.container {
-  width: 100%;
-  height: 100%;
-  overflow: hidden;
-}
-.container a, .container p, .container li {
-  color: black;
-  font-family: Sinkin Sans Light;
-  font-size: 0.7em;
-}
-.container .formSend {
-  float: right;
-  width: 420px;
-  height: 55px;
-}
-.container .formSend button {
-  margin-right: 0.7em;
-  margin-bottom: 2em;
-  margin-top: 1.2em;
-  border: 0;
-  color: white;
-  width: 47%;
-  height: 50%;
-  border-radius: 1em;
-  moz-border-radius: 1em;
-  -webkit-border-radius: 1em;
-  -khtml-border-radius: 1em;
-  text-transform: uppercase;
-  font-family: "Sinkin Sans Semi-Bold";
-  outline: none;
-  cursor: pointer;
-}
-.container .formSend button.grey {
-  text-align: left;
-  padding-left: 1.5em;
-  background-color: #424242;
-}
-.container .formSend button.blue {
-  text-align: right;
-  padding-right: 1.5em;
-  background-color: #7facc1;
-}
-.container #Parameters, .container #List {
-  overflow: auto;
-  width: 25%;
-  /*height: 751px;*/
-  position: relative;
-  float: left;
-  margin-left: 1%;
-}
-.container #Parameters svg, .container #List svg {
-  width: 100%;
-}
-.container #Parameters {
-  position: relative;
-  margin-right: 1%;
-  background-color: #262626 !important;
-}
-.container #Parameters a {
-  margin-left: 3em;
-  color: white;
-}
-.container #Parameters .parametersClass {
-  border: 1px white solid;
-  margin: 0.9em;
-  padding-left: 0.3em;
-  padding-top: 0.5em;
-  padding-bottom: 0.5em;
-  border-radius: 2px;
-  moz-border-radius: 2px;
-  -webkit-border-radius: 2px;
-  -khtml-border-radius: 2px;
-  width: 88%;
-}
-.container #Parameters .parametersClass a {
-  border: 0;
-}
-.container #Parameters input.parametersClass, .container #Parameters select.parametersClass {
-  border: 0;
-  padding: 0;
-  height: 2em;
-  margin-left: 3em !important;
-  cursor: pointer;
-}
-.container #Parameters input.parametersClass {
-  width: 70%;
-  padding-left: 2em;
-  font-family: "Sinkin Sans Light";
-}
-.container #Parameters select.parametersClass {
-  width: 77%;
-  text-indent: 1em;
-  font-family: "Sinkin Sans Light";
-}
-.container #Parameters .parametersEditedNode {
-    width: 90%;
-    margin: 0.9em;
-    height: 25px;
-}
-.container #Parameters .parametersEditedNode a {
-    height: 100%;
-    text-align: center;
-    font-family: "Sinkin Sans Light";
-}
-.container #Parameters .parametersHelp {
-  position: absolute;
-  bottom: 0;
-  width: 100%;
-  padding: 0;
-  background-color: black;
-}
-.container #Parameters .parametersHelp a {
-  padding-left: 0.2em;
-  padding-right: 0.2em;
-  padding-top: 0.5em;
-  padding-bottom: 2em;
-  display: block;
-  width: auto;
-  text-align: left;
-  border: 0;
-  color: #828282;
-  font-style: italic;
-  max-height: 95%;
-  height: 95%;
-}
-.container .GraphContainer {
-  width: 46%;
-  /*height: 751px;*/
-  height: 100%;
-  max-height: 100%;
-  position: relative;
-  float: left;
-  margin-left: 1%;
-}
-.container #Graph {
-  background: -ms-linear-gradient(top, #262626 0%, #7d7e7d 100%);
-  background: linear-gradient(top, #262626 0%, #7d7e7d 100%);
-  background: -webkit-linear-gradient(top, #262626 0%, #7d7e7d 100%);
-  position: relative;
-  overflow: scroll;
-  height: 96%;
-  width: 100%;
-  position: relative;
-}
-
-.container #Graph svg {
-  overflow: scroll;
-  height: 100%;
-  display: inline-block;
-}
-
-.container #Toolbar {
-  margin: 0;
-  padding: 0;
-  background-color: black;
-  padding-top: 1.1%;
-  padding-bottom: 1.1%;
-}
-.container #Toolbar ul {
-  padding: 0;
-  margin: 0;
-  position: relative;
-}
-.container #Toolbar ul li {
-  color: white;
-  margin-right: 4em;
-}
-.container #Toolbar ul li:first-child {
-  margin-left: 3em;
-}
-.container #Toolbar ul li:last-child {
-  margin-right: 0;
-}
-.container #Toolbar ul li.border {
-  padding: 0.2em;
-  border: 1px solid white;
-}
-.container #List {
-  background-color: #3a3a3a;
-  max-height: 95%;
-  height: 95%;
-}

File diff suppressed because it is too large
+ 0 - 207
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/index.html


+ 0 - 284
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/list.js

@@ -1,284 +0,0 @@
-/// <reference path="raphael.js" />
-/// <reference path="actionKinds.js" />
-/// <reference path="viewer.js" />
-
-var AB;
-(function (AB) {
-
-    //
-    // List element
-    //
-    var ListElement = (function () {
-        function ListElement() {
-            // Members
-            this.rect = null;
-            this.text = null;
-
-            this.name = new String();
-            this.type = AB.ActionsBuilder.Type.SCENE;
-            this.kind = null;
-            this.properties = null;
-        }
-
-        ListElement.prototype.attr = function (element, attribute, value) {
-            if (value)
-                element.attr(attribute, value);
-            else
-                return element.attr(attribute);
-        }
-
-        return ListElement;
-    })();
-
-    var List = (function () {
-
-        //
-        // Public functions
-        //
-        function List(graph) {
-            // Members
-            this.telement = document.getElementById("ListTriggers");
-            this.aelement = document.getElementById("ListActions");
-            this.faelement = document.getElementById("ListFlowActions");
-
-            this.tlist = Raphael("ListTriggers", (25 * screen.width) / 100, 400);
-            this.alist = Raphael("ListActions", (25 * screen.width) / 100, 400);
-            this.falist = Raphael("ListFlowActions", (25 * screen.width) / 100, 400);
-            this.graph = graph;
-
-            this.listElements = new Array();
-            this.objectType = AB.ActionsBuilder.Type.OBJECT;
-
-            var scope = this;
-            window.onresize = function () {
-                for (var i = 0; i < scope.listElements.length; i++) {
-                    scope.listElements[i].attr(scope.listElements[i].rect, "width", scope.telement.getBoundingClientRect().width - 20);
-                }
-            }
-        }
-
-        // Clears the list of elements
-        List.prototype.clearList = function () {
-            for (var i = 0; i < this.listElements.length; i++) {
-                this._removeListElement(this.listElements[i]);
-            }
-        }
-
-        // Creates the list of elements automatically
-        List.prototype.createListElements = function () {
-            var excludedTriggers = [7, 10, 11]; // If objectType === Scene
-            var yOffset = 10;
-            var textColor = Raphael.rgb(61, 72, 76);
-            var whiteTitle = Raphael.rgb(255, 255, 255);
-
-            // Create Triggers
-            var t = this._createListElement("TRIGGERS", AB.ActionsBuilder.Type.OBJECT, null, yOffset, false, whiteTitle, this.tlist);
-            t.attr(t.text, "x", 15);
-            t.attr(t.rect, "fill", Raphael.rgb(41, 129, 255));
-            t.text.attr("font-family", "Sinkin Sans Medium");
-            t.text.attr("font-size", "11");
-            yOffset += List.ELEMENT_HEIGHT;
-
-            for (var i = 0; i < AB.ActionsBuilder.Trigger.COUNT; i++) {
-                if (excludedTriggers.indexOf(i) != -1 && this.objectType != AB.ActionsBuilder.Type.SCENE)
-                    continue;
-
-                var e = this._createListElement(AB.ActionsBuilder.Trigger[i].name, AB.ActionsBuilder.Type.TRIGGER,
-                                                AB.ActionsBuilder.Trigger[i].properties, yOffset, true, textColor,
-                                                this.tlist);
-                e.attr(e.rect, "fill", Raphael.rgb(133, 154, 185));
-
-                yOffset += List.ELEMENT_HEIGHT;
-            }
-
-            yOffset += List.ELEMENT_HEIGHT;
-            this.tlist.canvas.style.height = this.telement.style.height = yOffset + "px";
-            this._createCollapseAnimation(this.tlist, this.telement, yOffset, t);
-
-            // Create Actions
-            yOffset = 10;
-
-            var a = this._createListElement("ACTIONS", AB.ActionsBuilder.Type.OBJECT, null, yOffset, false, textColor, this.alist);
-            a.attr(a.text, "x", 15);
-            a.attr(a.rect, "fill", Raphael.rgb(255, 220, 42));
-            a.text.attr("font-family", "Sinkin Sans Medium");
-            a.text.attr("font-size", "11");
-            yOffset += List.ELEMENT_HEIGHT;
-
-            for (var i = 0; i < AB.ActionsBuilder.Action.COUNT; i++) {
-                var e = this._createListElement(AB.ActionsBuilder.Action[i].name, AB.ActionsBuilder.Type.ACTION,
-                                                AB.ActionsBuilder.Action[i].properties, yOffset, true, textColor,
-                                                this.alist);
-                e.attr(e.rect, "fill", Raphael.rgb(182, 185, 132));
-
-                yOffset += List.ELEMENT_HEIGHT;
-            }
-
-            yOffset += List.ELEMENT_HEIGHT;
-            this.alist.canvas.style.height = this.aelement.style.height = yOffset + "px";
-            this._createCollapseAnimation(this.alist, this.aelement, yOffset, a);
-
-            // Create flow control
-            yOffset = 10;
-
-            var f = this._createListElement("FLOW CONTROL", AB.ActionsBuilder.Type.OBJECT, null, yOffset, false, whiteTitle, this.falist);
-            f.attr(f.text, "x", 15);
-            f.attr(f.rect, "fill", Raphael.rgb(255, 41, 53));
-            f.text.attr("font-family", "Sinkin Sans Medium");
-            f.text.attr("font-size", "11");
-            yOffset += List.ELEMENT_HEIGHT;
-
-            for (var i = 0; i < AB.ActionsBuilder.FlowAction.COUNT; i++) {
-                var e = this._createListElement(AB.ActionsBuilder.FlowAction[i].name, AB.ActionsBuilder.Type.FLOW_CONTROL,
-                                                AB.ActionsBuilder.FlowAction[i].properties, yOffset, true, textColor,
-                                                this.falist);
-                e.attr(e.rect, "fill", Raphael.rgb(185, 132, 140));
-
-                yOffset += List.ELEMENT_HEIGHT;
-            }
-
-            yOffset += List.ELEMENT_HEIGHT;
-            this.falist.canvas.style.height = this.faelement.style.height = yOffset + "px";
-            this._createCollapseAnimation(this.falist, this.faelement, yOffset, f);
-        }
-
-        // Sets the color theme of the list (background)
-        List.prototype.setColorTheme = function (color) {
-            this.tlist.canvas.style.backgroundColor = color;
-            this.alist.canvas.style.backgroundColor = color;
-            this.falist.canvas.style.backgroundColor = color;
-        }
-
-        //
-        // Private functions
-        //
-
-        // Creates a list element
-        // name: the element's name
-        // type: the elements type (TRIGGER, ACTION, FLOW_CONTROL)
-        // properties: array of properties
-        // yOffset: the y position of the element
-        // drag: boolean, if the element should be animated
-        // textColor: optional, the text color
-        // list: the raphaeljs object
-        List.prototype._createListElement = function (name, type, properties, yOffset, drag, textColor, list) {
-            var e = new ListElement();
-
-            e.rect = list.rect(10, yOffset, this.telement.getBoundingClientRect().width - 30, List.ELEMENT_HEIGHT);
-            e.text = list.text(e.rect.attr("x") + 20, yOffset + e.rect.attr("height") / 2, name);
-            e.name = name;
-            e.type = type;
-            e.properties = properties;
-
-            e.rect.attr("fill", Raphael.rgb(64, 64, 64));
-            e.rect.attr("stroke", Raphael.rgb(58, 58, 58));
-            e.text.attr("font-size", "12");
-            e.text.attr("text-anchor", "start");
-            e.text.attr("font-family", "Sinkin Sans Light");
-            if (textColor)
-                e.text.attr("fill", textColor);
-
-            if (drag) {
-                this._createListElementAnimation(e);
-            }
-
-            this.listElements.push(e);
-            return e;
-        }
-
-        // Removes a list element
-        // element: the list element to remove
-        List.prototype._removeListElement = function (element) {
-            element.rect.remove();
-            element.text.remove();
-        }
-
-        // Creates the collapse / expand animation
-        // element: the element to animated
-        // htmlElement: the html element container
-        // expandedHeight: the height when list is expanded
-        // onElement: the element that receives the click element
-        List.prototype._createCollapseAnimation = function (element, htmlElement, expandedHeight, onElement) {
-            var onClick = function (event) {               
-                var height = htmlElement.style.height;
-                if (height == expandedHeight + "px") {
-                    htmlElement.style.height = element.canvas.style.height = 35 + "px";
-                }
-                else {
-                    htmlElement.style.height = element.canvas.style.height = expandedHeight + "px";
-                }
-            };
-
-            onElement.rect.click(onClick);
-        }
-
-        // Creates the animation of list elements
-        // element: the element to animate
-        List.prototype._createListElementAnimation = function (element) {
-            var scope = this;
-            var mousex, mousey;
-
-            var onMove = function (dx, dy, x, y, event) {
-                mousex = x;
-                mousey = y;
-            };
-
-            var onStart = function (x, y, event) {
-                element.rect.animate({
-                    x: -10,
-                    opacity: 0.25
-                }, 500, ">");
-                element.text.animate({
-                    x: 10,
-                    opacity: 0.25
-                }, 500, ">");
-            };
-
-            var onEnd = function (event) {
-                element.rect.animate({
-                    x: 10,
-                    opacity: 1.0
-                }, 500, "<");
-                element.text.animate({
-                    x: 30,
-                    opacity: 1.0
-                }, 500, "<");
-
-                var x = mousex - scope.graph.graph.canvas.getBoundingClientRect().left;
-                var y = mousey - scope.graph.graph.canvas.getBoundingClientRect().top;
-                var dragResult = scope.graph.traverseGraph(null, x, y);
-
-                if (dragResult.hit) {
-                    if (element.type == AB.ActionsBuilder.Type.TRIGGER && dragResult.element != scope.graph.root.action)
-                        return;
-
-                    if (element.type == AB.ActionsBuilder.Type.ACTION && dragResult.element == scope.graph.root.action)
-                        return;
-
-                    if (element.type == AB.ActionsBuilder.Type.FLOW_CONTROL && (dragResult.element == scope.graph.root.action || (dragResult.element.type == AB.ActionsBuilder.Type.FLOW_CONTROL && dragResult.element.parent.hub == null)))
-                        return;
-
-                    if (element.type == AB.ActionsBuilder.Type.FLOW_CONTROL && dragResult.element.combine)
-                        return;
-
-                    if (!dragResult.element.combine && dragResult.element.children.length > 0 && dragResult.element.type != AB.ActionsBuilder.Type.TRIGGER && dragResult.element != scope.graph.root.action)
-                        return;
-
-                    scope.graph.addNode(dragResult.element, element);
-                    scope.graph.update();
-                }
-            };
-
-            element.rect.drag(onMove, onStart, onEnd);
-            element.text.drag(onMove, onStart, onEnd);
-        }
-
-        List.ELEMENT_HEIGHT = 25;
-
-        return List;
-    })();
-
-    AB.List = List;
-    AB.ListElement = ListElement;
-
-})(AB || (AB = { }));

+ 0 - 307
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/parametersManager.js

@@ -1,307 +0,0 @@
-/// <reference path="raphael.js" />
-/// <reference path="actionKinds.js" />
-/// <reference path="viewer.js" />
-
-var AB;
-(function (AB) {
-
-    var ParametersManager = (function () {
-
-        function ParametersManager(viewer) {
-            // Members
-            this.viewer = viewer;
-            this.parametersElement = document.getElementById("Parameters");
-        }
-
-        // Clears the parameters view (right side)
-        ParametersManager.prototype.clearParameters = function () {
-            if (this.divHelpText) {
-                this.divHelpText.parentNode.removeChild(this.divHelpText);
-                this.divHelpText = null;
-            }
-
-            while (this.parametersElement.childNodes.length)
-                this.parametersElement.removeChild(this.parametersElement.firstChild);
-        }
-
-        // Creates the help section
-        ParametersManager.prototype.createHelpSection = function (element) {
-            var divHelpText = document.createElement("div");
-            divHelpText.className = "parametersHelp";
-            this.parametersElement.appendChild(divHelpText);
-
-            var helpText = document.createElement("a");
-            helpText.innerHTML = AB.ActionsBuilder.GetDescriptionFromActionName(element.action.name);
-            helpText.className = "parametersClass";
-            divHelpText.appendChild(helpText);
-        }
-
-        // Creates parameters for the given element (node / action)
-        ParametersManager.prototype.createParameters = function (element) {
-            // Events
-            var onInputChange = function (input, propertyID) {
-                return function () {
-                    var value = input.value;
-                    element.action.propertiesResults[propertyID] = value;
-                };
-            };
-
-            var onTargetTypeChanged = function (targetTypeSelect, propertyPathSelect, targetNameSelect, propertyID) {
-                return function () {
-                    var selected = targetTypeSelect.selectedIndex;
-                    var value = targetTypeSelect.options[selected].value;
-
-                    if (targetNameSelect != null && value != "SceneProperties") {
-                        var array = null;
-                        // Keep target name value
-                        var nameValue = targetNameSelect.value;
-
-                        targetNameSelect.length = 0;
-
-                        if (value == "MeshProperties") array = AB.ActionsBuilder.MeshesList;
-                        else if (value == "LightProperties") array = AB.ActionsBuilder.LightsList;
-                        else if (value == "CameraProperties") array = AB.ActionsBuilder.CamerasList;
-
-                        for (var i = 0; i < array.length; i++) {
-                            var option = document.createElement("option");
-                            option.value = array[i];
-                            option.innerHTML = array[i];
-                            targetNameSelect.add(option);
-                        }
-
-                        targetNameSelect.value = nameValue;
-                    }
-
-                    if (propertyPathSelect != null) {
-                        // Get array of properties for selected object type (scene, camera, light, mesh, ...)
-                        var array = AB.ActionsBuilder[targetTypeSelect.options[selected].value];
-                        propertyPathSelect.length = 0;
-
-                        for (var j = 0; j < array.length; j++) {
-                            var option = document.createElement("option");
-                            option.value = array[j].name;
-                            option.innerHTML = array[j].name;
-                            propertyPathSelect.add(option);
-                        }
-                    }
-                    element.action.properties[propertyPathSelect != null ? propertyID - 1 : propertyID].targetType = targetTypeSelect.options[selected].value;
-                };
-            };
-
-            var onTargetNameChanged = function (targetNameSelect, propertyID) {
-                return function () {
-                    element.action.propertiesResults[propertyID] = targetNameSelect.options[targetNameSelect.selectedIndex].value;
-                }
-            }
-
-            var onPropertyPathChanged = function (propertyPathSelect, additionalInput, propertyID) {
-                return function () {
-                    additionalInput.value = "";
-                    element.action.propertiesResults[propertyID] = propertyPathSelect.options[propertyPathSelect.selectedIndex].value;
-                };
-            };
-
-            var onAdditionalPropertyPathChanged = function (propertyPathSelect, additionalInput, propertyID) {
-                return function () {
-                    var propertyPath = propertyPathSelect.options[propertyPathSelect.selectedIndex].value;
-                    if (additionalInput.value != "")
-                        propertyPath += "." + additionalInput.value;
-                    element.action.propertiesResults[propertyID] = propertyPath;
-                };
-            };
-
-            var onConditionOperatorChanged = function (conditionOperatorSelect, propertyID) {
-                return function () {
-                    element.action.propertiesResults[propertyID] = conditionOperatorSelect.options[conditionOperatorSelect.selectedIndex].value;
-                };
-            };
-
-            // Special Elements
-            var targetTypeSelect = null;
-            var targetNameSelect = null;
-            var propertyPathSelect = null;
-            var soundNameSelect = null;
-
-            // Clear view (div)
-            this.clearParameters();
-
-            // Get properties
-            var p = element.action.properties;
-            var pr = element.action.propertiesResults;
-
-            // Create edition presentation
-            var divEditedNode = document.createElement("div");
-            divEditedNode.className = "parametersEditedNode";
-            divEditedNode.style.backgroundColor = this.viewer.getSelectedNodeColor(element.action, this.viewer.isParentDetached(element.action));
-            divEditedNode.style.border = "2px solid white";
-
-            var textEditedNode = document.createElement("a");
-            textEditedNode.className = "parametersEditedNode";
-            textEditedNode.innerHTML = element.action.name;
-            textEditedNode.style.verticalAlign = "middle";
-            textEditedNode.style.textAlign = "center";
-            if (element.action.type == AB.ActionsBuilder.Type.ACTION)
-                textEditedNode.style.color = "black";
-            else
-                textEditedNode.style.color = "white";
-            textEditedNode.style.width = textEditedNode.style.height = "100%";
-            divEditedNode.appendChild(textEditedNode);
-
-            this.parametersElement.appendChild(divEditedNode);
-
-            if (p.length == 0) {
-                this.createHelpSection(element);
-                return;
-            }
-
-            // Create parameters
-            for (var i = 0; i < p.length; i++) {
-                // Create separator
-                var separator = document.createElement("hr");
-                separator.noShade = true;
-                separator.style.width = "90%";
-
-                this.parametersElement.appendChild(separator);
-
-                // Parameter text
-                var propertyText = document.createElement("a");
-                propertyText.text = p[i].text;
-
-                this.parametersElement.appendChild(propertyText);
-
-                // If target, add the input element + combo box with target type
-                if (p[i].text == "sound") {
-                    soundNameSelect = document.createElement("select");
-                    soundNameSelect.className = "parametersClass";
-
-                    for (var j = 0; j < AB.ActionsBuilder.SoundsList.length; j++) {
-                        var name = AB.ActionsBuilder.SoundsList[j];
-                        var option = document.createElement("option");
-                        option.value = option.innerHTML = name;
-                        option.className = "parametersClass";
-                        soundNameSelect.add(option);
-                    }
-
-                    soundNameSelect.value = pr[i];
-                    this.parametersElement.appendChild(document.createElement("br"));
-                    this.parametersElement.appendChild(soundNameSelect);
-
-                    soundNameSelect.onchange = onInputChange(soundNameSelect, i);
-
-                    continue;
-                }
-                else if (p[i].text == "target"
-                    || (element.action.type == AB.ActionsBuilder.Type.TRIGGER && p[i].text == "parameter")
-                    || p[i].text == "parent")
-                {
-                    targetTypeSelect = document.createElement("select");
-                    targetTypeSelect.className = "parametersClass";
-
-                    for (var j = 0; j < AB.ActionsBuilder.DataTypesNames.length; j++) {
-                        var data = AB.ActionsBuilder.DataTypesNames[j];
-                        var option = document.createElement("option");
-                        option.value = data.data;
-                        option.innerHTML = data.name;
-                        option.className = "parametersClass";
-                        targetTypeSelect.add(option);
-                    }
-
-                    targetTypeSelect.value = p[i].targetType;
-
-                    this.parametersElement.appendChild(document.createElement("br"));
-                    this.parametersElement.appendChild(targetTypeSelect);
-
-                    // List names
-                    targetNameSelect = document.createElement("select");
-                    targetNameSelect.className = "parametersClass";
-
-                    this.parametersElement.appendChild(document.createElement("br"));
-                    this.parametersElement.appendChild(targetNameSelect);
-
-                    onTargetTypeChanged(targetTypeSelect, null, targetNameSelect, i)();
-
-                    targetNameSelect.value = pr[i];
-
-                    targetTypeSelect.onchange = onTargetTypeChanged(targetTypeSelect, null, targetNameSelect, i);
-                    targetNameSelect.onchange = onTargetNameChanged(targetNameSelect, i);
-
-                    continue;
-                }
-                // If propertyPath, add the combox box to select the property and input element for additional property
-                else if (p[i].text == "propertyPath") {
-                    propertyPathSelect = document.createElement("select");
-                    propertyPathSelect.className = "parametersClass";
-
-                    this.parametersElement.appendChild(document.createElement("br"));
-                    this.parametersElement.appendChild(propertyPathSelect);
-
-                    // Special input, then continue after its creation
-                    var additionalInput = document.createElement("input");
-                    additionalInput.setAttribute("value", "");
-                    additionalInput.className = "parametersClass";
-
-                    this.parametersElement.appendChild(document.createElement("br"));
-                    this.parametersElement.appendChild(additionalInput);
-
-                    // If propertyPath exists, then target exists
-                    targetTypeSelect.onchange = onTargetTypeChanged(targetTypeSelect, propertyPathSelect, targetNameSelect, i);
-                    propertyPathSelect.onchange = onPropertyPathChanged(propertyPathSelect, additionalInput, i);
-                    additionalInput.onkeyup = onAdditionalPropertyPathChanged(propertyPathSelect, additionalInput, i);
-
-                    // Fill propertyPath combo box
-                    onTargetTypeChanged(targetTypeSelect, propertyPathSelect, targetNameSelect, i)();
-
-                    // Set selected property
-                    var propertyName = pr[i].split(".");
-                    propertyPathSelect.value = propertyName[0];
-
-                    var additionPropertyName = "";
-                    for (var j = 1; j < propertyName.length; j++)
-                        additionPropertyName += propertyName[j];
-
-                    additionalInput.setAttribute("value", additionPropertyName);
-
-                    // Finish
-                    continue;
-                }
-                    // Value condition, add combo box for operator type
-                else if (p[i].text == "operator") {
-                    var conditionOperatorSelect = document.createElement("select");
-                    conditionOperatorSelect.className = "parametersClass";
-
-                    for (var j = 0; j < AB.ActionsBuilder.FlowActionOperators.length; j++) {
-                        var option = document.createElement("option");
-                        option.value = AB.ActionsBuilder.FlowActionOperators[j];
-                        option.innerHTML = AB.ActionsBuilder.FlowActionOperators[j];
-                        conditionOperatorSelect.add(option);
-                    }
-
-                    conditionOperatorSelect.value = pr[i];
-                    conditionOperatorSelect.onchange = onConditionOperatorChanged(conditionOperatorSelect, i);
-
-                    this.parametersElement.appendChild(document.createElement("br"));
-                    this.parametersElement.appendChild(conditionOperatorSelect);
-
-                    continue;
-                }
-
-                var propertyInput = document.createElement("input");
-                propertyInput.setAttribute("value", pr[i]);
-                propertyInput.onkeyup = onInputChange(propertyInput, i);
-                propertyInput.className = "parametersClass";
-
-                //this.parametersElement.appendChild(document.createElement("br"));
-                this.parametersElement.appendChild(propertyInput);
-            }
-
-            // Create help text (bottom)
-            this.createHelpSection(element);
-        }
-
-        return ParametersManager;
-
-    })();
-
-    AB.ParametersManager = ParametersManager;
-
-})(AB || (AB = {}));

+ 0 - 216
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/utils.js

@@ -1,216 +0,0 @@
-/// <reference path="raphael.js" />
-/// <reference path="viewer.js" />
-
-var AB;
-(function (AB) {
-
-    var Utils = (function () {
-        function Utils(viewer) {
-            // Members
-            this.viewer = viewer;
-        }
-
-        // Removes the selected node
-        Utils.prototype.onRemoveNode = function () {
-            if (!this.viewer.selectedNode)
-                return;
-
-            var node = this.viewer.selectedNode;
-
-            if (node.type == AB.ActionsBuilder.Type.FLOW_CONTROL && node.parent.combine)
-                this.viewer.selectedNode = node.parent;
-
-            node.parent.removeChild(node);
-            this.viewer._removeAction(node, false);
-
-            if (node.combine) {
-                // Remove hub
-                var hub = node.hub;
-
-                node.parent.removeChild(hub.action);
-                this.viewer._removeAction(hub.action, false);
-
-                if (hub.action.children.length > 0)
-                    node.hub.action.children[0].parent = node.parent;
-            }
-
-            this.viewer.update();
-            this.viewer.parametersManager.clearParameters();
-
-            this.viewer.selectedNode = null;
-        }
-
-        // Removes the selected branch (starting from the selected node)
-        Utils.prototype.onRemoveBranch = function () {
-            if (!this.viewer.selectedNode)
-                return;
-
-            var node = this.viewer.selectedNode;
-
-            if (node.type == AB.ActionsBuilder.Type.FLOW_CONTROL && node.parent.combine)
-                this.selectedNode = node.parent;
-
-            node.parent.removeChild(this.selectedNode);
-            this.viewer._removeAction(node, true);
-
-            this.viewer.update();
-            this.viewer.parametersManager.clearParameters();
-
-            this.viewer.selectedNode = null;
-        }
-
-        // Detaches the selected node
-        // forceDetach: forces the Detach Color (green) for children of the selected node
-        // forceAttach: same as forceDetach but for the original node color
-        Utils.prototype.onDetachNode = function (forceDetach, forceAttach) {
-            if (!this.viewer.selectedNode)
-                return;
-
-            var node = this.viewer.selectedNode;
-
-            if (forceDetach == null) forceDetach = false;
-            if (forceAttach == null) forceAttach = false;
-
-            var detached = node.node.detached;
-            if (forceAttach)
-                detached = false;
-            else if (forceDetach)
-                detached = true;
-            else
-                detached = !detached;
-
-            node.node.detached = detached;
-
-            var scope = this;
-            var resetColor = function (root, color) {
-                var col = color == null ? scope.viewer.getNodeColor(root, scope.viewer.isParentDetached(root)) : color;
-                root.node.attr(root.node.rect, "fill", col);
-
-                if (root.node.line)
-                    root.node.attr(root.node.line, "stroke", col);
-
-                if (root.combine) {
-                    for (var i = 0; i < root.combineArray.length; i++) {
-                        resetColor(root.combineArray[i], color);
-                    }
-                }
-
-                for (var i = 0; i < root.children.length; i++) {
-                    resetColor(root.children[i], color);
-                }
-            };
-
-            this.viewer._setLine(node);
-            resetColor(node, !detached ? null : this.viewer.getNodeColor(node));
-        }
-
-        // Disconnects all triggers
-        Utils.prototype.onDetachAll = function (forceDetach, forceAttach) {
-            var scope = this;
-
-            var detach = function (root) {
-                scope.viewer.selectedNode = root;
-                scope.onDetachNode(forceDetach, forceAttach);
-            };
-
-            for (var i = 0; i < this.viewer.root.action.children.length; i++)
-                detach(this.viewer.root.action.children[i]);
-        }
-
-        // Copies the selected node structure (except root node) to the
-        // clipboard
-        Utils.prototype.onCopyStructure = function () {
-            if (!this.viewer.selectedNode)
-                return;
-
-            var structure = this.viewer.createJSON(this.viewer.selectedNode);
-            var asText = JSON.stringify(structure);
-
-            window.clipboardData.setData("text", asText);
-        }
-
-        // Pastes the previously copied structure (onCopyStructure) to
-        // the selected node
-        Utils.prototype.onPasteStructure = function () {
-            if (!this.viewer.selectedNode)
-                return;
-
-            var asText = window.clipboardData.getData("text");
-            var isJson = asText.length > 0 && asText[0] == "{" && asText[asText.length - 1] == "}";
-            var structure = JSON.parse(asText);
-            var node = this.viewer.selectedNode;
-
-            if (structure.type == AB.ActionsBuilder.Type.TRIGGER && node.node != this.viewer.root) {
-                alert("You can't paste a trigger if the selected node isn't the root object");
-                return;
-            }
-
-            if (structure.type != AB.ActionsBuilder.Type.TRIGGER && node.node == this.viewer.root) {
-                alert("You can't paste an action or condition if the selected node is the root object");
-                return;
-            }
-
-            this.viewer.loadFromJSON(structure, node);
-            this.viewer.update();
-        }
-
-        // Reduces the select node's width
-        Utils.prototype.onReduce = function (forceExpand, forceReduce) {
-            if (!this.viewer.selectedNode)
-                return;
-
-            if (forceExpand == null) forceExpand = false;
-            if (forceReduce == null) forceReduce = false;
-
-            var node = this.viewer.selectedNode.node;
-            var width = node.attr(node.rect, "width");
-
-            if ((width >= Graph.NODE_WIDTH && !forceExpand) || forceReduce) {
-                node.text.hide();
-                node.rect.stop();
-            }
-            else {
-                node.text.show();
-                node.attr(node.rect, "opacity", 1.0);
-            }
-
-            node.attr(node.rect, "width", (width >= Graph.NODE_WIDTH * this.viewer.zoom && !forceExpand) || forceReduce ? Graph.NODE_MINIMIZED_WIDTH * this.viewer.zoom : Graph.NODE_WIDTH * this.viewer.zoom);
-            node.minimized = !node.minimized;
-
-            this.viewer.update();
-        }
-
-        // Reduces all graph's nodes
-        Utils.prototype.onReduceAll = function (forceExpand) {
-            if (forceExpand == null)
-                forceExpand = false;
-
-            var scope = this;
-
-            var reduce = function (root) {
-                scope.viewer.selectedNode = root;
-                scope.onReduce(forceExpand, forceExpand ? false : true);
-
-                if (root.combine) {
-                    for (var i = 0; i < root.combineArray.length; i++)
-                        reduce(root.combineArray[i]);
-                }
-
-                for (var i = 0; i < root.children.length; i++)
-                    reduce(root.children[i]);
-
-            };
-
-            for (var i = 0; i < this.viewer.root.action.children.length; i++)
-                reduce(this.viewer.root.action.children[i]);
-
-            this.viewer.selectedNode = null;
-        }
-
-        return Utils;
-
-    })();
-
-    AB.Utils = Utils;
-
-})(AB || (AB = {}));

+ 0 - 750
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/viewer.js

@@ -1,750 +0,0 @@
-/// <reference path="raphael.js" />
-/// <reference path="action.js" />
-/// <reference path="contextmenu.js" />
-/// <reference path="viewertoolbar.js" />
-/// <reference path="parametersManager.js" />
-/// <reference path="utils.js" />
-
-var AB;
-(function (AB) {
-
-    var Graph = (function () {
-
-        //
-        // Public functions
-        //
-        function Graph() {
-            var scope = this;
-
-            // Members
-            this.element = document.getElementById("Graph");
-            this.graph = Raphael("Graph", (50 * screen.width) / 100, screen.height);
-            this.root = this._createNode("Object name", Raphael.rgb(255, 255, 255), true);
-
-            this.utils = new AB.Utils(this);
-            this.contextMenu = new AB.ContextMenu(this);
-            this.toolbar = new AB.ToolBar(this);
-            this.parametersManager = new AB.ParametersManager(this);
-
-            this.mousex = 0;
-            this.mousey = 0;
-            this.objectName = "";
-            this.editing = false;
-            this.zoom = 1.0;
-
-            this.selectedNode = null;
-
-            this.element.onmouseover = function () {
-                scope.editing = false;
-            };
-            this.element.onmouseout = function () {
-                scope.editing = true;
-            };
-
-            document.addEventListener("click", function (event) {
-                if (!scope.contextMenu.showing) {
-                    scope.onClick(event);
-                }
-            });
-            document.ondblclick = function (event) {
-                var result = scope.traverseGraph(null, scope.mousex, scope.mousey);
-                if (result.hit && result.element.node != scope.root) {
-                    scope.onReduce();
-                }
-            };
-            document.onmousemove = function (event) {
-                scope.mousex = event.clientX - scope.graph.canvas.getBoundingClientRect().left;
-                scope.mousey = event.clientY - scope.graph.canvas.getBoundingClientRect().top;
-            };
-
-            // Set properties
-            this.element.scrollLeft = (this.element.getBoundingClientRect().width / 2) + (Graph.NODE_WIDTH / 2);
-        }
-
-        // Handles the click event. Called by this and this.contextmenu
-        // event: the event object
-        Graph.prototype.onClick = function (event) {
-            var result = this.traverseGraph(null, this.mousex, this.mousey, true);
-
-            if (!this.editing) {
-                if (this.selectedNode != null) {
-                    var detached = this.isParentDetached(this.selectedNode);
-                    this.selectedNode.node.attr(this.selectedNode.node.rect, "fill", this.getNodeColor(this.selectedNode, detached));
-                    this.selectedNode = null;
-                    if (!result.hit)
-                        this.parametersManager.clearParameters();
-                }
-
-                if (result.hit && result.element.node != this.root) {
-                    this.selectedNode = result.element;
-                    this.selectedNode.node.attr(this.selectedNode.node.rect, "fill", this.getSelectedNodeColor(this.selectedNode, detached));
-                }
-
-                if (!result.hit)
-                    this.selectedNode = null;
-            }
-        }
-
-        // Returns the node's color for a given type
-        // action : the action to test
-        // returns the node color
-        Graph.prototype.getSelectedNodeColor = function (action, detached) {
-            // Detached
-            if (action.detached || (action.node && action.node.detached) || detached)
-                return Raphael.rgb(96, 122, 14);
-
-            // Get proper color
-            var color = Raphael.rgb(255, 255, 255); // Default color for root
-            switch (action.type) {
-                case AB.ActionsBuilder.Type.TRIGGER: color = Raphael.rgb(41, 129, 255); break;
-                case AB.ActionsBuilder.Type.ACTION: color = Raphael.rgb(255, 220, 42); break;
-                case AB.ActionsBuilder.Type.FLOW_CONTROL: color = Raphael.rgb(255, 41, 53); break;
-            }
-
-            return color;
-        }
-
-        Graph.prototype.getNodeColor = function (action, detached) {
-            if (action.detached || (action.node && action.node.detached) || detached)
-                return Raphael.rgb(96, 122, 14);
-
-            // Get proper color
-            var color = Raphael.rgb(255, 255, 255); // Default color for root
-            switch (action.type) {
-                case AB.ActionsBuilder.Type.TRIGGER: color = Raphael.rgb(133, 154, 185); break;
-                case AB.ActionsBuilder.Type.ACTION: color = Raphael.rgb(182, 185, 132); break;
-                case AB.ActionsBuilder.Type.FLOW_CONTROL: color = Raphael.rgb(185, 132, 140); break;
-            }
-
-            return color;
-        }
-
-        Graph.prototype.isParentDetached = function (node) {
-            var parent = node.parent;
-            while (parent != null) {
-                if (parent.node.detached)
-                    return true;
-                parent = parent.parent;
-            }
-
-            return false;
-        }
-
-        // Adds a node to the graph
-        // parent : the parent of the added node
-        // listElement : the values
-        Graph.prototype.addNode = function (parent, listElement) {
-            var color = this.getNodeColor(listElement);
-
-            var n = this._createNode(listElement.name, color, parent.combine ? true : false);
-            if (listElement.name == "CombineAction") {
-                n.action.combine = true;
-
-                var hubElement = AB.ActionsBuilder.FlowAction.Hub;
-                var hubType = AB.ActionsBuilder.Type.FLOW_CONTROL;
-                n.action.hub = this._createNode(hubElement.name, this.getNodeColor({ type: hubType }), false);
-                n.action.hub.action.type = hubType;
-                n.action.addChild(n.action.hub.action);
-                this._createNodeAnimation(n.action.hub);
-            }
-
-            n.action.name = listElement.name;
-            n.action.type = listElement.type;
-            n.detached = listElement.detached || false;
-            n.action.properties = listElement.properties;
-
-            for (var i = 0; i < listElement.properties.length; i++)
-                n.action.propertiesResults.push(listElement.properties[i].value);
-
-            if (parent && !parent.combine) {
-                parent.addChild(n.action);
-            }
-            else if (parent.combine) {
-                // Create hub
-                parent.combineArray.push(n.action);
-                n.action.parent = parent;
-                parent.node.attr(parent.node.text, "text", "");
-            }
-
-            this._createNodeAnimation(n);
-
-            return n;
-        }
-
-        // Updates the graph
-        Graph.prototype.update = function () {
-            var scope = this;
-            var rootChildID = 0;
-
-            var setNodeSize = function(node) {
-                if (node.minimized) {
-                    node.attr(node.rect, "width", Graph.NODE_MINIMIZED_WIDTH * scope.zoom);
-                    node.attr(node.rect, "height", Graph.NODE_HEIGHT * scope.zoom);
-                }
-                else {
-                    node.attr(node.rect, "width", Graph.NODE_WIDTH * scope.zoom);
-                    node.attr(node.rect, "height", Graph.NODE_HEIGHT * scope.zoom);
-                }
-                node.attr(node.text, "font-size", 11 * scope.zoom);
-            }
-
-            var onUpdate = function (action, yOffset) {
-                var node = action.node;
-                var parent = action.parent ? action.parent.node : null;
-
-                // Set size of node according to zoom
-                if (action.combine) {
-                    var length = 0;
-                    for (var i = 0; i < action.combineArray.length; i++) {
-                        var n = action.combineArray[i].node;
-
-                        setNodeSize(n);
-
-                        length += n.attr(n.rect, "width");
-                    }
-                }
-                setNodeSize(node);
-
-                // Set position
-                if (parent) {
-                    scope._setNodePosition(node, parent.attr(parent.rect, "x"), yOffset);
-                    scope._setLine(action);
-                }
-
-                // Calculate total width
-                var totalWidth = 0;
-                for (var i = 0; i < action.children.length; i++) {
-                    var n = action.children[i].node;
-                    totalWidth += n.attr(n.rect, "width");
-                }
-
-                var nodeWidth = node.attr(node.rect, "width");
-                var nodex = node.attr(node.rect, "x");
-
-                var startingXPos = nodex + (nodeWidth / 2) - (totalWidth / 2);
-
-                // Recursively set position of children
-                for (var i = 0; i < action.children.length; i++) {
-
-                    var n = action.children[i].node;
-                    var newx = startingXPos;
-                    var newy = yOffset + Graph.VERTICAL_OFFSET * scope.zoom;
-
-                    onUpdate(n.action, newy);
-
-                    scope._setNodePosition(n, newx, newy);
-                    scope._setLine(n.action);
-                    startingXPos += n.attr(n.rect, "width");
-                }
-            };
-
-            var onPosition = function (action, maxWidth) {
-
-                var total = 0;
-                var start = action.combine && action.combineArray.length > 1 ? 0 : 1;
-
-                for (var i = start; i < action.children.length; i++) {
-                    var n = action.children[i].node;
-
-                    if (action.combine) {
-                        for (var j = 1; j < action.combineArray.length; j++) {
-                            var cn = action.combineArray[j].node;
-                            total += cn.attr(cn.rect, "width");
-                        }
-                    }
-                    else
-                        total += n.attr(n.rect, "width");
-                }
-
-                if (total > maxWidth) {
-                    maxWidth = total;
-                }
-
-                for (var i = 0; i < action.children.length; i++) {
-                    maxWidth = onPosition(action.children[i], maxWidth);
-                }
-
-                return maxWidth;
-
-            };
-
-            // Set root node position / scale and recursively set position of its children
-            this._setNodePosition(this.root, (this.graph.width / 2) - (Graph.NODE_WIDTH / 2) * this.zoom, 10);
-            this.root.attr(this.root.rect, "width", Graph.NODE_WIDTH * scope.zoom);
-            this.root.attr(this.root.rect, "height", Graph.NODE_HEIGHT * scope.zoom);
-
-            onUpdate(this.root.action, 10 * this.zoom);
-
-            // Get total widths
-            var widths = new Array();
-            /*
-            object:
-                {
-                    triggerWidth: number
-                    childrenWidths: new Array<number>()
-                }
-            */
-
-            for (var i = 0; i < scope.root.action.children.length; i++) {
-                var a = scope.root.action.children[i];
-
-                var obj = {
-                    triggerWidth: onPosition(a, 0),
-                    childrenWidths: new Array()
-                };
-
-                for (var j = 0; j < a.children.length; j++) {
-                    var cw = onPosition(a.children[j], 0);
-                    obj.childrenWidths.push(cw);
-                    obj.triggerWidth += cw;
-                }
-
-                widths.push(obj);
-            }
-
-            // Set new position of children
-            var rx = scope.root.attr(scope.root.rect, "x");
-            var rwidth = 0;
-            var cwidth = 0;
-
-            for (var i = 0; i < scope.root.action.children.length; i++) {
-                var a = scope.root.action.children[i];
-                var tx = a.node.attr(a.node.rect, "x");
-
-                for (var j = 0; j < a.children.length; j++) {
-                    var n = a.children[j].node;
-                    var x = n.attr(n.rect, "x");
-                    var y = n.attr(n.rect, "y");
-                    var inverse = x >= tx ? 1 : -1;
-
-                    scope._setNodePosition(n, x + (scope.root.action.children.length > 1 ? widths[i].childrenWidths[j] / 1.8 : 0) * inverse, y);
-                    scope._setLine(n.action);
-
-                    scope._resizeCanvas(n);
-                    cwidth += widths[i].childrenWidths[j] / 2;
-                }
-
-                if (scope.root.action.children.length > 1) {
-                    var n = a.node;
-                    var x = n.attr(n.rect, "x");
-                    var y = n.attr(n.rect, "y");
-                    var inverse = x >= rx && i == 0 && !n.minimized ? 1 : -1;
-
-                    scope._setNodePosition(n, x + rwidth + (i > 1 ? widths[i - 1].triggerWidth / 1.8 : 0) + (widths[i].triggerWidth / 1.8) * inverse, y);
-                    scope._setLine(n.action);
-
-                    scope._resizeCanvas(n);
-                }
-
-                rwidth += widths[i].triggerWidth / 2;
-            }
-        }
-
-        // Creates the JSON according to the graph
-        // root: the root object to start with
-        Graph.prototype.createJSON = function (root) {
-            if (!root) root = this.root.action;
-
-            var action = {};
-            action.type = root.type;
-            action.name = root.name;
-            action.detached = root.node.detached;
-            action.children = new Array();
-            action.combine = new Array();
-
-            action.properties = new Array();
-            for (var i = 0; i < root.properties.length; i++) {
-                action.properties[i] = { name: root.properties[i].text, value: root.propertiesResults[i] };
-                if (root.properties[i].targetType != null)
-                    action.properties[i].targetType = root.properties[i].targetType;
-            }
-
-            if (root.combine) {
-                for (var i = 0; i < root.combineArray.length; i++) {
-                    var combinedAction = root.combineArray[i];
-                    action.combine.push(this.createJSON(combinedAction, action));
-                }
-            }
-            
-            if (root.combine)
-                root = root.children[0]; // The hub
-
-            for (var i = 0; i < root.children.length; i++) {
-                action.children.push(this.createJSON(root.children[i], action));
-            }
-
-            return action;
-        }
-
-        // Loads a graph from a JSON
-        // Graph: the root object's graph
-        // startNode: the start node to where begin the load
-        Graph.prototype.loadFromJSON = function (graph, startNode) {
-            var scope = this;
-
-            // If startNode is null, means it replaces all the graph
-            // If not, it comes from a copy/paste
-            if (startNode == null) {
-                for (var i = 0; i < this.root.action.children.length; i++)
-                    this._removeAction(this.root.action.children[i], true);
-
-                this.root.action.clearChildren();
-            }
-
-            var load = function (root, parent, detached, combine) {
-                if (!parent) parent = scope.root.action;
-                if (!root) root = graph;
-                if (!detached) detached = false;
-                if (!combine) combine = false;
-
-                var n = null; // Not going to be created
-
-                if (root.type != AB.ActionsBuilder.Type.OBJECT) { // Means it is not the root (the edited object)
-                    var e = {};
-                    e.type = root.type;
-                    e.name = root.name;
-                    e.detached = root.detached;
-                    e.combine = root.combine.length > 0;
-                    e.properties = new Array();
-                    e.combineArray = new Array();
-
-                    for (var i = 0; i < root.properties.length; i++) {
-                        e.properties.push({ text: root.properties[i].name, value: root.properties[i].value });
-                        if (root.properties[i].targetType != null) {
-                            e.properties[e.properties.length - 1].targetType = root.properties[i].targetType;
-                        }
-                    }
-
-                    n = scope.addNode(parent, e);
-                    if (detached)
-                        n.attr(n.rect, "fill", scope.getNodeColor(n.action));
-                    else
-                        detached = n.detached;
-
-                    // If combine array length > 0, it is a combine action
-                    for (var i = 0; i < root.combine.length; i++) {
-                        load(root.combine[i], n.action, detached, true);
-                    }
-
-                    if (!combine)
-                        parent = parent.children[parent.children.length - 1];
-                    else
-                        n.action.parent = null;
-                }
-
-                for (var i = 0; i < root.children.length; i++) {
-                    load(root.children[i], n && n.action.combine ? n.action.hub.action : parent, root.detached, false);
-                }
-            }
-
-            load(graph, startNode);
-            this.update();
-        }
-
-        // Traverse the graph and returns if hit a node
-        // start: the start node to start traverse
-        // x: the mouse's x position
-        // y: the mouse's y position
-        // traverseCombine: if check the combine nodes
-        Graph.prototype.traverseGraph = function (start, x, y, traverseCombine) {
-            if (!start) start = this.root.action;
-            if (traverseCombine == null) traverseCombine = false;
-
-            var result = {
-                hit: true,
-                element: start
-            };
-
-            if (start.node.isPointInside(x, y))
-                return result;
-
-            for (var i = 0; i < start.children.length; i++) {
-
-                if (start.children[i].node.isPointInside(x, y)) {
-                    result.hit = true;
-                    result.element = start.children[i];
-
-                    if (start.children[i].combine && traverseCombine) {
-                        var a = start.children[i];
-                        for (var j = 0; j < a.combineArray.length; j++) {
-                            if (a.combineArray[j].node.isPointInside(x, y)) {
-                                result.element = a.combineArray[j];
-                                break;
-                            }
-                        }
-                    }
-
-                    return result;
-                }
-
-                result = this.traverseGraph(start.children[i], x, y, traverseCombine);
-                if (result.hit)
-                    return result;
-
-            }
-
-            result.hit = false;
-            result.element = null;
-            return result;
-        }
-
-        //
-        // Private functions
-        //
-
-        // Sets the given node's line
-        // If commented, the line isn't setted by hidden
-        Graph.prototype._setLine = function (element) {
-            var n = element.node;
-            var nodeWidth = n.attr(n.rect, "width");
-            var nodeHeight = n.attr(n.rect, "height");
-            var nodex = n.attr(n.rect, "x");
-            var nodey = n.attr(n.rect, "y");
-
-            if (n.detached) {
-                n.attr(n.line, "path", ["M", nodex, nodey, "L", nodex, nodey]);
-                return;
-            }
-
-            var linex = n.attr(n.rect, "x") + nodeWidth / 2;
-            var liney = n.attr(n.rect, "y");
-
-            var p = element.parent.node;
-            var parentWidth = p.attr(p.rect, "width");
-            var parentHeight = p.attr(p.rect, "height");
-            var parentx = p.attr(p.rect, "x");
-            var parenty = p.attr(p.rect, "y");
-
-            var liney2 = liney - (liney - parenty - parentHeight) / 2;
-            var linex3 = parentx + parentWidth / 2;
-            var liney4 = parenty + parentHeight;
-
-            n.attr(n.line, "path", ["M", linex, liney, "L", linex, liney2, "L", linex3, liney2, "L", linex3, liney4]);
-            n.attr(n.line, "stroke", this.getSelectedNodeColor(element, element.node.detached));
-
-        }
-
-        // Sets the given node's position
-        // Applies changements on its children
-        Graph.prototype._setNodePosition = function (node, x, y) {
-            var offsetx = node.attr(node.rect, "x") - x;
-
-            node.attr(node.rect, "x", x);
-            node.attr(node.rect, "y", y);
-
-            var bbox = node.text.getBBox();
-            var textWidth = 0;
-            if (bbox)
-                textWidth = node.text.getBBox().width;
-
-            node.attr(node.text, "x", x + node.attr(node.rect, "width") / 2 - textWidth / 2);
-            node.attr(node.text, "y", y + node.attr(node.rect, "height") / 2);
-
-            // Set combine nodes positions
-            if (node.action.combine) {
-                var length = 0;
-                for (var i = 0; i < node.action.combineArray.length; i++) {
-                    var a = node.action.combineArray[i];
-                    var n = a.node;
-
-                    n.attr(n.rect, "x", node.attr(node.rect, "x") + length);
-                    n.attr(n.rect, "y", node.attr(node.rect, "y"));
-
-                    textWidth = n.text.getBBox().width;
-                    n.attr(n.text, "x", n.attr(n.rect, "x") + n.attr(n.rect, "width") / 2 - textWidth / 2);
-                    n.attr(n.text, "y", y + Graph.NODE_HEIGHT / 2);
-
-                    length += n.attr(n.rect, "width");
-                }
-
-                node.attr(node.rect, "width", length);
-            }
-
-            for (var i = 0; i < node.action.children.length; i++) {
-                this._setNodePosition(node.action.children[i].node, node.action.children[i].node.attr(node.action.children[i].node.rect, "x") - offsetx, y + Graph.VERTICAL_OFFSET);
-                this._setLine(node.action.children[i]);
-            }
-        }
-
-        // Resizes the canvas if the node is outside the current canvas size
-        Graph.prototype._resizeCanvas = function (node) {
-            var x = node.attr(node.rect, "x");
-            var y = node.attr(node.rect, "y");
-
-            if (x > 0 + Graph.NODE_WIDTH && x < this.graph.width - Graph.NODE_WIDTH && y < this.graph.height)
-                    return;
-
-            this.graph.setSize(this.graph.width + 500, this.graph.height + 500);
-            this._setNodePosition(this.root, (this.graph.width / 2) - (Graph.NODE_WIDTH / 2), 10);
-
-            this.element.scrollLeft = (this.graph.width / 2) - this.element.getBoundingClientRect().width / 2;
-        }
-
-        // Removes a node
-        // node : the node to remove
-        Graph.prototype._removeNode = function (node) {
-            node.rect.remove();
-            node.text.remove();
-            if (node.line)
-                node.line.remove();
-        }
-
-        // Remove an action from the graph
-        // action : the action to remove
-        // removeChildren : if true, it deletes the branch
-        Graph.prototype._removeAction = function (action, removeChildren) {
-            if (!removeChildren)
-                removeChildren = false;
-
-            this._removeNode(action.node);
-
-            if (action.combine) {
-                for (var i = 0; i < action.combineArray.length; i++) {
-                    this._removeNode(action.combineArray[i].node);
-                }
-                action.combineArray = new Array();
-            }
-
-            if (removeChildren) {
-                for (var i = 0; i < action.children.length; i++)
-                    this._removeAction(action.children[i], removeChildren);
-
-                action.clearChildren();
-            }
-            else {
-                for (var i = 0; i < action.children.length; i++) {
-                    action.parent.addChild(action.children[i]);
-                    action.children[i].parent = action.parent;
-                }
-            }
-        }
-
-        // Creates a node
-        // text : the text/name of the node
-        // color : the node's color
-        // noLine : if the node has parent then draw a line, or not
-        Graph.prototype._createNode = function (text, color, noLine) {
-            var n = new AB.Node();
-            n.rect = this.graph.rect(20, 20, Graph.NODE_WIDTH, Graph.NODE_HEIGHT, 0);
-            n.text = this.graph.text(0, 0, text);
-
-            if (!noLine) {
-                n.line = this.graph.path("M10 10L90 90");
-                n.line.attr("stroke", color);
-            }
-
-            n.action = new AB.Action(n);
-
-            n.rect.attr("fill", color);
-            n.text.attr("font-size", 11);
-            n.text.attr("text-anchor", "start");
-            n.text.attr("font-family", "Sinkin Sans Light");
-
-            return n;
-        }
-
-        // Creates the animations for a node
-        // element: the node
-        Graph.prototype._createNodeAnimation = function (element) {
-            var scope = this;
-            var mousex, mousey;
-            var finished = true;
-            var elementx = 0;
-            var elementy = 0;
-
-            var onMove = function (dx, dy, x, y, event) {
-                mousex = x;
-                mousey = y;
-            };
-
-            var onStart = function (x, y, event) {
-                if (element.minimized)
-                    return;
-
-                mousex = x;
-                mousey = y;
-
-                if (finished) {
-                    elementx = element.attr(element.rect, "x");
-                    elementy = element.attr(element.rect, "y");
-                }
-                finished = false;
-
-                if (!element.minimized) {
-                    element.rect.animate({
-                        x: element.attr(element.rect, "x") - 10,
-                        y: element.attr(element.rect, "y") - 5,
-                        width: element.minimized ? Graph.NODE_MINIMIZED_WIDTH + 20 : Graph.NODE_WIDTH + 20,
-                        height: Graph.NODE_HEIGHT + 10,
-                        opacity: 0.25
-                    }, 500, ">");
-                }
-            };
-
-            var onEnd = function (event) {
-
-                if (!element.minimized) {
-                    element.rect.animate({
-                        x: elementx,
-                        y: elementy,
-                        width: element.minimized ? Graph.NODE_MINIMIZED_WIDTH : Graph.NODE_WIDTH,
-                        height: Graph.NODE_HEIGHT,
-                        opacity: 1.0
-                    }, 500, ">", function () { finished = true; });
-                }
-                var x = mousex - scope.graph.canvas.getBoundingClientRect().left;
-                var y = mousey - scope.graph.canvas.getBoundingClientRect().top;
-                var dragResult = scope.traverseGraph(null, x, y, true);
-
-                if (dragResult.hit && dragResult.element == element.action || !dragResult.hit) {
-                    scope.parametersManager.createParameters(element);
-                }
-                else {
-                    if (dragResult.element.children.length > 0 && dragResult.element.type != AB.ActionsBuilder.Type.TRIGGER)
-                        return;
-
-                    if (element.action.type == AB.ActionsBuilder.Type.TRIGGER && dragResult.element != scope.root.action)
-                        return;
-
-                    if (element.action.type == AB.ActionsBuilder.Type.ACTION && dragResult.element == scope.root.action)
-                        return;
-
-                    if (element.action.type == AB.ActionsBuilder.Type.FLOW_CONTROL && (dragResult.element == scope.root.action || dragResult.element.type == AB.ActionsBuilder.Type.FLOW_CONTROL))
-                        return;
-
-                    if (element.action.parent && element.action.parent.combine) // Musn't move hubs
-                        return;
-
-                    if (element.action == dragResult.element.parent)
-                        return;
-
-                    // Reset node
-                    element.rect.stop(element.rect.animation);
-                    element.attr(element.rect, "opacity", 1.0);
-                    element.attr(element.rect, "width", Graph.NODE_WIDTH);
-                    element.attr(element.rect, "height", Graph.NODE_HEIGHT);
-
-                    if (element.action.parent) {
-                        element.action.parent.removeChild(element.action);
-                        dragResult.element.addChild(element.action);
-                        scope.update();
-                        scope._createNodeAnimation(element);
-                    }
-                }
-            };
-
-            element.rect.drag(onMove, onStart, onEnd);
-            element.text.drag(onMove, onStart, onEnd);
-        }
-
-        Graph.NODE_MINIMIZED_WIDTH = 50;
-        Graph.NODE_WIDTH = 150;
-        Graph.NODE_HEIGHT = 25;
-        Graph.VERTICAL_OFFSET = 70;
-
-        return Graph;
-    })();
-
-    AB.Graph = Graph;
-
-})(AB || (AB = {}));

+ 0 - 87
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/viewsertoolbar.js

@@ -1,87 +0,0 @@
-/// <reference path="raphael.js" />
-/// <reference path="actionKinds.js" />
-/// <reference path="viewer.js" />
-
-var AB;
-(function (AB) {
-
-    var ToolBar = (function () {
-        function ToolBar(viewer) {
-            // Members
-            this.element = document.getElementById("ToolbarList");
-            this.viewer = viewer;
-
-            // Configure
-            this._attachControl();
-        }
-
-        //
-        // Private methods
-        //
-        // Attaches controls to each button
-        ToolBar.prototype._attachControl = function () {
-            var scope = this;
-            var events = new Array();
-
-            // Create event handlers and add them to the events array
-            var onReduce = function () {
-                scope.viewer.utils.onReduceAll(false);
-            };
-            events.push(onReduce);
-
-            var onExpand = function () {
-                scope.viewer.utils.onReduceAll(true);
-            };
-            events.push(onExpand);
-
-            var onDisconnect = function () {
-                scope.viewer.utils.onDetachAll(true, false);
-            };
-            events.push(onDisconnect);
-
-            var onReconnect = function () {
-                scope.viewer.utils.onDetachAll(false, true);
-            };
-            events.push(onReconnect);
-
-            var onDeZoom = function () {
-                if (scope.viewer.zoom > 0.0)
-                    scope.viewer.zoom -= 0.1;
-
-                scope.viewer.update();
-            };
-            events.push(onDeZoom);
-
-            var onZoom = function () {
-                if (scope.viewer.zoom < 1.0)
-                    scope.viewer.zoom += 0.1;
-
-                scope.viewer.update();
-            };
-            events.push(onZoom);
-
-            // Add events
-            var onEvent = function (id, element) {
-                return function (event) {
-                    element.style.backgroundColor = "rgb(155, 155, 155)";
-                    events[id](event);
-                    setTimeout(function () {
-                        element.style.backgroundColor = "rgb(0, 0, 0)";
-                    }, 100);
-                };
-            };
-
-            var list = this.element.getElementsByTagName("li");
-            for (var i = 0; i < events.length; i++) {
-                list[i].addEventListener("click", onEvent(i, list[i]));
-            }
-        }
-
-        ToolBar.VIEW_HEIGHT = 40;
-
-        return ToolBar;
-    })();
-
-    AB.ToolBar = ToolBar;
-
-})(AB || (AB = {}));

+ 14 - 4
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Animation.cs

@@ -201,7 +201,7 @@ namespace Max2Babylon
 
         static float[] weightedLerp(int frame0, int frame1, int frame2, float[] value0, float[] value2)
         {
-            double weight2 = (double)(frame1 - frame0) / (double)(frame2 - frame0);
+            double weight2 = (frame1 - frame0) / (double)(frame2 - frame0);
             double weight0 = 1 - weight2;
             float[] result = new float[value0.Length];
             for (int i = 0; i < result.Length; ++i)
@@ -237,6 +237,8 @@ namespace Max2Babylon
 
         private static void ExportAnimation(string property, List<BabylonAnimation> animations, Func<int, float[]> extractValueFunc, BabylonAnimation.DataType dataType)
         {
+            var exportNonOptimizedAnimations = Loader.Core.RootNode.GetBoolProperty("babylonjs_exportnonoptimizedanimations");
+
             var start = Loader.Core.AnimRange.Start;
             var end = Loader.Core.AnimRange.End;
 
@@ -246,6 +248,10 @@ namespace Max2Babylon
             {
                 var current = extractValueFunc(key);
 
+                if (exportNonOptimizedAnimations && previous != null && previous.IsEqualTo(current))
+                {
+                    continue; // Do not add key
+                }
 
                 keys.Add(new BabylonAnimationKey()
                 {
@@ -253,11 +259,15 @@ namespace Max2Babylon
                     values = current
                 });
 
-
                 previous = current;
             }
-            RemoveLinearAnimationKeys(keys);
-            if (keys.Count > 0)
+
+            if (!exportNonOptimizedAnimations)
+            {
+                RemoveLinearAnimationKeys(keys);
+            }
+
+            if (keys.Count > 1)
             {
                 var animationPresent = true;
 

+ 3 - 1
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Skeleton.cs

@@ -59,6 +59,8 @@ namespace Max2Babylon
             }
 
             // fix hierarchy an generate animation keys
+            var exportNonOptimizedAnimations = Loader.Core.RootNode.GetBoolProperty("babylonjs_exportnonoptimizedanimations");
+
             for (var index = 0; index < skin.TotalSkinBoneCount; index++)
             {
                 var gameBone = gameBones[index];
@@ -108,7 +110,7 @@ namespace Max2Babylon
                     }
 
                     var current = mat.ToArray();
-                    if (key == start || key == end || !(previous.IsEqualTo(current)))
+                    if (key == start || key == end || exportNonOptimizedAnimations || !(previous.IsEqualTo(current)))
                     {
                         keys.Add(new BabylonAnimationKey
                         {

+ 6 - 0
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Texture.cs

@@ -65,6 +65,12 @@ namespace Max2Babylon
 
             var texMap = stdMat.GetSubTexmap(index);
 
+            if (texMap == null)
+            {
+                RaiseWarning("Texture channel " + index + " activated but no texture found.");
+                return null;
+            }
+
             // Fallout
             if (texMap.ClassName == "Falloff") // This is the only way I found to detect it. This is crappy but it works
             {

+ 1 - 1
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.cs

@@ -197,7 +197,7 @@ namespace Max2Babylon
                         babylonScene.fogColor = fog.GetColor(0).ToArray();
                         babylonScene.fogMode = 3;
                     }
-#if !MAX2015
+#if !MAX2015 && !MAX2016
                     else
                     {
                         var paramBlock = atmospheric.GetReference(0) as IIParamBlock;

+ 1 - 1
Exporters/3ds Max/Max2Babylon/Forms/ActionsBuilderForm.cs

@@ -26,7 +26,7 @@ namespace Max2Babylon
             // Finish
             _babylonActionsBuilderAction = babylonActionsBuilderAction;
         }
-         
+        
         private void ActionsBuilderForm_Load(object sender, EventArgs e)
         {
             if (Loader.Core.SelNodeCount > 0)

+ 5 - 5
Exporters/3ds Max/Max2Babylon/GlobalUtility.cs

@@ -54,7 +54,7 @@ namespace Max2Babylon
                 actionTable = Loader.Global.ActionTable.Create(idActionTable, 0, ref actionTableName);
                 actionTable.AppendOperation(new BabylonExportActionItem());
                 actionTable.AppendOperation(new BabylonPropertiesActionItem());
-               // actionTable.AppendOperation(new BabylonActionsBuilderActionItem());
+                actionTable.AppendOperation(new BabylonActionsBuilderActionItem());
                 actionCallback = new BabylonActionCallback();
 
                 actionManager.RegisterActionTable(actionTable);
@@ -107,11 +107,11 @@ namespace Max2Babylon
                 menuItemBabylon = Loader.Global.IMenuItem;
                 menuItemBabylon.Title = "Babylon Properties";
                 menuItemBabylon.ActionItem = actionTable[1];
-                //menu.AddItem(menuItemBabylon, -1);
+                menu.AddItem(menuItemBabylon, -1);
 
-                //menuItemBabylon = Loader.Global.IMenuItem;
-                //menuItemBabylon.Title = "Babylon Actions Builder";
-                //menuItemBabylon.ActionItem = actionTable[2];
+                menuItemBabylon = Loader.Global.IMenuItem;
+                menuItemBabylon.Title = "Babylon Actions Builder";
+                menuItemBabylon.ActionItem = actionTable[2];
                 menu.AddItem(menuItemBabylon, -1);
 
                 menuItem = Loader.Global.IMenuItem;

BIN
Exporters/3ds Max/Max2Babylon/Refs/BabylonFileConverter.dll


+ 16 - 16
Exporters/3ds Max/Max2Babylon/Tools/Tools.cs

@@ -15,7 +15,7 @@ namespace Max2Babylon
     {
         public static IntPtr GetNativeHandle(this INativeObject obj)
         {
-#if MAX2015
+#if MAX2015 || MAX2016
             return obj.NativePointer;
 #else
             return obj.Handle;
@@ -77,7 +77,7 @@ namespace Max2Babylon
 
         public static IMatrix3 Identity { get { return Loader.Global.Matrix3.Create(XAxis, YAxis, ZAxis, Origin); } }
 
-#if !MAX2015
+#if !MAX2015 && !MAX2016
         unsafe public static int GetParamBlockIndex(IIParamBlock paramBlock, string name)
         {
             for (short index = 0; index < paramBlock.NumParams; index++)
@@ -561,7 +561,7 @@ namespace Max2Babylon
         public static void SetStringProperty(this IINode node, string propertyName, string defaultState)
         {
             string state = defaultState;
-#if MAX2015
+#if MAX2015 || MAX2016
             node.SetUserPropString(propertyName, state);
 #else
             node.SetUserPropString(ref propertyName, ref state);
@@ -571,7 +571,7 @@ namespace Max2Babylon
         public static bool GetBoolProperty(this IINode node, string propertyName, int defaultState = 0)
         {
             int state = defaultState;
-#if MAX2015
+#if MAX2015 || MAX2016
             node.GetUserPropBool(propertyName, ref state);
 #else
             node.GetUserPropBool(ref propertyName, ref state);
@@ -583,7 +583,7 @@ namespace Max2Babylon
         public static string GetStringProperty(this IINode node, string propertyName, string defaultState)
         {
             string state = defaultState;
-#if MAX2015
+#if MAX2015 || MAX2016
             node.GetUserPropString(propertyName, ref state);
 #else
             node.GetUserPropString(ref propertyName, ref state);
@@ -595,7 +595,7 @@ namespace Max2Babylon
         public static float GetFloatProperty(this IINode node, string propertyName, float defaultState = 0)
         {
             float state = defaultState;
-#if MAX2015
+#if MAX2015 || MAX2016
             node.GetUserPropFloat(propertyName, ref state);
 #else
             node.GetUserPropFloat(ref propertyName, ref state);
@@ -608,7 +608,7 @@ namespace Max2Babylon
         {
             float state0 = 0;
             string name = propertyName + "_x";
-#if MAX2015
+#if MAX2015 || MAX2016
             node.GetUserPropFloat(name, ref state0);
 #else
             node.GetUserPropFloat(ref name, ref state0);
@@ -617,7 +617,7 @@ namespace Max2Babylon
 
             float state1 = 0;
             name = propertyName + "_y";
-#if MAX2015
+#if MAX2015 || MAX2016
             node.GetUserPropFloat(name, ref state1);
 #else
             node.GetUserPropFloat(ref name, ref state1);
@@ -625,7 +625,7 @@ namespace Max2Babylon
 
             float state2 = 0;
             name = propertyName + "_z";
-#if MAX2015
+#if MAX2015 || MAX2016
             node.GetUserPropFloat(name, ref state2);
 #else
             node.GetUserPropFloat(ref name, ref state2);
@@ -690,7 +690,7 @@ namespace Max2Babylon
         {
             if (checkBox.CheckState != CheckState.Indeterminate)
             {
-#if MAX2015
+#if MAX2015 || MAX2016
                 node.SetUserPropBool(propertyName, checkBox.CheckState == CheckState.Checked);
 #else
                 node.SetUserPropBool(ref propertyName, checkBox.CheckState == CheckState.Checked);
@@ -711,7 +711,7 @@ namespace Max2Babylon
             foreach (var node in nodes)
             {
                 var value = textBox.Text;
-#if MAX2015
+#if MAX2015 || MAX2016
                 node.SetUserPropString(propertyName, value);
 #else
                 node.SetUserPropString(ref propertyName, ref value);
@@ -728,7 +728,7 @@ namespace Max2Babylon
         {
             foreach (var node in nodes)
             {
-#if MAX2015
+#if MAX2015 || MAX2016
                 node.SetUserPropFloat(propertyName, (float)nup.Value);
 #else
                 node.SetUserPropFloat(ref propertyName, (float)nup.Value);
@@ -746,21 +746,21 @@ namespace Max2Babylon
         public static void UpdateVector3Control(Vector3Control vector3Control, IINode node, string propertyName)
         {
             string name = propertyName + "_x";
-#if MAX2015
+#if MAX2015 || MAX2016
             node.SetUserPropFloat(name, vector3Control.X);
 #else
             node.SetUserPropFloat(ref name, vector3Control.X);
 #endif
 
             name = propertyName + "_y";
-#if MAX2015
+#if MAX2015 || MAX2016
             node.SetUserPropFloat(name, vector3Control.Y);
 #else
             node.SetUserPropFloat(ref name, vector3Control.Y);
 #endif
 
             name = propertyName + "_z";
-#if MAX2015
+#if MAX2015 || MAX2016
             node.SetUserPropFloat(name, vector3Control.Z);
 #else
             node.SetUserPropFloat(ref name, vector3Control.Z);
@@ -778,7 +778,7 @@ namespace Max2Babylon
         public static void UpdateComboBox(ComboBox comboBox, IINode node, string propertyName)
         {
             var value = comboBox.SelectedItem.ToString();
-#if MAX2015
+#if MAX2015 || MAX2016
             node.SetUserPropString(propertyName, value);
 #else
             node.SetUserPropString(ref propertyName, ref value);

+ 2 - 2
Exporters/3ds Max/readme.md

@@ -1,9 +1,9 @@
 3DS Max to Babylon.js exporter
 ==============================
 
-This exporter is designed for 3ds Max 2013+. You just have to unzip the content of the archive to [3ds max folder\bin\assemblies]
+This exporter is designed for 3ds Max 2013, 2015 and 2016 (Use 2015 version for 3dsMax 2016). You just have to unzip the content of the archive to [3ds max folder\bin\assemblies]
 
-**After unzipping DLLs, you may have to go through all files, right-click on them, select the Properties menu and click on Unblock button to remove security protection enforce by Windows**
+**Before extracting, please go to downloaded .zip properties and click Unblock button**
 
 If you right click on the scene, on a light, on a camera or on a mesh you fill have a [Babylon...] menu. 
 

File diff suppressed because it is too large
+ 1233 - 622
Exporters/Blender/io_export_babylon.py


+ 8 - 1
Exporters/Blender/readme.md

@@ -3,6 +3,7 @@ Blender to Babylon.js exporter
 
 The [Blender export plugin](http://blogs.msdn.com/b/eternalcoding/archive/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender.aspx) supports the following features:
 
+For a discussion of Tower of Babel exporter, along with the difference this exporter, [See]{https://github.com/BabylonJS/Extensions/tree/master/TowerOfBabel)
 * **Cameras**
  * Name
  * Position
@@ -14,6 +15,7 @@ The [Blender export plugin](http://blogs.msdn.com/b/eternalcoding/archive/2013/0
  * Gravity
  * Ellipsoid
  * Animations
+ * 3D Camera Rigs
  * All kind of Babylon.js cameras can be chosen from a custom dropdown list
 * **Lights**
  * Type (Point, directional (Sun), Spot, Hemispheric)
@@ -25,7 +27,7 @@ The [Blender export plugin](http://blogs.msdn.com/b/eternalcoding/archive/2013/0
  * Energy
  * Diffuse color
  * Specular color
- * Shadow maps (For directional lights)
+ * Shadow maps, all types (For directional lights)
  * Animations
 * **Materials**
  * Name
@@ -42,9 +44,12 @@ The [Blender export plugin](http://blogs.msdn.com/b/eternalcoding/archive/2013/0
  * Reflection texture
  * Emissive texture
  * Bump texture
+ * Procedural Texture Baking
+ * Cycles Render Baking
 * **Multi-materials**
  * Name
  * Child materials
+ * 32 bit vertex limit for multi-materials
 * **Textures**
  * Name
  * Associated file
@@ -55,12 +60,14 @@ The [Blender export plugin](http://blogs.msdn.com/b/eternalcoding/archive/2013/0
  * uAng / vAng / Wang
  * WrapU / WrapV
  * Coordinates index
+ * Texture in-lining to .babylon file
 * **Meshes**
  * Name
  * Geometry (Positions & normals)
  * Position
  * Rotation
  * Scaling
+ * FreezeWorldMatrix
  * Texture coordinates (2 channels)
  * Vertex colors
  * Visibility

File diff suppressed because it is too large
+ 0 - 1141
Exporters/FBX/3rdParty/DirectXTex/BC.cpp


+ 0 - 892
Exporters/FBX/3rdParty/DirectXTex/BC.h

@@ -1,892 +0,0 @@
-//-------------------------------------------------------------------------------------
-// BC.h
-//  
-// Block-compression (BC) functionality
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//  
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#include <assert.h>
-#include <directxmath.h>
-#include <directxpackedvector.h>
-
-namespace DirectX
-{
-
-//-------------------------------------------------------------------------------------
-// Constants
-//-------------------------------------------------------------------------------------
-
-const uint16_t F16S_MASK    = 0x8000;   // f16 sign mask
-const uint16_t F16EM_MASK   = 0x7fff;   // f16 exp & mantissa mask
-const uint16_t F16MAX       = 0x7bff;   // MAXFLT bit pattern for XMHALF
-
-#define SIGN_EXTEND(x,nb) ((((x)&(1<<((nb)-1)))?((~0)<<(nb)):0)|(x))
-
-// Because these are used in SAL annotations, they need to remain macros rather than const values
-#define NUM_PIXELS_PER_BLOCK 16
-#define BC6H_MAX_REGIONS 2
-#define BC6H_MAX_INDICES 16
-#define BC7_MAX_REGIONS 3
-#define BC7_MAX_INDICES 16
-
-const size_t BC6H_NUM_CHANNELS = 3;
-const size_t BC6H_MAX_SHAPES = 32;
-
-const size_t BC7_NUM_CHANNELS = 4;
-const size_t BC7_MAX_SHAPES = 64;
-
-const int32_t BC67_WEIGHT_MAX = 64;
-const uint32_t BC67_WEIGHT_SHIFT = 6;
-const int32_t BC67_WEIGHT_ROUND = 32;
-
-extern const int g_aWeights2[4];
-extern const int g_aWeights3[8];
-extern const int g_aWeights4[16];
-
-enum BC_FLAGS
-{
-    BC_FLAGS_NONE       = 0x0,
-    BC_FLAGS_DITHER_RGB = 0x10000,  // Enables dithering for RGB colors for BC1-3
-    BC_FLAGS_DITHER_A   = 0x20000,  // Enables dithering for Alpha channel for BC1-3
-    BC_FLAGS_UNIFORM    = 0x40000,  // By default, uses perceptual weighting for BC1-3; this flag makes it a uniform weighting
-};
-
-//-------------------------------------------------------------------------------------
-// Structures
-//-------------------------------------------------------------------------------------
-class HDRColorA;
-
-class LDRColorA
-{
-public:
-    uint8_t r, g, b, a;
-
-    LDRColorA() {}
-    LDRColorA(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a) : r(_r), g(_g), b(_b), a(_a) {}
-
-    const uint8_t& operator [] (_In_range_(0,3) size_t uElement) const
-    {
-        switch(uElement)
-        {
-        case 0: return r;
-        case 1: return g;
-        case 2: return b;
-        case 3: return a;
-        default: assert(false); return r;
-        }
-    }
-
-    uint8_t& operator [] (_In_range_(0,3) size_t uElement)
-    {
-        switch(uElement)
-        {
-        case 0: return r;
-        case 1: return g;
-        case 2: return b;
-        case 3: return a;
-        default: assert(false); return r;
-        }
-    }
-
-    LDRColorA operator = (_In_ const HDRColorA& c);
-
-    static void InterpolateRGB(_In_ const LDRColorA& c0, _In_ const LDRColorA& c1, _In_ size_t wc, _In_ _In_range_(2, 4) size_t wcprec, _Out_ LDRColorA& out)
-    {
-        const int* aWeights = nullptr;
-        switch(wcprec)
-        {
-        case 2: aWeights = g_aWeights2; assert( wc < 4 ); _Analysis_assume_( wc < 4 ); break;
-        case 3: aWeights = g_aWeights3; assert( wc < 8 ); _Analysis_assume_( wc < 8 ); break;
-        case 4: aWeights = g_aWeights4; assert( wc < 16 ); _Analysis_assume_( wc < 16 ); break;
-        default: assert(false); out.r = out.g = out.b = 0; return;
-        }
-        out.r = uint8_t((uint32_t(c0.r) * uint32_t(BC67_WEIGHT_MAX - aWeights[wc]) + uint32_t(c1.r) * uint32_t(aWeights[wc]) + BC67_WEIGHT_ROUND) >> BC67_WEIGHT_SHIFT);
-        out.g = uint8_t((uint32_t(c0.g) * uint32_t(BC67_WEIGHT_MAX - aWeights[wc]) + uint32_t(c1.g) * uint32_t(aWeights[wc]) + BC67_WEIGHT_ROUND) >> BC67_WEIGHT_SHIFT);
-        out.b = uint8_t((uint32_t(c0.b) * uint32_t(BC67_WEIGHT_MAX - aWeights[wc]) + uint32_t(c1.b) * uint32_t(aWeights[wc]) + BC67_WEIGHT_ROUND) >> BC67_WEIGHT_SHIFT);
-    }
-
-    static void InterpolateA(_In_ const LDRColorA& c0, _In_ const LDRColorA& c1, _In_ size_t wa, _In_range_(2, 4) _In_ size_t waprec, _Out_ LDRColorA& out)
-    {
-        const int* aWeights = nullptr;
-        switch(waprec)
-        {
-        case 2: aWeights = g_aWeights2; assert( wa < 4 ); _Analysis_assume_( wa < 4 ); break;
-        case 3: aWeights = g_aWeights3; assert( wa < 8 ); _Analysis_assume_( wa < 8 ); break;
-        case 4: aWeights = g_aWeights4; assert( wa < 16 ); _Analysis_assume_( wa < 16 ); break;
-        default: assert(false); out.a = 0; return;
-        }
-        out.a = uint8_t((uint32_t(c0.a) * uint32_t(BC67_WEIGHT_MAX - aWeights[wa]) + uint32_t(c1.a) * uint32_t(aWeights[wa]) + BC67_WEIGHT_ROUND) >> BC67_WEIGHT_SHIFT);
-    }
-
-    static void Interpolate(_In_ const LDRColorA& c0, _In_ const LDRColorA& c1, _In_ size_t wc, _In_ size_t wa, _In_ _In_range_(2, 4) size_t wcprec, _In_ _In_range_(2, 4) size_t waprec, _Out_ LDRColorA& out)
-    {
-        InterpolateRGB(c0, c1, wc, wcprec, out);
-        InterpolateA(c0, c1, wa, waprec, out);
-    }
-};
-
-static_assert( sizeof(LDRColorA) == 4, "Unexpected packing");
-
-class HDRColorA
-{
-public:
-    float r, g, b, a;
-
-public:
-    HDRColorA() {}
-    HDRColorA(float _r, float _g, float _b, float _a) : r(_r), g(_g), b(_b), a(_a) {}
-    HDRColorA(const HDRColorA& c) : r(c.r), g(c.g), b(c.b), a(c.a) {}
-    HDRColorA(const LDRColorA& c)
-    {
-        r = float(c.r) * (1.0f/255.0f);
-        g = float(c.g) * (1.0f/255.0f);
-        b = float(c.b) * (1.0f/255.0f);
-        a = float(c.a) * (1.0f/255.0f);
-    }
-
-    // binary operators
-    HDRColorA operator + ( _In_ const HDRColorA& c ) const
-    {
-        return HDRColorA(r + c.r, g + c.g, b + c.b, a + c.a);
-    }
-
-    HDRColorA operator - ( _In_ const HDRColorA& c ) const
-    {
-        return HDRColorA(r - c.r, g - c.g, b - c.b, a - c.a);
-    }
-
-    HDRColorA operator * ( _In_ float f ) const
-    {
-        return HDRColorA(r * f, g * f, b * f, a * f);
-    }
-
-    HDRColorA operator / ( _In_ float f ) const
-    {
-        float fInv = 1.0f / f;
-        return HDRColorA(r * fInv, g * fInv, b * fInv, a * fInv);
-    }
-
-    float operator * ( _In_ const HDRColorA& c ) const
-    {
-        return r * c.r + g * c.g + b * c.b + a * c.a;
-    }
-
-    // assignment operators
-    HDRColorA& operator += ( _In_ const HDRColorA& c )
-    {
-        r += c.r;
-        g += c.g;
-        b += c.b;
-        a += c.a;
-        return *this;
-    }
-    
-    HDRColorA& operator -= ( _In_ const HDRColorA& c )
-    {
-        r -= c.r;
-        g -= c.g;
-        b -= c.b;
-        a -= c.a;
-        return *this;
-    }
-    
-    HDRColorA& operator *= ( _In_ float f )
-    {
-        r *= f;
-        g *= f;
-        b *= f;
-        a *= f;
-        return *this;
-    }
-    
-    HDRColorA& operator /= ( _In_ float f )
-    {
-        float fInv = 1.0f / f;
-        r *= fInv;
-        g *= fInv;
-        b *= fInv;
-        a *= fInv;
-        return *this;
-    }
-
-    HDRColorA& operator = (_In_ const LDRColorA& c)
-    {
-        r = (float) c.r;
-        g = (float) c.g;
-        b = (float) c.b;
-        a = (float) c.a;
-        return *this;
-    }
-
-    HDRColorA& Clamp(_In_ float fMin, _In_ float fMax)
-    {
-        r = std::min<float>(fMax, std::max<float>(fMin, r));
-        g = std::min<float>(fMax, std::max<float>(fMin, g));
-        b = std::min<float>(fMax, std::max<float>(fMin, b));
-        a = std::min<float>(fMax, std::max<float>(fMin, a));
-        return *this;
-    }
-
-    LDRColorA ToLDRColorA() const
-    {
-        return LDRColorA((uint8_t) (r + 0.01f), (uint8_t) (g + 0.01f), (uint8_t) (b + 0.01f), (uint8_t) (a + 0.01f));
-    }
-};
-
-inline LDRColorA LDRColorA::operator = (_In_ const HDRColorA& c)
-{
-    LDRColorA ret;
-    HDRColorA tmp(c);
-    tmp = tmp.Clamp(0.0f, 1.0f) * 255.0f;
-    ret.r = uint8_t(tmp.r + 0.001f);
-    ret.g = uint8_t(tmp.g + 0.001f);
-    ret.b = uint8_t(tmp.b + 0.001f);
-    ret.a = uint8_t(tmp.a + 0.001f);
-    return ret;
-}
-
-struct LDREndPntPair
-{
-    LDRColorA A;
-    LDRColorA B;
-};
-
-struct HDREndPntPair
-{
-    HDRColorA A;
-    HDRColorA B;
-};
-
-inline HDRColorA* HDRColorALerp(_Out_ HDRColorA *pOut, _In_ const HDRColorA *pC1, _In_ const HDRColorA *pC2, _In_ float s)
-{
-    pOut->r = pC1->r + s * (pC2->r - pC1->r);
-    pOut->g = pC1->g + s * (pC2->g - pC1->g);
-    pOut->b = pC1->b + s * (pC2->b - pC1->b);
-    pOut->a = pC1->a + s * (pC2->a - pC1->a);
-    return pOut;
-}
-
-#pragma pack(push,1)
-// BC1/DXT1 compression (4 bits per texel)
-struct D3DX_BC1
-{
-    uint16_t    rgb[2]; // 565 colors
-    uint32_t    bitmap; // 2bpp rgb bitmap
-};
-
-// BC2/DXT2/3 compression (8 bits per texel)
-struct D3DX_BC2
-{
-    uint32_t    bitmap[2];  // 4bpp alpha bitmap
-    D3DX_BC1    bc1;        // BC1 rgb data
-};
-
-// BC3/DXT4/5 compression (8 bits per texel)
-struct D3DX_BC3
-{
-    uint8_t     alpha[2];   // alpha values
-    uint8_t     bitmap[6];  // 3bpp alpha bitmap
-    D3DX_BC1    bc1;        // BC1 rgb data
-};
-#pragma pack(pop)
-
-class INTColor
-{
-public:
-    int r, g, b;
-    int pad;
-
-public:
-    INTColor() {}
-    INTColor(int nr, int ng, int nb) {r = nr; g = ng; b = nb;}
-    INTColor(const INTColor& c) {r = c.r; g = c.g; b = c.b;}
-
-    INTColor operator - ( _In_ const INTColor& c ) const
-    {
-        return INTColor(r - c.r, g - c.g, b - c.b);
-    }
-
-    INTColor& operator += ( _In_ const INTColor& c )
-    {
-        r += c.r;
-        g += c.g;
-        b += c.b;
-        return *this;
-    }
-
-    INTColor& operator -= ( _In_ const INTColor& c )
-    {
-        r -= c.r;
-        g -= c.g;
-        b -= c.b;
-        return *this;
-    }
-
-    INTColor& operator &= ( _In_ const INTColor& c )
-    {
-        r &= c.r;
-        g &= c.g;
-        b &= c.b;
-        return *this;
-    }
-
-    int& operator [] ( _In_ uint8_t i )
-    {
-        assert(i < sizeof(INTColor) / sizeof(int));
-        _Analysis_assume_(i < sizeof(INTColor) / sizeof(int));
-        return ((int*) this)[i];
-    }
-
-    void Set(_In_ const HDRColorA& c, _In_ bool bSigned)
-    {
-        PackedVector::XMHALF4 aF16;
-
-        XMVECTOR v = XMLoadFloat4( (const XMFLOAT4*)& c );
-        XMStoreHalf4( &aF16, v );
-
-        r = F16ToINT(aF16.x, bSigned);
-        g = F16ToINT(aF16.y, bSigned);
-        b = F16ToINT(aF16.z, bSigned);
-    }
-
-    INTColor& Clamp(_In_ int iMin, _In_ int iMax)
-    {
-        r = std::min<int>(iMax, std::max<int>(iMin, r));
-        g = std::min<int>(iMax, std::max<int>(iMin, g));
-        b = std::min<int>(iMax, std::max<int>(iMin, b));
-        return *this;
-    }
-
-    INTColor& SignExtend(_In_ const LDRColorA& Prec)
-    {
-        r = SIGN_EXTEND(r, Prec.r);
-        g = SIGN_EXTEND(g, Prec.g);
-        b = SIGN_EXTEND(b, Prec.b);
-        return *this;
-    }
-
-    void ToF16(_Out_writes_(3) PackedVector::HALF aF16[3], _In_ bool bSigned) const
-    {
-        aF16[0] = INT2F16(r, bSigned);
-        aF16[1] = INT2F16(g, bSigned);
-        aF16[2] = INT2F16(b, bSigned);
-    }
-
-private:
-    static int F16ToINT(_In_ const PackedVector::HALF& f, _In_ bool bSigned)
-    {
-        uint16_t input = *((const uint16_t*) &f);
-        int out, s;
-        if(bSigned)
-        {
-            s = input & F16S_MASK;
-            input &= F16EM_MASK;
-            if(input > F16MAX) out = F16MAX;
-            else out = input;
-            out = s ? -out : out;
-        }
-        else
-        {
-            if(input & F16S_MASK) out = 0;
-            else out = input;
-        }
-        return out;
-    }
-
-    static PackedVector::HALF INT2F16(_In_ int input, _In_ bool bSigned)
-    {
-        PackedVector::HALF h;
-        uint16_t out;
-        if(bSigned)
-        {
-            int s = 0;
-            if(input < 0)
-            {
-                s = F16S_MASK;
-                input = -input;
-            }
-            out = uint16_t(s | input);
-        }
-        else
-        {
-            assert(input >= 0 && input <= F16MAX);
-            out = (uint16_t) input;
-        }
-
-        *((uint16_t*) &h) = out;
-        return h;
-    }
-};
-
-static_assert( sizeof(INTColor) == 16, "Unexpected packing");
-
-struct INTEndPntPair
-{
-    INTColor A;
-    INTColor B;
-};
-
-template< size_t SizeInBytes >
-class CBits
-{
-public:
-    uint8_t GetBit(_Inout_ size_t& uStartBit) const
-    {
-        assert(uStartBit < 128);
-        _Analysis_assume_(uStartBit < 128);
-        size_t uIndex = uStartBit >> 3;
-        uint8_t ret = (m_uBits[uIndex] >> (uStartBit - (uIndex << 3))) & 0x01;
-        uStartBit++;
-        return ret;
-    }
-
-    uint8_t GetBits(_Inout_ size_t& uStartBit, _In_ size_t uNumBits) const
-    {
-        if(uNumBits == 0) return 0;
-        assert(uStartBit + uNumBits <= 128 && uNumBits <= 8);
-        _Analysis_assume_(uStartBit + uNumBits <= 128 && uNumBits <= 8);
-        uint8_t ret;
-        size_t uIndex = uStartBit >> 3;
-        size_t uBase = uStartBit - (uIndex << 3);
-        if(uBase + uNumBits > 8)
-        {
-            size_t uFirstIndexBits = 8 - uBase;
-            size_t uNextIndexBits = uNumBits - uFirstIndexBits;
-            ret = (m_uBits[uIndex] >> uBase) | ((m_uBits[uIndex+1] & ((1 << uNextIndexBits) - 1)) << uFirstIndexBits);
-        }
-        else
-        {
-            ret = (m_uBits[uIndex] >> uBase) & ((1 << uNumBits) - 1);
-        }
-        assert(ret < (1 << uNumBits));
-        uStartBit += uNumBits;
-        return ret;
-    }
-
-    void SetBit(_Inout_ size_t& uStartBit, _In_ uint8_t uValue)
-    {
-        assert(uStartBit < 128 && uValue < 2);
-        _Analysis_assume_(uStartBit < 128 && uValue < 2);
-        size_t uIndex = uStartBit >> 3;
-        size_t uBase = uStartBit - (uIndex << 3);
-        m_uBits[uIndex] &= ~(1 << uBase);
-        m_uBits[uIndex] |= uValue << uBase;
-        uStartBit++;
-    }
-
-    void SetBits(_Inout_ size_t& uStartBit, _In_ size_t uNumBits, _In_ uint8_t uValue)
-    {
-        if(uNumBits == 0)
-            return;
-        assert(uStartBit + uNumBits <= 128 && uNumBits <= 8);
-        _Analysis_assume_(uStartBit + uNumBits <= 128 && uNumBits <= 8);
-        assert(uValue < (1 << uNumBits));
-        size_t uIndex = uStartBit >> 3;
-        size_t uBase = uStartBit - (uIndex << 3);
-        if(uBase + uNumBits > 8)
-        {
-            size_t uFirstIndexBits = 8 - uBase;
-            size_t uNextIndexBits = uNumBits - uFirstIndexBits;
-            m_uBits[uIndex] &= ~(((1 << uFirstIndexBits) - 1) << uBase);
-            m_uBits[uIndex] |= uValue << uBase;
-            m_uBits[uIndex+1] &= ~((1 << uNextIndexBits) - 1);
-            m_uBits[uIndex+1] |= uValue >> uFirstIndexBits;
-        }
-        else
-        {
-            m_uBits[uIndex] &= ~(((1 << uNumBits) - 1) << uBase);
-            m_uBits[uIndex] |= uValue << uBase;
-        }
-        uStartBit += uNumBits;
-    }
-
-private:
-    uint8_t m_uBits[ SizeInBytes ];
-};
-
-// BC6H compression (16 bits per texel)
-class D3DX_BC6H : private CBits< 16 >
-{
-public:
-    void Decode(_In_ bool bSigned, _Out_writes_(NUM_PIXELS_PER_BLOCK) HDRColorA* pOut) const;
-    void Encode(_In_ bool bSigned, _In_reads_(NUM_PIXELS_PER_BLOCK) const HDRColorA* const pIn);
-
-private:
-#pragma warning(push)
-#pragma warning(disable : 4480)
-    enum EField : uint8_t
-    {
-        NA, // N/A
-        M,  // Mode
-        D,  // Shape
-        RW,
-        RX,
-        RY,
-        RZ,
-        GW,
-        GX,
-        GY,
-        GZ,
-        BW,
-        BX,
-        BY,
-        BZ,
-    };
-#pragma warning(pop)
-
-    struct ModeDescriptor
-    {
-        EField m_eField;
-        uint8_t   m_uBit;
-    };
-
-    struct ModeInfo
-    {
-        uint8_t uMode;
-        uint8_t uPartitions;
-        bool bTransformed;
-        uint8_t uIndexPrec;
-        LDRColorA RGBAPrec[BC6H_MAX_REGIONS][2];
-    };
-
-#pragma warning(push)
-#pragma warning(disable : 4512)
-    struct EncodeParams
-    {
-        float fBestErr;
-        const bool bSigned;
-        uint8_t uMode;
-        uint8_t uShape;
-        const HDRColorA* const aHDRPixels;
-        INTEndPntPair aUnqEndPts[BC6H_MAX_SHAPES][BC6H_MAX_REGIONS];
-        INTColor aIPixels[NUM_PIXELS_PER_BLOCK];
-
-        EncodeParams(const HDRColorA* const aOriginal, bool bSignedFormat) :
-            aHDRPixels(aOriginal), fBestErr(FLT_MAX), bSigned(bSignedFormat)
-        {
-            for(size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-            {
-                aIPixels[i].Set(aOriginal[i], bSigned);
-            }
-        }
-    };
-#pragma warning(pop)
-
-    static int Quantize(_In_ int iValue, _In_ int prec, _In_ bool bSigned);
-    static int Unquantize(_In_ int comp, _In_ uint8_t uBitsPerComp, _In_ bool bSigned);
-    static int FinishUnquantize(_In_ int comp, _In_ bool bSigned);
-
-    static bool EndPointsFit(_In_ const EncodeParams* pEP, _In_reads_(BC6H_MAX_REGIONS) const INTEndPntPair aEndPts[]);
-
-    void GeneratePaletteQuantized(_In_ const EncodeParams* pEP, _In_ const INTEndPntPair& endPts,
-                                  _Out_writes_(BC6H_MAX_INDICES) INTColor aPalette[]) const;
-    float MapColorsQuantized(_In_ const EncodeParams* pEP, _In_reads_(np) const INTColor aColors[], _In_ size_t np, _In_ const INTEndPntPair &endPts) const;
-    float PerturbOne(_In_ const EncodeParams* pEP, _In_reads_(np) const INTColor aColors[], _In_ size_t np, _In_ uint8_t ch,
-                     _In_ const INTEndPntPair& oldEndPts, _Out_ INTEndPntPair& newEndPts, _In_ float fOldErr, _In_ int do_b) const;
-    void OptimizeOne(_In_ const EncodeParams* pEP, _In_reads_(np) const INTColor aColors[], _In_ size_t np, _In_ float aOrgErr,
-                     _In_ const INTEndPntPair &aOrgEndPts, _Out_ INTEndPntPair &aOptEndPts) const;
-    void OptimizeEndPoints(_In_ const EncodeParams* pEP, _In_reads_(BC6H_MAX_REGIONS) const float aOrgErr[],
-                           _In_reads_(BC6H_MAX_REGIONS) const INTEndPntPair aOrgEndPts[],
-                           _Inout_updates_all_(BC6H_MAX_REGIONS) INTEndPntPair aOptEndPts[]) const;
-    static void SwapIndices(_In_ const EncodeParams* pEP, _Inout_updates_all_(BC6H_MAX_REGIONS) INTEndPntPair aEndPts[],
-                            _In_reads_(NUM_PIXELS_PER_BLOCK) size_t aIndices[]);
-    void AssignIndices(_In_ const EncodeParams* pEP, _In_reads_(BC6H_MAX_REGIONS) const INTEndPntPair aEndPts[],
-                        _Out_writes_(NUM_PIXELS_PER_BLOCK) size_t aIndices[],
-                        _Out_writes_(BC6H_MAX_REGIONS) float aTotErr[]) const;
-    void QuantizeEndPts(_In_ const EncodeParams* pEP, _Out_writes_(BC6H_MAX_REGIONS) INTEndPntPair* qQntEndPts) const;
-    void EmitBlock(_In_ const EncodeParams* pEP, _In_reads_(BC6H_MAX_REGIONS) const INTEndPntPair aEndPts[],
-                   _In_reads_(NUM_PIXELS_PER_BLOCK) const size_t aIndices[]);
-    void Refine(_Inout_ EncodeParams* pEP);
-
-    static void GeneratePaletteUnquantized(_In_ const EncodeParams* pEP, _In_ size_t uRegion, _Out_writes_(BC6H_MAX_INDICES) INTColor aPalette[]);
-    float MapColors(_In_ const EncodeParams* pEP, _In_ size_t uRegion, _In_ size_t np, _In_reads_(np) const size_t* auIndex) const;
-    float RoughMSE(_Inout_ EncodeParams* pEP) const;
-
-private:
-    const static ModeDescriptor ms_aDesc[][82];
-    const static ModeInfo ms_aInfo[];
-    const static int ms_aModeToInfo[];
-};
-
-// BC67 compression (16b bits per texel)
-class D3DX_BC7 : private CBits< 16 >
-{
-public:
-    void Decode(_Out_writes_(NUM_PIXELS_PER_BLOCK) HDRColorA* pOut) const;
-    void Encode(_In_reads_(NUM_PIXELS_PER_BLOCK) const HDRColorA* const pIn);
-
-private:
-    struct ModeInfo
-    {
-        uint8_t uPartitions;
-        uint8_t uPartitionBits;
-        uint8_t uPBits;
-        uint8_t uRotationBits;
-        uint8_t uIndexModeBits;
-        uint8_t uIndexPrec;
-        uint8_t uIndexPrec2;
-        LDRColorA RGBAPrec;
-        LDRColorA RGBAPrecWithP;
-    };
-
-#pragma warning(push)
-#pragma warning(disable : 4512)
-    struct EncodeParams
-    {
-        uint8_t uMode;
-        LDREndPntPair aEndPts[BC7_MAX_SHAPES][BC7_MAX_REGIONS];
-        LDRColorA aLDRPixels[NUM_PIXELS_PER_BLOCK];
-        const HDRColorA* const aHDRPixels;
-
-        EncodeParams(const HDRColorA* const aOriginal) : aHDRPixels(aOriginal) {}
-    };
-#pragma warning(pop)
-
-    static uint8_t Quantize(_In_ uint8_t comp, _In_ uint8_t uPrec)
-    {
-        assert(0 < uPrec && uPrec <= 8);
-        uint8_t rnd = (uint8_t) std::min<uint16_t>(255, uint16_t(comp) + (1 << (7 - uPrec)));
-        return rnd >> (8 - uPrec);
-    }
-
-    static LDRColorA Quantize(_In_ const LDRColorA& c, _In_ const LDRColorA& RGBAPrec)
-    {
-        LDRColorA q;
-        q.r = Quantize(c.r, RGBAPrec.r);
-        q.g = Quantize(c.g, RGBAPrec.g);
-        q.b = Quantize(c.b, RGBAPrec.b);
-        if(RGBAPrec.a)
-            q.a = Quantize(c.a, RGBAPrec.a);
-        else
-            q.a = 255;
-        return q;
-    }
-
-    static uint8_t Unquantize(_In_ uint8_t comp, _In_ size_t uPrec)
-    {
-        assert(0 < uPrec && uPrec <= 8);
-        comp = comp << (8 - uPrec);
-        return comp | (comp >> uPrec);
-    }
-
-    static LDRColorA Unquantize(_In_ const LDRColorA& c, _In_ const LDRColorA& RGBAPrec)
-    {
-        LDRColorA q;
-        q.r = Unquantize(c.r, RGBAPrec.r);
-        q.g = Unquantize(c.g, RGBAPrec.g);
-        q.b = Unquantize(c.b, RGBAPrec.b);
-        q.a = RGBAPrec.a > 0 ? Unquantize(c.a, RGBAPrec.a) : 255;
-        return q;
-    }
-
-    void GeneratePaletteQuantized(_In_ const EncodeParams* pEP, _In_ size_t uIndexMode, _In_ const LDREndPntPair& endpts,
-                                  _Out_writes_(BC7_MAX_INDICES) LDRColorA aPalette[]) const;
-    float PerturbOne(_In_ const EncodeParams* pEP, _In_reads_(np) const LDRColorA colors[], _In_ size_t np, _In_ size_t uIndexMode,
-                     _In_ size_t ch, _In_ const LDREndPntPair &old_endpts,
-                     _Out_ LDREndPntPair &new_endpts, _In_ float old_err, _In_ uint8_t do_b) const;
-    void Exhaustive(_In_ const EncodeParams* pEP, _In_reads_(np) const LDRColorA aColors[], _In_ size_t np, _In_ size_t uIndexMode,
-                    _In_ size_t ch, _Inout_ float& fOrgErr, _Inout_ LDREndPntPair& optEndPt) const;
-    void OptimizeOne(_In_ const EncodeParams* pEP, _In_reads_(np) const LDRColorA colors[], _In_ size_t np, _In_ size_t uIndexMode,
-                     _In_ float orig_err, _In_ const LDREndPntPair &orig_endpts, _Out_ LDREndPntPair &opt_endpts) const;
-    void OptimizeEndPoints(_In_ const EncodeParams* pEP, _In_ size_t uShape, _In_ size_t uIndexMode,
-                           _In_reads_(BC7_MAX_REGIONS) const float orig_err[],
-                           _In_reads_(BC7_MAX_REGIONS) const LDREndPntPair orig_endpts[],
-                           _Out_writes_(BC7_MAX_REGIONS) LDREndPntPair opt_endpts[]) const;
-    void AssignIndices(_In_ const EncodeParams* pEP, _In_ size_t uShape, _In_ size_t uIndexMode,
-                       _In_reads_(BC7_MAX_REGIONS) LDREndPntPair endpts[],
-                       _Out_writes_(NUM_PIXELS_PER_BLOCK) size_t aIndices[], _Out_writes_(NUM_PIXELS_PER_BLOCK) size_t aIndices2[],
-                       _Out_writes_(BC7_MAX_REGIONS) float afTotErr[]) const;
-    void EmitBlock(_In_ const EncodeParams* pEP, _In_ size_t uShape, _In_ size_t uRotation, _In_ size_t uIndexMode,
-                   _In_reads_(BC7_MAX_REGIONS) const LDREndPntPair aEndPts[],
-                   _In_reads_(NUM_PIXELS_PER_BLOCK) const size_t aIndex[],
-                   _In_reads_(NUM_PIXELS_PER_BLOCK) const size_t aIndex2[]);
-    float Refine(_In_ const EncodeParams* pEP, _In_ size_t uShape, _In_ size_t uRotation, _In_ size_t uIndexMode);
-
-    float MapColors(_In_ const EncodeParams* pEP, _In_reads_(np) const LDRColorA aColors[], _In_ size_t np, _In_ size_t uIndexMode,
-                    _In_ const LDREndPntPair& endPts, _In_ float fMinErr) const;
-    static float RoughMSE(_Inout_ EncodeParams* pEP, _In_ size_t uShape, _In_ size_t uIndexMode);
-
-private:
-    const static ModeInfo ms_aInfo[];
-};
-
-//-------------------------------------------------------------------------------------
-#pragma warning(push)
-#pragma warning(disable : 4127)
-template <bool bRange> void OptimizeAlpha(float *pX, float *pY, const float *pPoints, size_t cSteps)
-{
-    static const float pC6[] = { 5.0f/5.0f, 4.0f/5.0f, 3.0f/5.0f, 2.0f/5.0f, 1.0f/5.0f, 0.0f/5.0f };
-    static const float pD6[] = { 0.0f/5.0f, 1.0f/5.0f, 2.0f/5.0f, 3.0f/5.0f, 4.0f/5.0f, 5.0f/5.0f };
-    static const float pC8[] = { 7.0f/7.0f, 6.0f/7.0f, 5.0f/7.0f, 4.0f/7.0f, 3.0f/7.0f, 2.0f/7.0f, 1.0f/7.0f, 0.0f/7.0f };
-    static const float pD8[] = { 0.0f/7.0f, 1.0f/7.0f, 2.0f/7.0f, 3.0f/7.0f, 4.0f/7.0f, 5.0f/7.0f, 6.0f/7.0f, 7.0f/7.0f };
-
-    const float *pC = (6 == cSteps) ? pC6 : pC8;
-    const float *pD = (6 == cSteps) ? pD6 : pD8;
-
-    float MAX_VALUE = 1.0f;
-    float MIN_VALUE;
-    if (bRange)
-    {
-        MIN_VALUE = -1.0f;
-    }
-    else
-    {
-        MIN_VALUE = 0.0f;
-    }
-
-    // Find Min and Max points, as starting point
-    float fX = MAX_VALUE;
-    float fY = MIN_VALUE;
-
-    if(8 == cSteps)
-    {
-        for(size_t iPoint = 0; iPoint < NUM_PIXELS_PER_BLOCK; iPoint++)
-        {
-            if(pPoints[iPoint] < fX)
-                fX = pPoints[iPoint];
-    
-            if(pPoints[iPoint] > fY)
-                fY = pPoints[iPoint];
-        }
-    }
-    else
-    {
-        for(size_t iPoint = 0; iPoint < NUM_PIXELS_PER_BLOCK; iPoint++)
-        {
-            if(pPoints[iPoint] < fX && pPoints[iPoint] > MIN_VALUE)
-                fX = pPoints[iPoint];
-    
-            if(pPoints[iPoint] > fY && pPoints[iPoint] < MAX_VALUE)
-                fY = pPoints[iPoint];
-        }
-
-        if (fX == fY)
-        {
-            fY = MAX_VALUE;
-        }
-    }
-
-    // Use Newton's Method to find local minima of sum-of-squares error.
-    float fSteps = (float) (cSteps - 1);
-
-    for(size_t iIteration = 0; iIteration < 8; iIteration++)
-    {
-        float fScale;
-
-        if((fY - fX) < (1.0f / 256.0f))
-            break;
-        
-        fScale = fSteps / (fY - fX);
-
-        // Calculate new steps
-        float pSteps[8];
-
-        for(size_t iStep = 0; iStep < cSteps; iStep++)
-            pSteps[iStep] = pC[iStep] * fX + pD[iStep] * fY;
-
-        if(6 == cSteps)
-        {
-            pSteps[6] = MIN_VALUE;
-            pSteps[7] = MAX_VALUE;
-        }
-
-        // Evaluate function, and derivatives
-        float dX  = 0.0f;
-        float dY  = 0.0f;
-        float d2X = 0.0f;
-        float d2Y = 0.0f;
-
-        for(size_t iPoint = 0; iPoint < NUM_PIXELS_PER_BLOCK; iPoint++)
-        {
-            float fDot = (pPoints[iPoint] - fX) * fScale;
-
-            size_t iStep;
-
-            if(fDot <= 0.0f)
-                iStep = ((6 == cSteps) && (pPoints[iPoint] <= fX * 0.5f)) ? 6 : 0;
-            else if(fDot >= fSteps)
-                iStep = ((6 == cSteps) && (pPoints[iPoint] >= (fY + 1.0f) * 0.5f)) ? 7 : (cSteps - 1);
-            else
-                iStep = static_cast<int32_t>(fDot + 0.5f);
-
-
-            if(iStep < cSteps)
-            {
-                // D3DX had this computation backwards (pPoints[iPoint] - pSteps[iStep])
-                // this fix improves RMS of the alpha component
-                float fDiff = pSteps[iStep] - pPoints[iPoint];
-
-                dX  += pC[iStep] * fDiff;
-                d2X += pC[iStep] * pC[iStep];
-
-                dY  += pD[iStep] * fDiff; 
-                d2Y += pD[iStep] * pD[iStep];
-            }
-        }
-
-        // Move endpoints
-        if(d2X > 0.0f)
-            fX -= dX / d2X;
-
-        if(d2Y > 0.0f)
-            fY -= dY / d2Y;
-
-        if(fX > fY)
-        {
-            float f = fX; fX = fY; fY = f;
-        }
-
-        if((dX * dX < (1.0f / 64.0f)) && (dY * dY < (1.0f / 64.0f)))
-            break;
-    }
-
-    *pX = (fX < MIN_VALUE) ? MIN_VALUE : (fX > MAX_VALUE) ? MAX_VALUE : fX;
-    *pY = (fY < MIN_VALUE) ? MIN_VALUE : (fY > MAX_VALUE) ? MAX_VALUE : fY;
-}
-#pragma warning(pop)
-
-
-//-------------------------------------------------------------------------------------
-// Functions
-//-------------------------------------------------------------------------------------
-
-typedef void (*BC_DECODE)(XMVECTOR *pColor, const uint8_t *pBC);
-typedef void (*BC_ENCODE)(uint8_t *pDXT, const XMVECTOR *pColor, DWORD flags);
-
-void D3DXDecodeBC1(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(8) const uint8_t *pBC);
-void D3DXDecodeBC2(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(16) const uint8_t *pBC);
-void D3DXDecodeBC3(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(16) const uint8_t *pBC);
-void D3DXDecodeBC4U(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(8) const uint8_t *pBC);
-void D3DXDecodeBC4S(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(8) const uint8_t *pBC);
-void D3DXDecodeBC5U(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(16) const uint8_t *pBC);
-void D3DXDecodeBC5S(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(16) const uint8_t *pBC);
-void D3DXDecodeBC6HU(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(16) const uint8_t *pBC);
-void D3DXDecodeBC6HS(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(16) const uint8_t *pBC);
-void D3DXDecodeBC7(_Out_writes_(NUM_PIXELS_PER_BLOCK) XMVECTOR *pColor, _In_reads_(16) const uint8_t *pBC);
-
-void D3DXEncodeBC1(_Out_writes_(8) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ float alphaRef, _In_ DWORD flags);
-    // BC1 requires one additional parameter, so it doesn't match signature of BC_ENCODE above
-
-void D3DXEncodeBC2(_Out_writes_(16) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-void D3DXEncodeBC3(_Out_writes_(16) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-void D3DXEncodeBC4U(_Out_writes_(8) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-void D3DXEncodeBC4S(_Out_writes_(8) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-void D3DXEncodeBC5U(_Out_writes_(16) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-void D3DXEncodeBC5S(_Out_writes_(16) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-void D3DXEncodeBC6HU(_Out_writes_(16) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-void D3DXEncodeBC6HS(_Out_writes_(16) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-void D3DXEncodeBC7(_Out_writes_(16) uint8_t *pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const XMVECTOR *pColor, _In_ DWORD flags);
-
-}; // namespace

+ 0 - 548
Exporters/FBX/3rdParty/DirectXTex/BC4BC5.cpp

@@ -1,548 +0,0 @@
-//-------------------------------------------------------------------------------------
-// BC4BC5.cpp
-//  
-// Block-compression (BC) functionality for BC4 and BC5 (DirectX 10 texture compression)
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//  
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-#include "BC.h"
-
-namespace DirectX
-{
-
-//------------------------------------------------------------------------------------
-// Constants
-//------------------------------------------------------------------------------------
-
-// Because these are used in SAL annotations, they need to remain macros rather than const values
-#define BLOCK_LEN 4
-    // length of each block in texel
-
-#define BLOCK_SIZE (BLOCK_LEN * BLOCK_LEN)
-    // total texels in a 4x4 block.
-
-//------------------------------------------------------------------------------------
-// Structures
-//-------------------------------------------------------------------------------------
-
-#pragma warning(push)
-#pragma warning(disable : 4201)
-
-// BC4U/BC5U
-struct BC4_UNORM
-{
-    float R(size_t uOffset) const
-    {
-        size_t uIndex = GetIndex(uOffset);
-        return DecodeFromIndex(uIndex);
-    }
-
-    float DecodeFromIndex(size_t uIndex) const
-    {
-        if (uIndex == 0)
-            return red_0 / 255.0f;
-        if (uIndex == 1)
-            return red_1 / 255.0f;
-        float fred_0 = red_0 / 255.0f;
-        float fred_1 = red_1 / 255.0f;
-        if (red_0 > red_1)
-        {
-            uIndex -= 1;
-            return (fred_0 * (7-uIndex) + fred_1 * uIndex) / 7.0f;
-        }
-        else
-        {
-            if (uIndex == 6)
-                return 0.0f;
-            if (uIndex == 7)
-                return 1.0f;
-            uIndex -= 1;
-            return (fred_0 * (5-uIndex) + fred_1 * uIndex) / 5.0f;
-        }
-    }
-
-    size_t GetIndex(size_t uOffset) const
-    {
-        return (size_t) ((data >> (3*uOffset + 16)) & 0x07);
-    }    
-
-    void SetIndex(size_t uOffset, size_t uIndex)
-    {
-        data &= ~((uint64_t) 0x07 << (3*uOffset + 16));
-        data |= ((uint64_t) uIndex << (3*uOffset + 16));
-    }
-
-    union
-    {
-        struct 
-        {
-            uint8_t red_0;
-            uint8_t red_1;
-            uint8_t indices[6]; 
-        };
-        uint64_t data;
-    };
-};
-
-// BC4S/BC5S
-struct BC4_SNORM
-{
-    float R(size_t uOffset) const
-    {
-        size_t uIndex = GetIndex(uOffset);
-        return DecodeFromIndex(uIndex);
-    }
-
-    float DecodeFromIndex(size_t uIndex) const
-    {
-        int8_t sred_0 = (red_0 == -128)? -127 : red_0;
-        int8_t sred_1 = (red_1 == -128)? -127 : red_1;
-
-        if (uIndex == 0)
-            return sred_0 / 127.0f;
-        if (uIndex == 1)
-            return sred_1 / 127.0f;
-        float fred_0 = sred_0 / 127.0f;
-        float fred_1 = sred_1 / 127.0f;
-        if (red_0 > red_1)
-        {
-            uIndex -= 1;
-            return (fred_0 * (7-uIndex) + fred_1 * uIndex) / 7.0f;
-        }
-        else
-        {
-            if (uIndex == 6)
-                return -1.0f;
-            if (uIndex == 7)
-                return 1.0f;  
-            uIndex -= 1;
-            return (fred_0 * (5-uIndex) + fred_1 * uIndex) / 5.0f;
-        }
-    }
-
-    size_t GetIndex(size_t uOffset) const
-    {
-        return (size_t) ((data >> (3*uOffset + 16)) & 0x07);
-    }    
-
-    void SetIndex(size_t uOffset, size_t uIndex)
-    {
-        data &= ~((uint64_t) 0x07 << (3*uOffset + 16));
-        data |= ((uint64_t) uIndex << (3*uOffset + 16));
-    }
-
-    union
-    {
-        struct 
-        {
-            int8_t red_0;
-            int8_t red_1;
-            uint8_t indices[6]; 
-        };
-        uint64_t data;
-    };
-};
-
-#pragma warning(pop)
-
-//-------------------------------------------------------------------------------------
-// Convert a floating point value to an 8-bit SNORM
-//-------------------------------------------------------------------------------------
-static void inline FloatToSNorm( _In_ float fVal, _Out_ int8_t *piSNorm )
-{
-    const uint32_t dwMostNeg = ( 1 << ( 8 * sizeof( int8_t ) - 1 ) );
-
-    if( _isnan( fVal ) )
-        fVal = 0;
-    else
-        if( fVal > 1 )
-            fVal = 1;    // Clamp to 1
-        else
-            if( fVal < -1 )
-                fVal = -1;    // Clamp to -1
-
-    fVal = fVal * (int8_t) ( dwMostNeg - 1 );
-
-    if( fVal >= 0 )
-        fVal += .5f;
-    else
-        fVal -= .5f;
-
-    *piSNorm = (int8_t) (fVal);
-}
-
-
-//------------------------------------------------------------------------------
-static void FindEndPointsBC4U( _In_reads_(BLOCK_SIZE) const float theTexelsU[], _Out_ uint8_t &endpointU_0, _Out_ uint8_t &endpointU_1)
-{
-    // The boundary of codec for signed/unsigned format
-    float MIN_NORM;
-    float MAX_NORM = 1.0f;
-    int8_t iStart, iEnd;
-    size_t i;
-
-    MIN_NORM = 0.0f;
-
-    // Find max/min of input texels
-    float fBlockMax = theTexelsU[0];
-    float fBlockMin = theTexelsU[0];
-    for (i = 0; i < BLOCK_SIZE; ++i)
-    {    
-        if (theTexelsU[i]<fBlockMin)
-        {
-            fBlockMin = theTexelsU[i];
-        }
-        else if (theTexelsU[i]>fBlockMax)
-        {
-            fBlockMax = theTexelsU[i];
-        }
-    }
-
-    //  If there are boundary values in input texels, Should use 4 block-codec to guarantee
-    //  the exact code of the boundary values.
-    bool bUsing4BlockCodec = ( MIN_NORM == fBlockMin || MAX_NORM == fBlockMax );
-
-    // Using Optimize
-    float fStart, fEnd;
-
-    if (!bUsing4BlockCodec)
-    {   
-        OptimizeAlpha<false>(&fStart, &fEnd, theTexelsU, 8);
-
-        iStart = (uint8_t) (fStart * 255.0f);
-        iEnd   = (uint8_t) (fEnd   * 255.0f);
-
-        endpointU_0 = iEnd;
-        endpointU_1 = iStart;
-    }
-    else
-    {
-        OptimizeAlpha<false>(&fStart, &fEnd, theTexelsU, 6);
-
-        iStart = (uint8_t) (fStart * 255.0f);
-        iEnd   = (uint8_t) (fEnd   * 255.0f);
-
-        endpointU_1 = iEnd;
-        endpointU_0 = iStart;
-    }
-}
-
-static void FindEndPointsBC4S(_In_reads_(BLOCK_SIZE) const float theTexelsU[], _Out_ int8_t &endpointU_0, _Out_ int8_t &endpointU_1)
-{
-    //  The boundary of codec for signed/unsigned format
-    float MIN_NORM;
-    float MAX_NORM = 1.0f;
-    int8_t iStart, iEnd;
-    size_t i;
-
-    MIN_NORM = -1.0f;
-
-    // Find max/min of input texels
-    float fBlockMax = theTexelsU[0];
-    float fBlockMin = theTexelsU[0];
-    for (i = 0; i < BLOCK_SIZE; ++i)
-    {    
-        if (theTexelsU[i]<fBlockMin)
-        {
-            fBlockMin = theTexelsU[i];
-        }
-        else if (theTexelsU[i]>fBlockMax)
-        {
-            fBlockMax = theTexelsU[i];
-        }
-    }
-
-    //  If there are boundary values in input texels, Should use 4 block-codec to guarantee
-    //  the exact code of the boundary values.
-    bool bUsing4BlockCodec = ( MIN_NORM == fBlockMin || MAX_NORM == fBlockMax );
-
-    // Using Optimize
-    float fStart, fEnd;
-
-    if (!bUsing4BlockCodec)
-    {   
-        OptimizeAlpha<true>(&fStart, &fEnd, theTexelsU, 8);
-
-        FloatToSNorm(fStart, &iStart);
-        FloatToSNorm(fEnd, &iEnd);
-
-        endpointU_0 = iEnd;
-        endpointU_1 = iStart;
-    }
-    else
-    {
-        OptimizeAlpha<true>(&fStart, &fEnd, theTexelsU, 6);
-
-        FloatToSNorm(fStart, &iStart);
-        FloatToSNorm(fEnd, &iEnd);
-
-        endpointU_1 = iEnd;
-        endpointU_0 = iStart;
-    }
-}
-
-
-//------------------------------------------------------------------------------
-static inline void FindEndPointsBC5U( _In_reads_(BLOCK_SIZE) const float theTexelsU[], _In_reads_(BLOCK_SIZE) const float theTexelsV[],
-                                      _Out_ uint8_t &endpointU_0, _Out_ uint8_t &endpointU_1, _Out_ uint8_t &endpointV_0, _Out_ uint8_t &endpointV_1)
-{
-    //Encoding the U and V channel by BC4 codec separately.
-    FindEndPointsBC4U( theTexelsU, endpointU_0, endpointU_1);
-    FindEndPointsBC4U( theTexelsV, endpointV_0, endpointV_1);
-}
-
-static inline void FindEndPointsBC5S( _In_reads_(BLOCK_SIZE) const float theTexelsU[], _In_reads_(BLOCK_SIZE) const float theTexelsV[],
-                                      _Out_ int8_t &endpointU_0, _Out_ int8_t &endpointU_1, _Out_ int8_t &endpointV_0, _Out_ int8_t &endpointV_1)
-{
-    //Encoding the U and V channel by BC4 codec separately.
-    FindEndPointsBC4S( theTexelsU, endpointU_0, endpointU_1);
-    FindEndPointsBC4S( theTexelsV, endpointV_0, endpointV_1);
-}
-
-
-//------------------------------------------------------------------------------
-static void FindClosestUNORM(_Inout_ BC4_UNORM* pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const float theTexelsU[])
-{
-    float rGradient[8];
-    int i;
-    for (i = 0; i < 8; ++i)
-    {
-        rGradient[i] = pBC->DecodeFromIndex(i);
-    }
-    for (i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        size_t uBestIndex = 0;
-        float fBestDelta = 100000;
-        for (size_t uIndex = 0; uIndex < 8; uIndex++)
-        {
-            float fCurrentDelta = fabsf(rGradient[uIndex]-theTexelsU[i]);
-            if (fCurrentDelta < fBestDelta)
-            {
-                uBestIndex = uIndex;
-                fBestDelta = fCurrentDelta;
-            }
-        }
-        pBC->SetIndex(i, uBestIndex);
-    }
-}
-
-static void FindClosestSNORM(_Inout_ BC4_SNORM* pBC, _In_reads_(NUM_PIXELS_PER_BLOCK) const float theTexelsU[])
-{    
-    float rGradient[8];
-    int i;
-    for (i = 0; i < 8; ++i)
-    {
-        rGradient[i] = pBC->DecodeFromIndex(i);
-    }
-    for (i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        size_t uBestIndex = 0;
-        float fBestDelta = 100000;
-        for (size_t uIndex = 0; uIndex < 8; uIndex++)
-        {
-            float fCurrentDelta = fabsf(rGradient[uIndex]-theTexelsU[i]);
-            if (fCurrentDelta < fBestDelta)
-            {
-                uBestIndex = uIndex;
-                fBestDelta = fCurrentDelta;
-            }
-        }
-        pBC->SetIndex(i, uBestIndex);
-    }
-}
-
-
-//=====================================================================================
-// Entry points
-//=====================================================================================
-
-//-------------------------------------------------------------------------------------
-// BC4 Compression
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-void D3DXDecodeBC4U( XMVECTOR *pColor, const uint8_t *pBC )
-{
-    assert( pColor && pBC );
-    static_assert( sizeof(BC4_UNORM) == 8, "BC4_UNORM should be 8 bytes" );
-
-    auto pBC4 = reinterpret_cast<const BC4_UNORM*>(pBC);
-
-    for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        #pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
-        pColor[i] = XMVectorSet( pBC4->R(i), 0, 0, 1.0f);
-    }       
-}
-
-_Use_decl_annotations_
-void D3DXDecodeBC4S(XMVECTOR *pColor, const uint8_t *pBC)
-{
-    assert( pColor && pBC );
-    static_assert( sizeof(BC4_SNORM) == 8, "BC4_SNORM should be 8 bytes" );
-
-    auto pBC4 = reinterpret_cast<const BC4_SNORM*>(pBC);
-
-    for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        #pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
-        pColor[i] = XMVectorSet( pBC4->R(i), 0, 0, 1.0f);
-    }       
-}
-
-_Use_decl_annotations_
-void D3DXEncodeBC4U( uint8_t *pBC, const XMVECTOR *pColor, DWORD flags )
-{
-    UNREFERENCED_PARAMETER( flags );
-
-    assert( pBC && pColor );
-    static_assert( sizeof(BC4_UNORM) == 8, "BC4_UNORM should be 8 bytes" );
-
-    memset(pBC, 0, sizeof(BC4_UNORM));
-    auto pBC4 = reinterpret_cast<BC4_UNORM*>(pBC);
-    float theTexelsU[NUM_PIXELS_PER_BLOCK];
-
-    for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        theTexelsU[i] = XMVectorGetX( pColor[i] );
-    }
-
-    FindEndPointsBC4U(theTexelsU, pBC4->red_0, pBC4->red_1);
-    FindClosestUNORM(pBC4, theTexelsU);
-}
-
-_Use_decl_annotations_
-void D3DXEncodeBC4S( uint8_t *pBC, const XMVECTOR *pColor, DWORD flags )
-{
-    UNREFERENCED_PARAMETER( flags );
-
-    assert( pBC && pColor );
-    static_assert( sizeof(BC4_SNORM) == 8, "BC4_SNORM should be 8 bytes" );
-
-    memset(pBC, 0, sizeof(BC4_UNORM));
-    auto pBC4 = reinterpret_cast<BC4_SNORM*>(pBC);
-    float theTexelsU[NUM_PIXELS_PER_BLOCK];
-
-    for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        theTexelsU[i] = XMVectorGetX( pColor[i] );
-    }
-
-    FindEndPointsBC4S(theTexelsU, pBC4->red_0, pBC4->red_1);
-    FindClosestSNORM(pBC4, theTexelsU);
-}
-
-
-//-------------------------------------------------------------------------------------
-// BC5 Compression
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-void D3DXDecodeBC5U(XMVECTOR *pColor, const uint8_t *pBC)
-{
-    assert( pColor && pBC );
-    static_assert( sizeof(BC4_UNORM) == 8, "BC4_UNORM should be 8 bytes" );
-
-    auto pBCR = reinterpret_cast<const BC4_UNORM*>(pBC);
-    auto pBCG = reinterpret_cast<const BC4_UNORM*>(pBC+sizeof(BC4_UNORM));
-
-    for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        #pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
-        pColor[i] = XMVectorSet(pBCR->R(i), pBCG->R(i), 0, 1.0f);
-    }       
-}
-
-_Use_decl_annotations_
-void D3DXDecodeBC5S(XMVECTOR *pColor, const uint8_t *pBC)
-{
-    assert( pColor && pBC );
-    static_assert( sizeof(BC4_SNORM) == 8, "BC4_SNORM should be 8 bytes" );
-
-    auto pBCR = reinterpret_cast<const BC4_SNORM*>(pBC);
-    auto pBCG = reinterpret_cast<const BC4_SNORM*>(pBC+sizeof(BC4_SNORM));
-
-    for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        #pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
-        pColor[i] = XMVectorSet(pBCR->R(i), pBCG->R(i), 0, 1.0f);
-    }       
-}
-
-_Use_decl_annotations_
-void D3DXEncodeBC5U( uint8_t *pBC, const XMVECTOR *pColor, DWORD flags )
-{
-    UNREFERENCED_PARAMETER( flags );
-
-    assert( pBC && pColor );
-    static_assert( sizeof(BC4_UNORM) == 8, "BC4_UNORM should be 8 bytes" );
-
-    memset(pBC, 0, sizeof(BC4_UNORM)*2);
-    auto pBCR = reinterpret_cast<BC4_UNORM*>(pBC);
-    auto pBCG = reinterpret_cast<BC4_UNORM*>(pBC+sizeof(BC4_UNORM));
-    float theTexelsU[NUM_PIXELS_PER_BLOCK];
-    float theTexelsV[NUM_PIXELS_PER_BLOCK];
-
-    for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {   
-        XMFLOAT4A clr;
-        XMStoreFloat4A( &clr, pColor[i] );
-        theTexelsU[i] = clr.x;
-        theTexelsV[i] = clr.y;
-    }
-
-    FindEndPointsBC5U(
-        theTexelsU,
-        theTexelsV,
-        pBCR->red_0,
-        pBCR->red_1,
-        pBCG->red_0,
-        pBCG->red_1);
-
-    FindClosestUNORM(pBCR, theTexelsU);
-    FindClosestUNORM(pBCG, theTexelsV);
-}
-
-_Use_decl_annotations_
-void D3DXEncodeBC5S( uint8_t *pBC, const XMVECTOR *pColor, DWORD flags )
-{
-    UNREFERENCED_PARAMETER( flags );
-
-    assert( pBC && pColor );
-    static_assert( sizeof(BC4_SNORM) == 8, "BC4_SNORM should be 8 bytes" );
-
-    memset(pBC, 0, sizeof(BC4_UNORM)*2);
-    auto pBCR = reinterpret_cast<BC4_SNORM*>(pBC);
-    auto pBCG = reinterpret_cast<BC4_SNORM*>(pBC+sizeof(BC4_SNORM));
-    float theTexelsU[NUM_PIXELS_PER_BLOCK];
-    float theTexelsV[NUM_PIXELS_PER_BLOCK];
-
-    for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
-    {
-        XMFLOAT4A clr;
-        XMStoreFloat4A( &clr, pColor[i] );
-        theTexelsU[i] = clr.x;
-        theTexelsV[i] = clr.y;
-    }
-
-    FindEndPointsBC5S(
-        theTexelsU,
-        theTexelsV,
-        pBCR->red_0,
-        pBCR->red_1,
-        pBCG->red_0,
-        pBCG->red_1);
-
-    FindClosestSNORM(pBCR, theTexelsU);
-    FindClosestSNORM(pBCG, theTexelsV);
-}
-
-} // namespace

File diff suppressed because it is too large
+ 0 - 2871
Exporters/FBX/3rdParty/DirectXTex/BC6HBC7.cpp


+ 0 - 604
Exporters/FBX/3rdParty/DirectXTex/BCDirectCompute.cpp

@@ -1,604 +0,0 @@
-//-------------------------------------------------------------------------------------
-// BCDirectCompute.cpp
-//  
-// Direct3D 11 Compute Shader BC Compressor
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-#include "BCDirectCompute.h"
-
-#if defined(_DEBUG) || defined(PROFILE)
-#pragma comment(lib,"dxguid.lib")
-#endif
-
-using Microsoft::WRL::ComPtr;
-
-namespace
-{
-    #include "Shaders\Compiled\BC7Encode_EncodeBlockCS.inc"
-    #include "Shaders\Compiled\BC7Encode_TryMode02CS.inc"
-    #include "Shaders\Compiled\BC7Encode_TryMode137CS.inc"
-    #include "Shaders\Compiled\BC7Encode_TryMode456CS.inc"
-    #include "Shaders\Compiled\BC6HEncode_EncodeBlockCS.inc"
-    #include "Shaders\Compiled\BC6HEncode_TryModeG10CS.inc"
-    #include "Shaders\Compiled\BC6HEncode_TryModeLE10CS.inc"
-
-    struct BufferBC6HBC7
-    {
-        UINT color[4];
-    };
-
-    struct ConstantsBC6HBC7
-    {
-        UINT    tex_width;
-        UINT    num_block_x;
-        UINT    format;
-        UINT    mode_id;
-        UINT    start_block_id;
-        UINT    num_total_blocks;
-        float   alpha_weight;
-        UINT    reserved;
-    };
-
-    static_assert( sizeof(ConstantsBC6HBC7) == sizeof(UINT)*8, "Constant buffer size mismatch" );
-
-    inline void RunComputeShader( ID3D11DeviceContext* pContext,
-                                  ID3D11ComputeShader* shader,
-                                  ID3D11ShaderResourceView** pSRVs, 
-                                  UINT srvCount,
-                                  ID3D11Buffer* pCB, 
-                                  ID3D11UnorderedAccessView* pUAV,
-                                  UINT X )
-    {
-        // Force UAV to nullptr before setting SRV since we are swapping buffers
-        ID3D11UnorderedAccessView* nullUAV = nullptr;
-        pContext->CSSetUnorderedAccessViews( 0, 1, &nullUAV, nullptr );
-
-        pContext->CSSetShader( shader, nullptr, 0 );
-        pContext->CSSetShaderResources( 0, srvCount, pSRVs );
-        pContext->CSSetUnorderedAccessViews( 0, 1, &pUAV, nullptr );
-        pContext->CSSetConstantBuffers( 0, 1, &pCB );
-        pContext->Dispatch( X, 1, 1 );
-    }
-
-    inline void ResetContext( ID3D11DeviceContext* pContext )
-    {
-        ID3D11UnorderedAccessView* nullUAV = nullptr;
-        pContext->CSSetUnorderedAccessViews( 0, 1, &nullUAV, nullptr );
-
-        ID3D11ShaderResourceView* nullSRV[3] = { nullptr, nullptr, nullptr };
-        pContext->CSSetShaderResources( 0, 3, nullSRV );
-
-        ID3D11Buffer* nullBuffer[1] = { nullptr };
-        pContext->CSSetConstantBuffers( 0, 1, nullBuffer );
-    }
-};
-
-namespace DirectX
-{
-
-GPUCompressBC::GPUCompressBC() :
-    m_bcformat(DXGI_FORMAT_UNKNOWN),
-    m_srcformat(DXGI_FORMAT_UNKNOWN),
-    m_alphaWeight(1.f),
-    m_width(0),
-    m_height(0)
-{
-}
-
-
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT GPUCompressBC::Initialize( ID3D11Device* pDevice )
-{
-    if ( !pDevice )
-        return E_INVALIDARG;
-
-    // Check for DirectCompute support
-    D3D_FEATURE_LEVEL fl = pDevice->GetFeatureLevel();
-
-    if ( fl < D3D_FEATURE_LEVEL_10_0 )
-    {
-        // DirectCompute not supported on Feature Level 9.x hardware
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    if ( fl < D3D_FEATURE_LEVEL_11_0 )
-    {
-        // DirectCompute support on Feature Level 10.x hardware is optional, and this function needs it
-        D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS hwopts;
-        HRESULT hr = pDevice->CheckFeatureSupport( D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &hwopts, sizeof(hwopts) );
-        if ( FAILED(hr) )
-        {
-            memset( &hwopts, 0, sizeof(hwopts) );
-        }
-
-        if ( !hwopts.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x )
-        {
-            return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-        }
-    }
-
-    // Save a device reference and obtain immediate context
-    m_device = pDevice;
-
-    pDevice->GetImmediateContext( m_context.ReleaseAndGetAddressOf() );
-    assert( m_context );
-
-    //--- Create compute shader library: BC6H -----------------------------------------
-
-    // Modes 11-14
-    HRESULT hr = pDevice->CreateComputeShader( BC6HEncode_TryModeG10CS, sizeof(BC6HEncode_TryModeG10CS), nullptr, m_BC6H_tryModeG10CS.ReleaseAndGetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    // Modes 1-10
-    hr = pDevice->CreateComputeShader( BC6HEncode_TryModeLE10CS, sizeof(BC6HEncode_TryModeLE10CS), nullptr, m_BC6H_tryModeLE10CS.ReleaseAndGetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    // Encode
-    hr = pDevice->CreateComputeShader( BC6HEncode_EncodeBlockCS, sizeof(BC6HEncode_EncodeBlockCS), nullptr, m_BC6H_encodeBlockCS.ReleaseAndGetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    //--- Create compute shader library: BC7 ------------------------------------------
-
-    // Modes 4, 5, 6
-    hr = pDevice->CreateComputeShader( BC7Encode_TryMode456CS, sizeof(BC7Encode_TryMode456CS), nullptr, m_BC7_tryMode456CS.ReleaseAndGetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    // Modes 1, 3, 7
-    hr = pDevice->CreateComputeShader( BC7Encode_TryMode137CS, sizeof(BC7Encode_TryMode137CS), nullptr, m_BC7_tryMode137CS.ReleaseAndGetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    // Modes 0, 2
-    hr = pDevice->CreateComputeShader( BC7Encode_TryMode02CS, sizeof(BC7Encode_TryMode02CS), nullptr, m_BC7_tryMode02CS.ReleaseAndGetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    // Encode
-    hr = pDevice->CreateComputeShader( BC7Encode_EncodeBlockCS, sizeof(BC7Encode_EncodeBlockCS), nullptr, m_BC7_encodeBlockCS.ReleaseAndGetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT GPUCompressBC::Prepare( size_t width, size_t height, DXGI_FORMAT format, float alphaWeight )
-{
-    if ( !width || !height || alphaWeight < 0.f )
-        return E_INVALIDARG;
-
-#ifdef _M_X64
-    if ( (width > 0xFFFFFFFF) || (height > 0xFFFFFFFF) )
-        return E_INVALIDARG;
-#endif
-
-    m_width = width;
-    m_height = height;
-
-    m_alphaWeight = alphaWeight;
-
-    size_t xblocks = std::max<size_t>( 1, (width + 3) >> 2 );
-    size_t yblocks = std::max<size_t>( 1, (height + 3) >> 2 );
-    size_t num_blocks = xblocks * yblocks;
-
-    switch( format )
-    {
-    // BC6H GPU compressor takes RGBAF32 as input
-    case DXGI_FORMAT_BC6H_TYPELESS:
-    case DXGI_FORMAT_BC6H_UF16:
-    case DXGI_FORMAT_BC6H_SF16:
-        m_srcformat = DXGI_FORMAT_R32G32B32A32_FLOAT;
-        break;
-
-    // BC7 GPU compressor takes RGBA32 as input
-    case DXGI_FORMAT_BC7_TYPELESS:
-    case DXGI_FORMAT_BC7_UNORM:
-        m_srcformat = DXGI_FORMAT_R8G8B8A8_UNORM;
-        break;
-
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-        m_srcformat = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
-        break;
-
-    default:
-        m_bcformat = m_srcformat = DXGI_FORMAT_UNKNOWN;
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    m_bcformat = format;
-
-    auto pDevice = m_device.Get();
-    if ( !pDevice )
-        return E_POINTER;
-
-    // Create structured buffers
-    size_t bufferSize = num_blocks * sizeof( BufferBC6HBC7 );
-    {
-        D3D11_BUFFER_DESC desc;
-        memset( &desc, 0, sizeof(desc) );
-        desc.BindFlags = D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE;
-        desc.Usage = D3D11_USAGE_DEFAULT;
-        desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
-        desc.StructureByteStride = sizeof( BufferBC6HBC7 );
-        desc.ByteWidth = static_cast<UINT>( bufferSize );
-
-        HRESULT hr = pDevice->CreateBuffer( &desc, nullptr, m_output.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-
-        hr = pDevice->CreateBuffer( &desc, nullptr, m_err1.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-
-        hr = pDevice->CreateBuffer( &desc, nullptr, m_err2.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-    }
-
-    // Create staging output buffer
-    {
-        D3D11_BUFFER_DESC desc;
-        memset( &desc, 0, sizeof(desc) );
-        desc.Usage = D3D11_USAGE_STAGING;
-        desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
-        desc.ByteWidth = static_cast<UINT>( bufferSize );
-
-        HRESULT hr = pDevice->CreateBuffer( &desc, nullptr, m_outputCPU.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-    }
-
-    // Create constant buffer
-    {
-        D3D11_BUFFER_DESC desc;
-        memset( &desc, 0, sizeof(desc) );
-        desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
-        desc.Usage = D3D11_USAGE_DYNAMIC;
-        desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
-        desc.ByteWidth = sizeof( ConstantsBC6HBC7 );
-
-        HRESULT hr = pDevice->CreateBuffer( &desc, nullptr, m_constBuffer.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-    }
-
-    // Create shader resource views
-    {
-        D3D11_SHADER_RESOURCE_VIEW_DESC desc;
-        memset( &desc, 0, sizeof(desc) );
-        desc.Buffer.NumElements = static_cast<UINT>( num_blocks );
-        desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
-
-        HRESULT hr = pDevice->CreateShaderResourceView( m_err1.Get(), &desc, m_err1SRV.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-
-        hr = pDevice->CreateShaderResourceView( m_err2.Get(), &desc, m_err2SRV.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-    }
-
-    // Create unordered access views
-    {
-        D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
-        memset( &desc, 0, sizeof(desc) );
-        desc.Buffer.NumElements = static_cast<UINT>( num_blocks );
-        desc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
-
-        HRESULT hr = pDevice->CreateUnorderedAccessView( m_output.Get(), &desc, m_outputUAV.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-
-        hr = pDevice->CreateUnorderedAccessView( m_err1.Get(), &desc, m_err1UAV.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-
-        hr = pDevice->CreateUnorderedAccessView( m_err2.Get(), &desc, m_err2UAV.ReleaseAndGetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-    }
-    
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT GPUCompressBC::Compress( const Image& srcImage, const Image& destImage )
-{
-    if ( !srcImage.pixels || !destImage.pixels )
-        return E_INVALIDARG;
-
-    if ( srcImage.width != destImage.width
-         || srcImage.height != destImage.height
-         || srcImage.width != m_width
-         || srcImage.height != m_height
-         || srcImage.format != m_srcformat
-         || destImage.format != m_bcformat )
-    {
-        return E_UNEXPECTED;
-    }
-
-    //--- Create input texture --------------------------------------------------------
-    auto pDevice = m_device.Get();
-    if ( !pDevice )
-        return E_POINTER;
-
-    // We need to avoid the hardware doing additional colorspace conversion
-    DXGI_FORMAT inputFormat = ( m_srcformat == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB ) ? DXGI_FORMAT_R8G8B8A8_UNORM : m_srcformat;
-
-    ComPtr<ID3D11Texture2D> sourceTex;
-    {
-        D3D11_TEXTURE2D_DESC desc;
-        memset( &desc, 0, sizeof(desc) );
-        desc.Width = static_cast<UINT>( srcImage.width );
-        desc.Height = static_cast<UINT>( srcImage.height ); 
-        desc.MipLevels = 1;
-        desc.ArraySize = 1;
-        desc.Format = inputFormat;
-        desc.SampleDesc.Count = 1;
-        desc.Usage = D3D11_USAGE_DEFAULT;
-        desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
-
-        D3D11_SUBRESOURCE_DATA initData;
-        initData.pSysMem = srcImage.pixels;
-        initData.SysMemPitch = static_cast<DWORD>( srcImage.rowPitch );
-        initData.SysMemSlicePitch = static_cast<DWORD>( srcImage.slicePitch );
-
-        HRESULT hr = pDevice->CreateTexture2D( &desc, &initData, sourceTex.GetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-    }
-
-    ComPtr<ID3D11ShaderResourceView> sourceSRV;
-    {
-        D3D11_SHADER_RESOURCE_VIEW_DESC desc;
-        memset( &desc, 0, sizeof(desc) );
-        desc.Texture2D.MipLevels = 1;
-        desc.Format = inputFormat;
-        desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
-
-        HRESULT hr = pDevice->CreateShaderResourceView( sourceTex.Get(), &desc, sourceSRV.GetAddressOf() );
-        if ( FAILED(hr) )
-        {
-            return hr;
-        }
-    }
-
-    //--- Compress using DirectCompute ------------------------------------------------
-    bool isbc7 = false;
-    switch( m_bcformat )
-    {
-    case DXGI_FORMAT_BC6H_TYPELESS:
-    case DXGI_FORMAT_BC6H_UF16:
-    case DXGI_FORMAT_BC6H_SF16:
-        break;
-
-    case DXGI_FORMAT_BC7_TYPELESS:
-    case DXGI_FORMAT_BC7_UNORM:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-        isbc7 = true;
-        break;
-
-    default:
-        return E_UNEXPECTED;
-    }
-
-    const UINT MAX_BLOCK_BATCH = 64;
-
-    auto pContext = m_context.Get();
-    if ( !pContext )
-        return E_UNEXPECTED;
-
-    size_t xblocks = std::max<size_t>( 1, (m_width + 3) >> 2 );
-    size_t yblocks = std::max<size_t>( 1, (m_height + 3) >> 2 );
-
-    UINT num_total_blocks = static_cast<UINT>( xblocks * yblocks );
-    UINT num_blocks = num_total_blocks;
-    int start_block_id = 0;
-    while (num_blocks > 0)
-    {
-        UINT n = std::min<UINT>( num_blocks, MAX_BLOCK_BATCH );
-        UINT uThreadGroupCount = n;
-
-        {
-            D3D11_MAPPED_SUBRESOURCE mapped;
-            HRESULT hr = pContext->Map( m_constBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped );
-            if ( FAILED(hr) )
-                return hr;
-
-            ConstantsBC6HBC7 param;
-            param.tex_width = static_cast<UINT>( srcImage.width );
-            param.num_block_x = static_cast<UINT>( xblocks );
-            param.format = m_bcformat;
-            param.mode_id = 0;
-            param.start_block_id = start_block_id;
-            param.num_total_blocks = num_total_blocks;
-            param.alpha_weight = m_alphaWeight;
-            memcpy( mapped.pData, &param, sizeof( param ) );
-
-            pContext->Unmap( m_constBuffer.Get(), 0 );
-        }
-
-        if ( isbc7 )
-        {
-            //--- BC7 -----------------------------------------------------------------
-            ID3D11ShaderResourceView* pSRVs[] = { sourceSRV.Get(), nullptr };
-            RunComputeShader( pContext, m_BC7_tryMode456CS.Get(), pSRVs, 2, m_constBuffer.Get(),
-                              m_err1UAV.Get(), std::max<UINT>( (uThreadGroupCount + 3) / 4, 1) );
-
-            for ( UINT i = 0; i < 3; ++i )
-            {
-                static const UINT modes[] = { 1, 3, 7 };
-                {
-                    D3D11_MAPPED_SUBRESOURCE mapped;
-                    HRESULT hr = pContext->Map( m_constBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped );
-                    if ( FAILED(hr) )
-                    {
-                        ResetContext( pContext );
-                        return hr;
-                    }
-
-                    ConstantsBC6HBC7 param;
-                    param.tex_width = static_cast<UINT>( srcImage.width );
-                    param.num_block_x = static_cast<UINT>( xblocks );
-                    param.format = m_bcformat;
-                    param.mode_id = modes[i];
-                    param.start_block_id = start_block_id;
-                    param.num_total_blocks = num_total_blocks;
-                    param.alpha_weight = m_alphaWeight;
-                    memcpy( mapped.pData, &param, sizeof( param ) );
-                    pContext->Unmap( m_constBuffer.Get(), 0 );
-                }
-
-                pSRVs[1] = (i & 1) ? m_err2SRV.Get() : m_err1SRV.Get();
-                RunComputeShader( pContext, m_BC7_tryMode137CS.Get(), pSRVs, 2, m_constBuffer.Get(),
-                                  (i & 1) ? m_err1UAV.Get() : m_err2UAV.Get(), uThreadGroupCount );
-            }               
-
-            for ( UINT i = 0; i < 2; ++i )
-            {
-                static const UINT modes[] = { 0, 2 };
-                {
-                    D3D11_MAPPED_SUBRESOURCE mapped;
-                    HRESULT hr = pContext->Map( m_constBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped );
-                    if ( FAILED(hr) )
-                    {
-                        ResetContext( pContext );
-                        return hr;
-                    }
-
-                    ConstantsBC6HBC7 param;
-                    param.tex_width = static_cast<UINT>( srcImage.width );
-                    param.num_block_x = static_cast<UINT>( xblocks );
-                    param.format = m_bcformat;
-                    param.mode_id = modes[i];
-                    param.start_block_id = start_block_id;
-                    param.num_total_blocks = num_total_blocks;
-                    param.alpha_weight = m_alphaWeight;
-                    memcpy( mapped.pData, &param, sizeof( param ) );
-                    pContext->Unmap( m_constBuffer.Get(), 0 );
-                }
-
-                pSRVs[1] = (i & 1) ? m_err1SRV.Get() : m_err2SRV.Get();
-                RunComputeShader( pContext, m_BC7_tryMode02CS.Get(), pSRVs, 2, m_constBuffer.Get(),
-                                  (i & 1) ? m_err2UAV.Get() : m_err1UAV.Get(), uThreadGroupCount );
-            }
-
-            pSRVs[1] = m_err2SRV.Get();
-            RunComputeShader( pContext, m_BC7_encodeBlockCS.Get(), pSRVs, 2, m_constBuffer.Get(),
-                              m_outputUAV.Get(), std::max<UINT>( (uThreadGroupCount + 3) / 4, 1) );
-        }
-        else
-        {
-            //--- BC6H ----------------------------------------------------------------
-            ID3D11ShaderResourceView* pSRVs[] = { sourceSRV.Get(), nullptr };
-            RunComputeShader( pContext, m_BC6H_tryModeG10CS.Get(), pSRVs, 2, m_constBuffer.Get(),
-                              m_err1UAV.Get(), std::max<UINT>( (uThreadGroupCount + 3) / 4, 1) );
-
-            for ( UINT i = 0; i < 10; ++i )
-            {
-                {
-                    D3D11_MAPPED_SUBRESOURCE mapped;
-                    HRESULT hr = pContext->Map( m_constBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped );
-                    if ( FAILED(hr) )
-                    {
-                        ResetContext( pContext );
-                        return hr;
-                    }
-
-                    ConstantsBC6HBC7 param;
-                    param.tex_width = static_cast<UINT>( srcImage.width );
-                    param.num_block_x = static_cast<UINT>( xblocks );
-                    param.format = m_bcformat;
-                    param.mode_id = i;
-                    param.start_block_id = start_block_id;
-                    param.num_total_blocks = num_total_blocks;
-                    memcpy( mapped.pData, &param, sizeof( param ) );
-                    pContext->Unmap( m_constBuffer.Get(), 0 );
-                }
-
-                pSRVs[1] = (i & 1) ? m_err2SRV.Get() : m_err1SRV.Get();
-                RunComputeShader( pContext, m_BC6H_tryModeLE10CS.Get(), pSRVs, 2, m_constBuffer.Get(),
-                                  (i & 1) ? m_err1UAV.Get() : m_err2UAV.Get(), std::max<UINT>( (uThreadGroupCount + 1) / 2, 1) );
-            }               
-
-            pSRVs[1] = m_err1SRV.Get();
-            RunComputeShader( pContext, m_BC6H_encodeBlockCS.Get(), pSRVs, 2, m_constBuffer.Get(),
-                              m_outputUAV.Get(), std::max<UINT>( (uThreadGroupCount + 1) / 2, 1) );
-        }
-
-        start_block_id += n;
-        num_blocks -= n;
-    }
-
-    ResetContext( pContext );
-
-    //--- Copy output texture back to CPU ---------------------------------------------
-
-    pContext->CopyResource( m_outputCPU.Get(), m_output.Get() );
-
-    D3D11_MAPPED_SUBRESOURCE mapped;
-    HRESULT hr = pContext->Map( m_outputCPU.Get(), 0, D3D11_MAP_READ, 0, &mapped );
-    if ( SUCCEEDED(hr) )
-    {
-        const uint8_t *pSrc = reinterpret_cast<const uint8_t *>( mapped.pData );
-        uint8_t *pDest = destImage.pixels;
-
-        size_t pitch = xblocks * sizeof( BufferBC6HBC7 );
-
-        size_t rows = std::max<size_t>( 1, ( destImage.height + 3 ) >> 2 );
-
-        for( size_t h = 0; h < rows; ++h )
-        {
-            memcpy( pDest, pSrc, destImage.rowPitch );
-
-            pSrc += pitch;
-            pDest += destImage.rowPitch;
-        }
-
-        pContext->Unmap( m_outputCPU.Get(), 0 );
-    }
-
-    return hr;
-}
-
-}; // namespace

+ 0 - 68
Exporters/FBX/3rdParty/DirectXTex/BCDirectCompute.h

@@ -1,68 +0,0 @@
-//-------------------------------------------------------------------------------------
-// BCDirectCompute.h
-//  
-// Direct3D 11 Compute Shader BC Compressor
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//-------------------------------------------------------------------------------------
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-namespace DirectX
-{
-
-class GPUCompressBC
-{
-public:
-    GPUCompressBC();
-
-    HRESULT Initialize( _In_ ID3D11Device* pDevice );
-
-    HRESULT Prepare( _In_ size_t width, _In_ size_t height, _In_ DXGI_FORMAT format, _In_ float alphaWeight = 1.f );
-
-    HRESULT Compress( _In_ const Image& srcImage, _In_ const Image& destImage );
-
-    DXGI_FORMAT GetSourceFormat() const { return m_srcformat; }
-
-private:
-    DXGI_FORMAT                                         m_bcformat;
-    DXGI_FORMAT                                         m_srcformat;
-    float                                               m_alphaWeight;
-    size_t                                              m_width;
-    size_t                                              m_height;
-
-    Microsoft::WRL::ComPtr<ID3D11Device>                m_device;
-    Microsoft::WRL::ComPtr<ID3D11DeviceContext>         m_context;
-
-    Microsoft::WRL::ComPtr<ID3D11Buffer>                m_err1;
-    Microsoft::WRL::ComPtr<ID3D11UnorderedAccessView>   m_err1UAV;
-    Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>    m_err1SRV;
-
-    Microsoft::WRL::ComPtr<ID3D11Buffer>                m_err2;
-    Microsoft::WRL::ComPtr<ID3D11UnorderedAccessView>   m_err2UAV;
-    Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>    m_err2SRV;
-
-    Microsoft::WRL::ComPtr<ID3D11Buffer>                m_output;
-    Microsoft::WRL::ComPtr<ID3D11Buffer>                m_outputCPU;
-    Microsoft::WRL::ComPtr<ID3D11UnorderedAccessView>   m_outputUAV;
-    Microsoft::WRL::ComPtr<ID3D11Buffer>                m_constBuffer;
-    
-    // Compute shader library
-    Microsoft::WRL::ComPtr<ID3D11ComputeShader>         m_BC6H_tryModeG10CS;
-    Microsoft::WRL::ComPtr<ID3D11ComputeShader>         m_BC6H_tryModeLE10CS;
-    Microsoft::WRL::ComPtr<ID3D11ComputeShader>         m_BC6H_encodeBlockCS;
-
-    Microsoft::WRL::ComPtr<ID3D11ComputeShader>         m_BC7_tryMode456CS;
-    Microsoft::WRL::ComPtr<ID3D11ComputeShader>         m_BC7_tryMode137CS;
-    Microsoft::WRL::ComPtr<ID3D11ComputeShader>         m_BC7_tryMode02CS;
-    Microsoft::WRL::ComPtr<ID3D11ComputeShader>         m_BC7_encodeBlockCS;    
-};
-
-}; // namespace

+ 0 - 239
Exporters/FBX/3rdParty/DirectXTex/DDS.h

@@ -1,239 +0,0 @@
-//--------------------------------------------------------------------------------------
-// dds.h
-//
-// This header defines constants and structures that are useful when parsing 
-// DDS files.  DDS files were originally designed to use several structures
-// and constants that are native to DirectDraw and are defined in ddraw.h,
-// such as DDSURFACEDESC2 and DDSCAPS2.  This file defines similar 
-// (compatible) constants and structures so that one can use DDS files 
-// without needing to include ddraw.h.
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//--------------------------------------------------------------------------------------
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC
-#include <d3d11_x.h>
-#else
-#include <dxgiformat.h>
-#endif
-
-// VS 2010's stdint.h conflicts with intsafe.h
-#pragma warning(push)
-#pragma warning(disable : 4005)
-#include <stdint.h>
-#pragma warning(pop)
-
-namespace DirectX
-{
-
-#pragma pack(push,1)
-
-const uint32_t DDS_MAGIC = 0x20534444; // "DDS "
-
-struct DDS_PIXELFORMAT
-{
-    uint32_t    dwSize;
-    uint32_t    dwFlags;
-    uint32_t    dwFourCC;
-    uint32_t    dwRGBBitCount;
-    uint32_t    dwRBitMask;
-    uint32_t    dwGBitMask;
-    uint32_t    dwBBitMask;
-    uint32_t    dwABitMask;
-};
-
-#define DDS_FOURCC      0x00000004  // DDPF_FOURCC
-#define DDS_RGB         0x00000040  // DDPF_RGB
-#define DDS_RGBA        0x00000041  // DDPF_RGB | DDPF_ALPHAPIXELS
-#define DDS_LUMINANCE   0x00020000  // DDPF_LUMINANCE
-#define DDS_LUMINANCEA  0x00020001  // DDPF_LUMINANCE | DDPF_ALPHAPIXELS
-#define DDS_ALPHA       0x00000002  // DDPF_ALPHA
-#define DDS_PAL8        0x00000020  // DDPF_PALETTEINDEXED8
-
-#ifndef MAKEFOURCC
-    #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
-                ((uint32_t)(uint8_t)(ch0) | ((uint32_t)(uint8_t)(ch1) << 8) |       \
-                ((uint32_t)(uint8_t)(ch2) << 16) | ((uint32_t)(uint8_t)(ch3) << 24 ))
-#endif /* defined(MAKEFOURCC) */
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_DXT1 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_DXT2 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','2'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_DXT3 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','3'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_DXT4 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','4'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_DXT5 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','5'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_BC4_UNORM =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B','C','4','U'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_BC4_SNORM =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B','C','4','S'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_BC5_UNORM =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B','C','5','U'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_BC5_SNORM =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B','C','5','S'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_R8G8_B8G8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('R','G','B','G'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_G8R8_G8B8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('G','R','G','B'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_YUY2 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_A8R8G8B8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_X8R8G8B8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGB,  0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_A8B8G8R8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_X8B8G8R8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGB,  0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_G16R16 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGB,  0, 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_R5G6B5 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 16, 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_A1R5G5B5 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 16, 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_A4R4G4B4 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 16, 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_R8G8B8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_L8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_LUMINANCE, 0,  8, 0xff, 0x00, 0x00, 0x00 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_L16 =
-    { sizeof(DDS_PIXELFORMAT), DDS_LUMINANCE, 0, 16, 0xffff, 0x0000, 0x0000, 0x0000 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_A8L8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_LUMINANCEA, 0, 16, 0x00ff, 0x0000, 0x0000, 0xff00 };
-
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_A8 =
-    { sizeof(DDS_PIXELFORMAT), DDS_ALPHA, 0, 8, 0x00, 0x00, 0x00, 0xff };
-
-// D3DFMT_A2R10G10B10/D3DFMT_A2B10G10R10 should be written using DX10 extension to avoid D3DX 10:10:10:2 reversal issue
-
-// This indicates the DDS_HEADER_DXT10 extension is present (the format is in dxgiFormat)
-extern __declspec(selectany) const DDS_PIXELFORMAT DDSPF_DX10 =
-    { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 };
-
-#define DDS_HEADER_FLAGS_TEXTURE        0x00001007  // DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT 
-#define DDS_HEADER_FLAGS_MIPMAP         0x00020000  // DDSD_MIPMAPCOUNT
-#define DDS_HEADER_FLAGS_VOLUME         0x00800000  // DDSD_DEPTH
-#define DDS_HEADER_FLAGS_PITCH          0x00000008  // DDSD_PITCH
-#define DDS_HEADER_FLAGS_LINEARSIZE     0x00080000  // DDSD_LINEARSIZE
-
-#define DDS_HEIGHT 0x00000002 // DDSD_HEIGHT
-#define DDS_WIDTH  0x00000004 // DDSD_WIDTH
-
-#define DDS_SURFACE_FLAGS_TEXTURE 0x00001000 // DDSCAPS_TEXTURE
-#define DDS_SURFACE_FLAGS_MIPMAP  0x00400008 // DDSCAPS_COMPLEX | DDSCAPS_MIPMAP
-#define DDS_SURFACE_FLAGS_CUBEMAP 0x00000008 // DDSCAPS_COMPLEX
-
-#define DDS_CUBEMAP_POSITIVEX 0x00000600 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEX
-#define DDS_CUBEMAP_NEGATIVEX 0x00000a00 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX
-#define DDS_CUBEMAP_POSITIVEY 0x00001200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY
-#define DDS_CUBEMAP_NEGATIVEY 0x00002200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY
-#define DDS_CUBEMAP_POSITIVEZ 0x00004200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ
-#define DDS_CUBEMAP_NEGATIVEZ 0x00008200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ
-
-#define DDS_CUBEMAP_ALLFACES ( DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
-                               DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
-                               DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
-
-#define DDS_CUBEMAP 0x00000200 // DDSCAPS2_CUBEMAP
-
-#define DDS_FLAGS_VOLUME 0x00200000 // DDSCAPS2_VOLUME
-
-// Subset here matches D3D10_RESOURCE_DIMENSION and D3D11_RESOURCE_DIMENSION
-enum DDS_RESOURCE_DIMENSION
-{
-    DDS_DIMENSION_TEXTURE1D	= 2,
-    DDS_DIMENSION_TEXTURE2D	= 3,
-    DDS_DIMENSION_TEXTURE3D	= 4,
-};
-
-// Subset here matches D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG
-enum DDS_RESOURCE_MISC_FLAG
-{
-    DDS_RESOURCE_MISC_TEXTURECUBE = 0x4L,
-};
-
-enum DDS_MISC_FLAGS2
-{
-    DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
-};
-
-enum DDS_ALPHA_MODE
-{
-    DDS_ALPHA_MODE_UNKNOWN       = 0,
-    DDS_ALPHA_MODE_STRAIGHT      = 1,
-    DDS_ALPHA_MODE_PREMULTIPLIED = 2,
-    DDS_ALPHA_MODE_OPAQUE        = 3,
-    DDS_ALPHA_MODE_CUSTOM        = 4,
-};
-
-struct DDS_HEADER
-{
-    uint32_t    dwSize;
-    uint32_t    dwFlags;
-    uint32_t    dwHeight;
-    uint32_t    dwWidth;
-    uint32_t    dwPitchOrLinearSize;
-    uint32_t    dwDepth; // only if DDS_HEADER_FLAGS_VOLUME is set in dwFlags
-    uint32_t    dwMipMapCount;
-    uint32_t    dwReserved1[11];
-    DDS_PIXELFORMAT ddspf;
-    uint32_t    dwCaps;
-    uint32_t    dwCaps2;
-    uint32_t    dwCaps3;
-    uint32_t    dwCaps4;
-    uint32_t    dwReserved2;
-};
-
-struct DDS_HEADER_DXT10
-{
-    DXGI_FORMAT dxgiFormat;
-    uint32_t    resourceDimension;
-    uint32_t    miscFlag; // see DDS_RESOURCE_MISC_FLAG
-    uint32_t    arraySize;
-    uint32_t    miscFlags2; // see DDS_MISC_FLAGS2
-};
-
-#pragma pack(pop)
-
-static_assert( sizeof(DDS_HEADER) == 124, "DDS Header size mismatch" );
-static_assert( sizeof(DDS_HEADER_DXT10) == 20, "DDS DX10 Extended Header size mismatch");
-
-}; // namespace

+ 0 - 616
Exporters/FBX/3rdParty/DirectXTex/DirectXTex.h

@@ -1,616 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTex.h
-//  
-// DirectX Texture Library
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (_WIN32_WINNT <= _WIN32_WINNT_WIN8)
-#error WIC is not supported on Windows Phone 8.0
-#endif
-
-// VS 2010's stdint.h conflicts with intsafe.h
-#pragma warning(push)
-#pragma warning(disable : 4005)
-#include <stdint.h>
-#pragma warning(pop)
-
-#include <algorithm>
-#include <functional>
-
-#if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC
-#include <d3d11_x.h>
-#define DCOMMON_H_INCLUDED
-#else
-#include <d3d11_1.h>
-#endif
-
-#include <ocidl.h>
-
-#define DIRECTX_TEX_VERSION 130
-
-namespace DirectX
-{
-
-    //---------------------------------------------------------------------------------
-    // DXGI Format Utilities
-    bool IsValid( _In_ DXGI_FORMAT fmt );
-    bool IsCompressed( _In_ DXGI_FORMAT fmt );
-    bool IsPacked( _In_ DXGI_FORMAT fmt );
-    bool IsVideo( _In_ DXGI_FORMAT fmt );
-    bool IsPlanar( _In_ DXGI_FORMAT fmt );
-    bool IsPalettized( _In_ DXGI_FORMAT fmt );
-    bool IsDepthStencil(_In_ DXGI_FORMAT fmt );
-    bool IsSRGB( _In_ DXGI_FORMAT fmt );
-    bool IsTypeless( _In_ DXGI_FORMAT fmt, _In_ bool partialTypeless = true );
-
-    bool HasAlpha( _In_ DXGI_FORMAT fmt );
-
-    size_t BitsPerPixel( _In_ DXGI_FORMAT fmt );
-
-    size_t BitsPerColor( _In_ DXGI_FORMAT fmt );
-
-    enum CP_FLAGS
-    {
-        CP_FLAGS_NONE               = 0x0,      // Normal operation
-        CP_FLAGS_LEGACY_DWORD       = 0x1,      // Assume pitch is DWORD aligned instead of BYTE aligned
-        CP_FLAGS_PARAGRAPH          = 0x2,      // Assume pitch is 16-byte aligned instead of BYTE aligned
-        CP_FLAGS_24BPP              = 0x10000,  // Override with a legacy 24 bits-per-pixel format size
-        CP_FLAGS_16BPP              = 0x20000,  // Override with a legacy 16 bits-per-pixel format size
-        CP_FLAGS_8BPP               = 0x40000,  // Override with a legacy 8 bits-per-pixel format size
-    };
-
-    void ComputePitch( _In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height,
-                       _Out_ size_t& rowPitch, _Out_ size_t& slicePitch, _In_ DWORD flags = CP_FLAGS_NONE );
-
-    size_t ComputeScanlines( _In_ DXGI_FORMAT fmt, _In_ size_t height );
-
-    DXGI_FORMAT MakeSRGB( _In_ DXGI_FORMAT fmt );
-    DXGI_FORMAT MakeTypeless( _In_ DXGI_FORMAT fmt );
-    DXGI_FORMAT MakeTypelessUNORM( _In_ DXGI_FORMAT fmt );
-    DXGI_FORMAT MakeTypelessFLOAT( _In_ DXGI_FORMAT fmt );
-
-    //---------------------------------------------------------------------------------
-    // Texture metadata
-    enum TEX_DIMENSION
-        // Subset here matches D3D10_RESOURCE_DIMENSION and D3D11_RESOURCE_DIMENSION
-    {
-        TEX_DIMENSION_TEXTURE1D    = 2,
-        TEX_DIMENSION_TEXTURE2D    = 3,
-        TEX_DIMENSION_TEXTURE3D    = 4,
-    };
-
-    enum TEX_MISC_FLAG
-        // Subset here matches D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG
-    {
-        TEX_MISC_TEXTURECUBE = 0x4L,
-    };
-
-    enum TEX_MISC_FLAG2
-    {
-        TEX_MISC2_ALPHA_MODE_MASK = 0x7L,
-    };
-
-    enum TEX_ALPHA_MODE
-        // Matches DDS_ALPHA_MODE, encoded in MISC_FLAGS2
-    {
-        TEX_ALPHA_MODE_UNKNOWN       = 0,
-        TEX_ALPHA_MODE_STRAIGHT      = 1,
-        TEX_ALPHA_MODE_PREMULTIPLIED = 2,
-        TEX_ALPHA_MODE_OPAQUE        = 3,
-        TEX_ALPHA_MODE_CUSTOM        = 4,
-    };
-
-    struct TexMetadata
-    {
-        size_t          width;
-        size_t          height;     // Should be 1 for 1D textures
-        size_t          depth;      // Should be 1 for 1D or 2D textures
-        size_t          arraySize;  // For cubemap, this is a multiple of 6
-        size_t          mipLevels;
-        uint32_t        miscFlags;
-        uint32_t        miscFlags2;
-        DXGI_FORMAT     format;
-        TEX_DIMENSION   dimension;
-
-        size_t ComputeIndex( _In_ size_t mip, _In_ size_t item, _In_ size_t slice ) const;
-            // Returns size_t(-1) to indicate an out-of-range error
-
-        bool IsCubemap() const { return (miscFlags & TEX_MISC_TEXTURECUBE) != 0; }
-            // Helper for miscFlags
-
-        bool IsPMAlpha() const { return ((miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK) == TEX_ALPHA_MODE_PREMULTIPLIED) != 0; }
-        void SetAlphaMode( TEX_ALPHA_MODE mode ) { miscFlags2 = (miscFlags2 & ~TEX_MISC2_ALPHA_MODE_MASK) | static_cast<uint32_t>(mode); }
-            // Helpers for miscFlags2
-
-        bool IsVolumemap() const { return (dimension == TEX_DIMENSION_TEXTURE3D); }
-            // Helper for dimension
-    };
-
-    enum DDS_FLAGS
-    {
-        DDS_FLAGS_NONE                  = 0x0,
-
-        DDS_FLAGS_LEGACY_DWORD          = 0x1,
-            // Assume pitch is DWORD aligned instead of BYTE aligned (used by some legacy DDS files)
-
-        DDS_FLAGS_NO_LEGACY_EXPANSION   = 0x2,
-            // Do not implicitly convert legacy formats that result in larger pixel sizes (24 bpp, 3:3:2, A8L8, A4L4, P8, A8P8) 
-
-        DDS_FLAGS_NO_R10B10G10A2_FIXUP  = 0x4,
-            // Do not use work-around for long-standing D3DX DDS file format issue which reversed the 10:10:10:2 color order masks
-
-        DDS_FLAGS_FORCE_RGB             = 0x8,
-            // Convert DXGI 1.1 BGR formats to DXGI_FORMAT_R8G8B8A8_UNORM to avoid use of optional WDDM 1.1 formats
-
-        DDS_FLAGS_NO_16BPP              = 0x10,
-            // Conversions avoid use of 565, 5551, and 4444 formats and instead expand to 8888 to avoid use of optional WDDM 1.2 formats
-
-        DDS_FLAGS_EXPAND_LUMINANCE      = 0x20,
-            // When loading legacy luminance formats expand replicating the color channels rather than leaving them packed (L8, L16, A8L8)
-
-        DDS_FLAGS_FORCE_DX10_EXT        = 0x10000,
-            // Always use the 'DX10' header extension for DDS writer (i.e. don't try to write DX9 compatible DDS files)
-
-        DDS_FLAGS_FORCE_DX10_EXT_MISC2  = 0x20000,
-            // DDS_FLAGS_FORCE_DX10_EXT including miscFlags2 information (result may not be compatible with D3DX10 or D3DX11)
-    };
-
-    enum WIC_FLAGS
-    {
-        WIC_FLAGS_NONE                  = 0x0,
-
-        WIC_FLAGS_FORCE_RGB             = 0x1,
-            // Loads DXGI 1.1 BGR formats as DXGI_FORMAT_R8G8B8A8_UNORM to avoid use of optional WDDM 1.1 formats
-
-        WIC_FLAGS_NO_X2_BIAS            = 0x2,
-            // Loads DXGI 1.1 X2 10:10:10:2 format as DXGI_FORMAT_R10G10B10A2_UNORM
-
-        WIC_FLAGS_NO_16BPP              = 0x4,
-            // Loads 565, 5551, and 4444 formats as 8888 to avoid use of optional WDDM 1.2 formats
-
-        WIC_FLAGS_ALLOW_MONO            = 0x8,
-            // Loads 1-bit monochrome (black & white) as R1_UNORM rather than 8-bit grayscale
-
-        WIC_FLAGS_ALL_FRAMES            = 0x10,
-            // Loads all images in a multi-frame file, converting/resizing to match the first frame as needed, defaults to 0th frame otherwise
-
-        WIC_FLAGS_IGNORE_SRGB           = 0x20,
-            // Ignores sRGB metadata if present in the file
-
-        WIC_FLAGS_DITHER                = 0x10000,
-            // Use ordered 4x4 dithering for any required conversions
-
-        WIC_FLAGS_DITHER_DIFFUSION      = 0x20000,
-            // Use error-diffusion dithering for any required conversions
-
-        WIC_FLAGS_FILTER_POINT          = 0x100000,
-        WIC_FLAGS_FILTER_LINEAR         = 0x200000,
-        WIC_FLAGS_FILTER_CUBIC          = 0x300000,
-        WIC_FLAGS_FILTER_FANT           = 0x400000, // Combination of Linear and Box filter
-            // Filtering mode to use for any required image resizing (only needed when loading arrays of differently sized images; defaults to Fant)
-    };
-
-    HRESULT GetMetadataFromDDSMemory( _In_reads_bytes_(size) LPCVOID pSource, _In_ size_t size, _In_ DWORD flags,
-                                      _Out_ TexMetadata& metadata );
-    HRESULT GetMetadataFromDDSFile( _In_z_ LPCWSTR szFile, _In_ DWORD flags,
-                                    _Out_ TexMetadata& metadata );
-
-    HRESULT GetMetadataFromTGAMemory( _In_reads_bytes_(size) LPCVOID pSource, _In_ size_t size,
-                                      _Out_ TexMetadata& metadata );
-    HRESULT GetMetadataFromTGAFile( _In_z_ LPCWSTR szFile,
-                                    _Out_ TexMetadata& metadata );
-
-    HRESULT GetMetadataFromWICMemory( _In_reads_bytes_(size) LPCVOID pSource, _In_ size_t size, _In_ DWORD flags,
-                                      _Out_ TexMetadata& metadata );
-    HRESULT GetMetadataFromWICFile( _In_z_ LPCWSTR szFile, _In_ DWORD flags,
-                                    _Out_ TexMetadata& metadata );
-
-    //---------------------------------------------------------------------------------
-    // Bitmap image container
-    struct Image
-    {
-        size_t      width;
-        size_t      height;
-        DXGI_FORMAT format;
-        size_t      rowPitch;
-        size_t      slicePitch;
-        uint8_t*    pixels;
-    };
-
-    class ScratchImage
-    {
-    public:
-        ScratchImage()
-            : _nimages(0), _size(0), _image(nullptr), _memory(nullptr) {}
-        ScratchImage(ScratchImage&& moveFrom)
-            : _nimages(0), _size(0), _image(nullptr), _memory(nullptr) { *this = std::move(moveFrom); }
-        ~ScratchImage() { Release(); }
-
-        ScratchImage& operator= (ScratchImage&& moveFrom);
-
-        HRESULT Initialize( _In_ const TexMetadata& mdata, _In_ DWORD flags = CP_FLAGS_NONE );
-
-        HRESULT Initialize1D( _In_ DXGI_FORMAT fmt, _In_ size_t length, _In_ size_t arraySize, _In_ size_t mipLevels, _In_ DWORD flags = CP_FLAGS_NONE );
-        HRESULT Initialize2D( _In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t arraySize, _In_ size_t mipLevels, _In_ DWORD flags = CP_FLAGS_NONE );
-        HRESULT Initialize3D( _In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t depth, _In_ size_t mipLevels, _In_ DWORD flags = CP_FLAGS_NONE );
-        HRESULT InitializeCube( _In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t nCubes, _In_ size_t mipLevels, _In_ DWORD flags = CP_FLAGS_NONE );
-
-        HRESULT InitializeFromImage( _In_ const Image& srcImage, _In_ bool allow1D = false, _In_ DWORD flags = CP_FLAGS_NONE );
-        HRESULT InitializeArrayFromImages( _In_reads_(nImages) const Image* images, _In_ size_t nImages, _In_ bool allow1D = false, _In_ DWORD flags = CP_FLAGS_NONE ); 
-        HRESULT InitializeCubeFromImages( _In_reads_(nImages) const Image* images, _In_ size_t nImages, _In_ DWORD flags = CP_FLAGS_NONE );
-        HRESULT Initialize3DFromImages( _In_reads_(depth) const Image* images, _In_ size_t depth, _In_ DWORD flags = CP_FLAGS_NONE );
-
-        void Release();
-
-        bool OverrideFormat( _In_ DXGI_FORMAT f );
-
-        const TexMetadata& GetMetadata() const { return _metadata; }
-        const Image* GetImage(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const;
-
-        const Image* GetImages() const { return _image; }
-        size_t GetImageCount() const { return _nimages; }
-
-        uint8_t* GetPixels() const { return _memory; }
-        size_t GetPixelsSize() const { return _size; }
-
-        bool IsAlphaAllOpaque() const;
-
-    private:
-        size_t      _nimages;
-        size_t      _size;
-        TexMetadata _metadata;
-        Image*      _image;
-        uint8_t*    _memory;
-
-        // Hide copy constructor and assignment operator
-        ScratchImage( const ScratchImage& );
-        ScratchImage& operator=( const ScratchImage& );
-    };
-
-    //---------------------------------------------------------------------------------
-    // Memory blob (allocated buffer pointer is always 16-byte aligned)
-    class Blob
-    {
-    public:
-        Blob() : _buffer(nullptr), _size(0) {}
-        Blob(Blob&& moveFrom) : _buffer(nullptr), _size(0) { *this = std::move(moveFrom); }
-        ~Blob() { Release(); }
-
-        Blob& operator= (Blob&& moveFrom);
-
-        HRESULT Initialize( _In_ size_t size );
-
-        void Release();
-
-        void *GetBufferPointer() const { return _buffer; }
-        size_t GetBufferSize() const { return _size; }
-
-    private:
-        void*   _buffer;
-        size_t  _size;
-
-        // Hide copy constructor and assignment operator
-        Blob( const Blob& );
-        Blob& operator=( const Blob& );
-    };
-
-    //---------------------------------------------------------------------------------
-    // Image I/O
-
-    // DDS operations
-    HRESULT LoadFromDDSMemory( _In_reads_bytes_(size) LPCVOID pSource, _In_ size_t size, _In_ DWORD flags,
-                               _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image );
-    HRESULT LoadFromDDSFile( _In_z_ LPCWSTR szFile, _In_ DWORD flags,
-                             _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image );
-
-    HRESULT SaveToDDSMemory( _In_ const Image& image, _In_ DWORD flags,
-                             _Out_ Blob& blob );
-    HRESULT SaveToDDSMemory( _In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ DWORD flags,
-                             _Out_ Blob& blob );
-
-    HRESULT SaveToDDSFile( _In_ const Image& image, _In_ DWORD flags, _In_z_ LPCWSTR szFile );
-    HRESULT SaveToDDSFile( _In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ DWORD flags, _In_z_ LPCWSTR szFile );
-
-    // TGA operations
-    HRESULT LoadFromTGAMemory( _In_reads_bytes_(size) LPCVOID pSource, _In_ size_t size,
-                               _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image );
-    HRESULT LoadFromTGAFile( _In_z_ LPCWSTR szFile,
-                             _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image );
-
-    HRESULT SaveToTGAMemory( _In_ const Image& image, _Out_ Blob& blob );
-    HRESULT SaveToTGAFile( _In_ const Image& image, _In_z_ LPCWSTR szFile );
-
-    // WIC operations
-    HRESULT LoadFromWICMemory( _In_reads_bytes_(size) LPCVOID pSource, _In_ size_t size, _In_ DWORD flags,
-                               _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image );
-    HRESULT LoadFromWICFile( _In_z_ LPCWSTR szFile, _In_ DWORD flags,
-                             _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image );
-
-    HRESULT SaveToWICMemory( _In_ const Image& image, _In_ DWORD flags, _In_ REFGUID guidContainerFormat,
-                             _Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr, _In_opt_ std::function<void(IPropertyBag2*)> setCustomProps = nullptr );
-    HRESULT SaveToWICMemory( _In_count_(nimages) const Image* images, _In_ size_t nimages, _In_ DWORD flags, _In_ REFGUID guidContainerFormat,
-                             _Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr, _In_opt_ std::function<void(IPropertyBag2*)> setCustomProps = nullptr );
-
-    HRESULT SaveToWICFile( _In_ const Image& image, _In_ DWORD flags, _In_ REFGUID guidContainerFormat,
-                           _In_z_ LPCWSTR szFile, _In_opt_ const GUID* targetFormat = nullptr, _In_opt_ std::function<void(IPropertyBag2*)> setCustomProps = nullptr );
-    HRESULT SaveToWICFile( _In_count_(nimages) const Image* images, _In_ size_t nimages, _In_ DWORD flags, _In_ REFGUID guidContainerFormat,
-                           _In_z_ LPCWSTR szFile, _In_opt_ const GUID* targetFormat = nullptr, _In_opt_ std::function<void(IPropertyBag2*)> setCustomProps = nullptr );
-
-    enum WICCodecs
-    {
-        WIC_CODEC_BMP       =1,     // Windows Bitmap (.bmp)
-        WIC_CODEC_JPEG,             // Joint Photographic Experts Group (.jpg, .jpeg)
-        WIC_CODEC_PNG,              // Portable Network Graphics (.png)
-        WIC_CODEC_TIFF,             // Tagged Image File Format  (.tif, .tiff)
-        WIC_CODEC_GIF,              // Graphics Interchange Format  (.gif)
-        WIC_CODEC_WMP,              // Windows Media Photo / HD Photo / JPEG XR (.hdp, .jxr, .wdp)
-        WIC_CODEC_ICO,              // Windows Icon (.ico)
-    };
-
-    REFGUID GetWICCodec( _In_ WICCodecs codec );
-
-    //---------------------------------------------------------------------------------
-    // Texture conversion, resizing, mipmap generation, and block compression
-
-    enum TEX_FR_FLAGS
-    {
-        TEX_FR_ROTATE0          = 0x0,
-        TEX_FR_ROTATE90         = 0x1,
-        TEX_FR_ROTATE180        = 0x2,
-        TEX_FR_ROTATE270        = 0x3,
-        TEX_FR_FLIP_HORIZONTAL  = 0x08,
-        TEX_FR_FLIP_VERTICAL    = 0x10,
-    };
-
-    HRESULT FlipRotate( _In_ const Image& srcImage, _In_ DWORD flags, _Out_ ScratchImage& image );
-    HRESULT FlipRotate( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                        _In_ DWORD flags, _Out_ ScratchImage& result );
-        // Flip and/or rotate image
-
-    enum TEX_FILTER_FLAGS
-    {
-        TEX_FILTER_DEFAULT          = 0,
-
-        TEX_FILTER_WRAP_U           = 0x1,
-        TEX_FILTER_WRAP_V           = 0x2,
-        TEX_FILTER_WRAP_W           = 0x4,
-        TEX_FILTER_WRAP             = ( TEX_FILTER_WRAP_U | TEX_FILTER_WRAP_V | TEX_FILTER_WRAP_W ),
-        TEX_FILTER_MIRROR_U         = 0x10,
-        TEX_FILTER_MIRROR_V         = 0x20,
-        TEX_FILTER_MIRROR_W         = 0x40,
-        TEX_FILTER_MIRROR          = ( TEX_FILTER_MIRROR_U | TEX_FILTER_MIRROR_V | TEX_FILTER_MIRROR_W ),
-            // Wrap vs. Mirror vs. Clamp filtering options
-
-        TEX_FILTER_SEPARATE_ALPHA   = 0x100,
-            // Resize color and alpha channel independently
-
-        TEX_FILTER_RGB_COPY_RED     = 0x1000,
-        TEX_FILTER_RGB_COPY_GREEN   = 0x2000,
-        TEX_FILTER_RGB_COPY_BLUE    = 0x4000,
-            // When converting RGB to R, defaults to using grayscale. These flags indicate copying a specific channel instead
-            // When converting RGB to RG, defaults to copying RED | GREEN. These flags control which channels are selected instead.
-
-        TEX_FILTER_DITHER           = 0x10000,
-            // Use ordered 4x4 dithering for any required conversions
-        TEX_FILTER_DITHER_DIFFUSION = 0x20000,
-            // Use error-diffusion dithering for any required conversions
-
-        TEX_FILTER_POINT            = 0x100000,
-        TEX_FILTER_LINEAR           = 0x200000,
-        TEX_FILTER_CUBIC            = 0x300000,
-        TEX_FILTER_BOX              = 0x400000,
-        TEX_FILTER_FANT             = 0x400000, // Equiv to Box filtering for mipmap generation
-        TEX_FILTER_TRIANGLE         = 0x500000,
-            // Filtering mode to use for any required image resizing
-
-        TEX_FILTER_SRGB_IN          = 0x1000000,
-        TEX_FILTER_SRGB_OUT         = 0x2000000,
-        TEX_FILTER_SRGB             = ( TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT ),
-            // sRGB <-> RGB for use in conversion operations
-            // if the input format type is IsSRGB(), then SRGB_IN is on by default
-            // if the output format type is IsSRGB(), then SRGB_OUT is on by default
-
-        TEX_FILTER_FORCE_NON_WIC    = 0x10000000,
-            // Forces use of the non-WIC path when both are an option
-
-        TEX_FILTER_FORCE_WIC        = 0x20000000,
-            // Forces use of the WIC path even when logic would have picked a non-WIC path when both are an option
-    };
-
-    HRESULT Resize( _In_ const Image& srcImage, _In_ size_t width, _In_ size_t height, _In_ DWORD filter,
-                    _Out_ ScratchImage& image );
-    HRESULT Resize( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                    _In_ size_t width, _In_ size_t height, _In_ DWORD filter, _Out_ ScratchImage& result );
-        // Resize the image to width x height. Defaults to Fant filtering.
-        // Note for a complex resize, the result will always have mipLevels == 1
-
-    HRESULT Convert( _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ DWORD filter, _In_ float threshold,
-                     _Out_ ScratchImage& image );
-    HRESULT Convert( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                     _In_ DXGI_FORMAT format, _In_ DWORD filter, _In_ float threshold, _Out_ ScratchImage& result );
-        // Convert the image to a new format
-    
-    HRESULT ConvertToSinglePlane( _In_ const Image& srcImage, _Out_ ScratchImage& image );
-    HRESULT ConvertToSinglePlane( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                                  _Out_ ScratchImage& image );
-        // Converts the image from a planar format to an equivalent non-planar format
-
-    HRESULT GenerateMipMaps( _In_ const Image& baseImage, _In_ DWORD filter, _In_ size_t levels,
-                             _Inout_ ScratchImage& mipChain, _In_ bool allow1D = false );
-    HRESULT GenerateMipMaps( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                             _In_ DWORD filter, _In_ size_t levels, _Inout_ ScratchImage& mipChain );
-        // levels of '0' indicates a full mipchain, otherwise is generates that number of total levels (including the source base image)
-        // Defaults to Fant filtering which is equivalent to a box filter
-
-    HRESULT GenerateMipMaps3D( _In_reads_(depth) const Image* baseImages, _In_ size_t depth, _In_ DWORD filter, _In_ size_t levels,
-                               _Out_ ScratchImage& mipChain );
-    HRESULT GenerateMipMaps3D( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                               _In_ DWORD filter, _In_ size_t levels, _Out_ ScratchImage& mipChain );
-        // levels of '0' indicates a full mipchain, otherwise is generates that number of total levels (including the source base image)
-        // Defaults to Fant filtering which is equivalent to a box filter
-
-    enum TEX_PMALPHA_FLAGS
-    {
-        TEX_PMALPHA_DEFAULT         = 0,
-
-        TEX_PMALPHA_IGNORE_SRGB     = 0x1,
-            // ignores sRGB colorspace conversions
-
-        TEX_PMALPHA_SRGB_IN         = 0x1000000,
-        TEX_PMALPHA_SRGB_OUT        = 0x2000000,
-        TEX_PMALPHA_SRGB            = ( TEX_PMALPHA_SRGB_IN | TEX_PMALPHA_SRGB_OUT ),
-            // if the input format type is IsSRGB(), then SRGB_IN is on by default
-            // if the output format type is IsSRGB(), then SRGB_OUT is on by default
-    };
-
-    HRESULT PremultiplyAlpha( _In_ const Image& srcImage, _In_ DWORD flags, _Out_ ScratchImage& image );
-    HRESULT PremultiplyAlpha( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ DWORD flags, _Out_ ScratchImage& result );
-        // Converts to a premultiplied alpha version of the texture
-
-    enum TEX_COMPRESS_FLAGS
-    {
-        TEX_COMPRESS_DEFAULT        = 0,
-
-        TEX_COMPRESS_RGB_DITHER     = 0x10000,
-            // Enables dithering RGB colors for BC1-3 compression
-
-        TEX_COMPRESS_A_DITHER       = 0x20000,
-            // Enables dithering alpha for BC1-3 compression
-
-        TEX_COMPRESS_DITHER         = 0x30000,
-            // Enables both RGB and alpha dithering for BC1-3 compression
-
-        TEX_COMPRESS_UNIFORM        = 0x40000,
-            // Uniform color weighting for BC1-3 compression; by default uses perceptual weighting
-
-        TEX_COMPRESS_SRGB_IN        = 0x1000000,
-        TEX_COMPRESS_SRGB_OUT       = 0x2000000,
-        TEX_COMPRESS_SRGB           = ( TEX_COMPRESS_SRGB_IN | TEX_COMPRESS_SRGB_OUT ),
-            // if the input format type is IsSRGB(), then SRGB_IN is on by default
-            // if the output format type is IsSRGB(), then SRGB_OUT is on by default
-
-        TEX_COMPRESS_PARALLEL       = 0x10000000,
-            // Compress is free to use multithreading to improve performance (by default it does not use multithreading)
-    };
-
-    HRESULT Compress( _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ DWORD compress, _In_ float alphaRef,
-                      _Out_ ScratchImage& cImage );
-    HRESULT Compress( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                      _In_ DXGI_FORMAT format, _In_ DWORD compress, _In_ float alphaRef, _Out_ ScratchImage& cImages );
-        // Note that alphaRef is only used by BC1. 0.5f is a typical value to use
-
-    HRESULT Compress( _In_ ID3D11Device* pDevice, _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ DWORD compress,
-                      _In_ float alphaWeight, _Out_ ScratchImage& image );
-    HRESULT Compress( _In_ ID3D11Device* pDevice, _In_ const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                      _In_ DXGI_FORMAT format, _In_ DWORD compress, _In_ float alphaWeight, _Out_ ScratchImage& cImages );
-        // DirectCompute-based compression (alphaWeight is only used by BC7. 1.0 is the typical value to use)
-
-    HRESULT Decompress( _In_ const Image& cImage, _In_ DXGI_FORMAT format, _Out_ ScratchImage& image );
-    HRESULT Decompress( _In_reads_(nimages) const Image* cImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                        _In_ DXGI_FORMAT format, _Out_ ScratchImage& images );
-
-    //---------------------------------------------------------------------------------
-    // Normal map operations
-
-    enum CNMAP_FLAGS
-    {
-        CNMAP_DEFAULT           = 0,
-
-        CNMAP_CHANNEL_RED       = 0x1,
-        CNMAP_CHANNEL_GREEN     = 0x2,
-        CNMAP_CHANNEL_BLUE      = 0x3,
-        CNMAP_CHANNEL_ALPHA     = 0x4,
-        CNMAP_CHANNEL_LUMINANCE = 0x5,
-            // Channel selection when evaluting color value for height
-            // Luminance is a combination of red, green, and blue
-
-        CNMAP_MIRROR_U          = 0x1000,
-        CNMAP_MIRROR_V          = 0x2000,
-        CNMAP_MIRROR            = 0x3000,
-            // Use mirror semantics for scanline references (defaults to wrap)
-
-        CNMAP_INVERT_SIGN       = 0x4000,
-            // Inverts normal sign
-
-        CNMAP_COMPUTE_OCCLUSION = 0x8000,
-            // Computes a crude occlusion term stored in the alpha channel
-    };
-
-    HRESULT ComputeNormalMap( _In_ const Image& srcImage, _In_ DWORD flags, _In_ float amplitude,
-                              _In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMap );
-    HRESULT ComputeNormalMap( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                              _In_ DWORD flags, _In_ float amplitude, _In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMaps );
-
-    //---------------------------------------------------------------------------------
-    // Misc image operations
-    struct Rect
-    {
-        size_t x;
-        size_t y;
-        size_t w;
-        size_t h;
-
-        Rect() {}
-        Rect( size_t _x, size_t _y, size_t _w, size_t _h ) : x(_x), y(_y), w(_w), h(_h) {}
-    };
-
-    HRESULT CopyRectangle( _In_ const Image& srcImage, _In_ const Rect& srcRect, _In_ const Image& dstImage,
-                           _In_ DWORD filter, _In_ size_t xOffset, _In_ size_t yOffset );
-
-    enum CMSE_FLAGS
-    {
-        CMSE_DEFAULT                = 0,
-
-        CMSE_IMAGE1_SRGB            = 0x1,
-        CMSE_IMAGE2_SRGB            = 0x2,
-            // Indicates that image needs gamma correction before comparision
-
-        CMSE_IGNORE_RED             = 0x10,
-        CMSE_IGNORE_GREEN           = 0x20,
-        CMSE_IGNORE_BLUE            = 0x40,
-        CMSE_IGNORE_ALPHA           = 0x80,
-            // Ignore the channel when computing MSE
-
-        CMSE_IMAGE1_X2_BIAS         = 0x100,
-        CMSE_IMAGE2_X2_BIAS         = 0x200,
-            // Indicates that image should be scaled and biased before comparison (i.e. UNORM -> SNORM)
-    };
-
-    HRESULT ComputeMSE( _In_ const Image& image1, _In_ const Image& image2, _Out_ float& mse, _Out_writes_opt_(4) float* mseV, _In_ DWORD flags = 0 );
-
-    //---------------------------------------------------------------------------------
-    // Direct3D 11 functions
-    bool IsSupportedTexture( _In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata );
-
-    HRESULT CreateTexture( _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                           _Outptr_ ID3D11Resource** ppResource );
-
-    HRESULT CreateShaderResourceView( _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                                      _Outptr_ ID3D11ShaderResourceView** ppSRV );
-
-    HRESULT CreateTextureEx( _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                             _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB,
-                             _Outptr_ ID3D11Resource** ppResource );
-
-    HRESULT CreateShaderResourceViewEx( _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                                        _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB,
-                                        _Outptr_ ID3D11ShaderResourceView** ppSRV );
-
-    HRESULT CaptureTexture( _In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result );
-
-#include "DirectXTex.inl"
-
-}; // namespace

+ 0 - 352
Exporters/FBX/3rdParty/DirectXTex/DirectXTex.inl

@@ -1,352 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTex.inl
-//  
-// DirectX Texture Library
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-//=====================================================================================
-// DXGI Format Utilities
-//=====================================================================================
-
-_Use_decl_annotations_
-inline bool IsValid( DXGI_FORMAT fmt )
-{
-    return ( static_cast<size_t>(fmt) >= 1 && static_cast<size_t>(fmt) <= 120 );
-}
-
-_Use_decl_annotations_
-inline bool IsCompressed( DXGI_FORMAT fmt )
-{
-    switch ( fmt )
-    {
-    case DXGI_FORMAT_BC1_TYPELESS:
-    case DXGI_FORMAT_BC1_UNORM:
-    case DXGI_FORMAT_BC1_UNORM_SRGB:
-    case DXGI_FORMAT_BC2_TYPELESS:
-    case DXGI_FORMAT_BC2_UNORM:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:
-    case DXGI_FORMAT_BC3_TYPELESS:
-    case DXGI_FORMAT_BC3_UNORM:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:
-    case DXGI_FORMAT_BC4_TYPELESS:
-    case DXGI_FORMAT_BC4_UNORM:
-    case DXGI_FORMAT_BC4_SNORM:
-    case DXGI_FORMAT_BC5_TYPELESS:
-    case DXGI_FORMAT_BC5_UNORM:
-    case DXGI_FORMAT_BC5_SNORM:
-    case DXGI_FORMAT_BC6H_TYPELESS:
-    case DXGI_FORMAT_BC6H_UF16:
-    case DXGI_FORMAT_BC6H_SF16:
-    case DXGI_FORMAT_BC7_TYPELESS:
-    case DXGI_FORMAT_BC7_UNORM:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline bool IsPacked( DXGI_FORMAT fmt )
-{
-    switch( fmt )
-    {
-    case DXGI_FORMAT_R8G8_B8G8_UNORM:
-    case DXGI_FORMAT_G8R8_G8B8_UNORM:
-    case DXGI_FORMAT_YUY2: // 4:2:2 8-bit
-    case DXGI_FORMAT_Y210: // 4:2:2 10-bit
-    case DXGI_FORMAT_Y216: // 4:2:2 16-bit
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline bool IsPlanar( DXGI_FORMAT fmt )
-{
-    switch ( static_cast<int>(fmt) )
-    {
-    case DXGI_FORMAT_NV12:      // 4:2:0 8-bit
-    case DXGI_FORMAT_P010:      // 4:2:0 10-bit
-    case DXGI_FORMAT_P016:      // 4:2:0 16-bit
-    case DXGI_FORMAT_420_OPAQUE:// 4:2:0 8-bit
-    case DXGI_FORMAT_NV11:      // 4:1:1 8-bit
-        return true;
-
-    case 118 /* DXGI_FORMAT_D16_UNORM_S8_UINT */:
-    case 119 /* DXGI_FORMAT_R16_UNORM_X8_TYPELESS */:
-    case 120 /* DXGI_FORMAT_X16_TYPELESS_G8_UINT */:
-        // These are Xbox One platform specific types
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline bool IsPalettized( DXGI_FORMAT fmt )
-{
-    switch( fmt )
-    {
-    case DXGI_FORMAT_AI44:
-    case DXGI_FORMAT_IA44:
-    case DXGI_FORMAT_P8:
-    case DXGI_FORMAT_A8P8:
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline bool IsVideo( DXGI_FORMAT fmt )
-{
-    switch ( fmt )
-    {
-    case DXGI_FORMAT_AYUV:
-    case DXGI_FORMAT_Y410:
-    case DXGI_FORMAT_Y416:
-    case DXGI_FORMAT_NV12:
-    case DXGI_FORMAT_P010:
-    case DXGI_FORMAT_P016:
-    case DXGI_FORMAT_YUY2:
-    case DXGI_FORMAT_Y210:
-    case DXGI_FORMAT_Y216:
-    case DXGI_FORMAT_NV11:
-        // These video formats can be used with the 3D pipeline through special view mappings
-
-    case DXGI_FORMAT_420_OPAQUE:
-    case DXGI_FORMAT_AI44:
-    case DXGI_FORMAT_IA44:
-    case DXGI_FORMAT_P8:
-    case DXGI_FORMAT_A8P8:
-        // These are limited use video formats not usable in any way by the 3D pipeline
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline bool IsDepthStencil( DXGI_FORMAT fmt )
-{
-    switch( static_cast<int>(fmt) )
-    {
-    case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
-    case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
-    case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
-    case DXGI_FORMAT_D32_FLOAT:
-    case DXGI_FORMAT_D24_UNORM_S8_UINT:
-    case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
-    case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
-    case DXGI_FORMAT_D16_UNORM:
-    case 118 /* DXGI_FORMAT_D16_UNORM_S8_UINT */:
-    case 119 /* DXGI_FORMAT_R16_UNORM_X8_TYPELESS */:
-    case 120 /* DXGI_FORMAT_X16_TYPELESS_G8_UINT */:
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline bool IsSRGB( DXGI_FORMAT fmt )
-{
-    switch( fmt )
-    {
-    case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
-    case DXGI_FORMAT_BC1_UNORM_SRGB:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:
-    case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
-    case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline bool IsTypeless( DXGI_FORMAT fmt, bool partialTypeless )
-{
-    switch( static_cast<int>(fmt) )
-    {
-    case DXGI_FORMAT_R32G32B32A32_TYPELESS:
-    case DXGI_FORMAT_R32G32B32_TYPELESS:
-    case DXGI_FORMAT_R16G16B16A16_TYPELESS:
-    case DXGI_FORMAT_R32G32_TYPELESS:
-    case DXGI_FORMAT_R32G8X24_TYPELESS:
-    case DXGI_FORMAT_R10G10B10A2_TYPELESS:
-    case DXGI_FORMAT_R8G8B8A8_TYPELESS:
-    case DXGI_FORMAT_R16G16_TYPELESS:
-    case DXGI_FORMAT_R32_TYPELESS:
-    case DXGI_FORMAT_R24G8_TYPELESS:
-    case DXGI_FORMAT_R8G8_TYPELESS:
-    case DXGI_FORMAT_R16_TYPELESS:
-    case DXGI_FORMAT_R8_TYPELESS:
-    case DXGI_FORMAT_BC1_TYPELESS:
-    case DXGI_FORMAT_BC2_TYPELESS:
-    case DXGI_FORMAT_BC3_TYPELESS:
-    case DXGI_FORMAT_BC4_TYPELESS:
-    case DXGI_FORMAT_BC5_TYPELESS:
-    case DXGI_FORMAT_B8G8R8A8_TYPELESS:
-    case DXGI_FORMAT_B8G8R8X8_TYPELESS:
-    case DXGI_FORMAT_BC6H_TYPELESS:
-    case DXGI_FORMAT_BC7_TYPELESS:
-        return true;
-
-    case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
-    case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
-    case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
-    case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
-        return partialTypeless;
-
-    case 119 /* DXGI_FORMAT_R16_UNORM_X8_TYPELESS */:
-    case 120 /* DXGI_FORMAT_X16_TYPELESS_G8_UINT */:
-        // These are Xbox One platform specific types
-        return partialTypeless;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline bool HasAlpha( DXGI_FORMAT fmt )
-{
-    switch( static_cast<int>(fmt) )
-    {
-    case DXGI_FORMAT_R32G32B32A32_TYPELESS:
-    case DXGI_FORMAT_R32G32B32A32_FLOAT:
-    case DXGI_FORMAT_R32G32B32A32_UINT:
-    case DXGI_FORMAT_R32G32B32A32_SINT:
-    case DXGI_FORMAT_R16G16B16A16_TYPELESS:
-    case DXGI_FORMAT_R16G16B16A16_FLOAT:
-    case DXGI_FORMAT_R16G16B16A16_UNORM:
-    case DXGI_FORMAT_R16G16B16A16_UINT:
-    case DXGI_FORMAT_R16G16B16A16_SNORM:
-    case DXGI_FORMAT_R16G16B16A16_SINT:
-    case DXGI_FORMAT_R10G10B10A2_TYPELESS:
-    case DXGI_FORMAT_R10G10B10A2_UNORM:
-    case DXGI_FORMAT_R10G10B10A2_UINT:
-    case DXGI_FORMAT_R8G8B8A8_TYPELESS:
-    case DXGI_FORMAT_R8G8B8A8_UNORM:
-    case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
-    case DXGI_FORMAT_R8G8B8A8_UINT:
-    case DXGI_FORMAT_R8G8B8A8_SNORM:
-    case DXGI_FORMAT_R8G8B8A8_SINT:
-    case DXGI_FORMAT_A8_UNORM:
-    case DXGI_FORMAT_BC1_TYPELESS:
-    case DXGI_FORMAT_BC1_UNORM:
-    case DXGI_FORMAT_BC1_UNORM_SRGB:
-    case DXGI_FORMAT_BC2_TYPELESS:
-    case DXGI_FORMAT_BC2_UNORM:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:
-    case DXGI_FORMAT_BC3_TYPELESS:
-    case DXGI_FORMAT_BC3_UNORM:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:
-    case DXGI_FORMAT_B5G5R5A1_UNORM:
-    case DXGI_FORMAT_B8G8R8A8_UNORM:
-    case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM:
-    case DXGI_FORMAT_B8G8R8A8_TYPELESS:
-    case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
-    case DXGI_FORMAT_BC7_TYPELESS:
-    case DXGI_FORMAT_BC7_UNORM:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-    case DXGI_FORMAT_AYUV:
-    case DXGI_FORMAT_Y410:
-    case DXGI_FORMAT_Y416:
-    case DXGI_FORMAT_AI44:
-    case DXGI_FORMAT_IA44:
-    case DXGI_FORMAT_A8P8:
-    case DXGI_FORMAT_B4G4R4A4_UNORM:
-        return true;
-
-    case 116 /* DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT */:
-    case 117 /* DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT */:
-        // These are Xbox One platform specific types
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-_Use_decl_annotations_
-inline size_t ComputeScanlines( DXGI_FORMAT fmt, size_t height )
-{
-    if ( IsCompressed(fmt) )
-    {
-        return std::max<size_t>( 1, (height + 3) / 4 );
-    }
-    else if ( fmt == DXGI_FORMAT_NV11 )
-    {
-        // Direct3D makes this simplifying assumption, although it is larger than the 4:1:1 data
-        return height * 2;
-    }
-    else if ( IsPlanar(fmt) )
-    {
-        return height + ( ( height + 1 ) >> 1 );
-    }
-    else
-    {
-        return height;
-    }
-}
-
-//=====================================================================================
-// Image I/O
-//=====================================================================================
-_Use_decl_annotations_
-inline HRESULT SaveToDDSMemory( const Image& image, DWORD flags, Blob& blob )
-{
-    TexMetadata mdata;
-    memset( &mdata, 0, sizeof(mdata) );
-    mdata.width = image.width;
-    mdata.height = image.height;
-    mdata.depth = 1;
-    mdata.arraySize = 1;
-    mdata.mipLevels = 1;
-    mdata.format = image.format;
-    mdata.dimension = TEX_DIMENSION_TEXTURE2D;
-
-    return SaveToDDSMemory( &image, 1, mdata, flags, blob );
-}
-
-_Use_decl_annotations_
-inline HRESULT SaveToDDSFile( const Image& image, DWORD flags, LPCWSTR szFile )
-{
-    TexMetadata mdata;
-    memset( &mdata, 0, sizeof(mdata) );
-    mdata.width = image.width;
-    mdata.height = image.height;
-    mdata.depth = 1;
-    mdata.arraySize = 1;
-    mdata.mipLevels = 1;
-    mdata.format = image.format;
-    mdata.dimension = TEX_DIMENSION_TEXTURE2D;
-
-    return SaveToDDSFile( &image, 1, mdata, flags, szFile );
-}

+ 0 - 809
Exporters/FBX/3rdParty/DirectXTex/DirectXTexCompress.cpp

@@ -1,809 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexCompress.cpp
-//  
-// DirectX Texture Library - Texture compression
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-#ifdef _OPENMP
-#include <omp.h>
-#pragma warning(disable : 4616 6993)
-#endif
-
-#include "bc.h"
-
-
-namespace DirectX
-{
-
-inline static DWORD _GetBCFlags( _In_ DWORD compress )
-{
-    static_assert( TEX_COMPRESS_RGB_DITHER == BC_FLAGS_DITHER_RGB, "TEX_COMPRESS_* flags should match BC_FLAGS_*" );
-    static_assert( TEX_COMPRESS_A_DITHER == BC_FLAGS_DITHER_A, "TEX_COMPRESS_* flags should match BC_FLAGS_*"  );
-    static_assert( TEX_COMPRESS_DITHER == (BC_FLAGS_DITHER_RGB | BC_FLAGS_DITHER_A), "TEX_COMPRESS_* flags should match BC_FLAGS_*"  );
-    static_assert( TEX_COMPRESS_UNIFORM == BC_FLAGS_UNIFORM, "TEX_COMPRESS_* flags should match BC_FLAGS_*"  );
-    return ( compress & (BC_FLAGS_DITHER_RGB|BC_FLAGS_DITHER_A|BC_FLAGS_UNIFORM) );
-}
-
-inline static DWORD _GetSRGBFlags( _In_ DWORD compress )
-{
-    static_assert( TEX_COMPRESS_SRGB_IN == TEX_FILTER_SRGB_IN, "TEX_COMPRESS_SRGB* should match TEX_FILTER_SRGB*" );
-    static_assert( TEX_COMPRESS_SRGB_OUT == TEX_FILTER_SRGB_OUT, "TEX_COMPRESS_SRGB* should match TEX_FILTER_SRGB*" );
-    static_assert( TEX_COMPRESS_SRGB == TEX_FILTER_SRGB, "TEX_COMPRESS_SRGB* should match TEX_FILTER_SRGB*" );
-    return ( compress & TEX_COMPRESS_SRGB );
-}
-
-inline static bool _DetermineEncoderSettings( _In_ DXGI_FORMAT format, _Out_ BC_ENCODE& pfEncode, _Out_ size_t& blocksize, _Out_ DWORD& cflags )
-{
-    switch(format)
-    {
-    case DXGI_FORMAT_BC1_UNORM:
-    case DXGI_FORMAT_BC1_UNORM_SRGB:    pfEncode = nullptr;         blocksize = 8;   cflags = 0; break;
-    case DXGI_FORMAT_BC2_UNORM:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:    pfEncode = D3DXEncodeBC2;   blocksize = 16;  cflags = 0; break;
-    case DXGI_FORMAT_BC3_UNORM:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:    pfEncode = D3DXEncodeBC3;   blocksize = 16;  cflags = 0; break;
-    case DXGI_FORMAT_BC4_UNORM:         pfEncode = D3DXEncodeBC4U;  blocksize = 8;   cflags = TEX_FILTER_RGB_COPY_RED; break;
-    case DXGI_FORMAT_BC4_SNORM:         pfEncode = D3DXEncodeBC4S;  blocksize = 8;   cflags = TEX_FILTER_RGB_COPY_RED; break;
-    case DXGI_FORMAT_BC5_UNORM:         pfEncode = D3DXEncodeBC5U;  blocksize = 16;  cflags = TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN; break;
-    case DXGI_FORMAT_BC5_SNORM:         pfEncode = D3DXEncodeBC5S;  blocksize = 16;  cflags = TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN; break;
-    case DXGI_FORMAT_BC6H_UF16:         pfEncode = D3DXEncodeBC6HU; blocksize = 16;  cflags = 0; break;
-    case DXGI_FORMAT_BC6H_SF16:         pfEncode = D3DXEncodeBC6HS; blocksize = 16;  cflags = 0; break;
-    case DXGI_FORMAT_BC7_UNORM:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:    pfEncode = D3DXEncodeBC7;   blocksize = 16;  cflags = 0; break;
-    default:                            pfEncode = nullptr;         blocksize = 0;   cflags = 0; return false;
-    }
-
-    return true;
-}
-
-
-//-------------------------------------------------------------------------------------
-static HRESULT _CompressBC( _In_ const Image& image, _In_ const Image& result, _In_ DWORD bcflags,
-                            _In_ DWORD srgb, _In_ float alphaRef )
-{
-    if ( !image.pixels || !result.pixels )
-        return E_POINTER;
-
-    assert( image.width == result.width );
-    assert( image.height == result.height );
-
-    const DXGI_FORMAT format = image.format;
-    size_t sbpp = BitsPerPixel( format );
-    if ( !sbpp )
-        return E_FAIL;
-
-    if ( sbpp < 8 )
-    {
-        // We don't support compressing from monochrome (DXGI_FORMAT_R1_UNORM)
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    // Round to bytes
-    sbpp = ( sbpp + 7 ) / 8;
-
-    uint8_t *pDest = result.pixels;
-
-    // Determine BC format encoder
-    BC_ENCODE pfEncode;
-    size_t blocksize;
-    DWORD cflags;
-    if ( !_DetermineEncoderSettings( result.format, pfEncode, blocksize, cflags ) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    XMVECTOR temp[16];
-    const uint8_t *pSrc = image.pixels;
-    const size_t rowPitch = image.rowPitch;
-    for( size_t h=0; h < image.height; h += 4 )
-    {
-        const uint8_t *sptr = pSrc;
-        uint8_t* dptr = pDest;
-        size_t ph = std::min<size_t>( 4, image.height - h );
-        size_t w = 0;
-        for( size_t count = 0; count < rowPitch; count += sbpp*4, w += 4 )
-        {
-            size_t pw = std::min<size_t>( 4, image.width - w );
-            assert( pw > 0 && ph > 0 );
-
-            if ( !_LoadScanline( &temp[0], pw, sptr, rowPitch, format ) )
-                return E_FAIL;
-
-            if ( ph > 1 )
-            {
-                if ( !_LoadScanline( &temp[4], pw, sptr + rowPitch, rowPitch, format ) )
-                    return E_FAIL;
-
-                if ( ph > 2 )
-                {
-                    if ( !_LoadScanline( &temp[8], pw, sptr + rowPitch*2, rowPitch, format ) )
-                        return E_FAIL;
-
-                    if ( ph > 3 )
-                    {
-                        if ( !_LoadScanline( &temp[12], pw, sptr + rowPitch*3, rowPitch, format ) )
-                            return E_FAIL;
-                    }
-                }
-            }
-
-            if ( pw != 4 || ph != 4 )
-            {
-                // Replicate pixels for partial block
-                static const size_t uSrc[] = { 0, 0, 0, 1 };
-
-                if ( pw < 4 )
-                {
-                    for( size_t t = 0; t < ph && t < 4; ++t )
-                    {
-                        for( size_t s = pw; s < 4; ++s )
-                        {
-#pragma prefast(suppress: 26000, "PREFAST false positive")
-                            temp[ (t << 2) | s ] = temp[ (t << 2) | uSrc[s] ]; 
-                        }
-                    }
-                }
-
-                if ( ph < 4 )
-                {
-                    for( size_t t = ph; t < 4; ++t )
-                    {
-                        for( size_t s = 0; s < 4; ++s )
-                        {
-#pragma prefast(suppress: 26000, "PREFAST false positive")
-                            temp[ (t << 2) | s ] = temp[ (uSrc[t] << 2) | s ]; 
-                        }
-                    }
-                }
-            }
-
-            _ConvertScanline( temp, 16, result.format, format, cflags | srgb );
-            
-            if ( pfEncode )
-                pfEncode( dptr, temp, bcflags );
-            else
-                D3DXEncodeBC1( dptr, temp, alphaRef, bcflags );
-
-            sptr += sbpp*4;
-            dptr += blocksize;
-        }
-
-        pSrc += rowPitch*4;
-        pDest += result.rowPitch;
-    }
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-#ifdef _OPENMP
-static HRESULT _CompressBC_Parallel( _In_ const Image& image, _In_ const Image& result, _In_ DWORD bcflags,
-                                     _In_ DWORD srgb, _In_ float alphaRef )
-{
-    if ( !image.pixels || !result.pixels )
-        return E_POINTER;
-
-    assert( image.width == result.width );
-    assert( image.height == result.height );
-
-    const DXGI_FORMAT format = image.format;
-    size_t sbpp = BitsPerPixel( format );
-    if ( !sbpp )
-        return E_FAIL;
-
-    if ( sbpp < 8 )
-    {
-        // We don't support compressing from monochrome (DXGI_FORMAT_R1_UNORM)
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    // Round to bytes
-    sbpp = ( sbpp + 7 ) / 8;
-
-    // Determine BC format encoder
-    BC_ENCODE pfEncode;
-    size_t blocksize;
-    DWORD cflags;
-    if ( !_DetermineEncoderSettings( result.format, pfEncode, blocksize, cflags ) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    // Refactored version of loop to support parallel independance
-    const size_t nBlocks = std::max<size_t>(1, (image.width + 3) / 4 ) * std::max<size_t>(1, (image.height + 3) / 4 );
-
-    bool fail = false;
-
-#pragma omp parallel for
-    for( int nb=0; nb < static_cast<int>( nBlocks ); ++nb )
-    {
-        const size_t nbWidth = std::max<size_t>(1, (image.width + 3) / 4 );
-
-        const size_t y = nb / nbWidth;
-        const size_t x = nb - (y*nbWidth);
-
-        assert( x < image.width && y < image.height );
-
-        size_t rowPitch = image.rowPitch;
-        const uint8_t *pSrc = image.pixels + (y*4*rowPitch) + (x*4*sbpp);
-
-        uint8_t *pDest = result.pixels + (nb*blocksize);
-
-        size_t ph = std::min<size_t>( 4, image.height - y );
-        size_t pw = std::min<size_t>( 4, image.width - x );
-        assert( pw > 0 && ph > 0 );
-
-        XMVECTOR temp[16];
-        if ( !_LoadScanline( &temp[0], pw, pSrc, rowPitch, format ) )
-            fail = true;
-
-        if ( ph > 1 )
-        {
-            if ( !_LoadScanline( &temp[4], pw, pSrc + rowPitch, rowPitch, format ) )
-                fail = true;
-
-            if ( ph > 2 )
-            {
-                if ( !_LoadScanline( &temp[8], pw, pSrc + rowPitch*2, rowPitch, format ) )
-                    fail = true;
-
-                if ( ph > 3 )
-                {
-                    if ( !_LoadScanline( &temp[12], pw, pSrc + rowPitch*3, rowPitch, format ) )
-                        fail = true;
-                }
-            }
-        }
-
-        if ( pw != 4 || ph != 4 )
-        {
-            // Replicate pixels for partial block
-            static const size_t uSrc[] = { 0, 0, 0, 1 };
-
-            if ( pw < 4 )
-            {
-                for( size_t t = 0; t < ph && t < 4; ++t )
-                {
-                    for( size_t s = pw; s < 4; ++s )
-                    {
-                        temp[ (t << 2) | s ] = temp[ (t << 2) | uSrc[s] ]; 
-                    }
-                }
-            }
-
-            if ( ph < 4 )
-            {
-                for( size_t t = ph; t < 4; ++t )
-                {
-                    for( size_t s = 0; s < 4; ++s )
-                    {
-                        temp[ (t << 2) | s ] = temp[ (uSrc[t] << 2) | s ]; 
-                    }
-                }
-            }
-        }
-
-        _ConvertScanline( temp, 16, result.format, format, cflags | srgb );
-            
-        if ( pfEncode )
-            pfEncode( pDest, temp, bcflags );
-        else
-            D3DXEncodeBC1( pDest, temp, alphaRef, bcflags );
-    }
-
-    return (fail) ? E_FAIL : S_OK;
-}
-
-#endif // _OPENMP
-
-
-//-------------------------------------------------------------------------------------
-static DXGI_FORMAT _DefaultDecompress( _In_ DXGI_FORMAT format )
-{
-    switch( format )
-    {
-    case DXGI_FORMAT_BC1_TYPELESS:
-    case DXGI_FORMAT_BC1_UNORM:
-    case DXGI_FORMAT_BC2_TYPELESS:
-    case DXGI_FORMAT_BC2_UNORM:
-    case DXGI_FORMAT_BC3_TYPELESS:
-    case DXGI_FORMAT_BC3_UNORM:
-    case DXGI_FORMAT_BC7_TYPELESS:
-    case DXGI_FORMAT_BC7_UNORM:
-        return DXGI_FORMAT_R8G8B8A8_UNORM;
-
-    case DXGI_FORMAT_BC1_UNORM_SRGB:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-        return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
-
-    case DXGI_FORMAT_BC4_TYPELESS:
-    case DXGI_FORMAT_BC4_UNORM:
-        return DXGI_FORMAT_R8_UNORM;
-
-    case DXGI_FORMAT_BC4_SNORM:
-        return DXGI_FORMAT_R8_SNORM;
-
-    case DXGI_FORMAT_BC5_TYPELESS:
-    case DXGI_FORMAT_BC5_UNORM:
-        return DXGI_FORMAT_R8G8_UNORM;
-
-    case DXGI_FORMAT_BC5_SNORM:
-        return DXGI_FORMAT_R8G8_SNORM;
-
-    case DXGI_FORMAT_BC6H_TYPELESS:
-    case DXGI_FORMAT_BC6H_UF16:
-    case DXGI_FORMAT_BC6H_SF16:
-        // We could use DXGI_FORMAT_R32G32B32_FLOAT here since BC6H is always Alpha 1.0,
-        // but this format is more supported by viewers
-        return DXGI_FORMAT_R32G32B32A32_FLOAT;
-
-    default:
-        return DXGI_FORMAT_UNKNOWN;
-    }
-}
-
-
-//-------------------------------------------------------------------------------------
-static HRESULT _DecompressBC( _In_ const Image& cImage, _In_ const Image& result )
-{
-    if ( !cImage.pixels || !result.pixels )
-        return E_POINTER;
-
-    assert( cImage.width == result.width );
-    assert( cImage.height == result.height );
-
-    const DXGI_FORMAT format = result.format;
-    size_t dbpp = BitsPerPixel( format );
-    if ( !dbpp )
-        return E_FAIL;
-
-    if ( dbpp < 8 )
-    {
-        // We don't support decompressing to monochrome (DXGI_FORMAT_R1_UNORM)
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    // Round to bytes
-    dbpp = ( dbpp + 7 ) / 8;
-
-    uint8_t *pDest = result.pixels;
-    if ( !pDest )
-        return E_POINTER;
-
-    // Promote "typeless" BC formats
-    DXGI_FORMAT cformat;
-    switch( cImage.format )
-    {
-    case DXGI_FORMAT_BC1_TYPELESS:  cformat = DXGI_FORMAT_BC1_UNORM; break;
-    case DXGI_FORMAT_BC2_TYPELESS:  cformat = DXGI_FORMAT_BC2_UNORM; break;
-    case DXGI_FORMAT_BC3_TYPELESS:  cformat = DXGI_FORMAT_BC3_UNORM; break;
-    case DXGI_FORMAT_BC4_TYPELESS:  cformat = DXGI_FORMAT_BC4_UNORM; break;
-    case DXGI_FORMAT_BC5_TYPELESS:  cformat = DXGI_FORMAT_BC5_UNORM; break;
-    case DXGI_FORMAT_BC6H_TYPELESS: cformat = DXGI_FORMAT_BC6H_UF16; break;
-    case DXGI_FORMAT_BC7_TYPELESS:  cformat = DXGI_FORMAT_BC7_UNORM; break;
-    default:                        cformat = cImage.format;         break;
-    }
-
-    // Determine BC format decoder
-    BC_DECODE pfDecode;
-    size_t sbpp;
-    switch(cformat)
-    {
-    case DXGI_FORMAT_BC1_UNORM:
-    case DXGI_FORMAT_BC1_UNORM_SRGB:    pfDecode = D3DXDecodeBC1;   sbpp = 8;   break;
-    case DXGI_FORMAT_BC2_UNORM:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:    pfDecode = D3DXDecodeBC2;   sbpp = 16;  break;
-    case DXGI_FORMAT_BC3_UNORM:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:    pfDecode = D3DXDecodeBC3;   sbpp = 16;  break;
-    case DXGI_FORMAT_BC4_UNORM:         pfDecode = D3DXDecodeBC4U;  sbpp = 8;   break;
-    case DXGI_FORMAT_BC4_SNORM:         pfDecode = D3DXDecodeBC4S;  sbpp = 8;   break;
-    case DXGI_FORMAT_BC5_UNORM:         pfDecode = D3DXDecodeBC5U;  sbpp = 16;  break;
-    case DXGI_FORMAT_BC5_SNORM:         pfDecode = D3DXDecodeBC5S;  sbpp = 16;  break;
-    case DXGI_FORMAT_BC6H_UF16:         pfDecode = D3DXDecodeBC6HU; sbpp = 16;  break;
-    case DXGI_FORMAT_BC6H_SF16:         pfDecode = D3DXDecodeBC6HS; sbpp = 16;  break;
-    case DXGI_FORMAT_BC7_UNORM:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:    pfDecode = D3DXDecodeBC7;   sbpp = 16;  break;
-    default:
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    XMVECTOR temp[16];
-    const uint8_t *pSrc = cImage.pixels;
-    const size_t rowPitch = result.rowPitch;
-    for( size_t h=0; h < cImage.height; h += 4 )
-    {
-        const uint8_t *sptr = pSrc;
-        uint8_t* dptr = pDest;
-        size_t ph = std::min<size_t>( 4, cImage.height - h );
-        size_t w = 0;
-        for( size_t count = 0; count < cImage.rowPitch; count += sbpp, w += 4 )
-        {
-            pfDecode( temp, sptr );
-            _ConvertScanline( temp, 16, format, cformat, 0 );
-
-            size_t pw = std::min<size_t>( 4, cImage.width - w );
-            assert( pw > 0 && ph > 0 );
-
-            if ( !_StoreScanline( dptr, rowPitch, format, &temp[0], pw ) )
-                return E_FAIL;
-
-            if ( ph > 1 )
-            {
-                if ( !_StoreScanline( dptr + rowPitch, rowPitch, format, &temp[4], pw ) )
-                    return E_FAIL;
-
-                if ( ph > 2 )
-                {
-                    if ( !_StoreScanline( dptr + rowPitch*2, rowPitch, format, &temp[8], pw ) )
-                        return E_FAIL;
-
-                    if ( ph > 3 )
-                    {
-                        if ( !_StoreScanline( dptr + rowPitch*3, rowPitch, format, &temp[12], pw ) )
-                            return E_FAIL;
-                    }
-                }
-            }
-
-            sptr += sbpp;
-            dptr += dbpp*4;
-        }
-
-        pSrc += cImage.rowPitch;
-        pDest += rowPitch*4;
-    }
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-bool _IsAlphaAllOpaqueBC( _In_ const Image& cImage )
-{
-    if ( !cImage.pixels )
-        return false;
-
-    // Promote "typeless" BC formats
-    DXGI_FORMAT cformat;
-    switch( cImage.format )
-    {
-    case DXGI_FORMAT_BC1_TYPELESS:  cformat = DXGI_FORMAT_BC1_UNORM; break;
-    case DXGI_FORMAT_BC2_TYPELESS:  cformat = DXGI_FORMAT_BC2_UNORM; break;
-    case DXGI_FORMAT_BC3_TYPELESS:  cformat = DXGI_FORMAT_BC3_UNORM; break;
-    case DXGI_FORMAT_BC7_TYPELESS:  cformat = DXGI_FORMAT_BC7_UNORM; break;
-    default:                        cformat = cImage.format;         break;
-    }
-
-    // Determine BC format decoder
-    BC_DECODE pfDecode;
-    size_t sbpp;
-    switch(cformat)
-    {
-    case DXGI_FORMAT_BC1_UNORM:
-    case DXGI_FORMAT_BC1_UNORM_SRGB:    pfDecode = D3DXDecodeBC1;   sbpp = 8;   break;
-    case DXGI_FORMAT_BC2_UNORM:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:    pfDecode = D3DXDecodeBC2;   sbpp = 16;  break;
-    case DXGI_FORMAT_BC3_UNORM:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:    pfDecode = D3DXDecodeBC3;   sbpp = 16;  break;
-    case DXGI_FORMAT_BC7_UNORM:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:    pfDecode = D3DXDecodeBC7;   sbpp = 16;  break;
-    default:
-        // BC4, BC5, and BC6 don't have alpha channels
-        return false;
-    }
-
-    // Scan blocks for non-opaque alpha
-    static const XMVECTORF32 threshold = { 0.99f, 0.99f, 0.99f, 0.99f };
-
-    XMVECTOR temp[16];
-    const uint8_t *pPixels = cImage.pixels;
-    for( size_t h = 0; h < cImage.height; h += 4 )
-    {
-        const uint8_t *ptr = pPixels;
-        size_t ph = std::min<size_t>( 4, cImage.height - h );
-        size_t w = 0;
-        for( size_t count = 0; count < cImage.rowPitch; count += sbpp, w += 4 )
-        {
-            pfDecode( temp, ptr );
-
-            size_t pw = std::min<size_t>( 4, cImage.width - w );
-            assert( pw > 0 && ph > 0 );
-
-            if ( pw == 4 && ph == 4 )
-            {
-                // Full blocks
-                for( size_t j = 0; j < 16; ++j )
-                {
-                    XMVECTOR alpha = XMVectorSplatW( temp[j] );
-                    if ( XMVector4Less( alpha, threshold ) )
-                        return false;
-                }
-            }
-            else
-            {
-                // Handle partial blocks
-                for( size_t y = 0; y < ph; ++y )
-                {
-                    for( size_t x = 0; x < pw; ++x )
-                    {
-                        XMVECTOR alpha = XMVectorSplatW( temp[ y * 4 + x ] );
-                        if ( XMVector4Less( alpha, threshold ) )
-                            return false;
-                    }
-                }
-            }
-
-            ptr += sbpp;
-        }
-
-        pPixels += cImage.rowPitch;
-    }
-
-    return true;
-}
-
-
-//=====================================================================================
-// Entry-points
-//=====================================================================================
-
-//-------------------------------------------------------------------------------------
-// Compression
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT Compress( const Image& srcImage, DXGI_FORMAT format, DWORD compress, float alphaRef, ScratchImage& image )
-{
-    if ( IsCompressed(srcImage.format) || !IsCompressed(format) )
-        return E_INVALIDARG;
-
-    if ( IsTypeless(format)
-         || IsTypeless(srcImage.format) || IsPlanar(srcImage.format) || IsPalettized(srcImage.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    // Create compressed image
-    HRESULT hr = image.Initialize2D( format, srcImage.width, srcImage.height, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-
-    const Image *img = image.GetImage( 0, 0, 0 );
-    if ( !img )
-    {
-        image.Release();
-        return E_POINTER;
-    }
-
-    // Compress single image
-    if (compress & TEX_COMPRESS_PARALLEL)
-    {
-#ifndef _OPENMP
-        return E_NOTIMPL;
-#else
-        hr = _CompressBC_Parallel( srcImage, *img, _GetBCFlags( compress ), _GetSRGBFlags( compress ), alphaRef );
-#endif // _OPENMP
-    }
-    else
-    {
-        hr = _CompressBC( srcImage, *img, _GetBCFlags( compress ), _GetSRGBFlags( compress ), alphaRef );
-    }
-
-    if ( FAILED(hr) )
-        image.Release();
-
-    return hr;
-}
-
-_Use_decl_annotations_
-HRESULT Compress( const Image* srcImages, size_t nimages, const TexMetadata& metadata,
-                  DXGI_FORMAT format, DWORD compress, float alphaRef, ScratchImage& cImages )
-{
-    if ( !srcImages || !nimages )
-        return E_INVALIDARG;
-
-    if ( IsCompressed(metadata.format) || !IsCompressed(format) )
-        return E_INVALIDARG;
-
-    if ( IsTypeless(format)
-         || IsTypeless(metadata.format) || IsPlanar(metadata.format) || IsPalettized(metadata.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    cImages.Release();
-
-    TexMetadata mdata2 = metadata;
-    mdata2.format = format;
-    HRESULT hr = cImages.Initialize( mdata2 );
-    if ( FAILED(hr) )
-        return hr;
-
-    if ( nimages != cImages.GetImageCount() )
-    {
-        cImages.Release();
-        return E_FAIL;
-    }
-
-    const Image* dest = cImages.GetImages();
-    if ( !dest  )
-    {
-        cImages.Release();
-        return E_POINTER;
-    }
-
-    for( size_t index=0; index < nimages; ++index )
-    {
-        assert( dest[ index ].format == format );
-
-        const Image& src = srcImages[ index ];
-
-        if ( src.width != dest[ index ].width || src.height != dest[ index ].height )
-        {
-            cImages.Release();
-            return E_FAIL;
-        }
-
-        if ( (compress & TEX_COMPRESS_PARALLEL) )
-        {
-#ifndef _OPENMP
-            return E_NOTIMPL;
-#else
-            if ( compress & TEX_COMPRESS_PARALLEL )
-            {
-                hr = _CompressBC_Parallel( src, dest[ index ], _GetBCFlags( compress ), _GetSRGBFlags( compress ), alphaRef );
-                if ( FAILED(hr) )
-                {
-                    cImages.Release();
-                    return  hr;
-                }
-            }
-#endif // _OPENMP
-        }
-        else
-        {
-            hr = _CompressBC( src, dest[ index ], _GetBCFlags( compress ), _GetSRGBFlags( compress ), alphaRef );
-            if ( FAILED(hr) )
-            {
-                cImages.Release();
-                return hr;
-            }
-        }
-    }
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Decompression
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT Decompress( const Image& cImage, DXGI_FORMAT format, ScratchImage& image )
-{
-    if ( !IsCompressed(cImage.format) || IsCompressed(format) )
-        return E_INVALIDARG;
-
-    if ( format == DXGI_FORMAT_UNKNOWN )
-    {
-        // Pick a default decompressed format based on BC input format
-        format = _DefaultDecompress( cImage.format );
-        if ( format == DXGI_FORMAT_UNKNOWN )
-        {
-            // Input is not a compressed format
-            return E_INVALIDARG;
-        }
-    }
-    else
-    {
-        if ( !IsValid(format) )
-            return E_INVALIDARG;
-
-        if ( IsTypeless(format) || IsPlanar(format) || IsPalettized(format) )
-            return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    // Create decompressed image
-    HRESULT hr = image.Initialize2D( format, cImage.width, cImage.height, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-
-    const Image *img = image.GetImage( 0, 0, 0 );
-    if ( !img )
-    {
-        image.Release();
-        return E_POINTER;
-    }
-
-    // Decompress single image
-    hr = _DecompressBC( cImage, *img );
-    if ( FAILED(hr) )
-        image.Release();
-
-    return hr;
-}
-
-_Use_decl_annotations_
-HRESULT Decompress( const Image* cImages, size_t nimages, const TexMetadata& metadata,
-                    DXGI_FORMAT format, ScratchImage& images )
-{
-    if ( !cImages || !nimages )
-        return E_INVALIDARG;
-
-    if ( !IsCompressed(metadata.format) || IsCompressed(format) )
-        return E_INVALIDARG;
-
-    if ( format == DXGI_FORMAT_UNKNOWN )
-    {
-        // Pick a default decompressed format based on BC input format
-        format = _DefaultDecompress( cImages[0].format );
-        if ( format == DXGI_FORMAT_UNKNOWN )
-        {
-            // Input is not a compressed format
-            return E_FAIL;
-        }
-    }
-    else
-    {
-        if ( !IsValid(format) )
-            return E_INVALIDARG;
-
-        if ( IsTypeless(format) || IsPlanar(format) || IsPalettized(format) )
-            HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    images.Release();
-
-    TexMetadata mdata2 = metadata;
-    mdata2.format = format;
-    HRESULT hr = images.Initialize( mdata2 );
-    if ( FAILED(hr) )
-        return hr;
-
-    if ( nimages != images.GetImageCount() )
-    {
-        images.Release();
-        return E_FAIL;
-    }
-
-    const Image* dest = images.GetImages();
-    if ( !dest )
-    {
-        images.Release();
-        return E_POINTER;
-    }
-
-    for( size_t index=0; index < nimages; ++index )
-    {
-        assert( dest[ index ].format == format );
-
-        const Image& src = cImages[ index ];
-        if ( !IsCompressed( src.format ) )
-        {
-            images.Release();
-            return E_FAIL;
-        }
-
-        if ( src.width != dest[ index ].width || src.height != dest[ index ].height )
-        {
-            images.Release();
-            return E_FAIL;
-        }
-
-        hr = _DecompressBC( src, dest[ index ] );
-        if ( FAILED(hr) )
-        {
-            images.Release();
-            return hr;
-        }
-    }
-
-    return S_OK;
-}
-
-}; // namespace

+ 0 - 402
Exporters/FBX/3rdParty/DirectXTex/DirectXTexCompressGPU.cpp

@@ -1,402 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexCompressGPU.cpp
-//  
-// DirectX Texture Library - DirectCompute-based texture compression
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-#include "bcdirectcompute.h"
-
-namespace DirectX
-{
-
-inline static DWORD _GetSRGBFlags( _In_ DWORD compress )
-{
-    static_assert( TEX_COMPRESS_SRGB_IN == TEX_FILTER_SRGB_IN, "TEX_COMPRESS_SRGB* should match TEX_FILTER_SRGB*" );
-    static_assert( TEX_COMPRESS_SRGB_OUT == TEX_FILTER_SRGB_OUT, "TEX_COMPRESS_SRGB* should match TEX_FILTER_SRGB*" );
-    static_assert( TEX_COMPRESS_SRGB == TEX_FILTER_SRGB, "TEX_COMPRESS_SRGB* should match TEX_FILTER_SRGB*" );
-    return ( compress & TEX_COMPRESS_SRGB );
-}
-
-
-//-------------------------------------------------------------------------------------
-// Converts to R8G8B8A8_UNORM or R8G8B8A8_UNORM_SRGB doing any conversion logic needed
-//-------------------------------------------------------------------------------------
-static HRESULT _ConvertToRGBA32( _In_ const Image& srcImage, _In_ ScratchImage& image, bool srgb, _In_ DWORD filter )
-{
-    if ( !srcImage.pixels )
-        return E_POINTER;
-
-    DXGI_FORMAT format = srgb ? DXGI_FORMAT_R8G8B8A8_UNORM_SRGB : DXGI_FORMAT_R8G8B8A8_UNORM;
-
-    HRESULT hr = image.Initialize2D( format, srcImage.width, srcImage.height, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-
-    const Image *img = image.GetImage( 0, 0, 0 );
-    if ( !img )
-    {
-        image.Release();
-        return E_POINTER;
-    }
-
-    uint8_t* pDest = img->pixels;
-    if ( !pDest )
-    {
-        image.Release();
-        return E_POINTER;
-    }
-
-    ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast<XMVECTOR*>( _aligned_malloc( ( sizeof(XMVECTOR) * srcImage.width ), 16 ) ) );
-    if ( !scanline )
-    {
-        image.Release();
-        return E_OUTOFMEMORY;
-    }
-
-    const uint8_t *pSrc = srcImage.pixels;
-    for( size_t h = 0; h < srcImage.height; ++h )
-    {
-        if ( !_LoadScanline( scanline.get(), srcImage.width, pSrc, srcImage.rowPitch, srcImage.format ) )
-        {
-            image.Release();
-            return E_FAIL;
-        }
-
-        _ConvertScanline( scanline.get(), srcImage.width, format, srcImage.format, filter );
-
-        if ( !_StoreScanline( pDest, img->rowPitch, format, scanline.get(), srcImage.width ) )
-        {
-            image.Release();
-            return E_FAIL;
-        }
-
-        pSrc += srcImage.rowPitch;
-        pDest += img->rowPitch;
-    }
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Converts to DXGI_FORMAT_R32G32B32A32_FLOAT doing any conversion logic needed
-//-------------------------------------------------------------------------------------
-static HRESULT _ConvertToRGBAF32( const Image& srcImage, ScratchImage& image, _In_ DWORD filter )
-{
-    if ( !srcImage.pixels )
-        return E_POINTER;
-
-    HRESULT hr = image.Initialize2D( DXGI_FORMAT_R32G32B32A32_FLOAT, srcImage.width, srcImage.height, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-
-    const Image *img = image.GetImage( 0, 0, 0 );
-    if ( !img )
-    {
-        image.Release();
-        return E_POINTER;
-    }
-
-    uint8_t* pDest = img->pixels;
-    if ( !pDest )
-    {
-        image.Release();
-        return E_POINTER;
-    }
-
-    const uint8_t *pSrc = srcImage.pixels;
-    for( size_t h = 0; h < srcImage.height; ++h )
-    {
-        if ( !_LoadScanline( reinterpret_cast<XMVECTOR*>(pDest), srcImage.width, pSrc, srcImage.rowPitch, srcImage.format ) )
-        {
-            image.Release();
-            return E_FAIL;
-        }
-
-        _ConvertScanline( reinterpret_cast<XMVECTOR*>(pDest), srcImage.width, DXGI_FORMAT_R32G32B32A32_FLOAT, srcImage.format, filter );
-
-        pSrc += srcImage.rowPitch;
-        pDest += img->rowPitch;
-    }
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Compress using GPU, converting to the proper input format for the shader if needed
-//-------------------------------------------------------------------------------------
-inline static HRESULT _GPUCompress( _In_ GPUCompressBC* gpubc, _In_ const Image& srcImage, _In_ const Image& destImage, _In_ DWORD compress )
-{
-    if ( !gpubc )
-        return E_POINTER;
-
-    assert( srcImage.pixels && destImage.pixels );
-
-    DXGI_FORMAT format = gpubc->GetSourceFormat();
-
-    if ( srcImage.format == format )
-    {
-        // Input is already in our required source format
-        return gpubc->Compress( srcImage, destImage );
-    }
-    else
-    {
-        // Convert format and then use as the source image
-        ScratchImage image;
-        HRESULT hr;
-
-        DWORD srgb = _GetSRGBFlags( compress );
-
-        switch( format )
-        {
-        case DXGI_FORMAT_R8G8B8A8_UNORM:
-            hr = _ConvertToRGBA32( srcImage, image, false, srgb );
-            break;
-
-        case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
-            hr = _ConvertToRGBA32( srcImage, image, true, srgb );
-            break;
-
-        case DXGI_FORMAT_R32G32B32A32_FLOAT:
-            hr = _ConvertToRGBAF32( srcImage, image, srgb );
-            break;
-
-        default:
-            hr = E_UNEXPECTED;
-            break;
-        }
-
-        if ( FAILED(hr) )
-            return hr;
-
-        const Image *img = image.GetImage( 0, 0, 0 );
-        if ( !img )
-            return E_POINTER;
-
-        return gpubc->Compress( *img, destImage );
-    }
-}
-
-
-//=====================================================================================
-// Entry-points
-//=====================================================================================
-
-//-------------------------------------------------------------------------------------
-// Compression
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT Compress( ID3D11Device* pDevice, const Image& srcImage, DXGI_FORMAT format, DWORD compress, float alphaWeight, ScratchImage& image )
-{
-    if ( !pDevice || IsCompressed(srcImage.format) || !IsCompressed(format) )
-        return E_INVALIDARG;
-
-    if ( IsTypeless(format)
-         || IsTypeless(srcImage.format) || IsPlanar(srcImage.format) || IsPalettized(srcImage.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    // Setup GPU compressor
-    std::unique_ptr<GPUCompressBC> gpubc( new (std::nothrow) GPUCompressBC );
-    if ( !gpubc )
-        return E_OUTOFMEMORY;
-
-    HRESULT hr = gpubc->Initialize( pDevice );
-    if ( FAILED(hr) )
-        return hr;
-
-    hr = gpubc->Prepare( srcImage.width, srcImage.height, format, alphaWeight );
-    if ( FAILED(hr) )
-        return hr;
-
-    // Create workspace for result
-    hr = image.Initialize2D( format, srcImage.width, srcImage.height, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-
-    const Image *img = image.GetImage( 0, 0, 0 );
-    if ( !img )
-    {
-        image.Release();
-        return E_POINTER;
-    }
-
-    hr = _GPUCompress( gpubc.get(), srcImage, *img, compress );
-    if ( FAILED(hr) )
-        image.Release();
-
-    return hr;
-}
-
-_Use_decl_annotations_
-HRESULT Compress( ID3D11Device* pDevice, const Image* srcImages, size_t nimages, const TexMetadata& metadata,
-                  DXGI_FORMAT format, DWORD compress, float alphaWeight, ScratchImage& cImages )
-{
-    if ( !pDevice || !srcImages || !nimages )
-        return E_INVALIDARG;
-
-    if ( IsCompressed(metadata.format) || !IsCompressed(format) )
-        return E_INVALIDARG;
-
-    if ( IsTypeless(format)
-         || IsTypeless(metadata.format) || IsPlanar(metadata.format) || IsPalettized(metadata.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    cImages.Release();
-
-    // Setup GPU compressor
-    std::unique_ptr<GPUCompressBC> gpubc( new (std::nothrow) GPUCompressBC );
-    if ( !gpubc )
-        return E_OUTOFMEMORY;
-
-    HRESULT hr = gpubc->Initialize( pDevice );
-    if ( FAILED(hr) )
-        return hr;
-
-    // Create workspace for result
-    TexMetadata mdata2 = metadata;
-    mdata2.format = format;
-    hr = cImages.Initialize( mdata2 );
-    if ( FAILED(hr) )
-        return hr;
-
-    if ( nimages != cImages.GetImageCount() )
-    {
-        cImages.Release();
-        return E_FAIL;
-    }
-
-    const Image* dest = cImages.GetImages();
-    if ( !dest  )
-    {
-        cImages.Release();
-        return E_POINTER;
-    }
-
-    // Process images (ordered by size)
-    switch( metadata.dimension )
-    {
-    case TEX_DIMENSION_TEXTURE1D:
-    case TEX_DIMENSION_TEXTURE2D:
-        {
-            size_t w = metadata.width;
-            size_t h = metadata.height;
-
-            for( size_t level=0; level < metadata.mipLevels; ++level )
-            {
-                hr = gpubc->Prepare( w, h, format, alphaWeight );
-                if ( FAILED(hr) )
-                {
-                    cImages.Release();
-                    return hr;
-                }
-
-                for( size_t item = 0; item < metadata.arraySize; ++item )
-                {
-                    size_t index = metadata.ComputeIndex( level, item, 0 );
-                    if ( index >= nimages )
-                    {
-                        cImages.Release();
-                        return E_FAIL;
-                    }
-
-                    assert( dest[ index ].format == format );
-
-                    const Image& src = srcImages[ index ];
-
-                    if ( src.width != dest[ index ].width || src.height != dest[ index ].height )
-                    {
-                        cImages.Release();
-                        return E_FAIL;
-                    }
-
-                    hr = _GPUCompress( gpubc.get(), src, dest[ index ], compress );
-                    if ( FAILED(hr) )
-                    {
-                        cImages.Release();
-                        return hr;
-                    }
-                }
-
-                if ( h > 1 )
-                    h >>= 1;
-
-                if ( w > 1 )
-                    w >>= 1;
-            }
-        }
-        break;
-
-    case TEX_DIMENSION_TEXTURE3D:
-        {
-            size_t w = metadata.width;
-            size_t h = metadata.height;
-            size_t d = metadata.depth;
-
-            for( size_t level=0; level < metadata.mipLevels; ++level )
-            {
-                hr = gpubc->Prepare( w, h, format, alphaWeight );
-                if ( FAILED(hr) )
-                {
-                    cImages.Release();
-                    return hr;
-                }
-
-                for( size_t slice=0; slice < d; ++slice )
-                {
-                    size_t index = metadata.ComputeIndex( level, 0, slice );
-                    if ( index >= nimages )
-                    {
-                        cImages.Release();
-                        return E_FAIL;
-                    }
-
-                    assert( dest[ index ].format == format );
-
-                    const Image& src = srcImages[ index ];
-
-                    if ( src.width != dest[ index ].width || src.height != dest[ index ].height )
-                    {
-                        cImages.Release();
-                        return E_FAIL;
-                    }
-
-                    hr = _GPUCompress( gpubc.get(), src, dest[ index ], compress );
-                    if ( FAILED(hr) )
-                    {
-                        cImages.Release();
-                        return hr;
-                    }
-                }
-
-                if ( h > 1 )
-                    h >>= 1;
-
-                if ( w > 1 )
-                    w >>= 1;
-
-                if ( d > 1 )
-                    d >>= 1;
-            }
-        }
-        break;
-
-    default:
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    return S_OK;
-}
-
-}; // namespace

File diff suppressed because it is too large
+ 0 - 4515
Exporters/FBX/3rdParty/DirectXTex/DirectXTexConvert.cpp


+ 0 - 875
Exporters/FBX/3rdParty/DirectXTex/DirectXTexD3D11.cpp

@@ -1,875 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexD3D11.cpp
-//  
-// DirectX Texture Library - Direct3D 11 helpers
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-#if !defined(_XBOX_ONE) || !defined(_TITLE) || !MONOLITHIC
-#include <d3d10.h>
-#endif
-
-using Microsoft::WRL::ComPtr;
-
-namespace DirectX
-{
-
-static HRESULT _Capture( _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _In_ const TexMetadata& metadata,
-                         _In_ const ScratchImage& result )
-{
-    if ( !pContext || !pSource || !result.GetPixels() )
-        return E_POINTER;
-
-    if ( metadata.IsVolumemap() )
-    {
-        //--- Volume texture ----------------------------------------------------------
-        assert( metadata.arraySize == 1 );
-
-        size_t height = metadata.height;
-        size_t depth = metadata.depth;
-
-        for( size_t level = 0; level < metadata.mipLevels; ++level )
-        {
-            UINT dindex = D3D11CalcSubresource( static_cast<UINT>( level ), 0, static_cast<UINT>( metadata.mipLevels ) );
-
-            D3D11_MAPPED_SUBRESOURCE mapped;
-            HRESULT hr = pContext->Map( pSource, dindex, D3D11_MAP_READ, 0, &mapped );
-            if ( FAILED(hr) )
-                return hr;
-
-            auto pslice = reinterpret_cast<const uint8_t*>( mapped.pData );
-            if ( !pslice )
-            {
-                pContext->Unmap( pSource, dindex );
-                return E_POINTER;
-            }
-
-            size_t lines = ComputeScanlines( metadata.format, height );
-            if ( !lines )
-            {
-                pContext->Unmap( pSource, dindex );
-                return E_UNEXPECTED;
-            }
-
-            for( size_t slice = 0; slice < depth; ++slice )
-            {
-                const Image* img = result.GetImage( level, 0, slice );
-                if ( !img )
-                {
-                    pContext->Unmap( pSource, dindex );
-                    return E_FAIL;
-                }
-
-                if ( !img->pixels )
-                {
-                    pContext->Unmap( pSource, dindex );
-                    return E_POINTER;
-                }
-
-                const uint8_t* sptr = pslice;
-                uint8_t* dptr = img->pixels;
-                for( size_t h = 0; h < lines; ++h )
-                {
-                    size_t msize = std::min<size_t>( img->rowPitch, mapped.RowPitch );
-                    memcpy_s( dptr, img->rowPitch, sptr, msize );
-                    sptr += mapped.RowPitch;
-                    dptr += img->rowPitch;
-                }
-
-                pslice += mapped.DepthPitch;
-            }
-
-            pContext->Unmap( pSource, dindex );
-
-            if ( height > 1 )
-                height >>= 1;
-            if ( depth > 1 )
-                depth >>= 1;
-        }
-    }
-    else
-    {
-        //--- 1D or 2D texture --------------------------------------------------------
-        assert( metadata.depth == 1 );
-
-        for( size_t item = 0; item < metadata.arraySize; ++item )
-        {
-            size_t height = metadata.height;
-
-            for( size_t level = 0; level < metadata.mipLevels; ++level )
-            {
-                UINT dindex = D3D11CalcSubresource( static_cast<UINT>( level ), static_cast<UINT>( item ), static_cast<UINT>( metadata.mipLevels ) );
-
-                D3D11_MAPPED_SUBRESOURCE mapped;
-                HRESULT hr = pContext->Map( pSource, dindex, D3D11_MAP_READ, 0, &mapped );
-                if ( FAILED(hr) )
-                    return hr;
-
-                const Image* img = result.GetImage( level, item, 0 );
-                if ( !img )
-                {
-                    pContext->Unmap( pSource, dindex );
-                    return E_FAIL;
-                }
-
-                if ( !img->pixels )
-                {
-                    pContext->Unmap( pSource, dindex );
-                    return E_POINTER;
-                }
-
-                size_t lines = ComputeScanlines( metadata.format, height );
-                if ( !lines )
-                {
-                    pContext->Unmap( pSource, dindex );
-                    return E_UNEXPECTED;
-                }
-
-                auto sptr = reinterpret_cast<const uint8_t*>( mapped.pData );
-                uint8_t* dptr = img->pixels;
-                for( size_t h = 0; h < lines; ++h )
-                {
-                    size_t msize = std::min<size_t>( img->rowPitch, mapped.RowPitch );
-                    memcpy_s( dptr, img->rowPitch, sptr, msize );
-                    sptr += mapped.RowPitch;
-                    dptr += img->rowPitch;
-                }
-
-                pContext->Unmap( pSource, dindex );
-
-                if ( height > 1 )
-                    height >>= 1;
-            }
-        }
-    }
-
-    return S_OK;
-}
-
-
-//=====================================================================================
-// Entry-points
-//=====================================================================================
-
-//-------------------------------------------------------------------------------------
-// Determine if given texture metadata is supported on the given device
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-bool IsSupportedTexture( ID3D11Device* pDevice, const TexMetadata& metadata )
-{
-    if ( !pDevice )
-        return false;
-
-    D3D_FEATURE_LEVEL fl = pDevice->GetFeatureLevel();
-
-    // Validate format
-    DXGI_FORMAT fmt = metadata.format;
-
-    if ( !IsValid( fmt ) )
-        return false;
-
-    switch( fmt )
-    {
-    case DXGI_FORMAT_BC4_TYPELESS:
-    case DXGI_FORMAT_BC4_UNORM:
-    case DXGI_FORMAT_BC4_SNORM:
-    case DXGI_FORMAT_BC5_TYPELESS:
-    case DXGI_FORMAT_BC5_UNORM:
-    case DXGI_FORMAT_BC5_SNORM:
-        if ( fl < D3D_FEATURE_LEVEL_10_0 )
-            return false;
-        break;
-
-    case DXGI_FORMAT_BC6H_TYPELESS:
-    case DXGI_FORMAT_BC6H_UF16:
-    case DXGI_FORMAT_BC6H_SF16:
-    case DXGI_FORMAT_BC7_TYPELESS:
-    case DXGI_FORMAT_BC7_UNORM:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-        if ( fl < D3D_FEATURE_LEVEL_11_0 )
-            return false;
-        break;
-    }
-
-    // Validate miplevel count
-    if ( metadata.mipLevels > D3D11_REQ_MIP_LEVELS )
-        return false;
-       
-    // Validate array size, dimension, and width/height
-    size_t arraySize = metadata.arraySize;
-    size_t iWidth = metadata.width;
-    size_t iHeight = metadata.height;
-    size_t iDepth = metadata.depth;
-
-    // Most cases are known apriori based on feature level, but we use this for robustness to handle the few optional cases
-    UINT formatSupport = 0;
-    HRESULT hr = pDevice->CheckFormatSupport( fmt, &formatSupport );
-    if ( FAILED(hr) )
-    {
-        formatSupport = 0;
-    }
-
-    switch ( metadata.dimension )
-    {
-    case TEX_DIMENSION_TEXTURE1D:
-        if ( !(formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE1D) )
-            return false;
-
-        if ( (arraySize > D3D11_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION)
-             || (iWidth > D3D11_REQ_TEXTURE1D_U_DIMENSION) )
-            return false;
-
-        if ( fl < D3D_FEATURE_LEVEL_11_0 )
-        {
-            if ( (arraySize > D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION)
-                 || (iWidth > D3D10_REQ_TEXTURE1D_U_DIMENSION) )
-                return false;
-
-            if ( fl < D3D_FEATURE_LEVEL_10_0 )
-            {
-                if ( (arraySize > 1) || (iWidth > D3D_FL9_3_REQ_TEXTURE1D_U_DIMENSION) )
-                    return false;
-
-                if ( (fl < D3D_FEATURE_LEVEL_9_3) && (iWidth > D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION ) )
-                    return false;
-            }
-        }
-        break;
-
-    case TEX_DIMENSION_TEXTURE2D:
-        if ( metadata.IsCubemap() )
-        {
-            if ( !(formatSupport & D3D11_FORMAT_SUPPORT_TEXTURECUBE) )
-                return false;
-
-            if ( (arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION)
-                 || (iWidth > D3D11_REQ_TEXTURECUBE_DIMENSION) 
-                 || (iHeight > D3D11_REQ_TEXTURECUBE_DIMENSION))
-                return false;
-
-            if ( fl < D3D_FEATURE_LEVEL_11_0 )
-            {
-                if ( (arraySize > D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION)
-                     || (iWidth > D3D10_REQ_TEXTURECUBE_DIMENSION) 
-                     || (iHeight > D3D10_REQ_TEXTURECUBE_DIMENSION))
-                    return false;
-
-                if ( (fl < D3D_FEATURE_LEVEL_10_1) && (arraySize != 6) )
-                    return false;
-
-                if ( fl < D3D_FEATURE_LEVEL_10_0 )
-                {
-                    if ( (iWidth > D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION )
-                         || (iHeight > D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION ) )
-                        return false;
-
-                    if ( (fl < D3D_FEATURE_LEVEL_9_3)
-                         && ( (iWidth > D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION)
-                              || (iHeight > D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION) ) )
-                        return false;
-                }
-            }
-        }
-        else // Not a cube map
-        {
-            if ( !(formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE2D) )
-                return false;
-
-            if ( (arraySize > D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION)
-                 || (iWidth > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION) 
-                 || (iHeight > D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION))
-                return false;
-
-            if ( fl < D3D_FEATURE_LEVEL_11_0 )
-            {
-                if ( (arraySize > D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION)
-                     || (iWidth > D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION) 
-                     || (iHeight > D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION))
-                    return false;
-
-                if ( fl < D3D_FEATURE_LEVEL_10_0 )
-                {
-                    if ( (arraySize > 1)
-                         || (iWidth > D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION)
-                         || (iHeight > D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION) )
-                        return false;
-
-                    if ( (fl < D3D_FEATURE_LEVEL_9_3)
-                         && ( (iWidth > D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION)
-                              || (iHeight > D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION) ) )
-                        return false;
-                }
-            }
-        }
-        break;
-
-    case TEX_DIMENSION_TEXTURE3D:
-        if ( !(formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE3D) )
-            return false;
-
-        if ( (arraySize > 1)
-             || (iWidth > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION) 
-             || (iHeight > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION)
-             || (iDepth > D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION) )
-            return false;
-
-        if ( fl < D3D_FEATURE_LEVEL_11_0 )
-        {
-            if ( (iWidth > D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION) 
-                 || (iHeight > D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION)
-                 || (iDepth > D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION) )
-                return false;
-
-            if ( fl < D3D_FEATURE_LEVEL_10_0 )
-            {
-                if ( (iWidth > D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION)
-                     || (iHeight > D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION)
-                     || (iDepth > D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION) )
-                    return false;
-            }
-        }
-        break;
-
-    default:
-        // Not a supported dimension
-        return false;
-    }
-
-    return true;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Create a texture resource
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT CreateTexture( ID3D11Device* pDevice, const Image* srcImages, size_t nimages, const TexMetadata& metadata,
-                       ID3D11Resource** ppResource )
-{
-    return CreateTextureEx( pDevice, srcImages, nimages, metadata,
-                            D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false,
-                            ppResource );
-}
-
-_Use_decl_annotations_
-HRESULT CreateTextureEx( ID3D11Device* pDevice, const Image* srcImages, size_t nimages, const TexMetadata& metadata,
-                         D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags, bool forceSRGB,
-                         ID3D11Resource** ppResource )
-{
-    if ( !pDevice || !srcImages || !nimages || !ppResource )
-        return E_INVALIDARG;
-
-    *ppResource = nullptr;
-
-    if ( !metadata.mipLevels || !metadata.arraySize )
-        return E_INVALIDARG;
-
-#ifdef _M_X64
-    if ( (metadata.width > 0xFFFFFFFF) || (metadata.height > 0xFFFFFFFF)
-         || (metadata.mipLevels > 0xFFFFFFFF) || (metadata.arraySize > 0xFFFFFFFF) )
-        return E_INVALIDARG;
-#endif
-
-    std::unique_ptr<D3D11_SUBRESOURCE_DATA[]> initData( new (std::nothrow) D3D11_SUBRESOURCE_DATA[ metadata.mipLevels * metadata.arraySize ] );
-    if ( !initData )
-        return E_OUTOFMEMORY;
-
-    // Fill out subresource array
-    if ( metadata.IsVolumemap() )
-    {
-        //--- Volume case -------------------------------------------------------------
-        if ( !metadata.depth )
-            return E_INVALIDARG;
-
-#ifdef _M_X64
-        if ( metadata.depth > 0xFFFFFFFF )
-            return E_INVALIDARG;
-#endif
-
-        if ( metadata.arraySize > 1 )
-            // Direct3D 11 doesn't support arrays of 3D textures
-            return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-        size_t depth = metadata.depth;
-
-        size_t idx = 0;
-        for( size_t level = 0; level < metadata.mipLevels; ++level )
-        {
-            size_t index = metadata.ComputeIndex( level, 0, 0 );
-            if ( index >= nimages )
-                return E_FAIL;
-
-            const Image& img = srcImages[ index ];
-
-            if ( img.format != metadata.format )
-                return E_FAIL;
-
-            if ( !img.pixels )
-                return E_POINTER;
-
-            // Verify pixels in image 1 .. (depth-1) are exactly image->slicePitch apart
-            // For 3D textures, this relies on all slices of the same miplevel being continous in memory
-            // (this is how ScratchImage lays them out), which is why we just give the 0th slice to Direct3D 11
-            const uint8_t* pSlice = img.pixels + img.slicePitch;
-            for( size_t slice = 1; slice < depth; ++slice )
-            {
-                size_t tindex = metadata.ComputeIndex( level, 0, slice );
-                if ( tindex >= nimages )
-                    return E_FAIL;
-
-                const Image& timg = srcImages[ tindex ];
-
-                if ( !timg.pixels )
-                    return E_POINTER;
-
-                if ( timg.pixels != pSlice
-                     || timg.format != metadata.format
-                     || timg.rowPitch != img.rowPitch
-                     || timg.slicePitch != img.slicePitch )
-                    return E_FAIL;
-
-                pSlice = timg.pixels + img.slicePitch;
-            }
-
-            assert( idx < (metadata.mipLevels * metadata.arraySize) );
-
-            initData[idx].pSysMem = img.pixels;
-            initData[idx].SysMemPitch = static_cast<DWORD>( img.rowPitch );
-            initData[idx].SysMemSlicePitch = static_cast<DWORD>( img.slicePitch );
-            ++idx;
-
-            if ( depth > 1 )
-                depth >>= 1;
-        }
-    }
-    else
-    {
-        //--- 1D or 2D texture case ---------------------------------------------------
-        size_t idx = 0;
-        for( size_t item = 0; item < metadata.arraySize; ++item )
-        {
-            for( size_t level = 0; level < metadata.mipLevels; ++level )
-            {
-                size_t index = metadata.ComputeIndex( level, item, 0 );
-                if ( index >= nimages )
-                    return E_FAIL;
-
-                const Image& img = srcImages[ index ];
-
-                if ( img.format != metadata.format )
-                    return E_FAIL;
-
-                if ( !img.pixels )
-                    return E_POINTER;
-
-                assert( idx < (metadata.mipLevels * metadata.arraySize) );
-
-                initData[idx].pSysMem = img.pixels;
-                initData[idx].SysMemPitch = static_cast<DWORD>( img.rowPitch );
-                initData[idx].SysMemSlicePitch = static_cast<DWORD>( img.slicePitch );
-                ++idx;
-            }
-        }
-    }
-
-    // Create texture using static initialization data
-    HRESULT hr = E_FAIL;
-
-    DXGI_FORMAT tformat = ( forceSRGB ) ? MakeSRGB( metadata.format ) : metadata.format;
-
-    switch ( metadata.dimension )
-    {
-    case TEX_DIMENSION_TEXTURE1D:
-        {
-            D3D11_TEXTURE1D_DESC desc;
-            desc.Width = static_cast<UINT>( metadata.width );
-            desc.MipLevels = static_cast<UINT>( metadata.mipLevels );
-            desc.ArraySize = static_cast<UINT>( metadata.arraySize );
-            desc.Format = tformat;
-            desc.Usage = usage;
-            desc.BindFlags = bindFlags;
-            desc.CPUAccessFlags = cpuAccessFlags;
-            desc.MiscFlags = miscFlags & ~D3D11_RESOURCE_MISC_TEXTURECUBE;
-
-            hr = pDevice->CreateTexture1D( &desc, initData.get(), reinterpret_cast<ID3D11Texture1D**>(ppResource) );
-        }
-        break;
-
-    case TEX_DIMENSION_TEXTURE2D:
-        {
-            D3D11_TEXTURE2D_DESC desc;
-            desc.Width = static_cast<UINT>( metadata.width );
-            desc.Height = static_cast<UINT>( metadata.height ); 
-            desc.MipLevels = static_cast<UINT>( metadata.mipLevels );
-            desc.ArraySize = static_cast<UINT>( metadata.arraySize );
-            desc.Format = tformat;
-            desc.SampleDesc.Count = 1;
-            desc.SampleDesc.Quality = 0;
-            desc.Usage = usage;
-            desc.BindFlags = bindFlags;
-            desc.CPUAccessFlags = cpuAccessFlags;
-            if ( metadata.IsCubemap() )
-                desc.MiscFlags =  miscFlags | D3D11_RESOURCE_MISC_TEXTURECUBE;
-            else
-                desc.MiscFlags =  miscFlags & ~D3D11_RESOURCE_MISC_TEXTURECUBE;
-
-            hr = pDevice->CreateTexture2D( &desc, initData.get(), reinterpret_cast<ID3D11Texture2D**>(ppResource) );
-        }
-        break;
-
-    case TEX_DIMENSION_TEXTURE3D:
-        {
-            D3D11_TEXTURE3D_DESC desc;
-            desc.Width = static_cast<UINT>( metadata.width );
-            desc.Height = static_cast<UINT>( metadata.height );
-            desc.Depth = static_cast<UINT>( metadata.depth );
-            desc.MipLevels = static_cast<UINT>( metadata.mipLevels );
-            desc.Format = tformat;
-            desc.Usage = usage;
-            desc.BindFlags = bindFlags;
-            desc.CPUAccessFlags = cpuAccessFlags;
-            desc.MiscFlags = miscFlags & ~D3D11_RESOURCE_MISC_TEXTURECUBE;
-
-            hr = pDevice->CreateTexture3D( &desc, initData.get(), reinterpret_cast<ID3D11Texture3D**>(ppResource) );
-        }
-        break;
-    }
-
-    return hr;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Create a shader resource view and associated texture
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT CreateShaderResourceView( ID3D11Device* pDevice, const Image* srcImages, size_t nimages, const TexMetadata& metadata,
-                                  ID3D11ShaderResourceView** ppSRV )
-{
-    return CreateShaderResourceViewEx( pDevice, srcImages, nimages, metadata,
-                                       D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0, false,
-                                       ppSRV );
-}
-
-_Use_decl_annotations_
-HRESULT CreateShaderResourceViewEx( ID3D11Device* pDevice, const Image* srcImages, size_t nimages, const TexMetadata& metadata,
-                                    D3D11_USAGE usage, unsigned int bindFlags, unsigned int cpuAccessFlags, unsigned int miscFlags, bool forceSRGB,
-                                    ID3D11ShaderResourceView** ppSRV )
-{
-    if ( !ppSRV )
-        return E_INVALIDARG;
-
-    *ppSRV = nullptr;
-
-    ComPtr<ID3D11Resource> resource;
-    HRESULT hr = CreateTextureEx( pDevice, srcImages, nimages, metadata,
-                                  usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
-                                  resource.GetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    assert( resource );
-
-    D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc;
-    memset( &SRVDesc, 0, sizeof(SRVDesc) );
-    if ( forceSRGB )
-        SRVDesc.Format = MakeSRGB( metadata.format );
-    else
-        SRVDesc.Format = metadata.format;
-
-    switch ( metadata.dimension )
-    {
-    case TEX_DIMENSION_TEXTURE1D:
-        if ( metadata.arraySize > 1 )
-        {
-            SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE1DARRAY;
-            SRVDesc.Texture1DArray.MipLevels = static_cast<UINT>( metadata.mipLevels );
-            SRVDesc.Texture1DArray.ArraySize = static_cast<UINT>( metadata.arraySize );
-        }
-        else
-        {
-            SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE1D;
-            SRVDesc.Texture1D.MipLevels = static_cast<UINT>( metadata.mipLevels );
-        }
-        break;
-
-    case TEX_DIMENSION_TEXTURE2D:
-        if ( metadata.IsCubemap() )
-        {
-            if (metadata.arraySize > 6)
-            {
-                assert( (metadata.arraySize % 6) == 0 );
-                SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURECUBEARRAY;
-                SRVDesc.TextureCubeArray.MipLevels = static_cast<UINT>( metadata.mipLevels );
-                SRVDesc.TextureCubeArray.NumCubes = static_cast<UINT>( metadata.arraySize / 6 );
-            }
-            else
-            {
-                SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURECUBE;
-                SRVDesc.TextureCube.MipLevels = static_cast<UINT>( metadata.mipLevels );
-            }
-        }
-        else if ( metadata.arraySize > 1 )
-        {
-            SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2DARRAY;
-            SRVDesc.Texture2DArray.MipLevels = static_cast<UINT>( metadata.mipLevels );
-            SRVDesc.Texture2DArray.ArraySize = static_cast<UINT>( metadata.arraySize );
-        }
-        else
-        {
-            SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2D;
-            SRVDesc.Texture2D.MipLevels = static_cast<UINT>( metadata.mipLevels );
-        }
-        break;
-
-    case TEX_DIMENSION_TEXTURE3D:
-        assert( metadata.arraySize == 1 );
-        SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE3D;
-        SRVDesc.Texture3D.MipLevels = static_cast<UINT>( metadata.mipLevels );
-        break;
-
-    default:
-        return E_FAIL;
-    }
-
-    hr = pDevice->CreateShaderResourceView( resource.Get(), &SRVDesc, ppSRV );
-    if ( FAILED(hr) )
-        return hr;
-
-    assert( *ppSRV );
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Save a texture resource to a DDS file in memory/on disk
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT CaptureTexture( ID3D11Device* pDevice, ID3D11DeviceContext* pContext, ID3D11Resource* pSource, ScratchImage& result )
-{
-    if ( !pDevice || !pContext || !pSource )
-        return E_INVALIDARG;
-
-    D3D11_RESOURCE_DIMENSION resType = D3D11_RESOURCE_DIMENSION_UNKNOWN;
-    pSource->GetType( &resType );
-
-    HRESULT hr;
-
-    switch( resType )
-    {
-    case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
-        {
-            ComPtr<ID3D11Texture1D> pTexture;
-            hr = pSource->QueryInterface( __uuidof(ID3D11Texture1D), reinterpret_cast<void**>( pTexture.GetAddressOf() ) );
-            if ( FAILED(hr) )
-                break;
-
-            assert( pTexture );
-
-            D3D11_TEXTURE1D_DESC desc;
-            pTexture->GetDesc( &desc );
-
-            desc.BindFlags = 0;
-            desc.MiscFlags = 0;
-            desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
-            desc.Usage = D3D11_USAGE_STAGING;
-
-            ComPtr<ID3D11Texture1D> pStaging;
-            hr = pDevice->CreateTexture1D( &desc, 0, pStaging.GetAddressOf() );
-            if ( FAILED(hr) )
-                break;
-
-            assert( pStaging );
-
-            pContext->CopyResource( pStaging.Get(), pSource );
-
-            TexMetadata mdata;
-            mdata.width = desc.Width;
-            mdata.height = mdata.depth = 1;
-            mdata.arraySize = desc.ArraySize;
-            mdata.mipLevels = desc.MipLevels;
-            mdata.miscFlags = 0;
-            mdata.miscFlags2 = 0;
-            mdata.format = desc.Format;
-            mdata.dimension = TEX_DIMENSION_TEXTURE1D;
-
-            hr = result.Initialize( mdata );
-            if ( FAILED(hr) )
-                break;
-
-            hr = _Capture( pContext, pStaging.Get(), mdata, result );
-        }
-        break;
-
-    case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
-        {
-            ComPtr<ID3D11Texture2D> pTexture;
-            hr = pSource->QueryInterface( __uuidof(ID3D11Texture2D), reinterpret_cast<void**>( pTexture.GetAddressOf() ) );
-            if ( FAILED(hr) )
-                break;
-
-            assert( pTexture );
-
-            D3D11_TEXTURE2D_DESC desc;
-            pTexture->GetDesc( &desc );
-
-            ComPtr<ID3D11Texture2D> pStaging;
-            if ( desc.SampleDesc.Count > 1 )
-            {
-                desc.SampleDesc.Count = 1;
-                desc.SampleDesc.Quality = 0;
-
-                ComPtr<ID3D11Texture2D> pTemp;
-                hr = pDevice->CreateTexture2D( &desc, 0, pTemp.GetAddressOf() );
-                if ( FAILED(hr) )
-                    break;
-
-                assert( pTemp );
-
-                DXGI_FORMAT fmt = desc.Format;
-                if ( IsTypeless(fmt) )
-                {
-                    // Assume a UNORM if it exists otherwise use FLOAT
-                    fmt = MakeTypelessUNORM( fmt );
-                    fmt = MakeTypelessFLOAT( fmt );
-                }
-
-                UINT support = 0;
-                hr = pDevice->CheckFormatSupport( fmt, &support );
-                if ( FAILED(hr) )
-                    break;
-
-                if ( !(support & D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE) )
-                {
-                    hr = E_FAIL;
-                    break;
-                }
-
-                for( UINT item = 0; item < desc.ArraySize; ++item )
-                {
-                    for( UINT level = 0; level < desc.MipLevels; ++level )
-                    {
-                        UINT index = D3D11CalcSubresource( level, item, desc.MipLevels );
-                        pContext->ResolveSubresource( pTemp.Get(), index, pSource, index, fmt );
-                    }
-                }
-
-                desc.BindFlags = 0;
-                desc.MiscFlags &= D3D11_RESOURCE_MISC_TEXTURECUBE;
-                desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
-                desc.Usage = D3D11_USAGE_STAGING;
-
-                hr = pDevice->CreateTexture2D( &desc, 0, pStaging.GetAddressOf() );
-                if ( FAILED(hr) )
-                    break;
-
-                assert( pStaging );
-
-                pContext->CopyResource( pStaging.Get(), pTemp.Get() );
-            }
-            else
-            {
-                desc.BindFlags = 0;
-                desc.MiscFlags &= D3D11_RESOURCE_MISC_TEXTURECUBE;
-                desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
-                desc.Usage = D3D11_USAGE_STAGING;
-
-                hr = pDevice->CreateTexture2D( &desc, 0, &pStaging );
-                if ( FAILED(hr) )
-                    break;
-
-                assert( pStaging );
-
-                pContext->CopyResource( pStaging.Get(), pSource );
-            }
-
-            TexMetadata mdata;
-            mdata.width = desc.Width;
-            mdata.height = desc.Height;
-            mdata.depth = 1;
-            mdata.arraySize = desc.ArraySize;
-            mdata.mipLevels = desc.MipLevels;
-            mdata.miscFlags = (desc.MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE) ? TEX_MISC_TEXTURECUBE : 0;
-            mdata.miscFlags2 = 0;
-            mdata.format = desc.Format;
-            mdata.dimension = TEX_DIMENSION_TEXTURE2D;
-
-            hr = result.Initialize( mdata );
-            if ( FAILED(hr) )
-                break;
-
-            hr = _Capture( pContext, pStaging.Get(), mdata, result );
-        }
-        break;
-
-    case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
-        {
-            ComPtr<ID3D11Texture3D> pTexture;
-            hr = pSource->QueryInterface( __uuidof(ID3D11Texture3D), reinterpret_cast<void**>( pTexture.GetAddressOf() ) );
-            if ( FAILED(hr) )
-                break;
-
-            assert( pTexture );
-
-            D3D11_TEXTURE3D_DESC desc;
-            pTexture->GetDesc( &desc );
-
-            desc.BindFlags = 0;
-            desc.MiscFlags = 0;
-            desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
-            desc.Usage = D3D11_USAGE_STAGING;
-
-            ComPtr<ID3D11Texture3D> pStaging;
-            hr = pDevice->CreateTexture3D( &desc, 0, pStaging.GetAddressOf() );
-            if ( FAILED(hr) )
-                break;
-
-            assert( pStaging );
-
-            pContext->CopyResource( pStaging.Get(), pSource );
-
-            TexMetadata mdata;
-            mdata.width = desc.Width;
-            mdata.height = desc.Height;
-            mdata.depth = desc.Depth;
-            mdata.arraySize = 1;
-            mdata.mipLevels = desc.MipLevels;
-            mdata.miscFlags = 0;
-            mdata.miscFlags2 = 0;
-            mdata.format = desc.Format;
-            mdata.dimension = TEX_DIMENSION_TEXTURE3D;
-
-            hr = result.Initialize( mdata );
-            if ( FAILED(hr) )
-                break;
-
-            hr = _Capture( pContext, pStaging.Get(), mdata, result );
-        }
-        break;
-
-    default:
-        hr = E_FAIL;
-        break;
-    }
-
-    if ( FAILED(hr) )
-    {
-        result.Release();
-        return hr;
-    }
-
-    return S_OK;
-}
-
-}; // namespace

File diff suppressed because it is too large
+ 0 - 2002
Exporters/FBX/3rdParty/DirectXTex/DirectXTexDDS.cpp


+ 0 - 331
Exporters/FBX/3rdParty/DirectXTex/DirectXTexFlipRotate.cpp

@@ -1,331 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexFlipRotate.cpp
-//  
-// DirectX Texture Library - Image flip/rotate operations
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-using Microsoft::WRL::ComPtr;
-
-namespace DirectX
-{
-
-//-------------------------------------------------------------------------------------
-// Do flip/rotate operation using WIC
-//-------------------------------------------------------------------------------------
-static HRESULT _PerformFlipRotateUsingWIC( _In_ const Image& srcImage, _In_ DWORD flags,
-                                           _In_ const WICPixelFormatGUID& pfGUID, _In_ const Image& destImage )
-{
-    if ( !srcImage.pixels || !destImage.pixels )
-        return E_POINTER;
-
-    assert( srcImage.format == destImage.format );
-
-    IWICImagingFactory* pWIC = _GetWIC();
-    if ( !pWIC )
-        return E_NOINTERFACE;
-
-    ComPtr<IWICBitmap> source;
-    HRESULT hr = pWIC->CreateBitmapFromMemory( static_cast<UINT>( srcImage.width ), static_cast<UINT>( srcImage.height ), pfGUID,
-                                               static_cast<UINT>( srcImage.rowPitch ), static_cast<UINT>( srcImage.slicePitch ),
-                                               srcImage.pixels, source.GetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    ComPtr<IWICBitmapFlipRotator> FR;
-    hr = pWIC->CreateBitmapFlipRotator( FR.GetAddressOf() );
-    if ( FAILED(hr) )
-        return hr;
-
-    hr = FR->Initialize( source.Get(), static_cast<WICBitmapTransformOptions>( flags ) );
-    if ( FAILED(hr) )
-        return hr;
-
-    WICPixelFormatGUID pfFR;
-    hr = FR->GetPixelFormat( &pfFR );
-    if ( FAILED(hr) )
-        return hr;
-
-    if ( memcmp( &pfFR, &pfGUID, sizeof(GUID) ) != 0 )
-    {
-        // Flip/rotate should return the same format as the source...
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    UINT nwidth, nheight;
-    hr = FR->GetSize( &nwidth, &nheight );
-    if ( FAILED(hr) )
-        return hr;
-
-    if ( destImage.width != nwidth || destImage.height != nheight )
-        return E_FAIL;
-
-    hr = FR->CopyPixels( 0, static_cast<UINT>( destImage.rowPitch ), static_cast<UINT>( destImage.slicePitch ), destImage.pixels );
-    if ( FAILED(hr) )
-        return hr;
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Do conversion, flip/rotate using WIC, conversion cycle
-//-------------------------------------------------------------------------------------
-static HRESULT _PerformFlipRotateViaF32( _In_ const Image& srcImage, _In_ DWORD flags, _In_ const Image& destImage )
-{
-    if ( !srcImage.pixels || !destImage.pixels )
-        return E_POINTER;
-
-    assert( srcImage.format != DXGI_FORMAT_R32G32B32A32_FLOAT );
-    assert( srcImage.format == destImage.format );
-
-    ScratchImage temp;
-    HRESULT hr = _ConvertToR32G32B32A32( srcImage, temp );
-    if ( FAILED(hr) )
-        return hr;
-
-    const Image *tsrc = temp.GetImage( 0, 0, 0 );
-    if ( !tsrc )
-        return E_POINTER;
-
-    ScratchImage rtemp;
-    hr = rtemp.Initialize2D( DXGI_FORMAT_R32G32B32A32_FLOAT, destImage.width, destImage.height, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-
-    const Image *tdest = rtemp.GetImage( 0, 0, 0 );
-    if ( !tdest )
-        return E_POINTER;
-
-    hr = _PerformFlipRotateUsingWIC( *tsrc, flags, GUID_WICPixelFormat128bppRGBAFloat, *tdest );
-    if ( FAILED(hr) )
-        return hr;
-
-    temp.Release();
-
-    hr = _ConvertFromR32G32B32A32( *tdest, destImage );
-    if ( FAILED(hr) )
-        return hr;
-
-    return S_OK;
-}
-
-
-//=====================================================================================
-// Entry-points
-//=====================================================================================
-
-//-------------------------------------------------------------------------------------
-// Flip/rotate image
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT FlipRotate( const Image& srcImage, DWORD flags, ScratchImage& image )
-{
-    if ( !srcImage.pixels )
-        return E_POINTER;
-
-    if ( !flags )
-        return E_INVALIDARG;
-
-#ifdef _M_X64
-    if ( (srcImage.width > 0xFFFFFFFF) || (srcImage.height > 0xFFFFFFFF) )
-        return E_INVALIDARG;
-#endif
-
-    if ( IsCompressed( srcImage.format ) )
-    {
-        // We don't support flip/rotate operations on compressed images
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    static_assert( TEX_FR_ROTATE0 == WICBitmapTransformRotate0, "TEX_FR_ROTATE0 no longer matches WIC" );
-    static_assert( TEX_FR_ROTATE90 == WICBitmapTransformRotate90, "TEX_FR_ROTATE90 no longer matches WIC" );
-    static_assert( TEX_FR_ROTATE180 == WICBitmapTransformRotate180, "TEX_FR_ROTATE180 no longer matches WIC" );
-    static_assert( TEX_FR_ROTATE270 == WICBitmapTransformRotate270, "TEX_FR_ROTATE270 no longer matches WIC" );
-    static_assert( TEX_FR_FLIP_HORIZONTAL == WICBitmapTransformFlipHorizontal, "TEX_FR_FLIP_HORIZONTAL no longer matches WIC" );
-    static_assert( TEX_FR_FLIP_VERTICAL == WICBitmapTransformFlipVertical, "TEX_FR_FLIP_VERTICAL no longer matches WIC" );
-
-    // Only supports 90, 180, 270, or no rotation flags... not a combination of rotation flags
-    switch ( flags & (TEX_FR_ROTATE90|TEX_FR_ROTATE180|TEX_FR_ROTATE270) )
-    {
-    case 0:
-    case TEX_FR_ROTATE90:
-    case TEX_FR_ROTATE180:
-    case TEX_FR_ROTATE270:
-        break;
-
-    default:
-        return E_INVALIDARG;
-    }
-
-    size_t nwidth = srcImage.width;
-    size_t nheight = srcImage.height;
-
-    if (flags & (TEX_FR_ROTATE90|TEX_FR_ROTATE270))
-    {
-        nwidth = srcImage.height;
-        nheight = srcImage.width;
-    }
-
-    HRESULT hr = image.Initialize2D( srcImage.format, nwidth, nheight, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-   
-    const Image *rimage = image.GetImage( 0, 0, 0 );
-    if ( !rimage )
-        return E_POINTER;
-
-    WICPixelFormatGUID pfGUID;
-    if ( _DXGIToWIC( srcImage.format, pfGUID ) )
-    {
-        // Case 1: Source format is supported by Windows Imaging Component
-        hr = _PerformFlipRotateUsingWIC( srcImage, flags, pfGUID, *rimage );
-    }
-    else
-    {
-        // Case 2: Source format is not supported by WIC, so we have to convert, flip/rotate, and convert back
-        hr = _PerformFlipRotateViaF32( srcImage, flags, *rimage );
-    }
-
-    if ( FAILED(hr) )
-    {
-        image.Release();
-        return hr;
-    }
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Flip/rotate image (complex)
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT FlipRotate( const Image* srcImages, size_t nimages, const TexMetadata& metadata,
-                    DWORD flags, ScratchImage& result )
-{
-    if ( !srcImages || !nimages )
-        return E_INVALIDARG;
-
-    if ( IsCompressed( metadata.format ) )
-    {
-        // We don't support flip/rotate operations on compressed images
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    static_assert( TEX_FR_ROTATE0 == WICBitmapTransformRotate0, "TEX_FR_ROTATE0 no longer matches WIC" );
-    static_assert( TEX_FR_ROTATE90 == WICBitmapTransformRotate90, "TEX_FR_ROTATE90 no longer matches WIC" );
-    static_assert( TEX_FR_ROTATE180 == WICBitmapTransformRotate180, "TEX_FR_ROTATE180 no longer matches WIC" );
-    static_assert( TEX_FR_ROTATE270 == WICBitmapTransformRotate270, "TEX_FR_ROTATE270 no longer matches WIC" );
-    static_assert( TEX_FR_FLIP_HORIZONTAL == WICBitmapTransformFlipHorizontal, "TEX_FR_FLIP_HORIZONTAL no longer matches WIC" );
-    static_assert( TEX_FR_FLIP_VERTICAL == WICBitmapTransformFlipVertical, "TEX_FR_FLIP_VERTICAL no longer matches WIC" );
-
-    // Only supports 90, 180, 270, or no rotation flags... not a combination of rotation flags
-    switch ( flags & (TEX_FR_ROTATE90|TEX_FR_ROTATE180|TEX_FR_ROTATE270) )
-    {
-    case 0:
-    case TEX_FR_ROTATE90:
-    case TEX_FR_ROTATE180:
-    case TEX_FR_ROTATE270:
-        break;
-
-    default:
-        return E_INVALIDARG;
-    }
-
-    TexMetadata mdata2 = metadata;
-
-    bool flipwh = false;
-    if (flags & (TEX_FR_ROTATE90|TEX_FR_ROTATE270))
-    {
-        flipwh = true;
-        mdata2.width = metadata.height;
-        mdata2.height = metadata.width;
-    }
-
-    HRESULT hr = result.Initialize( mdata2 );
-    if ( FAILED(hr) )
-        return hr;
-
-    if ( nimages != result.GetImageCount() )
-    {
-        result.Release();
-        return E_FAIL;
-    }
-
-    const Image* dest = result.GetImages();
-    if ( !dest )
-    {
-        result.Release();
-        return E_POINTER;
-    }
-
-    WICPixelFormatGUID pfGUID;
-    bool wicpf = _DXGIToWIC( metadata.format, pfGUID );
-
-    for( size_t index=0; index < nimages; ++index )
-    {
-        const Image& src = srcImages[ index ];
-        if ( src.format != metadata.format )
-        {
-            result.Release();
-            return E_FAIL;
-        }
-
-#ifdef _M_X64
-        if ( (src.width > 0xFFFFFFFF) || (src.height > 0xFFFFFFFF) )
-            return E_FAIL;
-#endif
-
-        const Image& dst = dest[ index ];
-        assert( dst.format == metadata.format );
-
-        if ( flipwh )
-        {
-            if ( src.width != dst.height || src.height != dst.width )
-            {
-                result.Release();
-                return E_FAIL;
-            }
-        }
-        else
-        {
-            if ( src.width != dst.width || src.height != dst.height )
-            {
-                result.Release();
-                return E_FAIL;
-            }
-        }
-
-        if (wicpf)
-        {
-            // Case 1: Source format is supported by Windows Imaging Component
-            hr = _PerformFlipRotateUsingWIC( src, flags, pfGUID, dst );
-        }
-        else
-        {
-            // Case 2: Source format is not supported by WIC, so we have to convert, flip/rotate, and convert back
-            hr = _PerformFlipRotateViaF32( src, flags, dst );
-        }
-
-        if ( FAILED(hr) )
-        {
-            result.Release();
-            return hr;
-        }
-    }
-
-    return S_OK;
-}
-
-}; // namespace

+ 0 - 821
Exporters/FBX/3rdParty/DirectXTex/DirectXTexImage.cpp

@@ -1,821 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexImage.cpp
-//  
-// DirectX Texture Library - Image container
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-namespace DirectX
-{
-
-extern bool _CalculateMipLevels( _In_ size_t width, _In_ size_t height, _Inout_ size_t& mipLevels );
-extern bool _CalculateMipLevels3D( _In_ size_t width, _In_ size_t height, _In_ size_t depth, _Inout_ size_t& mipLevels );
-extern bool _IsAlphaAllOpaqueBC( _In_ const Image& cImage );
-
-//-------------------------------------------------------------------------------------
-// Determines number of image array entries and pixel size
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-void _DetermineImageArray( const TexMetadata& metadata, DWORD cpFlags,
-                           size_t& nImages, size_t& pixelSize )
-{
-    assert( metadata.width > 0 && metadata.height > 0 && metadata.depth > 0 );
-    assert( metadata.arraySize > 0 );
-    assert( metadata.mipLevels > 0 );
-
-    size_t _pixelSize = 0;
-    size_t _nimages = 0;
-
-    switch( metadata.dimension )
-    {
-    case TEX_DIMENSION_TEXTURE1D:
-    case TEX_DIMENSION_TEXTURE2D:
-        for( size_t item = 0; item < metadata.arraySize; ++item )
-        {
-            size_t w = metadata.width;
-            size_t h = metadata.height;
-
-            for( size_t level=0; level < metadata.mipLevels; ++level )
-            {
-                size_t rowPitch, slicePitch;
-                ComputePitch( metadata.format, w, h, rowPitch, slicePitch, cpFlags );
-
-                _pixelSize += slicePitch;
-                ++_nimages;
-
-                if ( h > 1 )
-                    h >>= 1;
-
-                if ( w > 1 )
-                    w >>= 1;
-            }
-        }
-        break;
-
-    case TEX_DIMENSION_TEXTURE3D:
-        {
-            size_t w = metadata.width;
-            size_t h = metadata.height;
-            size_t d = metadata.depth;
-
-            for( size_t level=0; level < metadata.mipLevels; ++level )
-            {
-                size_t rowPitch, slicePitch;
-                ComputePitch( metadata.format, w, h, rowPitch, slicePitch, cpFlags );
-
-                for( size_t slice=0; slice < d; ++slice )
-                {
-                    _pixelSize += slicePitch;
-                    ++_nimages;
-                }
-
-                if ( h > 1 )
-                    h >>= 1;
-
-                if ( w > 1 )
-                    w >>= 1;
-
-                if ( d > 1 )
-                    d >>= 1;
-            }
-        }
-        break;
-
-    default:
-        assert( false );
-        break;
-    }
-
-    nImages = _nimages;
-    pixelSize = _pixelSize;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Fills in the image array entries
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-bool _SetupImageArray( uint8_t *pMemory, size_t pixelSize,
-                       const TexMetadata& metadata, DWORD cpFlags,
-                       Image* images, size_t nImages )
-{
-    assert( pMemory );
-    assert( pixelSize > 0 );
-    assert( nImages > 0 );
-
-    if ( !images )
-        return false;
-
-    size_t index = 0;
-    uint8_t* pixels = pMemory;
-    const uint8_t* pEndBits = pMemory + pixelSize;
-
-    switch( metadata.dimension )
-    {
-    case TEX_DIMENSION_TEXTURE1D:
-    case TEX_DIMENSION_TEXTURE2D:
-        if (metadata.arraySize == 0 || metadata.mipLevels == 0)
-        {
-            return false;
-        }
-
-        for( size_t item = 0; item < metadata.arraySize; ++item )
-        {
-            size_t w = metadata.width;
-            size_t h = metadata.height;
-
-            for( size_t level=0; level < metadata.mipLevels; ++level )
-            {
-                if ( index >= nImages )
-                {
-                    return false;
-                }
-
-                size_t rowPitch, slicePitch;
-                ComputePitch( metadata.format, w, h, rowPitch, slicePitch, cpFlags );
-
-                images[index].width = w;
-                images[index].height = h;
-                images[index].format = metadata.format;
-                images[index].rowPitch = rowPitch;
-                images[index].slicePitch = slicePitch;
-                images[index].pixels = pixels;
-                ++index;
-
-                pixels += slicePitch;
-                if ( pixels > pEndBits )
-                {
-                    return false;
-                }
-            
-                if ( h > 1 )
-                    h >>= 1;
-
-                if ( w > 1 )
-                    w >>= 1;
-            }
-        }
-        return true;
-
-    case TEX_DIMENSION_TEXTURE3D:
-        {
-            if (metadata.mipLevels == 0 || metadata.depth == 0)
-            {
-                return false;
-            }
-
-            size_t w = metadata.width;
-            size_t h = metadata.height;
-            size_t d = metadata.depth;
-
-            for( size_t level=0; level < metadata.mipLevels; ++level )
-            {
-                size_t rowPitch, slicePitch;
-                ComputePitch( metadata.format, w, h, rowPitch, slicePitch, cpFlags );
-
-                for( size_t slice=0; slice < d; ++slice )
-                {
-                    if ( index >= nImages )
-                    {
-                        return false;
-                    }
-
-                    // We use the same memory organization that Direct3D 11 needs for D3D11_SUBRESOURCE_DATA
-                    // with all slices of a given miplevel being continuous in memory
-                    images[index].width = w;
-                    images[index].height = h;
-                    images[index].format = metadata.format;
-                    images[index].rowPitch = rowPitch;
-                    images[index].slicePitch = slicePitch;
-                    images[index].pixels = pixels;
-                    ++index;
-
-                    pixels += slicePitch;
-                    if ( pixels > pEndBits )
-                    {
-                        return false;
-                    }
-                }
-            
-                if ( h > 1 )
-                    h >>= 1;
-
-                if ( w > 1 )
-                    w >>= 1;
-
-                if ( d > 1 )
-                    d >>= 1;
-            }
-        }
-        return true;
-
-    default:
-        return false;
-    }
-}
-
-
-//=====================================================================================
-// ScratchImage - Bitmap image container
-//=====================================================================================
-
-ScratchImage& ScratchImage::operator= (ScratchImage&& moveFrom)
-{
-    if ( this != &moveFrom )
-    {
-        Release();
-
-        _nimages = moveFrom._nimages;
-        _size = moveFrom._size;
-        _metadata = moveFrom._metadata;
-        _image = moveFrom._image;
-        _memory = moveFrom._memory;
-
-        moveFrom._nimages = 0;
-        moveFrom._size = 0;
-        moveFrom._image = nullptr;
-        moveFrom._memory = nullptr;
-    }
-    return *this;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Methods
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT ScratchImage::Initialize( const TexMetadata& mdata, DWORD flags )
-{
-    if ( !IsValid(mdata.format) )
-        return E_INVALIDARG;
-
-    if ( IsPalettized(mdata.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    size_t mipLevels = mdata.mipLevels;
-
-    switch( mdata.dimension )
-    {
-    case TEX_DIMENSION_TEXTURE1D:
-        if ( !mdata.width || mdata.height != 1 || mdata.depth != 1 || !mdata.arraySize )
-            return E_INVALIDARG;
-
-        if ( IsVideo(mdata.format) )
-            return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-        if ( !_CalculateMipLevels(mdata.width,1,mipLevels) )
-            return E_INVALIDARG;
-        break;
-
-    case TEX_DIMENSION_TEXTURE2D:
-        if ( !mdata.width || !mdata.height || mdata.depth != 1 || !mdata.arraySize )
-            return E_INVALIDARG;
-
-        if ( mdata.IsCubemap() )
-        {
-            if ( (mdata.arraySize % 6) != 0 )
-                return E_INVALIDARG;
-
-            if ( IsVideo(mdata.format) )
-                return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-        }
-
-        if ( !_CalculateMipLevels(mdata.width,mdata.height,mipLevels) )
-            return E_INVALIDARG;
-        break;
-
-    case TEX_DIMENSION_TEXTURE3D:
-        if ( !mdata.width || !mdata.height || !mdata.depth || mdata.arraySize != 1 )
-            return E_INVALIDARG;
-        
-        if ( IsVideo(mdata.format) || IsPlanar(mdata.format) || IsDepthStencil(mdata.format) )
-            return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-        if ( !_CalculateMipLevels3D(mdata.width,mdata.height,mdata.depth,mipLevels) )
-            return E_INVALIDARG;
-        break;
-
-    default:
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    Release();
-
-    _metadata.width = mdata.width;
-    _metadata.height = mdata.height;
-    _metadata.depth = mdata.depth;
-    _metadata.arraySize = mdata.arraySize;
-    _metadata.mipLevels = mipLevels;
-    _metadata.miscFlags = mdata.miscFlags;
-    _metadata.miscFlags2 = mdata.miscFlags2;
-    _metadata.format = mdata.format;
-    _metadata.dimension = mdata.dimension;
-
-    size_t pixelSize, nimages;
-    _DetermineImageArray( _metadata, flags, nimages, pixelSize );
-
-    _image = new (std::nothrow) Image[ nimages ];
-    if ( !_image )
-        return E_OUTOFMEMORY;
-
-    _nimages = nimages;
-    memset( _image, 0, sizeof(Image) * nimages );
-
-    _memory = reinterpret_cast<uint8_t*>( _aligned_malloc( pixelSize, 16 ) );
-    if ( !_memory )
-    {
-        Release();
-        return E_OUTOFMEMORY;
-    }
-    _size = pixelSize;
-    if ( !_SetupImageArray( _memory, pixelSize, _metadata, flags, _image, nimages ) )
-    {
-        Release();
-        return E_FAIL;
-    }
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ScratchImage::Initialize1D( DXGI_FORMAT fmt, size_t length, size_t arraySize, size_t mipLevels, DWORD flags )
-{
-    if ( !length || !arraySize )
-        return E_INVALIDARG;
-
-    if ( IsVideo(fmt) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    // 1D is a special case of the 2D case
-    HRESULT hr = Initialize2D( fmt, length, 1, arraySize, mipLevels, flags );
-    if ( FAILED(hr) )
-        return hr;
-
-    _metadata.dimension = TEX_DIMENSION_TEXTURE1D;
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ScratchImage::Initialize2D( DXGI_FORMAT fmt, size_t width, size_t height, size_t arraySize, size_t mipLevels, DWORD flags )
-{
-    if ( !IsValid(fmt) || !width || !height || !arraySize )
-        return E_INVALIDARG;
-
-    if ( IsPalettized(fmt) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    if ( !_CalculateMipLevels(width,height,mipLevels) )
-        return E_INVALIDARG;
-
-    Release();
-
-    _metadata.width = width;
-    _metadata.height = height;
-    _metadata.depth = 1;
-    _metadata.arraySize = arraySize;
-    _metadata.mipLevels = mipLevels;
-    _metadata.miscFlags = 0;
-    _metadata.miscFlags2 = 0;
-    _metadata.format = fmt;
-    _metadata.dimension = TEX_DIMENSION_TEXTURE2D;
-
-    size_t pixelSize, nimages;
-    _DetermineImageArray( _metadata, flags, nimages, pixelSize );
-
-    _image = new (std::nothrow) Image[ nimages ];
-    if ( !_image )
-        return E_OUTOFMEMORY;
-
-    _nimages = nimages;
-    memset( _image, 0, sizeof(Image) * nimages );
-
-    _memory = reinterpret_cast<uint8_t*>( _aligned_malloc( pixelSize, 16 ) );
-    if ( !_memory )
-    {
-        Release();
-        return E_OUTOFMEMORY;
-    }
-    _size = pixelSize;
-    if ( !_SetupImageArray( _memory, pixelSize, _metadata, flags, _image, nimages ) )
-    {
-        Release();
-        return E_FAIL;
-    }
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ScratchImage::Initialize3D( DXGI_FORMAT fmt, size_t width, size_t height, size_t depth, size_t mipLevels, DWORD flags )
-{
-    if ( !IsValid(fmt) || !width || !height || !depth )
-        return E_INVALIDARG;
-
-    if ( IsVideo(fmt) || IsPlanar(fmt) || IsDepthStencil(fmt) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    if ( !_CalculateMipLevels3D(width,height,depth,mipLevels) )
-        return E_INVALIDARG;
-
-    Release();
-
-    _metadata.width = width;
-    _metadata.height = height;
-    _metadata.depth = depth;
-    _metadata.arraySize = 1;    // Direct3D 10.x/11 does not support arrays of 3D textures
-    _metadata.mipLevels = mipLevels;
-    _metadata.miscFlags = 0;
-    _metadata.miscFlags2 = 0;
-    _metadata.format = fmt;
-    _metadata.dimension = TEX_DIMENSION_TEXTURE3D;
-
-    size_t pixelSize, nimages;
-    _DetermineImageArray( _metadata, flags, nimages, pixelSize );
-
-    _image = new (std::nothrow) Image[ nimages ];
-    if ( !_image )
-    {
-        Release();
-        return E_OUTOFMEMORY;
-    }
-    _nimages = nimages;
-    memset( _image, 0, sizeof(Image) * nimages );
-
-    _memory = reinterpret_cast<uint8_t*>( _aligned_malloc( pixelSize, 16 ) );
-    if ( !_memory )
-    {
-        Release();
-        return E_OUTOFMEMORY;
-    }
-    _size = pixelSize;
-
-    if ( !_SetupImageArray( _memory, pixelSize, _metadata, flags, _image, nimages ) )
-    {
-        Release();
-        return E_FAIL;
-    }
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ScratchImage::InitializeCube( DXGI_FORMAT fmt, size_t width, size_t height, size_t nCubes, size_t mipLevels, DWORD flags )
-{
-    if ( !width || !height || !nCubes )
-        return E_INVALIDARG;
-
-    if ( IsVideo(fmt) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    
-    // A DirectX11 cubemap is just a 2D texture array that is a multiple of 6 for each cube
-    HRESULT hr = Initialize2D( fmt, width, height, nCubes * 6, mipLevels, flags );
-    if ( FAILED(hr) )
-        return hr;
-
-    _metadata.miscFlags |= TEX_MISC_TEXTURECUBE;
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ScratchImage::InitializeFromImage( const Image& srcImage, bool allow1D, DWORD flags )
-{
-    HRESULT hr = ( srcImage.height > 1 || !allow1D )
-                 ? Initialize2D( srcImage.format, srcImage.width, srcImage.height, 1, 1, flags )
-                 : Initialize1D( srcImage.format, srcImage.width, 1, 1, flags );
-
-    if ( FAILED(hr) )
-        return hr;
-
-    size_t rowCount = ComputeScanlines( srcImage.format, srcImage.height );
-    if ( !rowCount )
-        return E_UNEXPECTED;
-
-    const uint8_t* sptr = reinterpret_cast<const uint8_t*>( srcImage.pixels );
-    if ( !sptr )
-        return E_POINTER;
-
-    auto dptr = reinterpret_cast<uint8_t*>( _image[0].pixels );
-    if ( !dptr )
-        return E_POINTER;
-
-    size_t spitch = srcImage.rowPitch;
-    size_t dpitch = _image[0].rowPitch;
-
-    size_t size = std::min<size_t>( dpitch, spitch );
-
-    for( size_t y = 0; y < rowCount; ++y )
-    {
-        memcpy_s( dptr, dpitch, sptr, size );
-        sptr += spitch;
-        dptr += dpitch;
-    }
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ScratchImage::InitializeArrayFromImages( const Image* images, size_t nImages, bool allow1D, DWORD flags )
-{
-    if ( !images || !nImages )
-        return E_INVALIDARG;
-
-    DXGI_FORMAT format = images[0].format;
-    size_t width = images[0].width;
-    size_t height = images[0].height;
-
-    for( size_t index=0; index < nImages; ++index )
-    {
-        if ( !images[index].pixels )
-            return E_POINTER;
-
-        if ( images[index].format != format || images[index].width != width || images[index].height != height )
-        {
-            // All images must be the same format, width, and height
-            return E_FAIL;
-        }
-    }
-
-    HRESULT hr = ( height > 1 || !allow1D )
-                 ? Initialize2D( format, width, height, nImages, 1, flags )
-                 : Initialize1D( format, width, nImages, 1, flags );
-
-    if ( FAILED(hr) )
-        return hr;
-
-    size_t rowCount = ComputeScanlines( format, height );
-    if ( !rowCount )
-        return E_UNEXPECTED;
-
-    for( size_t index=0; index < nImages; ++index )
-    {
-        auto sptr = reinterpret_cast<const uint8_t*>( images[index].pixels );
-        if ( !sptr )
-            return E_POINTER;
-
-        assert( index < _nimages );
-        auto dptr = reinterpret_cast<uint8_t*>( _image[index].pixels );
-        if ( !dptr )
-            return E_POINTER;
-
-        size_t spitch = images[index].rowPitch;
-        size_t dpitch = _image[index].rowPitch;
-
-        size_t size = std::min<size_t>( dpitch, spitch );
-
-        for( size_t y = 0; y < rowCount; ++y )
-        {
-            memcpy_s( dptr, dpitch, sptr, size );
-            sptr += spitch;
-            dptr += dpitch;
-        }
-    }
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ScratchImage::InitializeCubeFromImages( const Image* images, size_t nImages, DWORD flags )
-{
-    if ( !images || !nImages )
-        return E_INVALIDARG;
-
-    // A DirectX11 cubemap is just a 2D texture array that is a multiple of 6 for each cube
-    if ( ( nImages % 6 ) != 0 )
-        return E_INVALIDARG;
-
-    if ( IsVideo(images[0].format) || IsPalettized(images[0].format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    HRESULT hr = InitializeArrayFromImages( images, nImages, false, flags );
-    if ( FAILED(hr) )
-        return hr;
-
-    _metadata.miscFlags |= TEX_MISC_TEXTURECUBE;
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ScratchImage::Initialize3DFromImages( const Image* images, size_t depth, DWORD flags )
-{
-    if ( !images || !depth )
-        return E_INVALIDARG;
-
-    DXGI_FORMAT format = images[0].format;
-    size_t width = images[0].width;
-    size_t height = images[0].height;
-
-    for( size_t slice=0; slice < depth; ++slice )
-    {
-        if ( !images[slice].pixels )
-            return E_POINTER;
-
-        if ( images[slice].format != format || images[slice].width != width || images[slice].height != height )
-        {
-            // All images must be the same format, width, and height
-            return E_FAIL;
-        }
-    }
-
-    HRESULT hr = Initialize3D( format, width, height, depth, 1, flags );
-    if ( FAILED(hr) )
-        return hr;
-
-    size_t rowCount = ComputeScanlines( format, height );
-    if ( !rowCount )
-        return E_UNEXPECTED;
-
-    for( size_t slice=0; slice < depth; ++slice )
-    {
-        auto sptr = reinterpret_cast<const uint8_t*>( images[slice].pixels );
-        if ( !sptr )
-            return E_POINTER;
-
-        assert( slice < _nimages );
-        auto dptr = reinterpret_cast<uint8_t*>( _image[slice].pixels );
-        if ( !dptr )
-            return E_POINTER;
-
-        size_t spitch = images[slice].rowPitch;
-        size_t dpitch = _image[slice].rowPitch;
-
-        size_t size = std::min<size_t>( dpitch, spitch );
-
-        for( size_t y = 0; y < rowCount; ++y )
-        {
-            memcpy_s( dptr, dpitch, sptr, size );
-            sptr += spitch;
-            dptr += dpitch;
-        }
-    }
-
-    return S_OK;
-}
-
-void ScratchImage::Release()
-{
-    _nimages = 0;
-    _size = 0;
-
-    if ( _image )
-    {
-        delete [] _image;
-        _image = 0;
-    }
-
-    if ( _memory )
-    {
-        _aligned_free( _memory );
-        _memory = 0;
-    }
-    
-    memset(&_metadata, 0, sizeof(_metadata));
-}
-
-_Use_decl_annotations_
-bool ScratchImage::OverrideFormat( DXGI_FORMAT f )
-{
-    if ( !_image )
-        return false;
-
-    if ( !IsValid( f ) || IsPlanar( f ) || IsPalettized( f ) )
-        return false;
-
-    if ( ( BitsPerPixel( f ) != BitsPerPixel( _metadata.format ) )
-         || ( IsCompressed( f ) != IsCompressed( _metadata.format ) )
-         || ( IsPacked( f ) != IsPacked( _metadata.format ) )
-         || ( IsVideo( f ) != IsVideo( _metadata.format ) ) )
-    {
-         // Can't change the effective pitch of the format this way
-         return false;
-    }
-
-    for( size_t index = 0; index < _nimages; ++index )
-    {
-        _image[ index ].format = f;
-    }
-
-    _metadata.format = f;
-
-    return true;
-}
-
-_Use_decl_annotations_
-const Image* ScratchImage::GetImage(size_t mip, size_t item, size_t slice) const
-{
-    if ( mip >= _metadata.mipLevels )
-        return nullptr;
-
-    size_t index = 0;
-
-    switch( _metadata.dimension )
-    {
-    case TEX_DIMENSION_TEXTURE1D:
-    case TEX_DIMENSION_TEXTURE2D:
-        if ( slice > 0 )
-            return nullptr;
-
-        if ( item >= _metadata.arraySize )
-            return nullptr;
-
-        index = item*( _metadata.mipLevels ) + mip;
-        break;
-
-    case TEX_DIMENSION_TEXTURE3D:
-        if ( item > 0 )
-        {
-            // No support for arrays of volumes
-            return nullptr;
-        }
-        else
-        {
-            size_t d = _metadata.depth;
-
-            for( size_t level = 0; level < mip; ++level )
-            {
-                index += d;
-                if ( d > 1 )
-                    d >>= 1;
-            }
-
-            if ( slice >= d )
-                return nullptr;
-
-            index += slice;
-        }
-        break;
-
-    default:
-        return nullptr;
-    }
- 
-    return &_image[index];
-}
-
-bool ScratchImage::IsAlphaAllOpaque() const
-{
-    if ( !_image )
-        return false;
-
-    if ( !HasAlpha( _metadata.format ) )
-        return true;
-
-    if ( IsCompressed( _metadata.format ) )
-    {
-        for( size_t index = 0; index < _nimages; ++index )
-        {
-            if ( !_IsAlphaAllOpaqueBC( _image[ index ] ) )
-                return false;
-        }
-    }
-    else
-    {
-        ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast<XMVECTOR*>( _aligned_malloc( (sizeof(XMVECTOR)*_metadata.width), 16 ) ) );
-        if ( !scanline )
-            return false;
-
-        static const XMVECTORF32 threshold = { 0.99f, 0.99f, 0.99f, 0.99f };
-
-        for( size_t index = 0; index < _nimages; ++index )
-        {
-#pragma warning( suppress : 6011 )
-            const Image& img = _image[ index ];
-
-            const uint8_t *pPixels = img.pixels;
-            assert( pPixels );
-
-            for( size_t h = 0; h < img.height; ++h )
-            {
-                if ( !_LoadScanline( scanline.get(), img.width, pPixels, img.rowPitch, img.format ) )
-                    return false;
-
-                XMVECTOR* ptr = scanline.get();
-                for( size_t w = 0; w < img.width; ++w )
-                {
-                    XMVECTOR alpha = XMVectorSplatW( *ptr );
-                    if ( XMVector4Less( alpha, threshold ) )
-                        return false;
-                    ++ptr;
-                }
-
-                pPixels += img.rowPitch;
-            }
-        }
-    }
-
-    return true;
-}
-
-}; // namespace

File diff suppressed because it is too large
+ 0 - 3051
Exporters/FBX/3rdParty/DirectXTex/DirectXTexMipmaps.cpp


+ 0 - 354
Exporters/FBX/3rdParty/DirectXTex/DirectXTexMisc.cpp

@@ -1,354 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexMisc.cpp
-//  
-// DirectX Texture Library - Misc image operations
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-namespace DirectX
-{
-static const XMVECTORF32 g_Gamma22 = { 2.2f, 2.2f, 2.2f, 1.f };
-
-//-------------------------------------------------------------------------------------
-static HRESULT _ComputeMSE( _In_ const Image& image1, _In_ const Image& image2,
-                            _Out_ float& mse, _Out_writes_opt_(4) float* mseV,
-                            _In_ DWORD flags )
-{
-    if ( !image1.pixels || !image2.pixels )
-        return E_POINTER;
-
-    assert( image1.width == image2.width && image1.height == image2.height );
-    assert( !IsCompressed( image1.format ) && !IsCompressed( image2.format )  );
-
-    const size_t width = image1.width;
-
-    ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast<XMVECTOR*>( _aligned_malloc( (sizeof(XMVECTOR)*width)*2, 16 ) ) );
-    if ( !scanline )
-        return E_OUTOFMEMORY;
-
-    // Flags implied from image formats
-    switch( image1.format )
-    {
-    case DXGI_FORMAT_B8G8R8X8_UNORM:
-        flags |= CMSE_IGNORE_ALPHA;
-        break;
-
-    case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
-        flags |= CMSE_IMAGE1_SRGB | CMSE_IGNORE_ALPHA;
-        break;
-
-    case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
-    case DXGI_FORMAT_BC1_UNORM_SRGB:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:
-    case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-        flags |= CMSE_IMAGE1_SRGB;
-        break;
-    }
-
-    switch( image2.format )
-    {
-    case DXGI_FORMAT_B8G8R8X8_UNORM:
-        flags |= CMSE_IGNORE_ALPHA;
-        break;
-
-    case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
-        flags |= CMSE_IMAGE2_SRGB | CMSE_IGNORE_ALPHA;
-        break;
-
-    case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
-    case DXGI_FORMAT_BC1_UNORM_SRGB:
-    case DXGI_FORMAT_BC2_UNORM_SRGB:
-    case DXGI_FORMAT_BC3_UNORM_SRGB:
-    case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
-    case DXGI_FORMAT_BC7_UNORM_SRGB:
-        flags |= CMSE_IMAGE2_SRGB;
-        break;
-    }
-
-    const uint8_t *pSrc1 = image1.pixels;
-    const size_t rowPitch1 = image1.rowPitch;
-
-    const uint8_t *pSrc2 = image2.pixels;
-    const size_t rowPitch2 = image2.rowPitch;
-
-    XMVECTOR acc = g_XMZero;
-    static XMVECTORF32 two = { 2.0f, 2.0f, 2.0f, 2.0f };
-
-    for( size_t h = 0; h < image1.height; ++h )
-    {
-        XMVECTOR* ptr1 = scanline.get();
-        if ( !_LoadScanline( ptr1, width, pSrc1, rowPitch1, image1.format ) )
-            return E_FAIL;
-
-        XMVECTOR* ptr2 = scanline.get() + width;
-        if ( !_LoadScanline( ptr2, width, pSrc2, rowPitch2, image2.format ) )
-            return E_FAIL;
-
-        for( size_t i = 0; i < width; ++i )
-        {
-            XMVECTOR v1 = *(ptr1++);
-            if ( flags & CMSE_IMAGE1_SRGB )
-            {
-                v1 = XMVectorPow( v1, g_Gamma22 );
-            }
-            if ( flags & CMSE_IMAGE1_X2_BIAS )
-            {
-                v1 = XMVectorMultiplyAdd( v1, two, g_XMNegativeOne );
-            }
-
-            XMVECTOR v2 = *(ptr2++);
-            if ( flags & CMSE_IMAGE2_SRGB )
-            {
-                v2 = XMVectorPow( v2, g_Gamma22 );
-            }
-            if ( flags & CMSE_IMAGE2_X2_BIAS )
-            {
-                v1 = XMVectorMultiplyAdd( v2, two, g_XMNegativeOne );
-            }
-
-            // sum[ (I1 - I2)^2 ]
-            XMVECTOR v = XMVectorSubtract( v1, v2 );
-            if ( flags & CMSE_IGNORE_RED )
-            {
-                v = XMVectorSelect( v, g_XMZero, g_XMMaskX );
-            }
-            if ( flags & CMSE_IGNORE_GREEN )
-            {
-                v = XMVectorSelect( v, g_XMZero, g_XMMaskY );
-            }
-            if ( flags & CMSE_IGNORE_BLUE )
-            {
-                v = XMVectorSelect( v, g_XMZero, g_XMMaskZ );
-            }
-            if ( flags & CMSE_IGNORE_ALPHA )
-            {
-                v = XMVectorSelect( v, g_XMZero, g_XMMaskW );
-            }
-
-            acc = XMVectorMultiplyAdd( v, v, acc );
-        }
-
-        pSrc1 += rowPitch1;
-        pSrc2 += rowPitch2;
-    }
-
-    // MSE = sum[ (I1 - I2)^2 ] / w*h
-    XMVECTOR d = XMVectorReplicate( float(image1.width * image1.height) );
-    XMVECTOR v = XMVectorDivide( acc, d );
-    if ( mseV )
-    {
-        XMStoreFloat4( reinterpret_cast<XMFLOAT4*>( mseV ), v );
-        mse = mseV[0] + mseV[1] + mseV[2] + mseV[3];
-    }
-    else
-    {
-        XMFLOAT4 _mseV;
-        XMStoreFloat4( &_mseV, v );
-        mse = _mseV.x + _mseV.y + _mseV.z + _mseV.w;
-    }
-
-    return S_OK; 
-}
-
-
-//=====================================================================================
-// Entry points
-//=====================================================================================
-        
-//-------------------------------------------------------------------------------------
-// Copies a rectangle from one image into another
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT CopyRectangle( const Image& srcImage, const Rect& srcRect, const Image& dstImage, DWORD filter, size_t xOffset, size_t yOffset )
-{
-    if ( !srcImage.pixels || !dstImage.pixels )
-        return E_POINTER;
-
-    if ( IsCompressed( srcImage.format ) || IsCompressed( dstImage.format )
-         || IsPlanar( srcImage.format ) || IsPlanar( dstImage.format )
-         || IsPalettized( srcImage.format ) || IsPalettized( dstImage.format ) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    // Validate rectangle/offset
-    if ( !srcRect.w || !srcRect.h || ( (srcRect.x + srcRect.w) > srcImage.width ) || ( (srcRect.y + srcRect.h) > srcImage.height ) )
-    {
-        return E_INVALIDARG;
-    }
-
-    if ( ( (xOffset + srcRect.w) > dstImage.width ) || ( (yOffset + srcRect.h) > dstImage.height ) )
-    {
-        return E_INVALIDARG;
-    }
-
-    // Compute source bytes-per-pixel
-    size_t sbpp = BitsPerPixel( srcImage.format );
-    if ( !sbpp )
-        return E_FAIL;
-
-    if ( sbpp < 8 )
-    {
-        // We don't support monochrome (DXGI_FORMAT_R1_UNORM)
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    const uint8_t* pEndSrc = srcImage.pixels + srcImage.rowPitch*srcImage.height;
-    const uint8_t* pEndDest = dstImage.pixels + dstImage.rowPitch*dstImage.height;
-
-    // Round to bytes
-    sbpp = ( sbpp + 7 ) / 8;
-
-    const uint8_t* pSrc = srcImage.pixels + (srcRect.y * srcImage.rowPitch) + (srcRect.x * sbpp);
-
-    if ( srcImage.format == dstImage.format )
-    {
-        // Direct copy case (avoid intermediate conversions)
-        uint8_t* pDest = dstImage.pixels + (yOffset * dstImage.rowPitch) + (xOffset * sbpp);
-        const size_t copyW = srcRect.w * sbpp;
-        for( size_t h=0; h < srcRect.h; ++h )
-        {
-            if ( ( (pSrc+copyW) > pEndSrc ) || (pDest > pEndDest) )
-                return E_FAIL;
-
-            memcpy_s( pDest, pEndDest - pDest, pSrc, copyW );
-
-            pSrc += srcImage.rowPitch;
-            pDest += dstImage.rowPitch;
-        }
-
-        return S_OK;
-    }
-
-    // Compute destination bytes-per-pixel (not the same format as source)
-    size_t dbpp = BitsPerPixel( dstImage.format );
-    if ( !dbpp )
-        return E_FAIL;
-
-    if ( dbpp < 8 )
-    {
-        // We don't support monochrome (DXGI_FORMAT_R1_UNORM)
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-    }
-
-    // Round to bytes
-    dbpp = ( dbpp + 7 ) / 8;
-
-    uint8_t* pDest = dstImage.pixels + (yOffset * dstImage.rowPitch) + (xOffset * dbpp);
-
-    ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast<XMVECTOR*>( _aligned_malloc( (sizeof(XMVECTOR)*srcRect.w), 16 ) ) );
-    if ( !scanline )
-        return E_OUTOFMEMORY;
-
-    const size_t copyS = srcRect.w * sbpp;
-    const size_t copyD = srcRect.w * dbpp;
-
-    for( size_t h=0; h < srcRect.h; ++h )
-    {
-        if ( ( (pSrc+copyS) > pEndSrc) || ((pDest+copyD) > pEndDest) )
-            return E_FAIL;
-
-        if ( !_LoadScanline( scanline.get(), srcRect.w, pSrc, copyS, srcImage.format ) )
-            return E_FAIL;
-
-        _ConvertScanline( scanline.get(), srcRect.w, dstImage.format, srcImage.format, filter );
-
-        if ( !_StoreScanline( pDest, copyD, dstImage.format, scanline.get(), srcRect.w ) )
-            return E_FAIL;
-
-        pSrc += srcImage.rowPitch;
-        pDest += dstImage.rowPitch;
-    }
-
-    return S_OK;
-}
-
-    
-//-------------------------------------------------------------------------------------
-// Computes the Mean-Squared-Error (MSE) between two images
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT ComputeMSE( const Image& image1, const Image& image2, float& mse, float* mseV, DWORD flags )
-{
-    if ( !image1.pixels || !image2.pixels )
-        return E_POINTER;
-
-    if ( image1.width != image2.width || image1.height != image2.height )
-        return E_INVALIDARG;
-
-    if ( IsPlanar( image1.format ) || IsPlanar( image2.format )
-         || IsPalettized( image1.format ) || IsPalettized( image2.format ) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    if ( IsCompressed(image1.format) )
-    {
-        if ( IsCompressed(image2.format) )
-        {
-            // Case 1: both images are compressed, expand to RGBA32F
-            ScratchImage temp1;
-            HRESULT hr = Decompress( image1, DXGI_FORMAT_R32G32B32A32_FLOAT, temp1 );
-            if ( FAILED(hr) )
-                return hr;
-
-            ScratchImage temp2;
-            hr = Decompress(  image2, DXGI_FORMAT_R32G32B32A32_FLOAT, temp2 );
-            if ( FAILED(hr) )
-                return hr;
-
-            const Image* img1 = temp1.GetImage(0,0,0);
-            const Image* img2 = temp2.GetImage(0,0,0);
-            if ( !img1 || !img2 )
-                return E_POINTER;
-
-            return _ComputeMSE( *img1, *img2, mse, mseV, flags );
-        }
-        else
-        {
-            // Case 2: image1 is compressed, expand to RGBA32F
-            ScratchImage temp;
-            HRESULT hr = Decompress( image1, DXGI_FORMAT_R32G32B32A32_FLOAT, temp );
-            if ( FAILED(hr) )
-                return hr;
-
-            const Image* img = temp.GetImage(0,0,0);
-            if ( !img )
-                return E_POINTER;
-
-            return _ComputeMSE( *img, image2, mse, mseV, flags );
-        }
-    }
-    else
-    {
-        if ( IsCompressed(image2.format) )
-        {
-            // Case 3: image2 is compressed, expand to RGBA32F
-            ScratchImage temp;
-            HRESULT hr = Decompress( image2, DXGI_FORMAT_R32G32B32A32_FLOAT, temp );
-            if ( FAILED(hr) )
-                return hr;
-
-            const Image* img = temp.GetImage(0,0,0);
-            if ( !img )
-                return E_POINTER;
-
-            return _ComputeMSE( image1, *img, mse, mseV, flags );
-        }
-        else
-        {
-            // Case 4: neither image is compressed
-            return _ComputeMSE( image1, image2, mse, mseV, flags );
-        }
-    }
-}
-
-}; // namespace

+ 0 - 383
Exporters/FBX/3rdParty/DirectXTex/DirectXTexNormalMaps.cpp

@@ -1,383 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexNormalMaps.cpp
-//  
-// DirectX Texture Library - Normal map operations
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-namespace DirectX
-{
-
-#pragma prefast(suppress : 25000, "FXMVECTOR is 16 bytes")
-static inline float _EvaluateColor( _In_ FXMVECTOR val, _In_ DWORD flags )
-{
-    XMFLOAT4A f;
-
-    static XMVECTORF32 lScale = { 0.2125f, 0.7154f, 0.0721f, 1.f };
-
-    static_assert( CNMAP_CHANNEL_RED == 0x1, "CNMAP_CHANNEL_ flag values don't match mask" );
-    switch( flags & 0xf )
-    {
-    case 0:
-    case CNMAP_CHANNEL_RED:     return XMVectorGetX( val );
-    case CNMAP_CHANNEL_GREEN:   return XMVectorGetY( val );
-    case CNMAP_CHANNEL_BLUE:    return XMVectorGetZ( val );
-    case CNMAP_CHANNEL_ALPHA:   return XMVectorGetW( val );
-
-    case CNMAP_CHANNEL_LUMINANCE:
-        {
-            XMVECTOR v = XMVectorMultiply( val, lScale );
-            XMStoreFloat4A( &f, v );
-            return f.x + f.y + f.z;
-        }
-        break;
-
-    default:
-        assert(false);
-        return 0.f;
-    }
-}
-
-static void _EvaluateRow( _In_reads_(width) const XMVECTOR* pSource, _Out_writes_(width+2) float* pDest,
-                          _In_ size_t width, _In_ DWORD flags )
-{
-    assert( pSource && pDest );
-    assert( width > 0 );
-
-    for( size_t x = 0; x < width; ++x )
-    {
-        pDest[x+1] = _EvaluateColor( pSource[x], flags );
-    }
-
-    if ( flags & CNMAP_MIRROR_U )
-    {
-        // Mirror in U
-        pDest[0] = _EvaluateColor( pSource[0], flags );
-        pDest[width+1] = _EvaluateColor( pSource[width-1], flags );
-    }
-    else
-    {
-        // Wrap in U
-        pDest[0] = _EvaluateColor( pSource[width-1], flags );
-        pDest[width+1] = _EvaluateColor( pSource[0], flags );
-    }
-}
-
-static HRESULT _ComputeNMap( _In_ const Image& srcImage, _In_ DWORD flags, _In_ float amplitude,
-                             _In_ DXGI_FORMAT format, _In_ const Image& normalMap )
-{
-    if ( !srcImage.pixels || !normalMap.pixels )
-        return E_INVALIDARG;
-
-    const DWORD convFlags = _GetConvertFlags( format );
-    if ( !convFlags )
-        return E_FAIL;
-
-    if ( !( convFlags & (CONVF_UNORM | CONVF_SNORM | CONVF_FLOAT) ) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    const size_t width = srcImage.width;
-    const size_t height = srcImage.height;
-    if ( width != normalMap.width || height != normalMap.height )
-        return E_FAIL;
-
-    // Allocate temporary space (4 scanlines and 3 evaluated rows)
-    ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast<XMVECTOR*>( _aligned_malloc( (sizeof(XMVECTOR)*width*4), 16 ) ) );
-    if ( !scanline )
-        return E_OUTOFMEMORY;
-
-    ScopedAlignedArrayFloat buffer( reinterpret_cast<float*>( _aligned_malloc( ( ( sizeof(float) * ( width + 2 ) ) * 3 ), 16 ) ) );
-    if ( !buffer )
-        return E_OUTOFMEMORY;
-
-    uint8_t* pDest = normalMap.pixels;
-    if ( !pDest )
-        return E_POINTER;
-
-    XMVECTOR* row0 = scanline.get();
-    XMVECTOR* row1 = row0 + width;
-    XMVECTOR* row2 = row1 + width;
-    XMVECTOR* target = row2 + width;
-
-    float* val0 = buffer.get();
-    float* val1 = val0 + width + 2;
-    float* val2 = val1 + width + 2;
-
-    const size_t rowPitch = srcImage.rowPitch;
-    const uint8_t* pSrc = srcImage.pixels;
-
-    // Read first scanline row into 'row1'
-    if ( !_LoadScanline( row1, width, pSrc, rowPitch, srcImage.format ) )
-        return E_FAIL;
-
-    // Setup 'row0'
-    if ( flags & CNMAP_MIRROR_V )
-    {
-        // Mirror first row
-        memcpy_s( row0, rowPitch, row1, rowPitch );
-    }
-    else
-    {
-        // Read last row (Wrap V)
-        if ( !_LoadScanline( row0, width, pSrc + (rowPitch * (height-1)), rowPitch, srcImage.format ) )
-            return E_FAIL;
-    }
-
-    // Evaluate the initial rows
-    _EvaluateRow( row0, val0, width, flags );
-    _EvaluateRow( row1, val1, width, flags );
-
-    pSrc += rowPitch;
-
-    for( size_t y = 0; y < height; ++y )
-    {
-        // Load next scanline of source image
-        if ( y < (height-1) )
-        {
-            if ( !_LoadScanline( row2, width, pSrc, rowPitch, srcImage.format ) )
-                return E_FAIL;
-        }
-        else
-        {
-            if ( flags & CNMAP_MIRROR_V )
-            {
-                // Use last row of source image
-                if ( !_LoadScanline( row2, width, srcImage.pixels + (rowPitch * (height-1)), rowPitch, srcImage.format ) )
-                    return E_FAIL;
-            }
-            else
-            {
-                // Use first row of source image (Wrap V)
-                if ( !_LoadScanline( row2, width, srcImage.pixels, rowPitch, srcImage.format ) )
-                    return E_FAIL;
-            }
-        }
-
-        // Evaluate row
-        _EvaluateRow( row2, val2, width, flags );
-
-        // Generate target scanline
-        XMVECTOR *dptr = target;
-        for( size_t x = 0; x < width; ++x )
-        {
-            // Compute normal via central differencing
-            float totDelta = ( val0[x] - val0[x+2] ) + ( val1[x] - val1[x+2] ) + ( val2[x] - val2[x+2] );
-            float deltaZX = totDelta * amplitude / 6.f;
-
-            totDelta = ( val0[x] - val2[x] ) + ( val0[x+1] - val2[x+1] ) + ( val0[x+2] - val2[x+2] );
-            float deltaZY = totDelta * amplitude / 6.f;
-
-            XMVECTOR vx = XMVectorSetZ( g_XMNegIdentityR0, deltaZX );   // (-1.0f, 0.0f, deltaZX)
-            XMVECTOR vy = XMVectorSetZ( g_XMNegIdentityR1, deltaZY );   // (0.0f, -1.0f, deltaZY)
-
-            XMVECTOR normal = XMVector3Normalize( XMVector3Cross( vx, vy ) );
-
-            // Compute alpha (1.0 or an occlusion term)
-            float alpha = 1.f;
-
-            if ( flags & CNMAP_COMPUTE_OCCLUSION )
-            {
-                float delta = 0.f;
-                float c = val1[x+1];
-
-                float t = val0[x] - c;  if ( t > 0.f ) delta += t;
-                t = val0[x+1]   - c;    if ( t > 0.f ) delta += t;
-                t = val0[x+2]   - c;    if ( t > 0.f ) delta += t;
-                t = val1[x]     - c;    if ( t > 0.f ) delta += t;
-                // Skip current pixel
-                t = val1[x+2]   - c;    if ( t > 0.f ) delta += t;
-                t = val2[x]     - c;    if ( t > 0.f ) delta += t;
-                t = val2[x+1]   - c;    if ( t > 0.f ) delta += t;
-                t = val2[x+2]   - c;    if ( t > 0.f ) delta += t;
-
-                // Average delta (divide by 8, scale by amplitude factor)
-                delta *= 0.125f * amplitude;
-                if ( delta > 0.f )
-                {
-                    // If < 0, then no occlusion
-                    float r = sqrtf( 1.f + delta*delta );
-                    alpha = (r - delta) / r;
-                }
-            }
-
-            // Encode based on target format
-            if ( convFlags & CONVF_UNORM )
-            {
-                // 0.5f*normal + 0.5f -or- invert sign case: -0.5f*normal + 0.5f
-                XMVECTOR n1 = XMVectorMultiplyAdd( (flags & CNMAP_INVERT_SIGN) ? g_XMNegativeOneHalf : g_XMOneHalf, normal, g_XMOneHalf ); 
-                *dptr++ = XMVectorSetW( n1, alpha );
-            }
-            else if ( flags & CNMAP_INVERT_SIGN )
-            {
-                *dptr++ = XMVectorSetW( XMVectorNegate( normal ), alpha );
-            }
-            else
-            {
-                *dptr++ = XMVectorSetW( normal, alpha );
-            }
-        }
-
-        if ( !_StoreScanline( pDest, normalMap.rowPitch, format, target, width ) )
-            return E_FAIL;
-
-        // Cycle buffers
-        float* temp = val0;
-        val0 = val1;
-        val1 = val2;
-        val2 = temp;
-
-        pSrc += rowPitch;
-        pDest += normalMap.rowPitch;
-    }
-
-    return S_OK;
-}
-
-
-//=====================================================================================
-// Entry points
-//=====================================================================================
-        
-//-------------------------------------------------------------------------------------
-// Generates a normal map from a height-map
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT ComputeNormalMap( const Image& srcImage, DWORD flags, float amplitude,
-                          DXGI_FORMAT format, ScratchImage& normalMap )
-{
-    if ( !srcImage.pixels || !IsValid(format) )
-        return E_INVALIDARG;
-
-    static_assert( CNMAP_CHANNEL_RED == 0x1, "CNMAP_CHANNEL_ flag values don't match mask" );
-    switch( flags & 0xf )
-    {
-    case 0:
-    case CNMAP_CHANNEL_RED:
-    case CNMAP_CHANNEL_GREEN:
-    case CNMAP_CHANNEL_BLUE:
-    case CNMAP_CHANNEL_ALPHA:
-    case CNMAP_CHANNEL_LUMINANCE:
-        break;
-
-    default:
-        return E_INVALIDARG;
-    }
-
-    if ( IsCompressed(format) || IsCompressed(srcImage.format)
-         || IsTypeless(format) || IsTypeless(srcImage.format) 
-         || IsPlanar(format) || IsPlanar(srcImage.format) 
-         || IsPalettized(format) || IsPalettized(srcImage.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    // Setup target image
-    normalMap.Release();
-
-    HRESULT hr = normalMap.Initialize2D( format, srcImage.width, srcImage.height, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-
-    const Image *img = normalMap.GetImage( 0, 0, 0 );
-    if ( !img )
-    {
-        normalMap.Release();
-        return E_POINTER;
-    }
-
-    hr = _ComputeNMap( srcImage, flags, amplitude, format, *img );
-    if ( FAILED(hr) )
-    {
-        normalMap.Release();
-        return hr;
-    }
-
-    return S_OK;
-}
-
-_Use_decl_annotations_
-HRESULT ComputeNormalMap( const Image* srcImages, size_t nimages, const TexMetadata& metadata,
-                          DWORD flags, float amplitude, DXGI_FORMAT format, ScratchImage& normalMaps )
-{
-    if ( !srcImages || !nimages || !IsValid(format) )
-        return E_INVALIDARG;
-
-    if ( IsCompressed(format) || IsCompressed(metadata.format)
-         || IsTypeless(format) || IsTypeless(metadata.format) 
-         || IsPlanar(format) || IsPlanar(metadata.format) 
-         || IsPalettized(format) || IsPalettized(metadata.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-    static_assert( CNMAP_CHANNEL_RED == 0x1, "CNMAP_CHANNEL_ flag values don't match mask" );
-    switch( flags & 0xf )
-    {
-    case 0:
-    case CNMAP_CHANNEL_RED:
-    case CNMAP_CHANNEL_GREEN:
-    case CNMAP_CHANNEL_BLUE:
-    case CNMAP_CHANNEL_ALPHA:
-    case CNMAP_CHANNEL_LUMINANCE:
-        break;
-
-    default:
-        return E_INVALIDARG;
-    }
-
-    normalMaps.Release();
-
-    TexMetadata mdata2 = metadata;
-    mdata2.format = format;
-    HRESULT hr = normalMaps.Initialize( mdata2 );
-    if ( FAILED(hr) )
-        return hr;
-
-    if ( nimages != normalMaps.GetImageCount() )
-    {
-        normalMaps.Release();
-        return E_FAIL;
-    }
-
-    const Image* dest = normalMaps.GetImages();
-    if ( !dest )
-    {
-        normalMaps.Release();
-        return E_POINTER;
-    }
-
-    for( size_t index=0; index < nimages; ++index )
-    {
-        assert( dest[ index ].format == format );
-
-        const Image& src = srcImages[ index ];
-        if ( IsCompressed( src.format ) || IsTypeless( src.format ) )
-        {
-            normalMaps.Release();
-            return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-        }
-
-        if ( src.width != dest[ index ].width || src.height != dest[ index ].height )
-        {
-            normalMaps.Release();
-            return E_FAIL;
-        }
-
-        hr = _ComputeNMap( src, flags, amplitude, format, dest[ index ] );
-        if ( FAILED(hr) )
-        {
-            normalMaps.Release();
-            return hr;
-        }
-    }
-
-    return S_OK;
-}
-
-}; // namespace

+ 0 - 209
Exporters/FBX/3rdParty/DirectXTex/DirectXTexP.h

@@ -1,209 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexp.h
-//  
-// DirectX Texture Library - Private header
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#define NOMINMAX
-#include <windows.h>
-#include <directxmath.h>
-#include <directxpackedvector.h>
-#include <assert.h>
-
-#include <malloc.h>
-#include <memory>
-
-#include <vector>
-
-#include <stdlib.h>
-#include <search.h>
-
-#include <ole2.h>
-
-#include "directxtex.h"
-
-// VS 2010's stdint.h conflicts with intsafe.h
-#pragma warning(push)
-#pragma warning(disable : 4005)
-#include <wincodec.h>
-#include <wrl.h>
-#pragma warning(pop)
-
-#include "scoped.h"
-
-struct IWICImagingFactory;
-
-#define TEX_FILTER_MASK 0xF00000
-
-namespace DirectX
-{
-    //---------------------------------------------------------------------------------
-    // WIC helper functions
-    DXGI_FORMAT _WICToDXGI( _In_ const GUID& guid );
-    bool _DXGIToWIC( _In_ DXGI_FORMAT format, _Out_ GUID& guid, _In_ bool ignoreRGBvsBGR = false );
-
-    DWORD _CheckWICColorSpace( _In_ const GUID& sourceGUID, _In_ const GUID& targetGUID );
-
-    IWICImagingFactory* _GetWIC();
-
-    bool _IsWIC2();
-
-    inline WICBitmapDitherType _GetWICDither( _In_ DWORD flags )
-    {
-        static_assert( TEX_FILTER_DITHER == 0x10000, "TEX_FILTER_DITHER* flag values don't match mask" );
-
-        static_assert( TEX_FILTER_DITHER == WIC_FLAGS_DITHER, "TEX_FILTER_DITHER* should match WIC_FLAGS_DITHER*" );
-        static_assert( TEX_FILTER_DITHER_DIFFUSION == WIC_FLAGS_DITHER_DIFFUSION, "TEX_FILTER_DITHER* should match WIC_FLAGS_DITHER*" );
-
-        switch( flags & 0xF0000 )
-        {
-        case TEX_FILTER_DITHER:
-            return WICBitmapDitherTypeOrdered4x4;
-
-        case TEX_FILTER_DITHER_DIFFUSION:
-            return WICBitmapDitherTypeErrorDiffusion;
-
-        default:
-            return WICBitmapDitherTypeNone;
-        }
-    }
-
-    inline WICBitmapInterpolationMode _GetWICInterp( _In_ DWORD flags )
-    {
-        static_assert( TEX_FILTER_POINT == 0x100000, "TEX_FILTER_ flag values don't match TEX_FILTER_MASK" );
-
-        static_assert( TEX_FILTER_POINT == WIC_FLAGS_FILTER_POINT, "TEX_FILTER_* flags should match WIC_FLAGS_FILTER_*" );
-        static_assert( TEX_FILTER_LINEAR == WIC_FLAGS_FILTER_LINEAR, "TEX_FILTER_* flags should match WIC_FLAGS_FILTER_*"  );
-        static_assert( TEX_FILTER_CUBIC == WIC_FLAGS_FILTER_CUBIC, "TEX_FILTER_* flags should match WIC_FLAGS_FILTER_*"  );
-        static_assert( TEX_FILTER_FANT == WIC_FLAGS_FILTER_FANT, "TEX_FILTER_* flags should match WIC_FLAGS_FILTER_*"  );
-
-        switch( flags & TEX_FILTER_MASK )
-        {
-        case TEX_FILTER_POINT:
-            return WICBitmapInterpolationModeNearestNeighbor;
-
-        case TEX_FILTER_LINEAR:
-            return WICBitmapInterpolationModeLinear;
-
-        case TEX_FILTER_CUBIC:
-            return WICBitmapInterpolationModeCubic;
-
-        case TEX_FILTER_FANT:
-        default:
-            return WICBitmapInterpolationModeFant;
-        }
-    }
-
-    //---------------------------------------------------------------------------------
-    // Image helper functions
-    void _DetermineImageArray( _In_ const TexMetadata& metadata, _In_ DWORD cpFlags,
-                               _Out_ size_t& nImages, _Out_ size_t& pixelSize );
-
-    _Success_(return != false)
-    bool _SetupImageArray( _In_reads_bytes_(pixelSize) uint8_t *pMemory, _In_ size_t pixelSize,
-                           _In_ const TexMetadata& metadata, _In_ DWORD cpFlags,
-                           _Out_writes_(nImages) Image* images, _In_ size_t nImages );
-
-    //---------------------------------------------------------------------------------
-    // Conversion helper functions
-
-    enum TEXP_SCANLINE_FLAGS
-    {
-        TEXP_SCANLINE_NONE          = 0,
-        TEXP_SCANLINE_SETALPHA      = 0x1,  // Set alpha channel to known opaque value
-        TEXP_SCANLINE_LEGACY        = 0x2,  // Enables specific legacy format conversion cases
-    };
-
-    enum CONVERT_FLAGS
-    {
-        CONVF_FLOAT     = 0x1,
-        CONVF_UNORM     = 0x2,
-        CONVF_UINT      = 0x4,
-        CONVF_SNORM     = 0x8, 
-        CONVF_SINT      = 0x10,
-        CONVF_DEPTH     = 0x20,
-        CONVF_STENCIL   = 0x40,
-        CONVF_SHAREDEXP = 0x80,
-        CONVF_BGR       = 0x100,
-        CONVF_XR        = 0x200,
-        CONVF_PACKED    = 0x400,
-        CONVF_BC        = 0x800,
-        CONVF_YUV       = 0x1000,
-        CONVF_R         = 0x10000,
-        CONVF_G         = 0x20000,
-        CONVF_B         = 0x40000,
-        CONVF_A         = 0x80000,
-        CONVF_RGB_MASK  = 0x70000,
-        CONVF_RGBA_MASK = 0xF0000,
-    };
-
-    DWORD _GetConvertFlags( _In_ DXGI_FORMAT format );
-
-    void _CopyScanline( _When_(pDestination == pSource, _Inout_updates_bytes_(outSize))
-                        _When_(pDestination != pSource, _Out_writes_bytes_(outSize))
-                        LPVOID pDestination, _In_ size_t outSize, 
-                        _In_reads_bytes_(inSize) LPCVOID pSource, _In_ size_t inSize,
-                        _In_ DXGI_FORMAT format, _In_ DWORD flags );
-
-    void _SwizzleScanline( _When_(pDestination == pSource, _In_)
-                           _When_(pDestination != pSource, _Out_writes_bytes_(outSize))
-                           LPVOID pDestination, _In_ size_t outSize, 
-                           _In_reads_bytes_(inSize) LPCVOID pSource, _In_ size_t inSize,
-                           _In_ DXGI_FORMAT format, _In_ DWORD flags );
-
-    _Success_(return != false)
-    bool _ExpandScanline( _Out_writes_bytes_(outSize) LPVOID pDestination, _In_ size_t outSize,
-                          _In_ DXGI_FORMAT outFormat, 
-                          _In_reads_bytes_(inSize) LPCVOID pSource, _In_ size_t inSize,
-                          _In_ DXGI_FORMAT inFormat, _In_ DWORD flags );
-
-    _Success_(return != false)
-    bool _LoadScanline( _Out_writes_(count) XMVECTOR* pDestination, _In_ size_t count,
-                        _In_reads_bytes_(size) LPCVOID pSource, _In_ size_t size, _In_ DXGI_FORMAT format );
-
-    _Success_(return != false)
-    bool _LoadScanlineLinear( _Out_writes_(count) XMVECTOR* pDestination, _In_ size_t count,
-                             _In_reads_bytes_(size) LPCVOID pSource, _In_ size_t size, _In_ DXGI_FORMAT format, _In_ DWORD flags  );
-
-    _Success_(return != false)
-    bool _StoreScanline( LPVOID pDestination, _In_ size_t size, _In_ DXGI_FORMAT format,
-                         _In_reads_(count) const XMVECTOR* pSource, _In_ size_t count, _In_ float threshold = 0 );
-
-    _Success_(return != false)
-    bool _StoreScanlineLinear( LPVOID pDestination, _In_ size_t size, _In_ DXGI_FORMAT format,
-                               _Inout_updates_all_(count) XMVECTOR* pSource, _In_ size_t count, _In_ DWORD flags );
-
-    _Success_(return != false)
-    bool _StoreScanlineDither( LPVOID pDestination, _In_ size_t size, _In_ DXGI_FORMAT format,
-                               _Inout_updates_all_(count) XMVECTOR* pSource, _In_ size_t count, _In_ float threshold, size_t y, size_t z,
-                               _Inout_updates_all_opt_(count+2) XMVECTOR* pDiffusionErrors );
-
-    HRESULT _ConvertToR32G32B32A32( _In_ const Image& srcImage, _Inout_ ScratchImage& image );
-
-    HRESULT _ConvertFromR32G32B32A32( _In_ const Image& srcImage, _In_ const Image& destImage );
-    HRESULT _ConvertFromR32G32B32A32( _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _Inout_ ScratchImage& image );
-    HRESULT _ConvertFromR32G32B32A32( _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata,
-                                      _In_ DXGI_FORMAT format, _Out_ ScratchImage& result );
-
-    void _ConvertScanline( _Inout_updates_all_(count) XMVECTOR* pBuffer, _In_ size_t count,
-                           _In_ DXGI_FORMAT outFormat, _In_ DXGI_FORMAT inFormat, _In_ DWORD flags );
-
-    //---------------------------------------------------------------------------------
-    // DDS helper functions
-    HRESULT _EncodeDDSHeader( _In_ const TexMetadata& metadata, DWORD flags,
-                              _Out_writes_bytes_to_opt_(maxsize, required) LPVOID pDestination, _In_ size_t maxsize, _Out_ size_t& required );
-
-}; // namespace

+ 0 - 229
Exporters/FBX/3rdParty/DirectXTex/DirectXTexPMAlpha.cpp

@@ -1,229 +0,0 @@
-//-------------------------------------------------------------------------------------
-// DirectXTexPMAlpha.cpp
-//  
-// DirectX Texture Library - Premultiplied alpha operations
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// http://go.microsoft.com/fwlink/?LinkId=248926
-//-------------------------------------------------------------------------------------
-
-#include "directxtexp.h"
-
-namespace DirectX
-{
-
-static HRESULT _PremultiplyAlpha( _In_ const Image& srcImage, _In_ const Image& destImage )
-{
-    assert( srcImage.width == destImage.width );
-    assert( srcImage.height == destImage.height );
-
-    ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast<XMVECTOR*>( _aligned_malloc( (sizeof(XMVECTOR)*srcImage.width), 16 ) ) );
-    if ( !scanline )
-        return E_OUTOFMEMORY;
-
-    const uint8_t *pSrc = srcImage.pixels;
-    uint8_t *pDest = destImage.pixels;
-    if ( !pSrc || !pDest )
-        return E_POINTER;
-
-    for( size_t h = 0; h < srcImage.height; ++h )
-    {
-        if ( !_LoadScanline( scanline.get(), srcImage.width, pSrc, srcImage.rowPitch, srcImage.format ) )
-            return E_FAIL;
-
-        XMVECTOR* ptr = scanline.get();
-        for( size_t w = 0; w < srcImage.width; ++w )
-        {
-            XMVECTOR v = *ptr;
-            XMVECTOR alpha = XMVectorSplatW( *ptr );
-            alpha = XMVectorMultiply( v, alpha );
-            *(ptr++) = XMVectorSelect( v, alpha, g_XMSelect1110 );
-        }
-
-        if ( !_StoreScanline( pDest, destImage.rowPitch, destImage.format, scanline.get(), srcImage.width ) )
-            return E_FAIL;
-
-        pSrc += srcImage.rowPitch;
-        pDest += destImage.rowPitch;
-    }
-
-    return S_OK;
-}
-
-static HRESULT _PremultiplyAlphaLinear( _In_ const Image& srcImage, _In_ DWORD flags, _In_ const Image& destImage )
-{
-    assert( srcImage.width == destImage.width );
-    assert( srcImage.height == destImage.height );
-
-    static_assert( TEX_PMALPHA_SRGB_IN == TEX_FILTER_SRGB_IN, "TEX_PMALHPA_SRGB* should match TEX_FILTER_SRGB*" );
-    static_assert( TEX_PMALPHA_SRGB_OUT == TEX_FILTER_SRGB_OUT, "TEX_PMALHPA_SRGB* should match TEX_FILTER_SRGB*" );
-    static_assert( TEX_PMALPHA_SRGB == TEX_FILTER_SRGB, "TEX_PMALHPA_SRGB* should match TEX_FILTER_SRGB*" );
-    flags &= TEX_PMALPHA_SRGB;
-
-    ScopedAlignedArrayXMVECTOR scanline( reinterpret_cast<XMVECTOR*>( _aligned_malloc( (sizeof(XMVECTOR)*srcImage.width), 16 ) ) );
-    if ( !scanline )
-        return E_OUTOFMEMORY;
-
-    const uint8_t *pSrc = srcImage.pixels;
-    uint8_t *pDest = destImage.pixels;
-    if ( !pSrc || !pDest )
-        return E_POINTER;
-
-    for( size_t h = 0; h < srcImage.height; ++h )
-    {
-        if ( !_LoadScanlineLinear( scanline.get(), srcImage.width, pSrc, srcImage.rowPitch, srcImage.format, flags ) )
-            return E_FAIL;
-
-        XMVECTOR* ptr = scanline.get();
-        for( size_t w = 0; w < srcImage.width; ++w )
-        {
-            XMVECTOR v = *ptr;
-            XMVECTOR alpha = XMVectorSplatW( *ptr );
-            alpha = XMVectorMultiply( v, alpha );
-            *(ptr++) = XMVectorSelect( v, alpha, g_XMSelect1110 );
-        }
-
-        if ( !_StoreScanlineLinear( pDest, destImage.rowPitch, destImage.format, scanline.get(), srcImage.width, flags ) )
-            return E_FAIL;
-
-        pSrc += srcImage.rowPitch;
-        pDest += destImage.rowPitch;
-    }
-
-    return S_OK;
-}
-
-
-//=====================================================================================
-// Entry-points
-//=====================================================================================
-
-//-------------------------------------------------------------------------------------
-// Converts to a premultiplied alpha version of the texture
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT PremultiplyAlpha( const Image& srcImage, DWORD flags, ScratchImage& image )
-{
-    if ( !srcImage.pixels )
-        return E_POINTER;
-
-    if ( IsCompressed(srcImage.format)
-         || IsPlanar(srcImage.format)
-         || IsPalettized(srcImage.format)
-         || IsTypeless(srcImage.format)
-         || !HasAlpha(srcImage.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-#ifdef _M_X64
-    if ( (srcImage.width > 0xFFFFFFFF) || (srcImage.height > 0xFFFFFFFF) )
-        return E_INVALIDARG;
-#endif
-
-    HRESULT hr = image.Initialize2D( srcImage.format, srcImage.width, srcImage.height, 1, 1 );
-    if ( FAILED(hr) )
-        return hr;
-   
-    const Image *rimage = image.GetImage( 0, 0, 0 );
-    if ( !rimage )
-    {
-        image.Release();
-        return E_POINTER;
-    }
-
-    hr = ( flags & TEX_PMALPHA_IGNORE_SRGB ) ? _PremultiplyAlpha( srcImage, *rimage ) : _PremultiplyAlphaLinear( srcImage, flags, *rimage );
-    if ( FAILED(hr) )
-    {
-        image.Release();
-        return hr;
-    }
-
-    return S_OK;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Converts to a premultiplied alpha version of the texture (complex)
-//-------------------------------------------------------------------------------------
-_Use_decl_annotations_
-HRESULT PremultiplyAlpha( const Image* srcImages, size_t nimages, const TexMetadata& metadata, DWORD flags, ScratchImage& result )
-{
-    if ( !srcImages || !nimages )
-        return E_INVALIDARG;
-
-    if ( IsCompressed(metadata.format)
-         || IsPlanar(metadata.format)
-         || IsPalettized(metadata.format)
-         || IsTypeless(metadata.format)
-         || !HasAlpha(metadata.format) )
-        return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
-
-#ifdef _M_X64
-    if ( (metadata.width > 0xFFFFFFFF) || (metadata.height > 0xFFFFFFFF) )
-        return E_INVALIDARG;
-#endif
-
-    if ( metadata.IsPMAlpha() )
-    {
-        // Already premultiplied
-        return E_FAIL;
-    }
-
-    TexMetadata mdata2 = metadata;
-    mdata2.SetAlphaMode(TEX_ALPHA_MODE_PREMULTIPLIED);
-    HRESULT hr = result.Initialize( mdata2 );
-    if ( FAILED(hr) )
-        return hr;
-
-    if ( nimages != result.GetImageCount() )
-    {
-        result.Release();
-        return E_FAIL;
-    }
-
-    const Image* dest = result.GetImages();
-    if ( !dest )
-    {
-        result.Release();
-        return E_POINTER;
-    }
-
-    for( size_t index=0; index < nimages; ++index )
-    {
-        const Image& src = srcImages[ index ];
-        if ( src.format != metadata.format )
-        {
-            result.Release();
-            return E_FAIL;
-        }
-
-#ifdef _M_X64
-        if ( (src.width > 0xFFFFFFFF) || (src.height > 0xFFFFFFFF) )
-            return E_FAIL;
-#endif
-        const Image& dst = dest[ index ];
-        assert( dst.format == metadata.format );
-
-        if ( src.width != dst.width || src.height != dst.height )
-        {
-            result.Release();
-            return E_FAIL;
-        }
-
-        hr = ( flags & TEX_PMALPHA_IGNORE_SRGB ) ? _PremultiplyAlpha( src, dst ) : _PremultiplyAlphaLinear( src, flags, dst );
-        if ( FAILED(hr) )
-        {
-            result.Release();
-            return hr;
-        }
-    }
-
-    return S_OK;
-}
-
-}; // namespace

File diff suppressed because it is too large
+ 0 - 1034
Exporters/FBX/3rdParty/DirectXTex/DirectXTexResize.cpp


File diff suppressed because it is too large
+ 0 - 1391
Exporters/FBX/3rdParty/DirectXTex/DirectXTexTGA.cpp


File diff suppressed because it is too large
+ 0 - 1029
Exporters/FBX/3rdParty/DirectXTex/DirectXTexUtil.cpp


File diff suppressed because it is too large
+ 0 - 1128
Exporters/FBX/3rdParty/DirectXTex/DirectXTexWIC.cpp


+ 0 - 432
Exporters/FBX/3rdParty/DirectXTex/DirectXTex_Desktop_2012.vcxproj

@@ -1,432 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.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="Profile|Win32">
-      <Configuration>Profile</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Profile|x64">
-      <Configuration>Profile</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">
-    <ProjectName>DirectXTex</ProjectName>
-    <ProjectGuid>{371B9FA9-4C90-4AC6-A123-ACED756D6C77}</ProjectGuid>
-    <RootNamespace>DirectXTex</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-    <VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''">$(VCTargetsPath11)</VCTargetsPath>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|X64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|X64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v110</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings" />
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Profile|x64'" Label="PropertySheets">
-    <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>
-  <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>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>true</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'">
-    <OutDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>true</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>false</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|X64'">
-    <OutDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>false</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
-    <OutDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>false</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|X64'">
-    <OutDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2012\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>false</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX86</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX64</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX86</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|X64'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX64</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX86</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Profile|X64'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX64</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <CLInclude Include="BC.h" />
-    <ClCompile Include="BC.cpp" />
-    <ClCompile Include="BC4BC5.cpp" />
-    <ClCompile Include="BC6HBC7.cpp" />
-    <ClInclude Include="BCDirectCompute.h" />
-    <CLInclude Include="DDS.h" />
-    <ClInclude Include="filters.h" />
-    <CLInclude Include="scoped.h" />
-    <CLInclude Include="DirectXTex.h" />
-    <CLInclude Include="DirectXTexp.h" />
-    <CLInclude Include="DirectXTex.inl" />
-    <ClCompile Include="BCDirectCompute.cpp" />
-    <ClCompile Include="DirectXTexCompress.cpp" />
-    <ClCompile Include="DirectXTexCompressGPU.cpp" />
-    <ClCompile Include="DirectXTexConvert.cpp" />
-    <ClCompile Include="DirectXTexD3D11.cpp" />
-    <ClCompile Include="DirectXTexDDS.cpp" />
-    <ClCompile Include="DirectXTexFlipRotate.cpp" />
-    <ClCompile Include="DirectXTexImage.cpp" />
-    <ClCompile Include="DirectXTexMipMaps.cpp" />
-    <ClCompile Include="DirectXTexMisc.cpp" />
-    <ClCompile Include="DirectXTexNormalMaps.cpp" />
-    <ClCompile Include="DirectXTexPMAlpha.cpp" />
-    <ClCompile Include="DirectXTexResize.cpp" />
-    <ClCompile Include="DirectXTexTGA.cpp" />
-    <ClCompile Include="DirectXTexUtil.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
-    </ClCompile>
-    <ClCompile Include="DirectXTexWIC.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets" />
-</Project>

+ 0 - 38
Exporters/FBX/3rdParty/DirectXTex/DirectXTex_Desktop_2012.vcxproj.filters

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns:atg="http://atg.xbox.com" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{8e114980-c1a3-4ada-ad7c-83caadf5daeb}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <CLInclude Include="BC.h" />
-    <ClCompile Include="BC.cpp" />
-    <ClCompile Include="BC4BC5.cpp" />
-    <ClCompile Include="BC6HBC7.cpp" />
-    <CLInclude Include="DDS.h" />
-    <ClInclude Include="filters.h" />
-    <CLInclude Include="scoped.h" />
-    <CLInclude Include="DirectXTex.h" />
-    <CLInclude Include="DirectXTexp.h" />
-    <CLInclude Include="DirectXTex.inl" />
-    <ClCompile Include="DirectXTexCompress.cpp" />
-    <ClCompile Include="DirectXTexConvert.cpp" />
-    <ClCompile Include="DirectXTexD3D11.cpp" />
-    <ClCompile Include="DirectXTexDDS.cpp" />
-    <ClCompile Include="DirectXTexFlipRotate.cpp" />
-    <ClCompile Include="DirectXTexImage.cpp" />
-    <ClCompile Include="DirectXTexMipMaps.cpp" />
-    <ClCompile Include="DirectXTexMisc.cpp" />
-    <ClCompile Include="DirectXTexNormalMaps.cpp" />
-    <ClCompile Include="DirectXTexPMAlpha.cpp" />
-    <ClCompile Include="DirectXTexResize.cpp" />
-    <ClCompile Include="DirectXTexTGA.cpp" />
-    <ClCompile Include="DirectXTexUtil.cpp" />
-    <ClCompile Include="DirectXTexWIC.cpp" />
-    <ClInclude Include="BCDirectCompute.h" />
-    <ClCompile Include="BCDirectCompute.cpp" />
-    <ClCompile Include="DirectXTexCompressGPU.cpp" />
-  </ItemGroup>
-</Project>

+ 0 - 436
Exporters/FBX/3rdParty/DirectXTex/DirectXTex_Desktop_2013.vcxproj

@@ -1,436 +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="Profile|Win32">
-      <Configuration>Profile</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Profile|x64">
-      <Configuration>Profile</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">
-    <ProjectName>DirectXTex</ProjectName>
-    <ProjectGuid>{371B9FA9-4C90-4AC6-A123-ACED756D6C77}</ProjectGuid>
-    <RootNamespace>DirectXTex</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-    <SccProjectName>SAK</SccProjectName>
-    <SccAuxPath>SAK</SccAuxPath>
-    <SccLocalPath>SAK</SccLocalPath>
-    <SccProvider>SAK</SccProvider>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|X64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|X64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v120</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings" />
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Profile|x64'" Label="PropertySheets">
-    <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>
-  <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>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>true</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'">
-    <OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>true</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>false</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|X64'">
-    <OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>false</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
-    <OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>false</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|X64'">
-    <OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
-    <IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
-    <TargetName>DirectXTex</TargetName>
-    <LinkIncremental>false</LinkIncremental>
-    <GenerateManifest>true</GenerateManifest>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX86</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;_DEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX64</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX86</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|X64'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX64</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX86</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Profile|X64'">
-    <ClCompile>
-      <WarningLevel>Level4</WarningLevel>
-      <Optimization>MaxSpeed</Optimization>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <OpenMPSupport>true</OpenMPSupport>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <FloatingPointModel>Fast</FloatingPointModel>
-      <ExceptionHandling>Sync</ExceptionHandling>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <PreprocessorDefinitions>_UNICODE;UNICODE;WIN32;NDEBUG;PROFILE;_LIB;_WIN7_PLATFORM_UPDATE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>DirectXTexP.h</PrecompiledHeaderFile>
-      <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <LargeAddressAware>true</LargeAddressAware>
-      <RandomizedBaseAddress>true</RandomizedBaseAddress>
-      <DataExecutionPrevention>true</DataExecutionPrevention>
-      <TargetMachine>MachineX64</TargetMachine>
-      <UACExecutionLevel>AsInvoker</UACExecutionLevel>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-    </Link>
-    <Manifest>
-      <EnableDPIAwareness>false</EnableDPIAwareness>
-    </Manifest>
-    <PreBuildEvent>
-      <Command>
-      </Command>
-    </PreBuildEvent>
-    <PostBuildEvent>
-      <Command>
-      </Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup />
-  <ItemGroup>
-    <CLInclude Include="BC.h" />
-    <ClCompile Include="BC.cpp" />
-    <ClCompile Include="BC4BC5.cpp" />
-    <ClCompile Include="BC6HBC7.cpp" />
-    <ClInclude Include="BCDirectCompute.h" />
-    <CLInclude Include="DDS.h" />
-    <ClInclude Include="filters.h" />
-    <CLInclude Include="scoped.h" />
-    <CLInclude Include="DirectXTex.h" />
-    <CLInclude Include="DirectXTexp.h" />
-    <CLInclude Include="DirectXTex.inl" />
-    <ClCompile Include="BCDirectCompute.cpp" />
-    <ClCompile Include="DirectXTexCompress.cpp" />
-    <ClCompile Include="DirectXTexCompressGPU.cpp" />
-    <ClCompile Include="DirectXTexConvert.cpp" />
-    <ClCompile Include="DirectXTexD3D11.cpp" />
-    <ClCompile Include="DirectXTexDDS.cpp" />
-    <ClCompile Include="DirectXTexFlipRotate.cpp" />
-    <ClCompile Include="DirectXTexImage.cpp" />
-    <ClCompile Include="DirectXTexMipMaps.cpp" />
-    <ClCompile Include="DirectXTexMisc.cpp" />
-    <ClCompile Include="DirectXTexNormalMaps.cpp" />
-    <ClCompile Include="DirectXTexPMAlpha.cpp" />
-    <ClCompile Include="DirectXTexResize.cpp" />
-    <ClCompile Include="DirectXTexTGA.cpp" />
-    <ClCompile Include="DirectXTexUtil.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
-    </ClCompile>
-    <ClCompile Include="DirectXTexWIC.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <ItemGroup>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets" />
-</Project>

+ 0 - 38
Exporters/FBX/3rdParty/DirectXTex/DirectXTex_Desktop_2013.vcxproj.filters

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns:atg="http://atg.xbox.com" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{8e114980-c1a3-4ada-ad7c-83caadf5daeb}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <CLInclude Include="BC.h" />
-    <ClCompile Include="BC.cpp" />
-    <ClCompile Include="BC4BC5.cpp" />
-    <ClCompile Include="BC6HBC7.cpp" />
-    <CLInclude Include="DDS.h" />
-    <ClInclude Include="filters.h" />
-    <CLInclude Include="scoped.h" />
-    <CLInclude Include="DirectXTex.h" />
-    <CLInclude Include="DirectXTexp.h" />
-    <CLInclude Include="DirectXTex.inl" />
-    <ClCompile Include="DirectXTexCompress.cpp" />
-    <ClCompile Include="DirectXTexConvert.cpp" />
-    <ClCompile Include="DirectXTexD3D11.cpp" />
-    <ClCompile Include="DirectXTexDDS.cpp" />
-    <ClCompile Include="DirectXTexFlipRotate.cpp" />
-    <ClCompile Include="DirectXTexImage.cpp" />
-    <ClCompile Include="DirectXTexMipMaps.cpp" />
-    <ClCompile Include="DirectXTexMisc.cpp" />
-    <ClCompile Include="DirectXTexNormalMaps.cpp" />
-    <ClCompile Include="DirectXTexPMAlpha.cpp" />
-    <ClCompile Include="DirectXTexResize.cpp" />
-    <ClCompile Include="DirectXTexTGA.cpp" />
-    <ClCompile Include="DirectXTexUtil.cpp" />
-    <ClCompile Include="DirectXTexWIC.cpp" />
-    <ClInclude Include="BCDirectCompute.h" />
-    <ClCompile Include="BCDirectCompute.cpp" />
-    <ClCompile Include="DirectXTexCompressGPU.cpp" />
-  </ItemGroup>
-</Project>

+ 0 - 424
Exporters/FBX/3rdParty/DirectXTex/Filters.h

@@ -1,424 +0,0 @@
-//-------------------------------------------------------------------------------------
-// filters.h
-//  
-// Utility header with helpers for implementing image filters
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//-------------------------------------------------------------------------------------
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#include <directxmath.h>
-#include <directxpackedvector.h>
-
-#include <memory>
-
-#include "scoped.h"
-
-namespace DirectX
-{
-
-//-------------------------------------------------------------------------------------
-// Box filtering helpers
-//-------------------------------------------------------------------------------------
-
-XMGLOBALCONST XMVECTORF32 g_boxScale = { 0.25f, 0.25f, 0.25f, 0.25f };
-XMGLOBALCONST XMVECTORF32 g_boxScale3D = { 0.125f, 0.125f, 0.125f, 0.125f };
-
-#define AVERAGE4( res, p0, p1, p2, p3 ) \
-{ \
-    XMVECTOR v = XMVectorAdd( (p0), (p1) ); \
-    v = XMVectorAdd( v, (p2) ); \
-    v = XMVectorAdd( v, (p3) ); \
-    res = XMVectorMultiply( v, g_boxScale ); \
-}
-
-#define AVERAGE8( res, p0, p1, p2, p3, p4, p5, p6, p7) \
-{ \
-    XMVECTOR v = XMVectorAdd( (p0), (p1) ); \
-    v = XMVectorAdd( v, (p2) ); \
-    v = XMVectorAdd( v, (p3) ); \
-    v = XMVectorAdd( v, (p4) ); \
-    v = XMVectorAdd( v, (p5) ); \
-    v = XMVectorAdd( v, (p6) ); \
-    v = XMVectorAdd( v, (p7) ); \
-    res = XMVectorMultiply( v, g_boxScale3D ); \
-}
-
-
-//-------------------------------------------------------------------------------------
-// Linear filtering helpers
-//-------------------------------------------------------------------------------------
-
-struct LinearFilter
-{
-    size_t  u0;
-    float   weight0;
-    size_t  u1;
-    float   weight1;
-};
-
-inline void _CreateLinearFilter( _In_ size_t source, _In_ size_t dest, _In_ bool wrap, _Out_writes_(dest) LinearFilter* lf )
-{
-    assert( source > 0 );
-    assert( dest > 0 );
-    assert( lf != 0 );
-
-    float scale = float(source) / float(dest);
-
-    // Mirror is the same case as clamp for linear
-
-    for( size_t u = 0; u < dest; ++u )
-    {
-        float srcB = ( float(u) + 0.5f ) * scale + 0.5f;
-
-        ptrdiff_t isrcB = ptrdiff_t(srcB);
-        ptrdiff_t isrcA = isrcB - 1;
-        
-        if ( isrcA < 0 )
-        {
-            isrcA = ( wrap ) ? ( source - 1) : 0;
-        }
-
-        if ( size_t(isrcB) >= source )
-        {
-            isrcB = ( wrap ) ? 0 : ( source - 1);
-        }
-
-        float weight = 1.0f + float(isrcB) - srcB;
-
-        auto& entry = lf[ u ];
-        entry.u0 = size_t(isrcA);
-        entry.weight0 = weight;
-
-        entry.u1 = size_t(isrcB);
-        entry.weight1 = 1.0f - weight;
-    }
-}
-
-#define BILINEAR_INTERPOLATE( res, x, y, r0, r1 ) \
-    res = ( y.weight0 * ( (r0)[ x.u0 ] * x.weight0 + (r0)[ x.u1 ] * x.weight1 ) ) \
-          + ( y.weight1 * ( (r1)[ x.u0 ] * x.weight0 + (r1)[ x.u1 ] * x.weight1 ) )
-
-#define TRILINEAR_INTERPOLATE( res, x, y, z, r0, r1, r2, r3 ) \
-    res = ( z.weight0 * ( ( y.weight0 * ( (r0)[ x.u0 ] * x.weight0 + (r0)[ x.u1 ] * x.weight1 ) ) \
-                          + ( y.weight1 * ( (r1)[ x.u0 ] * x.weight0 + (r1)[ x.u1 ] * x.weight1 ) ) ) ) \
-          + ( z.weight1 * ( ( y.weight0 * ( (r2)[ x.u0 ] * x.weight0 + (r2)[ x.u1 ] * x.weight1 ) ) \
-                             + ( y.weight1 * ( (r3)[ x.u0 ] * x.weight0 + (r3)[ x.u1 ] * x.weight1 ) ) ) )
-
-
-//-------------------------------------------------------------------------------------
-// Cubic filtering helpers
-//-------------------------------------------------------------------------------------
-
-XMGLOBALCONST XMVECTORF32 g_cubicThird = { 1.f/3.f, 1.f/3.f, 1.f/3.f, 1.f/3.f }; 
-XMGLOBALCONST XMVECTORF32 g_cubicSixth = { 1.f/6.f, 1.f/6.f, 1.f/6.f, 1.f/6.f }; 
-XMGLOBALCONST XMVECTORF32 g_cubicHalf = { 1.f/2.f, 1.f/2.f, 1.f/2.f, 1.f/2.f };
-
-inline ptrdiff_t bounduvw( ptrdiff_t u, ptrdiff_t maxu, bool wrap, bool mirror )
-{
-    if ( wrap )
-    {
-        if ( u < 0 )
-        {
-            u = maxu + u + 1;
-        }
-        else if ( u > maxu )
-        {
-            u = u - maxu - 1;
-        }
-    }
-    else if ( mirror )
-    {
-        if ( u < 0 )
-        {
-            u = ( -u ) - 1;
-        }
-        else if ( u > maxu )
-        {
-            u = maxu - (u - maxu - 1);
-        }
-    }
-
-    // Handles clamp, but also a safety factor for degenerate images for wrap/mirror
-    u = std::min<ptrdiff_t>( u, maxu );
-    u = std::max<ptrdiff_t>( u, 0 );
-
-    return u;
-}
-
-struct CubicFilter
-{
-    size_t  u0;
-    size_t  u1;
-    size_t  u2;
-    size_t  u3;
-    float   x;
-};
-
-inline void _CreateCubicFilter( _In_ size_t source, _In_ size_t dest, _In_ bool wrap, _In_ bool mirror, _Out_writes_(dest) CubicFilter* cf )
-{
-    assert( source > 0 );
-    assert( dest > 0 );
-    assert( cf != 0 );
-
-    float scale = float(source) / float(dest);
-
-    for( size_t u = 0; u < dest; ++u )
-    {
-        float srcB = ( float(u) + 0.5f ) * scale - 0.5f;
-
-        ptrdiff_t isrcB = bounduvw( ptrdiff_t(srcB), source - 1, wrap, mirror );
-        ptrdiff_t isrcA = bounduvw( isrcB - 1, source - 1, wrap, mirror );
-        ptrdiff_t isrcC = bounduvw( isrcB + 1, source - 1, wrap, mirror );
-        ptrdiff_t isrcD = bounduvw( isrcB + 2, source - 1, wrap, mirror );
-
-        auto& entry = cf[ u ];
-        entry.u0 = size_t(isrcA);
-        entry.u1 = size_t(isrcB);
-        entry.u2 = size_t(isrcC);
-        entry.u3 = size_t(isrcD);
-
-        float x = srcB - float(isrcB);
-        entry.x = x;
-    }
-}
-
-#define CUBIC_INTERPOLATE( res, dx, p0, p1, p2, p3 ) \
-{ \
-    XMVECTOR a0 = (p1); \
-    XMVECTOR d0 = (p0) - a0; \
-    XMVECTOR d2 = (p2) - a0; \
-    XMVECTOR d3 = (p3) - a0; \
-    XMVECTOR a1 = d2 - g_cubicThird*d0 - g_cubicSixth*d3; \
-    XMVECTOR a2 = g_cubicHalf*d0 + g_cubicHalf*d2; \
-    XMVECTOR a3 = g_cubicSixth*d3 - g_cubicSixth*d0 - g_cubicHalf*d2;  \
-    XMVECTOR vdx = XMVectorReplicate( dx ); \
-    XMVECTOR vdx2 = vdx * vdx; \
-    XMVECTOR vdx3 = vdx2 * vdx; \
-    res = a0 + a1*vdx + a2*vdx2 + a3*vdx3; \
-}
-
-
-//-------------------------------------------------------------------------------------
-// Triangle filtering helpers
-//-------------------------------------------------------------------------------------
-
-namespace TriangleFilter
-{
-    struct FilterTo
-    {
-        size_t      u;
-        float       weight;
-    };
-
-    struct FilterFrom
-    {
-        size_t      count;
-        size_t      sizeInBytes;
-        FilterTo    to[1]; // variable-sized array
-    };
-
-    struct Filter
-    {
-        size_t      sizeInBytes;
-        size_t      totalSize;
-        FilterFrom  from[1]; // variable-sized array
-    };
-
-    struct TriangleRow
-    {
-        size_t                      remaining;
-        TriangleRow*                next;
-        ScopedAlignedArrayXMVECTOR  scanline;
-
-        TriangleRow() : remaining(0), next(nullptr) {}
-    };
-
-    static const size_t TF_FILTER_SIZE = sizeof(Filter) - sizeof(FilterFrom);
-    static const size_t TF_FROM_SIZE = sizeof(FilterFrom) - sizeof(FilterTo);
-    static const size_t TF_TO_SIZE = sizeof(FilterTo);
-
-    static const float TF_EPSILON = 0.00001f;
-
-    inline HRESULT _Create( _In_ size_t source, _In_ size_t dest, _In_ bool wrap, _Inout_ std::unique_ptr<Filter>& tf )
-    {
-        assert( source > 0 );
-        assert( dest > 0 );
-
-        float scale = float(dest) / float(source);
-        float scaleInv = 0.5f / scale;
-
-        // Determine storage required for filter and allocate memory if needed
-        size_t totalSize = TF_FILTER_SIZE + TF_FROM_SIZE + TF_TO_SIZE;
-        float repeat = (wrap) ? 1.f : 0.f;
-
-        for( size_t u = 0; u < source; ++u )
-        {
-            float src = float(u) - 0.5f;
-            float destMin = src * scale;
-            float destMax = destMin + scale;
-
-            totalSize += TF_FROM_SIZE + TF_TO_SIZE + size_t( destMax - destMin + repeat + 1.f ) * TF_TO_SIZE * 2;
-        }
-
-        uint8_t* pFilter = nullptr;
-
-        if ( tf )
-        {
-            // See if existing filter memory block is large enough to reuse
-            if ( tf->totalSize >= totalSize )
-            {
-                pFilter = reinterpret_cast<uint8_t*>( tf.get() );
-            }
-            else
-            {
-                // Need to reallocate filter memory block
-                tf.reset( nullptr );
-            }
-        }
-
-        if ( !tf )
-        {
-            // Allocate filter memory block
-            pFilter = new (std::nothrow) uint8_t[ totalSize ];
-            if ( !pFilter )
-                return E_OUTOFMEMORY;
-
-            tf.reset( reinterpret_cast<Filter*>( pFilter ) );
-            tf->totalSize = totalSize;
-        }
-
-        assert( pFilter != 0 );
-
-        // Filter setup
-        size_t sizeInBytes = TF_FILTER_SIZE;
-        size_t accumU = 0;
-        float accumWeight = 0.f;
-
-        for( size_t u = 0; u < source; ++u )
-        {
-            // Setup from entry
-            size_t sizeFrom = sizeInBytes;
-            auto pFrom = reinterpret_cast<FilterFrom*>( pFilter + sizeInBytes );
-            sizeInBytes += TF_FROM_SIZE;
-
-            if ( sizeInBytes > totalSize )
-                return E_FAIL;
-
-            size_t toCount = 0;
-
-            // Perform two passes to capture the influences from both sides
-            for( size_t j = 0; j < 2; ++j )
-            {
-                float src = float( u + j ) - 0.5f;
-
-                float destMin = src * scale;
-                float destMax = destMin + scale;
-
-                if ( !wrap )
-                {
-                    // Clamp
-                    if ( destMin < 0.f )
-                        destMin = 0.f;
-                    if ( destMax > float(dest) )
-                        destMax = float(dest);
-                }
-
-                for( auto k = static_cast<ptrdiff_t>( floorf( destMin ) ); float(k) < destMax; ++k )
-                {
-                    float d0 = float(k);
-                    float d1 = d0 + 1.f;
-
-                    size_t u0;
-                    if ( k < 0 )
-                    {
-                        // Handle wrap
-                        u0 = size_t( k + ptrdiff_t(dest) );
-                    }
-                    else if ( k >= ptrdiff_t(dest) )
-                    {
-                        // Handle wrap
-                        u0 = size_t( k - ptrdiff_t(dest) );
-                    }
-                    else
-                    {
-                        u0 = size_t( k );
-                    }
-
-                    // Save previous accumulated weight (if any)
-                    if ( u0 != accumU )
-                    {
-                        if ( accumWeight > TF_EPSILON )
-                        {
-                            auto pTo = reinterpret_cast<FilterTo*>( pFilter + sizeInBytes );
-                            sizeInBytes += TF_TO_SIZE;
-                            ++toCount;
-
-                            if ( sizeInBytes > totalSize )
-                                return E_FAIL;
-
-                            pTo->u = accumU;
-                            pTo->weight = accumWeight;
-                        }
-
-                        accumWeight = 0.f;
-                        accumU = u0;
-                    }
-
-                    // Clip destination
-                    if ( d0 < destMin )
-                        d0 = destMin;
-                    if ( d1 > destMax )
-                        d1 = destMax;
-
-                    // Calculate average weight over destination pixel
-
-                    float weight;
-                    if ( !wrap && src < 0.f )
-                        weight = 1.f;
-                    else if ( !wrap && ( ( src + 1.f ) >= float(source) ) )
-                        weight = 0.f;
-                    else
-                        weight = (d0 + d1) * scaleInv - src;
-
-                    accumWeight += (d1 - d0) * ( j ? (1.f - weight) : weight );
-                }
-            }
-
-            // Store accumulated weight
-            if ( accumWeight > TF_EPSILON )
-            {
-                auto pTo = reinterpret_cast<FilterTo*>( pFilter + sizeInBytes );
-                sizeInBytes += TF_TO_SIZE;
-                ++toCount;
-
-                if ( sizeInBytes > totalSize )
-                    return E_FAIL;
-
-                pTo->u = accumU;
-                pTo->weight = accumWeight;
-            }
-
-            accumWeight = 0.f;
-
-            // Finalize from entry
-            pFrom->count = toCount;
-            pFrom->sizeInBytes = sizeInBytes - sizeFrom;
-        }
-
-        tf->sizeInBytes = sizeInBytes;
-
-        return S_OK;
-    }
-
-}; // namespace
-
-}; // namespace

File diff suppressed because it is too large
+ 0 - 2566
Exporters/FBX/3rdParty/DirectXTex/Shaders/BC6HEncode.hlsl


File diff suppressed because it is too large
+ 0 - 1907
Exporters/FBX/3rdParty/DirectXTex/Shaders/BC7Encode.hlsl


+ 0 - 37
Exporters/FBX/3rdParty/DirectXTex/Shaders/CompileShaders.cmd

@@ -1,37 +0,0 @@
-@echo off
-rem THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-rem ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-rem THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-rem PARTICULAR PURPOSE.
-rem
-rem Copyright (c) Microsoft Corporation. All rights reserved.
-
-setlocal
-set error=0
-
-call :CompileShader BC7Encode TryMode456CS
-call :CompileShader BC7Encode TryMode137CS
-call :CompileShader BC7Encode TryMode02CS
-call :CompileShader BC7Encode EncodeBlockCS
-
-call :CompileShader BC6HEncode TryModeG10CS
-call :CompileShader BC6HEncode TryModeLE10CS
-call :CompileShader BC6HEncode EncodeBlockCS
-
-echo.
-
-if %error% == 0 (
-    echo Shaders compiled ok
-) else (
-    echo There were shader compilation errors!
-)
-
-endlocal
-exit /b
-
-:CompileShader
-set fxc=fxc /nologo %1.hlsl /Tcs_4_0 /Zpc /Qstrip_reflect /Qstrip_debug /E%2 /FhCompiled\%1_%2.inc /Vn%1_%2
-echo.
-echo %fxc%
-%fxc% || set error=1
-exit /b

File diff suppressed because it is too large
+ 0 - 22215
Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC6HEncode_EncodeBlockCS.inc


File diff suppressed because it is too large
+ 0 - 3375
Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC6HEncode_TryModeG10CS.inc


File diff suppressed because it is too large
+ 0 - 5103
Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC6HEncode_TryModeLE10CS.inc


File diff suppressed because it is too large
+ 0 - 10152
Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC7Encode_EncodeBlockCS.inc


File diff suppressed because it is too large
+ 0 - 3824
Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC7Encode_TryMode02CS.inc


File diff suppressed because it is too large
+ 0 - 3962
Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC7Encode_TryMode137CS.inc


File diff suppressed because it is too large
+ 0 - 3027
Exporters/FBX/3rdParty/DirectXTex/Shaders/Compiled/BC7Encode_TryMode456CS.inc


+ 0 - 34
Exporters/FBX/3rdParty/DirectXTex/scoped.h

@@ -1,34 +0,0 @@
-//-------------------------------------------------------------------------------------
-// scoped.h
-//  
-// Utility header with helper classes for exception-safe handling of resources
-//
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//-------------------------------------------------------------------------------------
-
-#if defined(_MSC_VER) && (_MSC_VER > 1000)
-#pragma once
-#endif
-
-#include <assert.h>
-#include <memory>
-#include <malloc.h>
-
-//---------------------------------------------------------------------------------
-struct aligned_deleter { void operator()(void* p) { _aligned_free(p); } };
-
-typedef std::unique_ptr<float, aligned_deleter> ScopedAlignedArrayFloat;
-
-typedef std::unique_ptr<DirectX::XMVECTOR, aligned_deleter> ScopedAlignedArrayXMVECTOR;
-
-//---------------------------------------------------------------------------------
-struct handle_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) CloseHandle(h); } };
-
-typedef public std::unique_ptr<void, handle_closer> ScopedHandle;
-
-inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }

+ 273 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk.h

@@ -0,0 +1,273 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxsdk.h
+#ifndef _FBXSDK_H_
+#define _FBXSDK_H_
+
+/**
+  * \mainpage FBX SDK Reference
+  * <p>
+  * \section welcome Welcome to the FBX SDK Reference
+  * The FBX SDK Reference contains reference information on every header file, 
+  * namespace, class, method, enum, typedef, variable, and other C++ elements 
+  * that comprise the FBX software development kit (SDK).
+  * <p>
+  * The FBX SDK Reference is organized into the following sections:
+  * <ul><li>Class List: an alphabetical list of FBX SDK classes
+  *     <li>Class Hierarchy: a textual representation of the FBX SDK class structure
+  *     <li>Graphical Class Hierarchy: a graphical representation of the FBX SDK class structure
+  *     <li>File List: an alphabetical list of all documented header files</ul>
+  * <p>
+  * \section otherdocumentation Other Documentation
+  * Apart from this reference guide, an FBX SDK Programming Guide and many FBX 
+  * SDK examples are also provided.
+  * <p>
+  * \section aboutFBXSDK About the FBX SDK
+  * The FBX SDK is a C++ software development kit (SDK) that lets you import 
+  * and export 3D scenes using the Autodesk FBX file format. The FBX SDK 
+  * reads FBX files created with FiLMBOX version 2.5 and later and writes FBX 
+  * files compatible with MotionBuilder version 6.0 and up. 
+  */
+
+#pragma pack(push, 8)	//FBXSDK is compiled with default value (8)
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#ifndef FBXSDK_NAMESPACE_USING
+	#define FBXSDK_NAMESPACE_USING 1
+#endif
+
+//---------------------------------------------------------------------------------------
+//Core Base Includes
+#include <fbxsdk/core/base/fbxarray.h>
+#include <fbxsdk/core/base/fbxbitset.h>
+#include <fbxsdk/core/base/fbxcharptrset.h>
+#include <fbxsdk/core/base/fbxcontainerallocators.h>
+#include <fbxsdk/core/base/fbxdynamicarray.h>
+#include <fbxsdk/core/base/fbxstatus.h>
+#include <fbxsdk/core/base/fbxfile.h>
+#ifndef FBXSDK_ENV_WINSTORE
+	#include <fbxsdk/core/base/fbxfolder.h>
+#endif
+#include <fbxsdk/core/base/fbxhashmap.h>
+#include <fbxsdk/core/base/fbxintrusivelist.h>
+#include <fbxsdk/core/base/fbxmap.h>
+#include <fbxsdk/core/base/fbxmemorypool.h>
+#include <fbxsdk/core/base/fbxpair.h>
+#include <fbxsdk/core/base/fbxset.h>
+#include <fbxsdk/core/base/fbxstring.h>
+#include <fbxsdk/core/base/fbxstringlist.h>
+#include <fbxsdk/core/base/fbxtime.h>
+#include <fbxsdk/core/base/fbxtimecode.h>
+#include <fbxsdk/core/base/fbxutils.h>
+
+//---------------------------------------------------------------------------------------
+//Core Math Includes
+#include <fbxsdk/core/math/fbxmath.h>
+#include <fbxsdk/core/math/fbxdualquaternion.h>
+#include <fbxsdk/core/math/fbxmatrix.h>
+#include <fbxsdk/core/math/fbxquaternion.h>
+#include <fbxsdk/core/math/fbxvector2.h>
+#include <fbxsdk/core/math/fbxvector4.h>
+
+//---------------------------------------------------------------------------------------
+//Core Sync Includes
+#ifndef FBXSDK_ENV_WINSTORE
+	#include <fbxsdk/core/sync/fbxatomic.h>
+	#include <fbxsdk/core/sync/fbxclock.h>
+	#include <fbxsdk/core/sync/fbxsync.h>
+	#include <fbxsdk/core/sync/fbxthread.h>
+#endif /* !FBXSDK_ENV_WINSTORE */
+
+//---------------------------------------------------------------------------------------
+//Core Includes
+#include <fbxsdk/core/fbxclassid.h>
+#include <fbxsdk/core/fbxconnectionpoint.h>
+#include <fbxsdk/core/fbxdatatypes.h>
+#ifndef FBXSDK_ENV_WINSTORE
+	#include <fbxsdk/core/fbxmodule.h>
+	#include <fbxsdk/core/fbxloadingstrategy.h>
+#endif /* !FBXSDK_ENV_WINSTORE */
+#include <fbxsdk/core/fbxmanager.h>
+#include <fbxsdk/core/fbxobject.h>
+#include <fbxsdk/core/fbxperipheral.h>
+#ifndef FBXSDK_ENV_WINSTORE
+	#include <fbxsdk/core/fbxplugin.h>
+	#include <fbxsdk/core/fbxplugincontainer.h>
+#endif /* !FBXSDK_ENV_WINSTORE */
+#include <fbxsdk/core/fbxproperty.h>
+#include <fbxsdk/core/fbxpropertydef.h>
+#include <fbxsdk/core/fbxpropertyhandle.h>
+#include <fbxsdk/core/fbxpropertypage.h>
+#include <fbxsdk/core/fbxpropertytypes.h>
+#include <fbxsdk/core/fbxquery.h>
+#include <fbxsdk/core/fbxqueryevent.h>
+#ifndef FBXSDK_ENV_WINSTORE
+	#include <fbxsdk/core/fbxscopedloadingdirectory.h>
+	#include <fbxsdk/core/fbxscopedloadingfilename.h>
+#endif /* !FBXSDK_ENV_WINSTORE */
+#include <fbxsdk/core/fbxxref.h>
+
+//---------------------------------------------------------------------------------------
+//File I/O Includes
+#include <fbxsdk/fileio/fbxexporter.h>
+#include <fbxsdk/fileio/fbxexternaldocreflistener.h>
+#include <fbxsdk/fileio/fbxfiletokens.h>
+#include <fbxsdk/fileio/fbxglobalcamerasettings.h>
+#include <fbxsdk/fileio/fbxgloballightsettings.h>
+#include <fbxsdk/fileio/fbxgobo.h>
+#include <fbxsdk/fileio/fbximporter.h>
+#include <fbxsdk/fileio/fbxiobase.h>
+#include <fbxsdk/fileio/fbxiopluginregistry.h>
+#include <fbxsdk/fileio/fbxiosettings.h>
+#include <fbxsdk/fileio/fbxstatisticsfbx.h>
+#include <fbxsdk/fileio/fbxstatistics.h>
+
+//---------------------------------------------------------------------------------------
+//Scene Includes
+#include <fbxsdk/scene/fbxcollection.h>
+#include <fbxsdk/scene/fbxcollectionexclusive.h>
+#include <fbxsdk/scene/fbxcontainer.h>
+#include <fbxsdk/scene/fbxcontainertemplate.h>
+#include <fbxsdk/scene/fbxdisplaylayer.h>
+#include <fbxsdk/scene/fbxdocument.h>
+#include <fbxsdk/scene/fbxdocumentinfo.h>
+#include <fbxsdk/scene/fbxenvironment.h>
+#include <fbxsdk/scene/fbxgroupname.h>
+#include <fbxsdk/scene/fbxlibrary.h>
+#include <fbxsdk/scene/fbxobjectmetadata.h>
+#include <fbxsdk/scene/fbxpose.h>
+#include <fbxsdk/scene/fbxreference.h>
+#include <fbxsdk/scene/fbxscene.h>
+#include <fbxsdk/scene/fbxselectionset.h>
+#include <fbxsdk/scene/fbxselectionnode.h>
+#include <fbxsdk/scene/fbxtakeinfo.h>
+#include <fbxsdk/scene/fbxthumbnail.h>
+#include <fbxsdk/scene/fbxvideo.h>
+
+//---------------------------------------------------------------------------------------
+//Scene Animation Includes
+#include <fbxsdk/scene/animation/fbxanimcurve.h>
+#include <fbxsdk/scene/animation/fbxanimcurvebase.h>
+#include <fbxsdk/scene/animation/fbxanimcurvefilters.h>
+#include <fbxsdk/scene/animation/fbxanimcurvenode.h>
+#include <fbxsdk/scene/animation/fbxanimevalclassic.h>
+#include <fbxsdk/scene/animation/fbxanimevalstate.h>
+#include <fbxsdk/scene/animation/fbxanimevaluator.h>
+#include <fbxsdk/scene/animation/fbxanimlayer.h>
+#include <fbxsdk/scene/animation/fbxanimstack.h>
+#include <fbxsdk/scene/animation/fbxanimutilities.h>
+
+//---------------------------------------------------------------------------------------
+//Scene Constraint Includes
+#include <fbxsdk/scene/constraint/fbxcharacternodename.h>
+#include <fbxsdk/scene/constraint/fbxcharacter.h>
+#include <fbxsdk/scene/constraint/fbxcharacterpose.h>
+#include <fbxsdk/scene/constraint/fbxconstraint.h>
+#include <fbxsdk/scene/constraint/fbxconstraintaim.h>
+#include <fbxsdk/scene/constraint/fbxconstraintcustom.h>
+#include <fbxsdk/scene/constraint/fbxconstraintparent.h>
+#include <fbxsdk/scene/constraint/fbxconstraintposition.h>
+#include <fbxsdk/scene/constraint/fbxconstraintrotation.h>
+#include <fbxsdk/scene/constraint/fbxconstraintscale.h>
+#include <fbxsdk/scene/constraint/fbxconstraintsinglechainik.h>
+#include <fbxsdk/scene/constraint/fbxconstraintutils.h>
+#include <fbxsdk/scene/constraint/fbxcontrolset.h>
+#include <fbxsdk/scene/constraint/fbxhik2fbxcharacter.h>
+
+//---------------------------------------------------------------------------------------
+//Scene Geometry Includes
+#include <fbxsdk/scene/geometry/fbxblendshape.h>
+#include <fbxsdk/scene/geometry/fbxblendshapechannel.h>
+#include <fbxsdk/scene/geometry/fbxcache.h>
+#include <fbxsdk/scene/geometry/fbxcachedeffect.h>
+#include <fbxsdk/scene/geometry/fbxcamera.h>
+#include <fbxsdk/scene/geometry/fbxcamerastereo.h>
+#include <fbxsdk/scene/geometry/fbxcameraswitcher.h>
+#include <fbxsdk/scene/geometry/fbxcluster.h>
+#include <fbxsdk/scene/geometry/fbxdeformer.h>
+#include <fbxsdk/scene/geometry/fbxgenericnode.h>
+#include <fbxsdk/scene/geometry/fbxgeometry.h>
+#include <fbxsdk/scene/geometry/fbxgeometrybase.h>
+#include <fbxsdk/scene/geometry/fbxgeometryweightedmap.h>
+#include <fbxsdk/scene/geometry/fbxlight.h>
+#include <fbxsdk/scene/geometry/fbxlimitsutilities.h>
+#include <fbxsdk/scene/geometry/fbxline.h>
+#include <fbxsdk/scene/geometry/fbxlodgroup.h>
+#include <fbxsdk/scene/geometry/fbxmarker.h>
+#include <fbxsdk/scene/geometry/fbxmesh.h>
+#include <fbxsdk/scene/geometry/fbxnode.h>
+#include <fbxsdk/scene/geometry/fbxnodeattribute.h>
+#include <fbxsdk/scene/geometry/fbxnull.h>
+#include <fbxsdk/scene/geometry/fbxnurbs.h>
+#include <fbxsdk/scene/geometry/fbxnurbscurve.h>
+#include <fbxsdk/scene/geometry/fbxnurbssurface.h>
+#include <fbxsdk/scene/geometry/fbxopticalreference.h>
+#include <fbxsdk/scene/geometry/fbxpatch.h>
+#include <fbxsdk/scene/geometry/fbxproceduralgeometry.h>
+#include <fbxsdk/scene/geometry/fbxshape.h>
+#include <fbxsdk/scene/geometry/fbxskeleton.h>
+#include <fbxsdk/scene/geometry/fbxskin.h>
+#include <fbxsdk/scene/geometry/fbxsubdeformer.h>
+#include <fbxsdk/scene/geometry/fbxsubdiv.h>
+#include <fbxsdk/scene/geometry/fbxtrimnurbssurface.h>
+#include <fbxsdk/scene/geometry/fbxvertexcachedeformer.h>
+#include <fbxsdk/scene/geometry/fbxweightedmapping.h>
+
+//---------------------------------------------------------------------------------------
+//Scene Shading Includes
+#include <fbxsdk/scene/shading/fbxshadingconventions.h>
+#include <fbxsdk/scene/shading/fbxbindingsentryview.h>
+#include <fbxsdk/scene/shading/fbxbindingtable.h>
+#include <fbxsdk/scene/shading/fbxbindingtableentry.h>
+#include <fbxsdk/scene/shading/fbxbindingoperator.h>
+#include <fbxsdk/scene/shading/fbxconstantentryview.h>
+#include <fbxsdk/scene/shading/fbxentryview.h>
+#include <fbxsdk/scene/shading/fbxfiletexture.h>
+#include <fbxsdk/scene/shading/fbximplementation.h>
+#include <fbxsdk/scene/shading/fbximplementationfilter.h>
+#include <fbxsdk/scene/shading/fbximplementationutils.h>
+#include <fbxsdk/scene/shading/fbxlayeredtexture.h>
+#include <fbxsdk/scene/shading/fbxoperatorentryview.h>
+#include <fbxsdk/scene/shading/fbxproceduraltexture.h>
+#include <fbxsdk/scene/shading/fbxpropertyentryview.h>
+#include <fbxsdk/scene/shading/fbxsemanticentryview.h>
+#include <fbxsdk/scene/shading/fbxsurfacelambert.h>
+#include <fbxsdk/scene/shading/fbxsurfacematerial.h>
+#include <fbxsdk/scene/shading/fbxsurfacephong.h>
+#include <fbxsdk/scene/shading/fbxtexture.h>
+
+//---------------------------------------------------------------------------------------
+//Utilities Includes
+#include <fbxsdk/utils/fbxdeformationsevaluator.h>
+#include <fbxsdk/utils/fbxprocessor.h>
+#include <fbxsdk/utils/fbxprocessorxref.h>
+#include <fbxsdk/utils/fbxprocessorxrefuserlib.h>
+#include <fbxsdk/utils/fbxprocessorshaderdependency.h>
+#include <fbxsdk/utils/fbxclonemanager.h>
+#include <fbxsdk/utils/fbxgeometryconverter.h>
+#include <fbxsdk/utils/fbxmanipulators.h>
+#include <fbxsdk/utils/fbxmaterialconverter.h>
+#include <fbxsdk/utils/fbxrenamingstrategyfbx5.h>
+#include <fbxsdk/utils/fbxrenamingstrategyfbx6.h>
+#include <fbxsdk/utils/fbxrenamingstrategyutilities.h>
+#include <fbxsdk/utils/fbxrootnodeutility.h>
+#include <fbxsdk/utils/fbxusernotification.h>
+
+//---------------------------------------------------------------------------------------
+#if defined(FBXSDK_NAMESPACE) && (FBXSDK_NAMESPACE_USING == 1)
+	using namespace FBXSDK_NAMESPACE;
+#endif
+
+#pragma pack(pop)
+
+#endif /* _FBXSDK_H_ */

+ 419 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxalloc.h

@@ -0,0 +1,419 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+/** \file fbxalloc.h
+  * Allocation functions definition.
+  *
+  * It is possible to override memory allocation functions throughout the FBX SDK by
+  * providing system memory allocation functions using the handler set functions below.
+  * The Microsoft Windows implementation in debug mode allows to specify where the
+  * allocations happen by providing the standard block type, file name and line number.
+  */
+#ifndef _FBXSDK_CORE_ARCH_ALLOC_H_
+#define _FBXSDK_CORE_ARCH_ALLOC_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#if defined(_DEBUG) && defined(FBXSDK_ENV_WIN)
+	#include <crtdbg.h>
+#endif
+
+#if defined(FBXSDK_ENV_MAC)
+	#include <malloc/malloc.h>
+#else
+	#include <malloc.h>
+#endif
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+#if defined(FBXSDK_CPU_32) && !defined(FBXSDK_ENV_IOS)
+	#define FBXSDK_MEMORY_ALIGNMENT ((size_t)8U)
+#else
+	#define FBXSDK_MEMORY_ALIGNMENT ((size_t)16U)
+#endif
+
+#define FBXSDK_MEMORY_COPY(dst, src, size) {memcpy(dst,src,size);}
+
+typedef void*	(*FbxMallocProc)(size_t);			//! Function pointer signature used to replace "malloc"
+typedef void*	(*FbxCallocProc)(size_t, size_t);	//! Function pointer signature used to replace "calloc"
+typedef void*	(*FbxReallocProc)(void*, size_t);	//! Function pointer signature used to replace "realloc"
+typedef void	(*FbxFreeProc)(void*);				//! Function pointer signature used to replace "free"
+
+/** Set the global memory allocation function used internally by the FBX SDK.
+* \param pHandler Function pointer that implements the necessary procedure to allocate memory in the system. */
+FBXSDK_DLL void FbxSetMallocHandler(FbxMallocProc pHandler);
+
+/** Set the global zero'd memory allocation function used internally by the FBX SDK.
+* \param pHandler Function pointer that implements the necessary procedure to allocate zero'd memory in the system. */
+FBXSDK_DLL void FbxSetCallocHandler(FbxCallocProc pHandler);
+
+/** Set the global memory re-allocation function used internally by the FBX SDK.
+* \param pHandler Function pointer that implements the necessary procedure to re-allocate memory in the system. */
+FBXSDK_DLL void FbxSetReallocHandler(FbxReallocProc pHandler);
+
+/** Set the global memory freeing function used internally by the FBX SDK.
+* \param pHandler Function pointer that implements the necessary procedure to free memory in the system. */
+FBXSDK_DLL void FbxSetFreeHandler(FbxFreeProc pHandler);
+
+/** Get the global memory allocation function used internally by the FBX SDK.
+* \return pHandler Function pointer on FBX's internal malloc */
+FBXSDK_DLL FbxMallocProc FbxGetMallocHandler();
+
+/** Get the global zero'd memory allocation function used internally by the FBX SDK.
+* \return pHandler Function pointer on FBX's internal calloc */
+FBXSDK_DLL FbxCallocProc FbxGetCallocHandler();
+
+/** Get the global memory re-allocation function used internally by the FBX SDK.
+* \return pHandler Function pointer on FBX's internal realloc */
+FBXSDK_DLL FbxReallocProc FbxGetReallocHandler();
+
+/** Get the global memory freeing function used internally by the FBX SDK.
+* \return pHandler Function pointer on FBX's internal free */
+FBXSDK_DLL FbxFreeProc FbxGetFreeHandler();
+
+/** Get the default global memory allocation function used internally by the FBX SDK.
+* \return pHandler Function pointer on FBX's internal malloc */
+FBXSDK_DLL FbxMallocProc FbxGetDefaultMallocHandler();
+
+/** Get the default global zero'd memory allocation function used internally by the FBX SDK.
+* \return pHandler Function pointer on FBX's internal calloc */
+FBXSDK_DLL FbxCallocProc FbxGetDefaultCallocHandler();
+
+/** Get the default global memory re-allocation function used internally by the FBX SDK.
+* \return pHandler Function pointer on FBX's internal realloc */
+FBXSDK_DLL FbxReallocProc FbxGetDefaultReallocHandler();
+
+/** Get the default global memory freeing function used internally by the FBX SDK.
+* \return pHandler Function pointer on FBX's internal free */
+FBXSDK_DLL FbxFreeProc FbxGetDefaultFreeHandler();
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	FBXSDK_DLL void* FbxMalloc(size_t pSize);
+	FBXSDK_DLL void* FbxCalloc(size_t pCount, size_t pSize);
+	FBXSDK_DLL void* FbxRealloc(void* pData, size_t pSize);
+	FBXSDK_DLL void FbxFree(void* pData);
+	FBXSDK_DLL char* FbxStrDup(const char* pString);
+	FBXSDK_DLL wchar_t* FbxStrDupWC(const wchar_t* pString);
+
+	//These versions of allocators use the default system mallocs, and on Windows we also pass the debugging parameters.
+	//If you define FBXSDK_ALLOC_DEBUG in your project, the FBX SDK will use these debug versions everywhere.
+	FBXSDK_DLL void* FbxMallocDebug(size_t pSize, int pBlock, const char* pFile, int pLine);
+	FBXSDK_DLL void* FbxCallocDebug(size_t pCount, size_t pSize, int pBlock, const char* pFile, int pLine);
+	FBXSDK_DLL void* FbxReallocDebug(void* pData, size_t pSize, int pBlock, const char* pFile, int pLine);
+	FBXSDK_DLL void FbxFreeDebug(void* pData, int pBlock);
+
+	//When FBXSDK_ALLOC_DEBUG is defined, redirect allocation calls to the debug version.
+	#if defined(FBXSDK_ALLOC_DEBUG)
+		#define FbxMalloc(s) FbxMallocDebug(s, _NORMAL_BLOCK, __FILE__, __LINE__)
+		#define FbxCalloc(c, s) FbxCallocDebug(c, s, _NORMAL_BLOCK, __FILE__, __LINE__)
+		#define FbxRealloc(p, s) FbxReallocDebug(p, s, _NORMAL_BLOCK, __FILE__, __LINE__)
+		#define FbxFree(p) FbxFreeDebug(p, _NORMAL_BLOCK)
+	#endif
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+
+//! Deletion policy for pointer template classes that uses the delete operator.
+template <class Type> class FbxDeletionPolicyDefault
+{
+public:
+	//! Destruction policy implementation.
+	static inline void DeleteIt(Type** pPtr)
+	{
+		if( *pPtr )
+		{
+			delete *pPtr;
+			*pPtr = NULL;
+		}
+	}
+};
+
+//! Deletion policy for pointer template classes that uses the FbxDelete() function.
+template<typename T> void FbxDelete(T* p);
+template<typename T> void FbxDelete(const T* p);
+template <class Type> class FbxDeletionPolicyDelete
+{
+public:
+	//! Destruction policy implementation.
+	static inline void DeleteIt(Type** mPtr)
+	{
+		if( *mPtr )
+		{
+			FbxDelete(*mPtr);
+			*mPtr = NULL;
+		}
+	}
+};
+
+//! Deletion policy for pointer template classes that uses the FbxFree() function.
+template <class Type> class FbxDeletionPolicyFree
+{
+public:
+	//! Destruction policy implementation.
+	static inline void DeleteIt(Type** pPtr)
+	{
+		if( *pPtr )
+		{
+			FbxFree(*pPtr);
+			*pPtr = NULL;
+		}
+	}
+};
+
+//! Deletion policy for pointer template classes that uses the Destroy() function.
+template <class Type> class FbxDeletionPolicyObject
+{
+public:
+	//! Destruction policy implementation.
+	static inline void DeleteIt(Type** pPtr)
+	{
+		if( *pPtr )
+		{
+			(*pPtr)->Destroy();
+			*pPtr = NULL;
+		}
+	}
+};
+
+/** FbxAutoPtr mimics the \c auto_ptr class template implementation available in the C++ Standard Library. The \c auto_ptr template
+* class describes an object that stores a pointer to a single allocated object of type Type* that ensures that the object to which
+* it points gets destroyed automatically when control leaves a scope. */
+template<class Type, class Policy=FbxDeletionPolicyDefault<Type> > class FbxAutoPtr
+{
+public:
+	//! Construct from a pointer.
+	explicit FbxAutoPtr(Type* pPtr=0) : mPtr(pPtr){}
+
+	//! Destructor.
+	~FbxAutoPtr() { Policy::DeleteIt(&mPtr); }
+
+	//! Retrieve the pointer it holds.
+	inline Type* Get() const { return mPtr; }
+
+	//! Member access operator.
+	inline Type* operator->() const { return mPtr; }
+
+	//! Convert to a Type pointer.
+	inline operator Type* () const { return mPtr; }
+
+	//! Dereference operator.
+	inline Type& operator*() const { return *mPtr; }
+
+	//! Logical not operator.
+	inline bool operator!() const { return mPtr == 0; }
+
+	//! Convert to boolean value.
+	inline operator bool () const { return mPtr != 0; }
+
+	//! Reset the scoped pointer by swapping with another pointer.
+	inline void Reset(Type* pPtr=0)
+	{
+		FBX_ASSERT(pPtr == 0 || pPtr != mPtr);	//Catch self-reset errors
+		FbxAutoPtr<Type, Policy>(pPtr).Swap(*this);
+	}
+
+	//! Swap with another pointer.
+	inline void Swap(FbxAutoPtr& pOther)
+	{
+		Type* TmpPtr = pOther.mPtr;
+		pOther.mPtr = mPtr;
+		mPtr = TmpPtr;
+	}
+
+	//! Release the pointer, so that it won't perform deletion in its destruction.
+	inline Type* Release()
+	{
+		Type* TmpPtr = mPtr;
+		mPtr = NULL;
+		return TmpPtr;
+	}
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+private:
+	FbxAutoPtr(const FbxAutoPtr&);
+	FbxAutoPtr& operator=(const FbxAutoPtr&);
+
+	Type* mPtr;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+//! Scoped pointer for FbxMalloc allocations, which call FbxFree() to deallocate.
+template <class Type> class FbxAutoFreePtr : public FbxAutoPtr<Type, FbxDeletionPolicyFree<Type> >
+{
+public:
+	//! Construct from a pointer.
+    explicit FbxAutoFreePtr(Type* pPtr=0) : FbxAutoPtr<Type, FbxDeletionPolicyFree<Type> >(pPtr){}
+};
+
+//! Scoped pointer for FbxNew allocations, which call FbxDelete() to deallocate.
+template <class Type> class FbxAutoDeletePtr : public FbxAutoPtr<Type, FbxDeletionPolicyDelete<Type> >
+{
+public:
+	//! Construct from a pointer.
+    explicit FbxAutoDeletePtr(Type* pPtr=0) : FbxAutoPtr<Type, FbxDeletionPolicyDelete<Type> >(pPtr){}
+};
+
+//! Scoped pointer for FbxObject derived classes, which call Destroy() to deallocate.
+template <class Type> class FbxAutoDestroyPtr : public FbxAutoPtr<Type, FbxDeletionPolicyObject<Type> >
+{
+public:
+	//! Construct from a pointer.
+    explicit FbxAutoDestroyPtr(Type* pPtr=0) : FbxAutoPtr<Type, FbxDeletionPolicyObject<Type> >(pPtr){}
+};
+
+
+/** FbxSharedPtr class describes an object that stores a pointer to a single allocated object of type 
+* Type* that ensures that the object to which it points gets destroyed automatically when the control 
+* leaves a scope and the reference count is 0. */
+class RefCount
+{
+public:
+ 	RefCount()	{ Init(); };
+	~RefCount() { Init(); };
+
+	void    Init()   { count = 0; }
+	void	IncRef() { count++; }
+	int	    DecRef() { count--; if (count < 0) count = 0; return count; }
+	
+private:
+	int  count;
+};
+
+template<class Type, class Policy=FbxDeletionPolicyDefault<Type> > class FbxSharedPtr
+{
+public:
+	// Default constructor.
+	FbxSharedPtr() : 
+		mPtr(0),
+		mRef(0)
+	{}
+
+	//! Construct from a pointer.
+	explicit FbxSharedPtr(Type* pPtr) : 
+		mPtr(pPtr),
+		mRef(0)
+	{ 
+		if (pPtr != 0) 
+		{
+			mRef = (RefCount*)FbxMalloc(sizeof(RefCount)); 
+			mRef->Init();
+			mRef->IncRef(); 
+		}
+	}
+
+	//! Copy constructor
+	FbxSharedPtr(const FbxSharedPtr& pSPtr) : 
+		mPtr(pSPtr.mPtr), 
+		mRef(pSPtr.mRef) 
+	{ 
+		if (pSPtr.mPtr != 0 && mRef != 0) 
+			mRef->IncRef(); 
+	}
+
+	// Assignment operator
+	FbxSharedPtr& operator=(const FbxSharedPtr& pSPtr)
+	{
+		if (this != &pSPtr) // avoid self assignment
+		{
+			Reset();
+
+			if (pSPtr.mPtr)
+			{
+				mPtr = pSPtr.mPtr;
+				mRef = pSPtr.mRef;
+				FBX_ASSERT(mRef != NULL);
+				mRef->IncRef();
+			}
+		}
+		return *this;
+	}
+
+	//! Destructor.
+	~FbxSharedPtr() { Destroy(); }
+
+	void Destroy() { Reset(); }
+
+	//! Retrieve the pointer it holds.
+	inline Type* Get() const { return mPtr; }
+
+	//! Member access operator.
+	inline Type* operator->() const { return mPtr; }
+
+	//! Convert to a Type pointer.
+	inline operator Type* () const { return mPtr; }
+
+	//! Dereference operator.
+	inline Type& operator*() const { return *mPtr; }
+
+	//! Logical not operator.
+	inline bool operator!() const { return mPtr == 0; }
+
+	//! Convert to boolean value.
+	inline operator bool () const { return mPtr != 0; }
+
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+private:
+	void Reset() 
+	{		
+		if (mRef)
+		{
+			FBX_ASSERT(mPtr != 0);
+			if (mRef->DecRef() == 0)
+			{
+				Policy::DeleteIt(&mPtr); 
+				FbxFree(mRef);
+				mRef = NULL;
+			}
+		}
+	}
+
+	Type* mPtr;
+	RefCount* mRef;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+//! Scoped pointer for FbxMalloc allocations, which call FbxFree() to deallocate.
+template <class Type> class FbxSharedFreePtr : public FbxSharedPtr<Type, FbxDeletionPolicyFree<Type> >
+{
+public:
+	//! Construct from a pointer.
+    explicit FbxSharedFreePtr(Type* pPtr=0) : FbxSharedPtr<Type, FbxDeletionPolicyFree<Type> >(pPtr){}
+};
+
+//! Scoped pointer for FbxNew allocations, which call FbxDelete() to deallocate.
+template <class Type> class FbxSharedDeletePtr : public FbxSharedPtr<Type, FbxDeletionPolicyDelete<Type> >
+{
+public:
+	//! Construct from a pointer.
+    explicit FbxSharedDeletePtr(Type* pPtr=0) : FbxSharedPtr<Type, FbxDeletionPolicyDelete<Type> >(pPtr){}
+};
+
+//! Scoped pointer for FbxObject derived classes, which call Destroy() to deallocate.
+template <class Type> class FbxSharedDestroyPtr : public FbxSharedPtr<Type, FbxDeletionPolicyObject<Type> >
+{
+public:
+	//! Construct from a pointer.
+    explicit FbxSharedDestroyPtr(Type* pPtr=0) : FbxSharedPtr<Type, FbxDeletionPolicyObject<Type> >(pPtr){}
+};
+
+
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_ARCH_ALLOC_H_ */

+ 238 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxarch.h

@@ -0,0 +1,238 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+/** \file fbxarch.h
+  * Architecture definition.
+  * 
+  * List of available preprocessor defines that can appear on various systems:
+  *
+  * Operating System Environment:
+  *    FBXSDK_ENV_WIN (Windows)
+  *    FBXSDK_ENV_WINSTORE (Windows Store App)
+  *    FBXSDK_ENV_MAC (MacOSX)
+  *    FBXSDK_ENV_IOS (iOS)
+  *    FBXSDK_ENV_LINUX (Linux)
+  *
+  * Architecture:
+  *    FBXSDK_ARCH_IX86 (Intel x86)
+  *    FBXSDK_ARCH_AMD64 (AMD64)
+  *    FBXSDK_ARCH_ARM (Advanced RISC Machine)
+  *
+  * Processor:
+  *    FBXSDK_CPU_32 (32bit processor)
+  *    FBXSDK_CPU_64 (64bit processor)
+  *
+  * Compiler:
+  *    FBXSDK_COMPILER_MSC (Microsoft Compiler)
+  *    FBXSDK_COMPILER_GNU (GNU Compiler)
+  *    FBXSDK_COMPILER_INTEL (Intel Compiler)
+  *    FBXSDK_COMPILER_CLANG (Clang Compiler)
+  *
+  * These definitions are based on the information found here:
+  * http://predef.sourceforge.net/index.php
+  *
+  */
+#ifndef _FBXSDK_CORE_ARCH_ARCH_H_
+#define _FBXSDK_CORE_ARCH_ARCH_H_
+
+#if defined(_WIN32) || defined(_WIN64) //Microsoft Windows ------------------------------
+
+	#define FBXSDK_ENV_WIN 1
+
+	#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
+		#define FBXSDK_ENV_WINSTORE 1
+	#endif
+
+	#if defined(_M_X64)
+		#define FBXSDK_ARCH_AMD64 1
+		#define FBXSDK_CPU_64 1
+	#elif defined(_M_IX86)
+		#define FBXSDK_ARCH_IX86 1
+		#define FBXSDK_CPU_32 1
+	#elif defined(_M_ARM)
+		#define FBXSDK_ARCH_ARM 1
+		#define FBXSDK_CPU_32 1
+	#else
+		#error Unsupported architecture!
+	#endif
+
+	#if defined(_MSC_VER)
+		#define FBXSDK_COMPILER_MSC 1
+	#elif defined(__GNUC__)
+		#define FBXSDK_COMPILER_GNU 1
+	#elif defined(__ICL)
+		#define FBXSDK_COMPILER_INTEL 1
+	#else
+		#error Unsupported compiler!
+	#endif
+
+#elif defined(__APPLE__) || defined(__MACH__) //Apple MacOS/X ---------------------------
+
+    #include "TargetConditionals.h"
+
+	#define FBXSDK_ENV_MAC 1
+
+    #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
+        #define FBXSDK_ENV_IOS 1
+    #endif
+
+	#if defined(__i386__)
+		#define FBXSDK_ARCH_IX86 1
+		#define FBXSDK_CPU_32 1
+	#elif defined(__x86_64__) || defined(__x86_64)
+		#define FBXSDK_ARCH_AMD64 1
+		#define FBXSDK_CPU_64 1
+	#elif defined(__arm__)
+		#define FBXSDK_ARCH_ARM 1
+		#define FBXSDK_CPU_32 1
+    #elif defined(__arm64__)
+        #define FBXSDK_ARCH_ARM 1
+        #define FBXSDK_CPU_64 1
+	#else
+		#error Unsupported architecture!
+	#endif
+
+	#if defined(__GNUC__)
+		#define FBXSDK_COMPILER_GNU 1
+	#endif
+
+    #if defined(__clang__)
+        #define FBXSDK_COMPILER_CLANG 1
+	#endif
+
+	#if !defined(FBXSDK_COMPILER_GNU) && !defined(FBXSDK_COMPILER_CLANG)
+		#error Unsupported compiler!
+	#endif
+
+#elif defined(__linux__) || defined(__CYGWIN__) || defined(EMSCRIPTEN) || defined(ANDROID) //Linux ---------------------------------
+
+	#define FBXSDK_ENV_LINUX 1
+
+  	#if defined(EMSCRIPTEN)
+  		#define FBXSDK_ENV_EMSCRIPTEN 1
+  	#endif
+
+	#if defined(ANDROID)
+		#define FBXSDK_ENV_ANDROID 1
+	#endif
+
+	#if defined(__i386__)
+		#define FBXSDK_ARCH_IX86 1
+		#define FBXSDK_CPU_32 1
+	#elif defined(__x86_64__) || defined(__x86_64)
+		#define FBXSDK_ARCH_AMD64 1
+		#define FBXSDK_CPU_64 1
+    #elif defined(__arm__)
+		#define FBXSDK_ARCH_ARM 1
+		#define FBXSDK_CPU_32 1
+	#elif defined(EMSCRIPTEN)
+  		#define FBXSDK_ARCH_AMD64 1
+		#define FBXSDK_CPU_64 1
+  	#else
+		#error Unsupported architecture!
+	#endif
+
+	#if defined(__GNUC__)
+		#define FBXSDK_COMPILER_GNU 1
+	#elif defined(EMSCRIPTEN)
+  		#define FBXSDK_COMPILER_EMSCRIPTEN 1 
+	#else
+		#error Unsupported compiler!
+	#endif
+ #else
+	#error Unsupported platform!
+#endif
+
+//---------------------------------------------------------------------------------------
+//Compiler Specifics
+#if defined(FBXSDK_SHARED)
+	#if defined(FBXSDK_COMPILER_MSC) || defined(FBXSDK_COMPILER_INTEL)
+		#define FBXSDK_DLLIMPORT __declspec(dllimport)
+		#define FBXSDK_DLLEXPORT __declspec(dllexport)
+	#elif defined(FBXSDK_COMPILER_GNU) && (__GNUC__ >= 4)
+		#define FBXSDK_DLLIMPORT __attribute__((visibility("default")))
+		#define FBXSDK_DLLEXPORT __attribute__((visibility("default")))
+	#else
+		#define FBXSDK_DLLIMPORT
+		#define FBXSDK_DLLEXPORT
+	#endif
+#else
+	#define FBXSDK_DLLIMPORT
+	#define FBXSDK_DLLEXPORT
+#endif
+
+#ifndef FBXSDK_DLL
+	#define FBXSDK_DLL FBXSDK_DLLIMPORT
+#endif
+
+#if defined(FBXSDK_COMPILER_MSC)
+	#pragma warning(disable : 4251)	//'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
+    #if _MSC_VER >= 1300 // 7.1
+        #define FBX_DEPRECATED __declspec(deprecated)
+    #else
+        #define FBX_DEPRECATED
+    #endif
+#elif defined(FBXSDK_COMPILER_GNU) || defined(FBXSDK_COMPILER_EMSCRIPTEN)
+    #define FBX_DEPRECATED __attribute__((deprecated))
+#elif defined(FBXSDK_COMPILER_INTEL)
+    #if __INTEL_COMPILER >= 810
+        #define FBX_DEPRECATED __declspec(deprecated)
+    #else
+        #define FBX_DEPRECATED
+    #endif
+#else
+	#error Unsupported compiler!
+#endif
+
+#ifdef FBXSDK_COMPILER_CLANG
+	#define FBX_UNUSED(p) _Pragma(FBX_STRINGIFY(unused(p)))
+#else
+	#define FBX_UNUSED(p) (void)(p)
+#endif
+
+//---------------------------------------------------------------------------------------
+//Platform Standardization
+#ifndef NULL
+	#if defined(__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
+		#define NULL (__null)
+	#else	
+    	#if defined(__cplusplus)
+    		#define NULL 0
+    	#else
+    		#define NULL ((void*)0)
+    	#endif
+    #endif
+#endif
+
+#if !defined(_MAX_PATH)
+	#define _MAX_PATH 260
+#endif
+
+#if defined(FBXSDK_ENV_WIN)
+	#define snprintf _snprintf //for stdio.h platform compatibility
+#endif
+
+#if !defined(FBXSDK_COMPILER_MSC)
+	#ifndef strcmpi
+		#define strcmpi strcasecmp
+	#endif
+	#ifndef stricmp
+		#define stricmp strcasecmp
+	#endif
+	#ifndef strncmpi
+		#define strncmpi strncasecmp
+	#endif
+	#ifndef strnicmp
+		#define strnicmp strncasecmp
+	#endif
+#endif
+
+#endif /* _FBXSDK_CORE_ARCH_ARCH_H_ */

+ 93 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxdebug.h

@@ -0,0 +1,93 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+/** \file fbxdebug.h
+  * Debugging macros and functions.
+  * 
+  * All macros and functions are removed in release builds. To enable asserts, a debug build is required as well
+  * as the environment variable "FBXSDK_ASSERT" set to 1 is also required. By default, assertions will pop-up
+  * a window. It is possible to disable the pop-up on the Windows platform by calling the following code:
+  * \code
+  * _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
+  * \endcode
+  */
+#ifndef _FBXSDK_CORE_ARCH_DEBUG_H_
+#define _FBXSDK_CORE_ARCH_DEBUG_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** If this environment variable is set to 1, the FBX SDK will assert in debug builds */
+#define FBXSDK_ASSERT_ENVSTR "FBXSDK_ASSERT"
+
+/** The assertion procedure signature. If a different assertion procedure must be provided, it should have this signature.
+* \param pFileName The file name where the assertion occurred.
+* \param pFunctionName The function name where the assertion occurred.
+* \param pLineNumber The line number in the file where the assertion occurred.
+* \param pMessage The message to display when the assertion occurs. */
+typedef void (*FbxAssertProc)(const char* pFileName, const char* pFunctionName, const unsigned int pLineNumber, const char* pMessage);
+
+/** Change the procedure used when assertion occurs.
+* \param pAssertProc The procedure to be called when assertions occurs. */
+FBXSDK_DLL void FbxAssertSetProc(FbxAssertProc pAssertProc);
+
+//! Change the procedure back to the default one.
+FBXSDK_DLL void FbxAssertSetDefaultProc();
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+FBXSDK_DLL void _FbxAssert(const char* pFileName, const char* pFunctionName, const unsigned int pLineNumber, bool pFormat, const char* pMessage, ...);
+FBXSDK_DLL void _FbxTrace(const char* pMessage, ...);
+
+#ifdef _DEBUG
+    template <bool x> struct FbxStaticAssertType;
+    template<> struct FbxStaticAssertType<true>			{enum{value=1};};
+    template<> struct FbxStaticAssertType<false>		{enum{value=-1};};
+	#define FBX_ASSERT(Condition)						{if(!(Condition)){_FbxAssert(__FILE__,__FUNCTION__,__LINE__,false,#Condition);}}
+	#define FBX_ASSERT_MSG(Condition, Message, ...)		{if(!(Condition)){_FbxAssert(__FILE__,__FUNCTION__,__LINE__,true,Message,##__VA_ARGS__);}}
+	#define FBX_ASSERT_NOW(Message, ...)				_FbxAssert(__FILE__,__FUNCTION__,__LINE__,true,Message,##__VA_ARGS__);
+	#define FBX_ASSERT_RETURN(Condition)				{if(!(Condition)){FBX_ASSERT_NOW(#Condition); return;}}
+	#define FBX_ASSERT_RETURN_VALUE(Condition, Value)	{if(!(Condition)){FBX_ASSERT_NOW(#Condition); return Value;}}
+	#define FBX_ASSERT_STATIC(Condition)				typedef char FbxBuildBreakIfFalse[FbxStaticAssertType<(bool)(Condition)>::value];
+	#define FBX_TRACE(Message, ...)						{_FbxTrace(Message,##__VA_ARGS__);}
+#else
+	#define FBX_ASSERT(Condition)						((void)0)
+	#define FBX_ASSERT_MSG(Condition, Message, ...)		((void)0)
+	#define FBX_ASSERT_NOW(Message, ...)				((void)0)
+	#define FBX_ASSERT_RETURN(Condition)				if(!(Condition)){return;}
+	#define FBX_ASSERT_RETURN_VALUE(Condition, Value)	if(!(Condition)){return Value;}
+	#define FBX_ASSERT_STATIC(Condition)
+	#define FBX_TRACE(Message, ...)						((void)0)
+#endif
+
+template<typename T> struct FbxIncompatibleWithArray{ enum {value = 0}; };
+
+#define FBXSDK_INCOMPATIBLE_WITH_ARRAY_TEMPLATE(T)\
+	struct FbxIncompatibleWithArray< T >{\
+		union {\
+			T t();\
+		} catcherr;\
+		enum {value = 1};}
+
+#define FBXSDK_INCOMPATIBLE_WITH_ARRAY(T)\
+	template<> FBXSDK_INCOMPATIBLE_WITH_ARRAY_TEMPLATE(T)
+
+#define FBXSDK_IS_INCOMPATIBLE_WITH_ARRAY(T) ((bool) FbxIncompatibleWithArray<T>::value)
+
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_ARCH_DEBUG_H_ */

+ 510 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxnew.h

@@ -0,0 +1,510 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+/** \file fbxnew.h
+  * New operator override templates.
+  *
+  * Instead of overloading the operator new in the FBX SDK, we provide a set of templates
+  * that are used internally to create objects. This mechanic allows the FBX SDK to call
+  * a different memory allocator.
+  * \see FbxSetMallocHandler FbxSetCallocHandler FbxSetReallocHandler FbxSetFreeHandler FbxSetMSizeHandler
+  */
+#ifndef _FBXSDK_CORE_ARCH_NEW_H_
+#define _FBXSDK_CORE_ARCH_NEW_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <new>
+
+#if defined(FBXSDK_COMPILER_MSC)
+	#pragma warning(push)
+	#pragma warning(disable : 4345) //warning C4345: behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized
+#endif
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+//Type traits for primitive types
+template<typename T> struct FbxSimpleType { enum {value = 0}; };
+template<typename T> struct FbxSimpleType<T*> { enum {value = 1}; };
+template<typename T> struct FbxSimpleType<const T> { enum {value = FbxSimpleType<T>::value}; };
+template<typename T, size_t n> struct FbxSimpleType<T[n]> { enum {value = FbxSimpleType<T>::value}; };
+
+#define FBXSDK_DEFINE_SIMPLE_TYPE(T) template<> struct FbxSimpleType<T>{ union {T t;} catcherr; enum {value = 1};}
+
+FBXSDK_DEFINE_SIMPLE_TYPE(bool);
+FBXSDK_DEFINE_SIMPLE_TYPE(char);
+FBXSDK_DEFINE_SIMPLE_TYPE(unsigned char);
+FBXSDK_DEFINE_SIMPLE_TYPE(short);
+FBXSDK_DEFINE_SIMPLE_TYPE(unsigned short);
+FBXSDK_DEFINE_SIMPLE_TYPE(int);
+FBXSDK_DEFINE_SIMPLE_TYPE(unsigned int);
+FBXSDK_DEFINE_SIMPLE_TYPE(long);
+FBXSDK_DEFINE_SIMPLE_TYPE(unsigned long);
+FBXSDK_DEFINE_SIMPLE_TYPE(float);
+FBXSDK_DEFINE_SIMPLE_TYPE(double);
+FBXSDK_DEFINE_SIMPLE_TYPE(long double);
+FBXSDK_DEFINE_SIMPLE_TYPE(long long);
+FBXSDK_DEFINE_SIMPLE_TYPE(unsigned long long);
+
+#define FBXSDK_IS_SIMPLE_TYPE(T) ((bool)FbxSimpleType<T>::value)
+
+template<typename T> T* FbxNew()
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T();
+}
+
+template<typename T, typename T1> T* FbxNew(T1& p1)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1);
+}
+
+template<typename T, typename T1> T* FbxNew(const T1& p1)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1);
+}
+
+template<typename T, typename T1, typename T2> T* FbxNew(T1& p1, T2& p2)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2);
+}
+
+template<typename T, typename T1, typename T2> T* FbxNew(T1& p1, const T2& p2)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2);
+}
+
+template<typename T, typename T1, typename T2> T* FbxNew(const T1& p1, T2& p2)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2);
+}
+
+template<typename T, typename T1, typename T2> T* FbxNew(const T1& p1, const T2& p2)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2);
+}
+
+template<typename T, typename T1, typename T2, typename T3> T* FbxNew(T1& p1, T2& p2, T3& p3)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3);
+}
+
+template<typename T, typename T1, typename T2, typename T3> T* FbxNew(T1& p1, T2& p2, const T3& p3)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3);
+}
+
+template<typename T, typename T1, typename T2, typename T3> T* FbxNew(T1& p1, const T2& p2, T3& p3)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3);
+}
+
+template<typename T, typename T1, typename T2, typename T3> T* FbxNew(T1& p1, const T2& p2, const T3& p3)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3);
+}
+
+template<typename T, typename T1, typename T2, typename T3> T* FbxNew(const T1& p1, T2& p2, T3& p3)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3);
+}
+
+template<typename T, typename T1, typename T2, typename T3> T* FbxNew(const T1& p1, T2& p2, const T3& p3)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3);
+}
+
+template<typename T, typename T1, typename T2, typename T3> T* FbxNew(const T1& p1, const T2& p2, T3& p3)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3);
+}
+
+template<typename T, typename T1, typename T2, typename T3> T* FbxNew(const T1& p1, const T2& p2, const T3& p3)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(T1& p1, T2& p2, T3& p3, T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(T1& p1, T2& p2, T3& p3, const T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(T1& p1, T2& p2, const T3& p3, T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(T1& p1, T2& p2, const T3& p3, const T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(T1& p1, const T2& p2, T3& p3, T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(T1& p1, const T2& p2, T3& p3, const T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(T1& p1, const T2& p2, const T3& p3, T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(T1& p1, const T2& p2, const T3& p3, const T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(const T1& p1, T2& p2, T3& p3, T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(const T1& p1, T2& p2, T3& p3, const T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(const T1& p1, T2& p2, const T3& p3, T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(const T1& p1, T2& p2, const T3& p3, const T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(const T1& p1, const T2& p2, T3& p3, T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(const T1& p1, const T2& p2, T3& p3, const T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1, p2, p3, p4);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(T1& p1, T2& p2, T3& p3, T4& p4, T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, T2& p2, T3& p3, T4& p4, T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, const T2& p2, T3& p3, T4& p4, T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, T2& p2, const T3& p3, T4& p4, T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, T2& p2, T3& p3, const T4& p4, T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, T2& p2, T3& p3, T4& p4, const T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, T4& p4, T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, const T2& p2, T3& p3, const T4& p4, T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, const T2& p2, T3& p3, T4& p4, const T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, T4& p4, const T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const T6& p6)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5,p6);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const T6& p6, const T7& p7)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5,p6,p7);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const T6& p6, const T7& p7, const T8& p8)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5,p6,p7,p8);
+}
+
+template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> T* FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const T6& p6, const T7& p7, const T8& p8, const T9& p9)
+{
+	T* p = (T*)FbxMalloc(sizeof(T));
+	return new(p)T(p1,p2,p3,p4,p5,p6,p7,p8,p9);
+}
+
+template<typename T> void FbxDelete(T* p)
+{
+	if( p )
+	{
+		((T*)p)->~T();
+		FbxFree(p);
+	}
+}
+
+template<typename T> void FbxDelete(const T* p)
+{
+	if( p )
+	{
+		((T*)p)->~T();
+		FbxFree(const_cast<T*>(p));
+	}
+}
+
+template<typename T> T* FbxNewArray(const int n)
+{
+	if( FBXSDK_IS_SIMPLE_TYPE(T) )
+	{
+		return (T*)FbxMalloc(sizeof(T)*n);
+	}
+	else
+	{
+		void* pTmp = FbxMalloc(sizeof(T) * n + sizeof(int));
+		T* p = (T*)((int*)pTmp+1);
+		*((int*)pTmp) = n;
+		for( int i = 0; i < n; ++i )
+		{
+			new((T*)p+i)T;	//in-place new, not allocating memory so it is safe.
+		}
+		return p;
+	}
+}
+
+template<typename T> void FbxDeleteArray(T* p)
+{
+	if( p )
+	{
+		if( !FBXSDK_IS_SIMPLE_TYPE(T) )
+		{
+			for( int i = 0; i < ((int*)p)[-1]; ++i )
+			{
+				((T*)p)[i].~T();
+			}
+			FbxFree((int*)p-1);
+		}
+		else
+		{
+			FbxFree((void*)p);
+		}
+	}
+}
+
+#define FBXSDK_FRIEND_NEW()\
+	template<typename T>\
+	friend T* FBXSDK_NAMESPACE::FbxNew();\
+	template<typename T, typename T1>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1);\
+	template<typename T, typename T1>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1);\
+	template<typename T, typename T1, typename T2>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, T2& p2);\
+	template<typename T, typename T1, typename T2>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, const T2& p2);\
+	template<typename T, typename T1, typename T2>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2);\
+	template<typename T, typename T1, typename T2>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2);\
+	template<typename T, typename T1, typename T2, typename T3>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, T2& p2, T3& p3);\
+	template<typename T, typename T1, typename T2, typename T3>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, T2& p2, const T3& p3);\
+	template<typename T, typename T1, typename T2, typename T3>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, const T2& p2, T3& p3);\
+	template<typename T, typename T1, typename T2, typename T3>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, const T2& p2, const T3& p3);\
+	template<typename T, typename T1, typename T2, typename T3>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, T3& p3);\
+	template<typename T, typename T1, typename T2, typename T3>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, const T3& p3);\
+	template<typename T, typename T1, typename T2, typename T3>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, T3& p3);\
+	template<typename T, typename T1, typename T2, typename T3>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3);\
+    \
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, T2& p2, T3& p3, T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, T2& p2, T3& p3, const T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, T2& p2, const T3& p3, T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, T2& p2, const T3& p3, const T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, const T2& p2, T3& p3, T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, const T2& p2, T3& p3, const T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, const T2& p2, const T3& p3, T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, const T2& p2, const T3& p3, const T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, T3& p3, T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, T3& p3, const T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, const T3& p3, T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, const T3& p3, const T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, T3& p3, T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, T3& p3, const T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, T4& p4);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4);\
+    \
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(T1& p1, T2& p2, T3& p3, T4& p4, T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, T3& p3, T4& p4, T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, T3& p3, T4& p4, T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, const T3& p3, T4& p4, T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, T3& p3, const T4& p4, T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, T2& p2, T3& p3, T4& p4, const T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, T4& p4, T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, T3& p3, const T4& p4, T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, T3& p3, T4& p4, const T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, T4& p4, const T5& p5);\
+    template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\
+    friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5);\
+    \
+	template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const T6& p6);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const T6& p6, const T7& p7);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const T6& p6, const T7& p7, const T8& p8);\
+	template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>\
+	friend T* FBXSDK_NAMESPACE::FbxNew(const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const T6& p6, const T7& p7, const T8& p8, const T9& p9);\
+	template<typename T>\
+	friend void FBXSDK_NAMESPACE::FbxDelete(T* p);\
+	template<typename T>\
+	friend void FBXSDK_NAMESPACE::FbxDelete(const T* p);\
+	template<typename T>\
+	friend T* FBXSDK_NAMESPACE::FbxNewArray(const int n);\
+	template<typename T>\
+	friend void FBXSDK_NAMESPACE::FbxDeleteArray(T* p);
+
+#ifdef FBXSDK_COMPILER_MSC
+	#pragma warning(pop)
+#endif
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_ARCH_NEW_H_ */

+ 97 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxstdcompliant.h

@@ -0,0 +1,97 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+/** \file fbxstdcompliant.h
+* Macros to properly support the CRT secure functions. */
+#ifndef _FBXSDK_CORE_ARCH_STDCOMPLIANT_H_
+#define _FBXSDK_CORE_ARCH_STDCOMPLIANT_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+#if defined(FBXSDK_ENV_WIN)
+	#define FBXSDK_printf							printf_s
+	#define FBXSDK_fprintf							fprintf_s
+	inline int FBXSDK_sprintf(char* dst, size_t dstsize, const char* format, ...){ va_list vl; va_start(vl, format); int ret = vsprintf_s(dst, dstsize, format, vl); va_end(vl); return ret; }
+	inline int FBXSDK_snprintf(char* dst, size_t dstsize, const char* format, ...){ va_list vl; va_start(vl, format); int ret = vsnprintf_s(dst, dstsize, _TRUNCATE, format, vl); va_end(vl); return ret; }
+	inline int FBXSDK_vsprintf(char* dst, size_t dstsize, const char* format, va_list vl){ return vsprintf_s(dst, dstsize, format, vl); }
+	inline int FBXSDK_vsnprintf(char* dst, size_t dstsize, const char* format, va_list vl){ return vsnprintf_s(dst, dstsize, _TRUNCATE, format, vl); }
+	#define FBXSDK_stricmp(dst, src)				_stricmp(dst, src)
+	#define FBXSDK_strnicmp(dst, src, count)		_strnicmp(dst, src, count)
+	#define FBXSDK_strcpy(dst, size, src)			strcpy_s(dst, size, src)
+	#define FBXSDK_strncpy(dst, size, src, count)	strncpy_s(dst, size, src, count)
+	#define FBXSDK_strcat(dst, size, src)			strcat_s(dst, size, src)
+	#define FBXSDK_strtok(str, delim, ctx)			strtok_s(str, delim, ctx)
+	#define FBXSDK_wcscpy(dst, size, src)			wcscpy_s(dst, size, src)
+	#define FBXSDK_wcscat(dst, size, src)			wcscat_s(dst, size, src)
+#if !defined(FBXSDK_ENV_WINSTORE)
+	#define FBXSDK_getpid							_getpid
+	#define FBXSDK_getcwd							_getcwd
+#else
+	inline int FBXSDK_getpid(){ return 0; }
+	inline char* FBXSDK_getcwd(char*,int){ return NULL; }
+#endif
+	#define FBXSDK_localtime(ptm, time)				{ struct tm tms; ptm = &tms; localtime_s(ptm, time); }
+	#define FBXSDK_gmtime(ptm, time)				{ struct tm tms; ptm = &tms; gmtime_s(ptm, time); }
+	#define FBXSDK_fopen(fp, name, mode)			fopen_s(&fp, name, mode)
+
+#elif defined(FBXSDK_ENV_MAC) || defined(FBXSDK_ENV_LINUX)
+	#define FBXSDK_printf							printf
+	#define FBXSDK_fprintf							fprintf
+	inline int FBXSDK_sprintf(char* dst, size_t dstsize, const char* format, ...){ va_list vl; va_start(vl, format); int ret = vsprintf(dst, format, vl); va_end(vl); return ret; }
+	inline int FBXSDK_snprintf(char* dst, size_t dstsize, const char* format, ...){ va_list vl; va_start(vl, format); int ret = vsnprintf(dst, dstsize, format, vl); va_end(vl); return ret; }
+	inline int FBXSDK_vsprintf(char* dst, size_t dstsize, const char* format, va_list vl){ return vsprintf(dst, format, vl); }
+	inline int FBXSDK_vsnprintf(char* dst, size_t dstsize, const char* format, va_list vl){ return vsnprintf(dst, dstsize, format, vl); }
+	#define FBXSDK_stricmp(dst, src)				stricmp(dst, src)
+	#define FBXSDK_strnicmp(dst, src, count)		strnicmp(dst, src, count)
+	#define FBXSDK_strcpy(dst, size, src)			strcpy(dst, src)
+	#define FBXSDK_strncpy(dst, size, src, count)	strncpy(dst, src, count)
+	#define FBXSDK_strcat(dst, size, src)			strcat(dst, src)
+	#define FBXSDK_strtok(str, delim, ctx)			strtok(str, delim)
+	#define FBXSDK_wcscpy(dst, size, src)			wcscpy(dst, src)
+	#define FBXSDK_wcscat(dst, size, src)			wcscat_s(dst, src)
+	#define FBXSDK_getpid							getpid	
+	#define FBXSDK_getcwd							getcwd
+	#define FBXSDK_localtime(tm, time)				tm=localtime(time)
+	#define FBXSDK_gmtime(tm, time)					tm=gmtime(time)
+	#define FBXSDK_fopen(fp, name, mode)			fp=fopen(name, mode)
+
+#else
+	#error Unsupported platform!
+#endif
+
+#define FBXSDK_strdup								FbxStrDup
+
+//The scanf family functions cannot easily be used in both secure and non-secure versions because
+//Microsoft's secure version expects the size of the string/char* arguments following their address.
+//On Unix machines the scanf family functions do not have this behavior and trying to use the same
+//calls would result in compiler errors because the arguments would not match the format string.
+//Using the following macros in the code will simply desable the warning at compile time.
+#if defined(FBXSDK_COMPILER_MSC) && (_MSC_VER >= 1300)
+	#define FBXSDK_CRT_SECURE_NO_WARNING_BEGIN\
+	{\
+		__pragma(warning(push))\
+		__pragma(warning(disable : 4996))\
+	}
+    
+	#define FBXSDK_CRT_SECURE_NO_WARNING_END\
+	{\
+		__pragma(warning(pop))\
+	}
+#else
+	#define FBXSDK_CRT_SECURE_NO_WARNING_BEGIN
+	#define FBXSDK_CRT_SECURE_NO_WARNING_END
+#endif
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_ARCH_STDCOMPLIANT_H_ */

+ 264 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/arch/fbxtypes.h

@@ -0,0 +1,264 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+/** \file fbxtypes.h
+  * Basic types definition.
+  *
+  * Standard basic types used across the FBX SDK. There is also platform independent
+  * definitions that guarantee size across operating systems. The FBXSDK_SYSTEM_IS_LP64
+  * define is set to 1 when the operating system defines the "long" C++ type as 64-bit.
+  */
+#ifndef _FBXSDK_CORE_ARCH_TYPES_H_
+#define _FBXSDK_CORE_ARCH_TYPES_H_
+
+#include <fbxsdk/core/arch/fbxarch.h>
+
+//Note: On MacOSX and Linux 64-bit, long is defined as 64-bits while on Windows
+//it is still a 32-bits for backward compatibility. We stick with Windows standard.
+#if defined(FBXSDK_CPU_64) && !defined(FBXSDK_ENV_WIN)
+	#define FBXSDK_SYSTEM_IS_LP64 1
+#endif
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+class FbxObject;
+
+typedef bool			FbxBool;
+typedef signed char		FbxChar;
+typedef unsigned char	FbxUChar;
+typedef signed short	FbxShort;
+typedef unsigned short	FbxUShort;
+typedef signed int		FbxInt;
+typedef unsigned int	FbxUInt;
+typedef float			FbxFloat;
+typedef double			FbxDouble;
+
+typedef FbxBool*		FbxBoolPtr;
+typedef FbxChar*		FbxCharPtr;
+typedef FbxUChar*		FbxUCharPtr;
+typedef FbxShort*		FbxShortPtr;
+typedef FbxUShort*		FbxUShortPtr;
+typedef FbxInt*			FbxIntPtr;
+typedef FbxUInt*		FbxUIntPtr;
+typedef FbxFloat*		FbxFloatPtr;
+typedef FbxDouble*		FbxDoublePtr;
+
+typedef FbxInt			FbxEnum;
+typedef FbxObject*		FbxReference;
+
+//-------------------------------------------------------------------------------------
+//Architecture independent defines (guarantee size)
+#if defined(FBXSDK_COMPILER_MSC)
+	#define FBXSDK_LONGLONG(x)	(x##i64)
+	#define FBXSDK_ULONGLONG(x)	(x##Ui64)
+
+	typedef signed __int8		FbxInt8;
+	typedef unsigned __int8		FbxUInt8;
+	typedef signed __int16		FbxInt16;
+	typedef unsigned __int16	FbxUInt16;
+	typedef signed __int32		FbxInt32;
+	typedef unsigned __int32	FbxUInt32;
+	typedef signed __int64		FbxInt64;
+	typedef unsigned __int64	FbxUInt64;
+#else
+	#define FBXSDK_LONGLONG(x)	(x##LL)
+	#define FBXSDK_ULONGLONG(x)	(x##ULL)
+
+	typedef signed char			FbxInt8;
+	typedef unsigned char		FbxUInt8;
+	typedef signed short		FbxInt16;
+	typedef unsigned short		FbxUInt16;
+	typedef signed int			FbxInt32;
+	typedef unsigned int		FbxUInt32;
+	typedef signed long long	FbxInt64;
+	typedef unsigned long long	FbxUInt64;
+#endif
+
+#ifdef FBXSDK_SYSTEM_IS_LP64
+	typedef signed int			FbxLong;
+	typedef unsigned int		FbxULong;
+#else
+	typedef signed long			FbxLong;
+	typedef unsigned long		FbxULong;
+#endif
+typedef FbxInt64				FbxLongLong;
+typedef FbxUInt64				FbxULongLong;
+
+typedef FbxLong*				FbxLongPtr;
+typedef FbxULong*				FbxULongPtr;
+typedef FbxLongLong*			FbxLongLongPtr;
+typedef FbxULongLong*			FbxULongLongPtr;
+
+
+#if defined(FBXSDK_ENV_EMSCRIPTEN)
+	typedef FbxInt32 			__int32_t;
+	typedef FbxUInt32			__uint32_t;
+	typedef FbxInt64  			__int64_t;
+	typedef FbxUInt64			__uint64_t;
+#endif
+
+//-------------------------------------------------------------------------------------
+//Minimum and Maximum values for types
+#define FBXSDK_CHAR_MIN			-128
+#define FBXSDK_CHAR_MAX			127
+#define FBXSDK_UCHAR_MIN		0
+#define FBXSDK_UCHAR_MAX		255
+#define FBXSDK_SHORT_MIN		-32768
+#define FBXSDK_SHORT_MAX		32767
+#define FBXSDK_USHORT_MIN		0
+#define FBXSDK_USHORT_MAX		65535
+#define FBXSDK_INT_MIN			0x80000000
+#define FBXSDK_INT_MAX			0x7fffffff
+#define FBXSDK_UINT_MIN			0
+#define FBXSDK_UINT_MAX			0xffffffff
+#define FBXSDK_LONG_MIN			FBXSDK_INT_MIN
+#define FBXSDK_LONG_MAX			FBXSDK_INT_MAX
+#define FBXSDK_ULONG_MIN		FBXSDK_UINT_MIN
+#define FBXSDK_ULONG_MAX		FBXSDK_UINT_MAX
+#define FBXSDK_LONGLONG_MIN		FBXSDK_LONGLONG(0x8000000000000000)
+#define FBXSDK_LONGLONG_MAX		FBXSDK_LONGLONG(0x7fffffffffffffff)
+#define FBXSDK_ULONGLONG_MIN	FBXSDK_ULONGLONG(0)
+#define FBXSDK_ULONGLONG_MAX	FBXSDK_ULONGLONG(0xffffffffffffffff)
+#define FBXSDK_FLOAT_MIN		FLT_MIN
+#define FBXSDK_FLOAT_MAX		FLT_MAX
+#define FBXSDK_FLOAT_EPSILON	FLT_EPSILON
+#define FBXSDK_DOUBLE_MIN		DBL_MIN
+#define FBXSDK_DOUBLE_MAX		DBL_MAX
+#define FBXSDK_DOUBLE_EPSILON	DBL_EPSILON
+#define FBXSDK_TOLERANCE		(1.0e-6)
+
+//-------------------------------------------------------------------------------------
+//Handle and atomic definition (size change depending of architecture)
+#if defined(FBXSDK_CPU_32)
+	typedef FbxUInt32			FbxHandle;
+	#define FBXSDK_REF_MIN		FBXSDK_UINT_MIN
+	#define FBXSDK_REF_MAX		FBXSDK_UINT_MAX
+
+	typedef FbxLong				FbxAtomic;
+	#define FBXSDK_ATOMIC_MIN	FBXSDK_LONG_MIN
+	#define FBXSDK_ATOMIC_MAX	FBXSDK_LONG_MAX
+#elif defined(FBXSDK_CPU_64)
+	typedef FbxUInt64			FbxHandle;
+	#define FBXSDK_REF_MIN		FBXSDK_ULONGLONG_MIN
+	#define FBXSDK_REF_MAX		FBXSDK_ULONGLONG_MAX
+
+	typedef FbxInt64			FbxAtomic;
+	#define FBXSDK_ATOMIC_MIN	FBXSDK_LONGLONG_MIN
+	#define FBXSDK_ATOMIC_MAX	FBXSDK_LONGLONG_MAX
+#else
+	#error Unsupported architecture!
+#endif
+
+//-------------------------------------------------------------------------------------
+//Various utility functions for fbxsdk basic types
+inline const FbxChar				FbxMin(const FbxChar){ return FBXSDK_CHAR_MIN; }
+inline const FbxUChar				FbxMin(const FbxUChar){ return FBXSDK_UCHAR_MIN; }
+inline const FbxShort				FbxMin(const FbxShort){ return FBXSDK_SHORT_MIN; }
+inline const FbxUShort				FbxMin(const FbxUShort){ return FBXSDK_USHORT_MIN; }
+inline const FbxInt					FbxMin(const FbxInt){ return FBXSDK_INT_MIN; }
+inline const FbxUInt				FbxMin(const FbxUInt){ return FBXSDK_UINT_MIN; }
+inline const FbxLongLong			FbxMin(const FbxLongLong){ return FBXSDK_LONGLONG_MIN; }
+inline const FbxULongLong			FbxMin(const FbxULongLong){ return FBXSDK_ULONGLONG_MIN; }
+inline const FbxFloat				FbxMin(const FbxFloat){ return FBXSDK_FLOAT_MIN; }
+inline const FbxDouble				FbxMin(const FbxDouble){ return FBXSDK_DOUBLE_MIN; }
+
+inline const FbxChar				FbxMax(const FbxChar){ return FBXSDK_CHAR_MAX; }
+inline const FbxUChar				FbxMax(const FbxUChar){ return FBXSDK_UCHAR_MAX; }
+inline const FbxShort				FbxMax(const FbxShort){ return FBXSDK_SHORT_MAX; }
+inline const FbxUShort				FbxMax(const FbxUShort){ return FBXSDK_USHORT_MAX; }
+inline const FbxInt					FbxMax(const FbxInt){ return FBXSDK_INT_MAX; }
+inline const FbxUInt				FbxMax(const FbxUInt){ return FBXSDK_UINT_MAX; }
+inline const FbxLongLong			FbxMax(const FbxLongLong){ return FBXSDK_LONGLONG_MAX; }
+inline const FbxULongLong			FbxMax(const FbxULongLong){ return FBXSDK_ULONGLONG_MAX; }
+inline const FbxFloat				FbxMax(const FbxFloat){ return FBXSDK_FLOAT_MAX; }
+inline const FbxDouble				FbxMax(const FbxDouble){ return FBXSDK_DOUBLE_MAX; }
+
+#ifndef FBXSDK_SYSTEM_IS_LP64
+	inline const FbxLong			FbxMin(const FbxLong){ return FBXSDK_LONG_MIN; }
+	inline const FbxULong			FbxMin(const FbxULong){ return FBXSDK_ULONG_MIN; }
+	inline const FbxLong			FbxMax(const FbxLong){ return FBXSDK_LONG_MAX; }
+	inline const FbxULong			FbxMax(const FbxULong){ return FBXSDK_ULONG_MAX; }
+#endif
+
+template<class T> inline const T	FbxMin(const T){};
+template<class T> inline const T	FbxMax(const T){};
+
+template<class T> inline T			FbxMin(const T x, const T y){ return (x < y) ? x : y; }
+template<class T> inline T			FbxMax(const T x, const T y){ return (x > y) ? x : y; }
+
+//-------------------------------------------------------------------------------------
+//Vector Template Types
+template<class T> class FBXSDK_DLL FbxVectorTemplate2
+{
+public:
+	inline FbxVectorTemplate2(){ *this = T(0); }
+	inline explicit FbxVectorTemplate2(T pValue){ *this = pValue; }
+	inline FbxVectorTemplate2(T pData0, T pData1){ mData[0] = pData0; mData[1] = pData1; }
+	inline ~FbxVectorTemplate2(){}
+	inline T& operator[](int pIndex){ return mData[pIndex]; }
+	inline const T& operator[](int pIndex) const { return mData[pIndex]; }
+	inline FbxVectorTemplate2<T>& operator=(const T& pValue){ mData[0] = pValue; mData[1] = pValue; return *this; }
+	inline FbxVectorTemplate2<T>& operator=(const FbxVectorTemplate2<T>& pVector){ mData[0] = pVector.mData[0]; mData[1] = pVector.mData[1]; return *this; }
+	inline bool operator==(const FbxVectorTemplate2<T>& pVector) const { return ((mData[0] == pVector.mData[0]) && (mData[1] == pVector.mData[1])); }
+	inline bool operator!=(const FbxVectorTemplate2<T>& pVector) const { return !operator==( pVector ); }
+	inline T* Buffer(){ return mData; }
+	inline const T* Buffer() const { return mData; }
+	T mData[2];
+};
+
+template<class T> class FBXSDK_DLL FbxVectorTemplate3
+{
+public:
+	inline FbxVectorTemplate3(){ *this = T(0); }
+	inline explicit FbxVectorTemplate3(T pValue){ *this = pValue; }
+	inline FbxVectorTemplate3(T pData0, T pData1, T pData2){ mData[0] = pData0; mData[1] = pData1; mData[2] = pData2; }
+	inline ~FbxVectorTemplate3(){}
+	inline T& operator[](int pIndex) { return mData[pIndex]; }
+	inline const T& operator[](int pIndex) const { return mData[pIndex]; }
+	inline operator FbxVectorTemplate2<T>& () const { return *((FbxVectorTemplate2<T>*)this); }
+	inline FbxVectorTemplate3<T>& operator=(T const &pValue){ mData[0] = pValue; mData[1] = pValue; mData[2] = pValue; return *this; }
+	inline FbxVectorTemplate3<T>& operator=(const FbxVectorTemplate2<T>& pVector){ mData[0] = pVector.mData[0]; mData[1] = pVector.mData[1]; return *this; }
+	inline FbxVectorTemplate3<T>& operator=(const FbxVectorTemplate3<T>& pVector){ mData[0] = pVector.mData[0]; mData[1] = pVector.mData[1]; mData[2] = pVector.mData[2]; return *this; }
+	inline bool operator==(const FbxVectorTemplate3<T>& pVector) const { return ((mData[0] == pVector.mData[0]) && (mData[1] == pVector.mData[1]) && (mData[2] == pVector.mData[2])); }
+	inline bool operator!=(const FbxVectorTemplate3<T>& pVector) const { return !operator==(pVector); }
+	inline T* Buffer(){ return mData; }
+	inline const T* Buffer() const { return mData; }
+	T mData[3];
+};
+
+template<class T> class FBXSDK_DLL FbxVectorTemplate4
+{
+public:
+	inline FbxVectorTemplate4(){ *this = T(0); }
+	inline explicit FbxVectorTemplate4(T pValue){ *this = pValue; }
+	inline FbxVectorTemplate4(T pData0, T pData1, T pData2, T pData3){ mData[0] = pData0; mData[1] = pData1; mData[2] = pData2; mData[3] = pData3; }
+	inline ~FbxVectorTemplate4(){}
+	inline T& operator[](int pIndex){ return mData[pIndex]; }
+	inline const T& operator[](int pIndex) const { return mData[pIndex]; }
+	inline operator FbxVectorTemplate3<T>& () const { return *((FbxVectorTemplate3<T>*)this); }
+	inline FbxVectorTemplate4<T>& operator=(const T& pValue){ mData[0] = pValue; mData[1] = pValue; mData[2] = pValue; mData[3] = pValue; return *this; }
+	inline FbxVectorTemplate4<T>& operator=(const FbxVectorTemplate3<T>& pValue){ mData[0] = pValue[0]; mData[1] = pValue[1]; mData[2] = pValue[2]; return *this; }
+	inline FbxVectorTemplate4<T>& operator=(const FbxVectorTemplate4<T>& pVector){ mData[0] = pVector.mData[0]; mData[1] = pVector.mData[1]; mData[2] = pVector.mData[2]; mData[3] = pVector.mData[3]; return *this; }
+	inline bool operator==(const FbxVectorTemplate4<T>& pVector) const { return ((mData[0] == pVector.mData[0]) && (mData[1] == pVector.mData[1]) && (mData[2] == pVector.mData[2]) && (mData[3] == pVector.mData[3])); }
+	inline bool operator!=(const FbxVectorTemplate4<T>& pVector) const { return !operator==( pVector ); }
+	inline T* Buffer(){ return mData; }
+	inline const T* Buffer() const { return mData; }
+	T mData[4];
+};
+
+typedef FbxVectorTemplate2<FbxDouble> FbxDouble2;
+typedef FbxVectorTemplate3<FbxDouble> FbxDouble3;
+typedef FbxVectorTemplate4<FbxDouble> FbxDouble4;
+typedef FbxVectorTemplate4<FbxDouble4> FbxDouble4x4;
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_ARCH_TYPES_H_ */

+ 487 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxarray.h

@@ -0,0 +1,487 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxarray.h
+#ifndef _FBXSDK_CORE_BASE_ARRAY_H_
+#define _FBXSDK_CORE_BASE_ARRAY_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** Class for array of basic elements such as pointers and basic types. This class will not
+* call constructor and destructor for elements, thus it is not suitable for object references.
+* Memory allocations are always done in a single contiguous memory region. */
+template <class T> class FbxArray
+{
+public:
+	//! Element compare function pointer definition
+	typedef int (*CompareFunc)(const void*, const void*);
+
+	//! Constructor.
+	FbxArray() : mSize(0), mCapacity(0), mArray(NULL){}
+
+	//! Reserve constructor.
+	FbxArray(const int pCapacity) : mSize(0), mCapacity(0), mArray(NULL){ if( pCapacity > 0 ) Reserve(pCapacity); }
+
+	//! Copy constructor.
+	FbxArray(const FbxArray& pArray) : mSize(0), mCapacity(0), mArray(NULL){ *this = pArray; }
+
+	/** Destructor.
+	* \remark The destructor for each element will not be called. */
+	~FbxArray(){ Clear(); }
+
+	/** Insert an element at the given position, growing the array if capacity is not sufficient.
+	* \param pIndex Position where to insert the element. Must be a positive value.
+	* \param pElement Element to insert in the array.
+	* \param pCompact If \c true and capacity is exceeded, grow capacity by one, otherwise double capacity (default).
+	* \return -1 if insert failed, otherwise the position of the inserted element in the array.
+	* \remark If the given index is greater than Size(), the element is appended at the end. Use compact mode only if you need to save memory. */
+	inline int InsertAt(const int pIndex, const T& pElement, bool pCompact=false)
+	{
+		FBX_ASSERT_RETURN_VALUE(pIndex >= 0, -1);
+		int lIndex = FbxMin(pIndex, mSize);
+		if( mSize >= mCapacity )
+		{
+			T lElement = pElement;	//Copy element because we might move memory
+			int lNewCapacity = FbxMax(pCompact ? mCapacity + 1 : mCapacity * 2, 1);	//We always double capacity when not compacting
+			T* lArray = Allocate(lNewCapacity);
+			FBX_ASSERT_RETURN_VALUE(lArray, -1);
+			mArray = lArray;
+			mCapacity = lNewCapacity;
+			return InsertAt(pIndex, lElement);	//Insert copied element because reference might be moved
+		}
+
+		if( lIndex < mSize )	//Move elements to leave a space open to insert the new element
+		{
+			//If pElement is inside memmove range, copy element and insert copy instead
+			if( (&pElement >= &mArray[lIndex]) && (&pElement < &mArray[mSize]) )
+			{
+				T lElement = pElement;
+				return InsertAt(pIndex, lElement);
+			}
+			memmove(&mArray[lIndex + 1], &mArray[lIndex], (mSize - lIndex) * sizeof(T));
+		}
+
+		memcpy(&mArray[lIndex], &pElement, sizeof(T));
+		mSize++;
+
+		return lIndex;
+	}
+
+	/** Append an element at the end of the array, doubling the array if capacity is not sufficient.
+	* \param pElement Element to append to the array.
+	* \return -1 if add failed, otherwise the position of the added element in the array. */
+	inline int Add(const T& pElement)
+	{
+		return InsertAt(mSize, pElement);
+	}
+
+	/** Append an element at the end of array, if not already present, doubling the array if capacity is not sufficient.
+	* \param pElement Element to append to the array.
+	* \return -1 if add failed, otherwise the position of the added element in the array. */
+	inline int AddUnique(const T& pElement)
+	{
+		int lIndex = Find(pElement);
+		return ( lIndex == -1 ) ? Add(pElement) : lIndex;
+	}
+
+	/** Append an element at the end of the array, growing the array by one element if capacity is not sufficient.
+	* \param pElement Element to append to the array.
+	* \return -1 if add failed, otherwise the position of the added element in the array. */
+	inline int AddCompact(const T& pElement)
+	{
+		return InsertAt(mSize, pElement, true);
+	}
+
+	/** Retrieve the number of element contained in the array. To increase the capacity without increasing the size, please use Reserve().
+	* \return The number of element in the array.
+	* \remark The size of the array cannot exceed its capacity. */
+	inline int Size() const { return mSize; }
+
+	/** Retrieve the current allocated memory capacity of the array.
+	* \return The capacity of the array in number of element.
+	* \remark The capacity will always be greater or equal to its size. */
+	inline int Capacity() const { return mCapacity; }
+
+	/** Retrieve a reference of the element at given index position in the array.
+	* \param pIndex Position of element in the array.
+	* \return A reference to the element at the specified position in the array.
+	* \remark No error will be thrown if the index is out of bounds. */
+	inline T& operator[](const int pIndex) const
+	{
+	#ifdef _DEBUG
+		FBX_ASSERT_MSG(pIndex >= 0, "Index is out of range!");
+		if( pIndex >= mSize )
+		{
+			if( pIndex < mCapacity )
+			{
+				FBX_ASSERT_NOW("Index is out of range, but not outside of capacity! Call SetAt() to use reserved memory.");
+			}
+			else FBX_ASSERT_NOW("Index is out of range!");
+		}
+	#endif
+		return (T&)mArray[pIndex];
+	}
+
+	/** Retrieve a copy of the element at given index position in the array.
+	* \param pIndex Position of element in the array.
+	* \return The value of the element at the specified position in the array.
+	* \remark No error will be thrown if the index is out of bounds. */
+	inline T GetAt(const int pIndex) const
+	{
+		return operator[](pIndex);
+	}
+
+	/** Retrieve a copy of the first element.
+	* \return Copy of the first element.
+	* \remark The array should have at least one element and no error will be thrown if the array is empty. */
+	inline T GetFirst() const
+	{
+		return GetAt(0);
+	}
+
+	/** Retrieve a copy of the last element.
+	* \return Copy of the last element.
+	* \remark The array should have at least one element and no error will be thrown if the array is empty. */
+	inline T GetLast() const
+	{
+		return GetAt(mSize-1);
+	}
+
+	/** Find first matching element, from first to last.
+	* \param pElement The element to be compared to each of the elements.
+	* \param pStartIndex The position to start searching from.
+	* \return Position of first matching element or -1 if there is no matching element. */
+	inline int Find(const T& pElement, const int pStartIndex=0) const
+	{
+		FBX_ASSERT_RETURN_VALUE(pStartIndex >= 0, -1);
+		for( int i = pStartIndex; i < mSize; ++i )
+		{
+			if( operator[](i) == pElement ) return i;
+		}
+		return -1;
+	}
+
+	/** Find first matching element, from last to first.
+	* \param pElement The element to be compared to each of the elements.
+	* \param pStartIndex The position to start searching from.
+	* \return Position of first matching element or -1 if there is no matching element. */
+	inline int FindReverse(const T& pElement, const int pStartIndex=FBXSDK_INT_MAX) const
+	{
+		for( int i = FbxMin(pStartIndex, mSize-1); i >= 0; --i )
+		{
+			if( operator[](i) == pElement ) return i;
+		}
+		return -1;
+	}
+
+	/** Request for allocation of additional memory without inserting new elements. After the memory has been reserved, please use SetAt() to initialize elements.
+	* \param pCapacity The number of additional element memory allocation requested.
+	* \return \c true if the memory allocation succeeded or if the capacity is unchanged, \c false otherwise.
+	* \remark If the requested capacity is less than or equal to the current capacity, this call has no effect. In either case, Size() is unchanged. */
+	inline bool Reserve(const int pCapacity)
+	{
+		FBX_ASSERT_RETURN_VALUE(pCapacity > 0, false);
+		if( pCapacity > mCapacity )
+		{
+			T* lArray = Allocate(pCapacity);
+			FBX_ASSERT_RETURN_VALUE(lArray, false);
+			mArray = lArray;
+			mCapacity = pCapacity;
+
+			//Initialize new memory to zero
+			memset(&mArray[mSize], 0, (mCapacity - mSize) * sizeof(T));
+		}
+		return true;
+	}
+
+	/** Set the element at given position in the array.
+	* \param pIndex Position of element in the array.
+	* \param pElement The new element.
+	* \remark If the index is outside range, and outside capacity, this call has no effect. However, if index is
+	* within capacity range, element count is increased such that Size() will become pIndex + 1. */
+	inline void SetAt(const int pIndex, const T& pElement)
+	{
+		FBX_ASSERT_RETURN(pIndex < mCapacity);
+		if( pIndex >= mSize ) mSize = pIndex + 1;
+		if( mArray ) memcpy(&mArray[pIndex], &pElement, sizeof(T));
+	}
+
+	/** Set the value of the first element.
+	* \param pElement The new value of the last element.
+	* \remark The array should have at least one element and no error will be thrown if the array is empty. */
+	inline void SetFirst(const T& pElement)
+	{
+		SetAt(0, pElement);
+	}
+
+	/** Set the value of the last element.
+	* \param pElement The new value of the last element.
+	* \remark The array should have at least one element and no error will be thrown if the array is empty. */
+	inline void SetLast(const T& pElement)
+	{
+		SetAt(mSize-1, pElement);
+	}
+
+	/** Remove an element at the given position in the array.
+	* \param pIndex Position of the element to remove.
+	* \return Removed element.
+	* \remark No error will be thrown if the index is out of bounds. */
+	inline T RemoveAt(const int pIndex)
+	{
+		T lElement = GetAt(pIndex);
+		if( pIndex + 1 < mSize )
+		{
+			memmove(&mArray[pIndex], &mArray[pIndex + 1], (mSize - pIndex - 1) * sizeof(T));
+		}
+		mSize--;
+		return lElement;
+	}
+
+	/** Remove the first element in the array.
+	* \return Removed element.
+	* \remark The array should have at least one element and no error will be thrown if the array is empty. */
+	inline T RemoveFirst()
+	{
+		return RemoveAt(0);
+	}
+
+	/** Remove the last element in the array.
+	* \return Removed element.
+	* \remark The array should have at least one element and no error will be thrown if the array is empty. */
+	inline T RemoveLast()
+	{
+		return RemoveAt(mSize-1);
+	}
+
+	/** Remove first matching element in the array.
+	* \param pElement Element to be removed.
+	* \return \c true if a matching element is found and removed, \c false otherwise. */
+	inline bool RemoveIt(const T& pElement)
+	{
+		int Index = Find(pElement);
+		if( Index >= 0 )
+		{
+			RemoveAt(Index);
+			return true;
+		}
+		return false;
+	}
+
+	/** Remove a range of elements at the given position in the array.
+	* \param pIndex Begin position of the elements to remove.
+	* \param pCount The count of elements to remove.
+	* \return \c true if successful, otherwise \c false. */
+	inline void RemoveRange(const int pIndex, const int pCount)
+	{
+		if( pIndex + pCount < mSize )
+		{
+			memmove(&mArray[pIndex], &mArray[pIndex + pCount], (mSize - pIndex - pCount) * sizeof(T));
+		}
+		mSize -= pCount;
+	}
+
+	/** Inserts or erases elements at the end such that Size() becomes pSize, increasing capacity if needed. Please use SetAt() to initialize any new elements.
+	* \param pSize The new count of elements to set the array to. Must be greater or equal to zero.
+	* \return \c true if the memory (re)allocation succeeded, \c false otherwise.
+	* \remark If the requested element count is less than or equal to the current count, elements are freed from memory. Otherwise, the array grows and elements are unchanged. */
+	inline bool Resize(const int pSize)
+	{
+		if( pSize == mSize && mSize == mCapacity ) return true;
+
+		if( pSize == 0 )
+		{
+			Clear();
+			return true;
+		}
+
+		FBX_ASSERT_RETURN_VALUE(pSize > 0, false);
+		if( pSize != mCapacity )
+		{
+			T* lArray = Allocate(pSize);
+			FBX_ASSERT_RETURN_VALUE(lArray, false);
+			mArray = lArray;
+		}
+
+		if( pSize > mCapacity )	//Initialize new memory to zero
+		{
+			memset(&mArray[mSize], 0, (pSize - mSize) * sizeof(T));
+		}
+
+		mSize = pSize;
+		mCapacity = pSize;
+		return true;
+	}
+
+	/** Increase size of array by the specified size.
+	* \param pSize The size to add to the array size.
+	* \return \c true if operation succeeded, \c false otherwise. */
+	inline bool Grow(const int pSize)
+	{
+		return Resize(mSize + pSize);
+	}
+
+	/** Reduce size of array by the specified size.
+	* \param pSize The size to remove from the array size.
+	* \return \c true if operation succeeded, \c false otherwise. */
+	inline bool Shrink(const int pSize)
+	{
+		return Resize(mSize - pSize);
+	}
+
+	/** Compact the array so that its capacity is the same as its size.
+	* \return \c true if operation succeeded, \c false otherwise. */
+	inline bool Compact()
+	{
+		return Resize(mSize);
+	}
+
+	/** Reset the number of element to zero and free the memory allocated.
+	* \remark This only free the memory allocated by the array, and doesn't call the destructor of each element. */
+	inline void Clear()
+	{
+		if( mArray != NULL )
+		{
+			mSize = 0;
+			mCapacity = 0;
+			FbxFree(mArray);
+			mArray = NULL;
+		}
+	}
+
+	/** Sort the array using the specified compare function pointer
+	* \param pCompareFunc The compare function to use to sort elements. */
+	inline void Sort(CompareFunc pCompareFunc)
+	{
+		qsort(mArray, mSize, sizeof(T), pCompareFunc);
+	}
+
+	//! Get pointer to internal array of elements.
+	inline T* GetArray() const { return mArray ? (T*)mArray : NULL; }
+
+	//! Cast operator.
+	inline operator T* (){ return mArray ? (T*)mArray : NULL; }
+
+	/** Append another array at the end of this array.
+	* \param pOther The other array to append to this array. */
+	inline void AddArray(const FbxArray<T>& pOther)
+	{
+		if( Grow(pOther.mSize) )
+		{
+			memcpy(&mArray[mSize - pOther.mSize], pOther.mArray, pOther.mSize * sizeof(T));
+		}
+	}
+
+	/** Append the elements of another array at the end of this array if they are not present.
+	* \param pOther Another array. */
+	inline void AddArrayNoDuplicate(const FbxArray<T>& pOther)
+	{
+		for( int i = 0, c = pOther.mSize; i < c; ++i )
+		{
+			AddUnique(pOther[i]);
+		}
+	}
+
+	/** Remove the elements of another array from this array is they are present.
+	* \param pOther Another array. */
+	inline void RemoveArray(const FbxArray<T>& pOther)
+	{
+		for( int i = 0, c = pOther.mSize; i < c; ++i )
+		{
+			RemoveIt(pOther[i]);
+		}
+	}
+
+	/** Operator to copy elements of an array.
+	* \return this array containing a copy of pOther elements. */
+	inline FbxArray<T>& operator=(const FbxArray<T>& pOther)
+	{
+		if( this != &pOther )
+		{
+			if( Resize(pOther.mSize) )
+			{
+				memcpy(mArray, pOther.mArray, pOther.mSize * sizeof(T));
+			}
+		}
+		return *this;
+	}
+
+	/** Operator to compare elements of an array.
+	* \return \c true if the two arrays are equal, otherwise \c false. */
+	inline bool operator==(const FbxArray<T>& pOther) const
+	{
+		if( this == &pOther ) return true;
+		if( mSize != pOther.mSize ) return false;
+		return memcmp(mArray, pOther.mArray, sizeof(T) * mSize) == 0;
+	}
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	inline int GetCount() const { return mSize; }
+
+private:
+	inline T* Allocate(const int pCapacity)
+	{
+		return (T*)FbxRealloc(mArray, pCapacity * sizeof(T));
+	}
+
+	int	mSize;
+	int	mCapacity;
+	T*	mArray;
+
+#if defined(FBXSDK_COMPILER_MSC)
+    //Previously class FbxArray is for pointers. Somehow, it's used to store other types. Here's a compile-time checking for known incompatible classes.
+    //If it happens you find new incompatible ones, declare them with macro FBXSDK_INCOMPATIBLE_WITH_ARRAY. Also see file fbxstring.h.
+    FBX_ASSERT_STATIC(FBXSDK_IS_SIMPLE_TYPE(T) || __is_enum(T) || (__has_trivial_constructor(T)&&__has_trivial_destructor(T)) || !FBXSDK_IS_INCOMPATIBLE_WITH_ARRAY(T));
+#endif
+
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+//! Call FbxFree on each element of the array, and then clear it.
+template <class T> inline void FbxArrayFree(FbxArray<T>& pArray)
+{
+	for( int i = 0, c = pArray.Size(); i < c; ++i )
+	{
+		FbxFree(pArray[i]);
+	}
+	pArray.Clear();
+}
+
+//! Call FbxDelete on each element of the array, and then clear it.
+template <class T> inline void FbxArrayDelete(FbxArray<T>& pArray)
+{
+	for( int i = 0, c = pArray.Size(); i < c; ++i )
+	{
+		FbxDelete(pArray[i]);
+	}
+	pArray.Clear();
+}
+
+//! Call Destroy on each element of the array, and then clear it.
+template <class T> inline void FbxArrayDestroy(FbxArray<T>& pArray)
+{
+	for( int i = 0, c = pArray.Size(); i < c; ++i )
+	{
+		(pArray[i])->Destroy();
+	}
+	pArray.Clear();
+}
+
+//! Make sure to break build if someone try to make FbxArray<FbxArray<T>>, which is not supported.
+template <class T> FBXSDK_INCOMPATIBLE_WITH_ARRAY_TEMPLATE(FbxArray<T>);
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_ARRAY_H_ */

+ 90 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxbitset.h

@@ -0,0 +1,90 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxbitset.h
+#ifndef _FBXSDK_CORE_BASE_BITSET_H_
+#define _FBXSDK_CORE_BASE_BITSET_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** An automatic growing array of bit.
+  *
+  * The bit array will automatically grow when specifying bit indexes that are greater
+  * than the array size when calling SetBit or UnsetBit. Indexes can vary from 0 to
+  * FBXSDK_UINT_MAX-1. When an invalid index is returned from any functions, FBXSDK_UINT_MAX
+  * is returned. The bit array is not thread safe.
+  */
+class FBXSDK_DLL FbxBitSet
+{
+public:
+	/** Constructor.
+	  * \param pInitialSize Initial bit array size in bit count (not in byte count!).
+	  */
+	FbxBitSet(const FbxUInt pInitialSize=0);
+
+	//! Destructor.
+	virtual ~FbxBitSet();
+
+	/** Set the bit at the specified bit index to true regardless of its current value.
+	  * \param pBitIndex The bit index in the array in the range of [0, FBXSDK_UINT_MAX-1].
+	  */
+	void SetBit(const FbxUInt pBitIndex);
+
+	/** Set all the bits to the specified value regardless of their current value.
+	  * \param pValue The boolean value to set to all bits.
+	  */
+	void SetAllBits(const bool pValue);
+
+	/** Set the bit at the specified bit index to false regardless of its current value.
+	  * \param pBitIndex The bit index in the array in the range of [0, FBXSDK_UINT_MAX-1].
+	  */
+	void UnsetBit(const FbxUInt pBitIndex);
+
+	/** Get the bit boolean value at the specified bit index.
+	  * \param pBitIndex The bit index in the array in the range of [0, FBXSDK_UINT_MAX-1].
+	  * \return True if the bit is set, false otherwise.
+	  */
+	bool GetBit(const FbxUInt pBitIndex) const;
+
+	/** Get the bit index of the first bit that is currently set.
+	  * \return The bit index of the first set bit, FBXSDK_UINT_MAX if none found.
+	  */
+	FbxUInt GetFirstSetBitIndex() const;
+
+	/** Get the bit index of the last bit that is currently set.
+	  * \return The bit index of the last set bit, FBXSDK_UINT_MAX if none found.
+	  */
+	FbxUInt GetLastSetBitIndex() const;
+
+	/** Get the bit index of the next set bit after the specified bit index.
+	  * \param pBitIndex The start bit index in the array in the range of [0, FBXSDK_UINT_MAX-1].
+	  * \return The bit index of the next set bit, FBXSDK_UINT_MAX if none found.
+	  */
+	FbxUInt GetNextSetBitIndex(const FbxUInt pBitIndex) const;
+
+	/** Get the bit index of the previous set bit before the specified bit index.
+	  * \param pBitIndex The start bit index in the array in the range of [0, FBXSDK_UINT_MAX-1].
+	  * \return The bit index of the previous set bit, FBXSDK_UINT_MAX if none found.
+	  */
+	FbxUInt GetPreviousSetBitIndex(const FbxUInt pBitIndex) const;
+
+private:
+	void Grow(const FbxUInt pNewSize);
+
+	void* mData;
+	FbxUInt mSize;
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_BITSET_H_ */

+ 95 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxcharptrset.h

@@ -0,0 +1,95 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxcharptrset.h
+#ifndef _FBXSDK_CORE_BASE_CHARPTRSET_H_
+#define _FBXSDK_CORE_BASE_CHARPTRSET_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** This class contains the data structure support for char pointer set.
+  */
+class FBXSDK_DLL FbxCharPtrSet
+{
+public:
+	/** Class constructor
+	* \param pItemPerBlock Number of item per block. Default is 20. */
+	FbxCharPtrSet(int pItemPerBlock=20);
+
+	//! Class destructor
+	~FbxCharPtrSet();
+
+	/** Add a new item.
+	* \param pReference char pointer reference to the item.
+	* \param pItem FbxHandle to the item. */
+	void Add(const char* pReference, FbxHandle pItem);
+
+	/** Removes an item.
+	* \param pReference char reference to the item.
+	* \return true if successful. */
+	bool Remove(const char* pReference);
+
+	/** Get an item's reference.
+	* \param pReference char reference to the item.
+	* \param PIndex index to the item.
+	* \return FbxHandle to the item, NULL if fails. */
+	FbxHandle Get(const char* pReference, int* PIndex=NULL);
+
+	/** Get an item's reference from index.
+	* \param pIndex index to the item.
+	* \return FbxHandle to the item, NULL if fails. */
+	FbxHandle& operator[](int pIndex);
+
+	/** Get an item's reference from index.
+	* \param pIndex index to the item.
+	* \param pReference char reference to the item.
+	* \return FbxHandle to the item, NULL if fails. */
+	FbxHandle GetFromIndex(int pIndex, const char** pReference=NULL);
+
+	/** Removes an item by index.
+	* \param pIndex index to the item. */
+	void RemoveFromIndex(int pIndex);
+
+	/** Get the number of item in the array.
+	* \return the number of element in the set. */
+	inline int GetCount() const { return mCharPtrSetCount; }
+
+	//! Sorts the array.
+	void Sort();
+
+	//! Clears the array.
+	void Clear();
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	struct CharPtrSet;
+
+	inline void SetCaseSensitive(bool pIsCaseSensitive){ mIsCaseSensitive = pIsCaseSensitive; }
+
+private:
+	CharPtrSet*	FindEqual(const char* pReference) const;
+
+	CharPtrSet*	mCharPtrSetArray;
+	int			mCharPtrSetCount;
+	int			mBlockCount;
+	int			mItemPerBlock;
+	bool		mIsChanged;
+	bool		mIsCaseSensitive;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_CHARPTRSET_H_ */

+ 213 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxcontainerallocators.h

@@ -0,0 +1,213 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxcontainerallocators.h
+#ifndef _FBXSDK_CORE_BASE_CONTAINER_ALLOCATORS_H_
+#define _FBXSDK_CORE_BASE_CONTAINER_ALLOCATORS_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** An allocator class for use as a template parameter to one of the
+  * container class (FbxMap, FbxSet, FbxDynamicArray...) must implement these.
+  */
+class FBXSDK_DLL FbxBaseAllocator
+{
+public:
+	/** The class constructor.  
+	  * \param pRecordSize the size of one record held by the container. 
+	  * \remarks The parameter pRecordSize is not necessarily the same 
+	  *  size as of the value type, since the
+	  *  container may wrap the value into a private class.
+	  */
+	FbxBaseAllocator(const size_t pRecordSize) :
+		mRecordSize(pRecordSize)
+	{
+	}
+
+	/** This tells the allocator that we are about to call AllocateRecords
+	  * one or many times to allocate pRecordCount records. 
+	  * \param pRecordCount
+	  * \remarks This gives the allocator a chance to do whatever it deems necessary
+	  * to optimize subsequent allocations, for example, by preallocating a
+	  * sufficiently large pool of memory.
+	  */
+	void Reserve(const size_t /*pRecordCount*/)
+	{
+		// By default, ignore all preallocating requests.
+	}
+
+	/** Returns a pointer to a uninitialized continuous block of memory
+	  * able to hold pRecordCount * pRecordSize  bytes.  
+	  * \param pRecordCount
+	  * \remarks pRecordSize was defined in the Constructor description, above.
+	  */
+	void* AllocateRecords(const size_t pRecordCount=1)
+	{
+		return FbxMalloc(pRecordCount * mRecordSize);
+	}
+
+	/** Frees a block of memory returned by AllocateRecords. 
+	  * \param pRecord
+	  */
+	void FreeMemory(void* pRecord)
+	{
+		FbxFree(pRecord);
+	}
+
+	/** \return the size of each record allocated. 
+	  */
+	size_t GetRecordSize() const
+	{
+		return mRecordSize;
+	}
+
+private:
+	size_t mRecordSize;
+};
+
+/** This allocator only frees the allocated memory when it is deleted.
+  * This is a good allocator for building dictionaries, where we only
+  * add things to a container, but never remove them.
+  */
+class FbxHungryAllocator
+{
+public:
+	FbxHungryAllocator(size_t pRecordSize) :
+		mRecordSize(pRecordSize),
+		mRecordPoolSize(0),
+		mData(NULL)
+	{
+	}
+
+	FbxHungryAllocator(const FbxHungryAllocator& pOther) :
+		mRecordSize(pOther.mRecordSize),
+		mRecordPoolSize(pOther.mRecordPoolSize),
+		mData(NULL)
+	{
+	}
+
+	~FbxHungryAllocator()
+	{
+		MemoryBlock* lCurrent = mData;
+		MemoryBlock* lNext = lCurrent ? lCurrent->mNextBlock : 0;
+		while (lCurrent)
+		{
+			FbxDelete(lCurrent);
+			lCurrent = lNext;
+			lNext = lCurrent ? lCurrent->mNextBlock : 0;
+		}
+	}
+
+	void Reserve(const size_t pRecordCount)
+	{
+		MemoryBlock* lMem = FbxNew< MemoryBlock >(pRecordCount* mRecordSize);
+		lMem->mNextBlock = mData;
+		mData = lMem;
+		mRecordPoolSize += pRecordCount;
+	}
+
+	void* AllocateRecords(const size_t pRecordCount = 1)
+	{
+		MemoryBlock* lBlock = mData;
+		void* lRecord = NULL;
+
+		while( (lBlock != NULL) && ((lRecord = lBlock->GetChunk(pRecordCount * mRecordSize)) == NULL) )
+		{
+			lBlock = lBlock->mNextBlock;
+		}
+
+		if( lRecord == NULL )
+		{
+			size_t lNumRecordToAllocate = mRecordPoolSize / 8 == 0 ? 2 : mRecordPoolSize / 8;
+			if( lNumRecordToAllocate < pRecordCount )
+			{
+				lNumRecordToAllocate = pRecordCount;
+			}
+			Reserve(lNumRecordToAllocate);
+			lRecord = AllocateRecords(pRecordCount);
+		}
+		return lRecord;
+	}
+
+	void FreeMemory(void* /*pRecord*/)
+	{
+		// "Hungry": release memory only when the allocator is destroyed.
+	}
+
+	size_t GetRecordSize() const
+	{
+		return mRecordSize;
+	}
+
+	FbxHungryAllocator& operator=(const FbxHungryAllocator& pOther)
+	{
+		if( this != &pOther )
+		{
+			// The next call to AllocateRecords() may skip over currently reserved
+			// records if the size changes drastically, but otherwise GetChunk()
+			// is size-oblivious.
+			if( mRecordSize < pOther.mRecordSize )
+			{
+				mRecordPoolSize = 0;
+			}
+
+			mRecordSize = pOther.mRecordSize;
+		}
+		return(*this);
+	}
+
+private:
+	class MemoryBlock
+	{
+	public:
+		MemoryBlock(size_t pSize) :
+			mNextBlock(NULL),
+			mData(NULL),
+			mFreeData(NULL),
+			mEnd(NULL)
+		{
+			mData = FbxMalloc(pSize);
+			mFreeData = mData;
+			mEnd = reinterpret_cast<char*>(mData) + pSize;
+		}
+
+		~MemoryBlock()
+		{
+			FbxFree(mData);
+		}
+
+		void* GetChunk(const size_t pSize)
+		{
+			if( reinterpret_cast<char*>(mFreeData) + pSize < mEnd )
+			{
+				void* lChunk = mFreeData;
+				mFreeData = reinterpret_cast<char*>(mFreeData) + pSize;
+				return lChunk;
+			}
+			return NULL;
+		}
+
+		MemoryBlock*	mNextBlock;
+		void*			mData;
+		void*			mFreeData;
+		void*			mEnd;
+	};
+
+	size_t			mRecordSize;
+	size_t			mRecordPoolSize;
+	MemoryBlock*	mData;
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_CONTAINER_ALLOCATORS_H_ */

+ 324 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxdynamicarray.h

@@ -0,0 +1,324 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxdynamicarray.h
+#ifndef _FBXSDK_CORE_BASE_DYNAMICARRAY_H_
+#define _FBXSDK_CORE_BASE_DYNAMICARRAY_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxcontainerallocators.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** Template class for dynamic array holding objects.
+  * \nosubgrouping
+  * \see FbxStaticArray
+  */
+template <typename Type, typename Allocator=FbxBaseAllocator> class FbxDynamicArray
+{
+public:
+	//! Default constructor.
+	FbxDynamicArray() :
+		mArray(NULL),
+		mCapacity(0),
+		mSize(0),
+		mAllocator(sizeof(Type))
+	{
+	}
+
+	/** Constructor.
+	* \param pInitialSize initial capacity of this array */
+	FbxDynamicArray(const size_t pInitialSize) :
+		mArray(NULL),
+		mCapacity(0),
+		mSize(0),
+		mAllocator(sizeof(Type))
+	{
+		Reserve(pInitialSize);
+	}
+
+	/** Copy constructor.
+	* \remarks The copy constructor of \c Type will be 
+	* invoked in order to copy the value of elements to the
+	* new array.
+	*/
+	FbxDynamicArray(const FbxDynamicArray& pArray) :
+		mArray(NULL),
+		mCapacity(0),
+		mSize(0),
+		mAllocator(sizeof(Type))
+	{
+		Reserve(pArray.mCapacity);
+		CopyArray(mArray, pArray.mArray, pArray.mSize);
+		mSize = pArray.mSize;
+	}
+
+	//! Destructor.
+	~FbxDynamicArray()
+	{
+		for( size_t i = 0; i < mSize; ++i )
+		{
+			mArray[i].~Type();
+		}
+		mAllocator.FreeMemory(mArray);
+	}
+
+	//! Gets the current capacity of the array.
+	size_t Capacity() const
+	{
+		return mCapacity;
+	}
+
+	//! Gets the size of the array.
+	size_t Size() const
+	{
+		return mSize;
+	}
+
+	/** Assures that sufficient memory is allocated to hold n objects in the array, and increases the capacity if necessary.
+	* \param pCount Number of objects to reserve */
+	void Reserve(const size_t pCount)
+	{
+		if( pCount > mCapacity )
+		{
+			//We don't use mAllocator.PreAllocate, because we want our array to be continuous in memory.
+			Type* lNewArray = (Type*)mAllocator.AllocateRecords(pCount);
+			MoveArray(lNewArray, mArray, mSize);
+			mAllocator.FreeMemory(mArray);
+			mArray = lNewArray;
+			mCapacity = pCount;
+		}
+	}
+
+	/** Appends n objects at the end of the array.
+	* \param pItem object to append
+	* \param pNCopies number of copies to append */
+	void PushBack(const Type& pItem, const size_t pNCopies = 1)
+	{
+		if( mSize + pNCopies > mCapacity )
+		{
+			size_t lNewSize = mCapacity + mCapacity / 2;	//grow by 50%
+			if( mSize + pNCopies > lNewSize )
+			{
+				lNewSize = mSize + pNCopies;
+			}
+			Reserve(lNewSize);
+		}
+		FBX_ASSERT(mSize + pNCopies <= mCapacity);
+		Fill(mArray + mSize, pItem, pNCopies);
+		mSize += pNCopies;
+	}
+
+	/** Inserts n objects at the specified position.
+	* \param pIndex position index
+	* \param pItem object to insert
+	* \param pNCopies number of copies to append */
+	void Insert(const size_t pIndex, const Type& pItem, const size_t pNCopies=1)
+	{
+		FBX_ASSERT(pIndex >= 0);
+		FBX_ASSERT(pIndex <= mSize);
+		Type lValue = pItem; // in case pItem is in array
+		if( pNCopies == 0 )
+		{
+		}
+		else if( pIndex >= mSize )
+		{
+			PushBack(pItem, pNCopies);
+		}
+		else if( mSize + pNCopies > mCapacity )
+		{
+			size_t lNewSize = mCapacity + mCapacity / 2;	//not enough room, grow by 50%
+			if( mSize + pNCopies > lNewSize )
+			{
+				lNewSize = mSize + pNCopies;
+			}
+
+			Type* lNewArray = (Type*)mAllocator.AllocateRecords(lNewSize);
+			MoveArray(lNewArray, mArray, pIndex); // copy prefix
+			Fill(lNewArray + pIndex, pItem, pNCopies); // copy values
+			MoveArray(lNewArray + pIndex + pNCopies, mArray + pIndex, mSize - pIndex); // copy suffix
+			mAllocator.FreeMemory(mArray);
+			mArray = lNewArray;
+			mSize += pNCopies;
+			mCapacity = lNewSize;
+		}
+		else
+		{
+			// copy suffix backwards
+			MoveArrayBackwards(mArray + pIndex + pNCopies, mArray + pIndex, mSize - pIndex);
+			Fill(mArray + pIndex, pItem, pNCopies); // copy values
+			mSize += pNCopies;
+		}
+	}
+
+	/** Removes n objects at the end.
+	* \param pNElements number of objects to remove */
+	void PopBack(size_t pNElements=1)
+	{
+		FBX_ASSERT(pNElements <= mSize);
+		for( size_t i = mSize - pNElements; i < mSize; ++i )
+		{
+			mArray[i].~Type();
+		}
+		mSize -= pNElements;
+	}
+
+	/** Removes n objects at the specified position.
+	* \param pIndex position index
+	* \param pNElements number of objects to remove */
+	void Remove(const size_t pIndex, size_t pNElements=1)
+	{
+		FBX_ASSERT(pIndex >= 0);
+		FBX_ASSERT(pIndex <= mSize);
+		FBX_ASSERT(pIndex + pNElements <= mSize);
+		if( pIndex + pNElements >= mSize )
+		{
+			PopBack(pNElements);
+		}
+		else
+		{            
+			for( size_t i = pIndex; i < pIndex + pNElements; ++i )
+			{
+				mArray[i].~Type();
+			}
+			MoveOverlappingArray(&mArray[pIndex], &mArray[pIndex + pNElements], mSize - pIndex - pNElements);
+			mSize -= pNElements;
+		}
+	}
+
+	/** Gets nth object in the array.
+	* \param pIndex position index */
+	Type& operator[](const size_t pIndex)
+	{
+		return mArray[pIndex];
+	}
+
+	/** Gets nth object in the array.
+	* \param pIndex position index */
+	const Type& operator[](const size_t pIndex) const
+	{
+		return mArray[pIndex];
+	}
+
+	/** Retrieve the first item in the array.
+	* \return The first item in the array. */
+	Type& First()
+	{
+		return operator[](0);
+	}
+
+	/** Retrieve the first item in the array.
+	* \return The first item in the array. */
+	const Type& First() const
+	{
+		return operator[](0);
+	}
+
+	/** Retrieve the last item in the array.
+	* \return The last item in the array. */
+	Type& Last()
+	{
+		return operator[](mSize-1);
+	}
+
+	/** Retrieve the last item in the array.
+	* \return The last item in the array. */
+	const Type& Last() const
+	{
+		return operator[](mSize-1);
+	}
+
+	/** Find first matching element, from first to last.
+	* \param pItem The item to try to find in the array.
+	* \param pStartIndex The index to start searching from.
+	* \return Index of the first matching item, otherwise returns -1 (equivalent of SIZE_MAX for size_t). */
+	size_t Find(const Type& pItem, const size_t pStartIndex=0) const
+	{
+		for( size_t i = pStartIndex; i < mSize; ++i )
+		{
+			if( operator[](i) == pItem ) return i;
+		}
+		return -1;
+	}
+
+	/** Assignment operator.
+	* \remarks The copy constructor of \c Type will be invoked in order to copy the value of elements to the new array. */
+	FbxDynamicArray& operator=(const FbxDynamicArray& pArray)
+	{
+		Reserve(pArray.mCapacity);
+		CopyArray(mArray, pArray.mArray, pArray.mSize);
+		mSize = pArray.mSize;
+		return *this;
+	}
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+private:
+	static void CopyArray(Type* pDest, const Type* pSrc, size_t pCount)
+	{
+		for( int i = 0; i < int(pCount); i++ )
+		{
+			new(&(pDest[i])) Type(pSrc[i]);	//in-place new won't allocate memory, so it is safe
+		}
+	}
+
+	static void MoveArray(Type* pDest, const Type* pSrc, size_t pCount)
+	{
+		for( int i = 0; i < int(pCount); i++ )
+		{
+			new(&(pDest[i])) Type(pSrc[i]);	//in-place new won't allocate memory, so it is safe
+		}
+
+		for( int i = 0; i < int(pCount); i++ )
+		{
+			pSrc[i].~Type();
+		}
+	}
+
+	static void MoveOverlappingArray(Type* pDest, const Type* pSrc, size_t pCount)
+	{
+		for( int i = 0; i < int(pCount); i++ )
+		{
+			new(&(pDest[i])) Type(pSrc[i]);	//in-place new won't allocate memory, so it is safe
+			pSrc[i].~Type();
+		}
+	}
+
+	static void MoveArrayBackwards(Type* pDest, const Type* pSrc, size_t pCount)
+	{
+		for( int i = 0; i < int(pCount); ++i )
+		{
+			new(&(pDest[pCount-1-i])) Type(pSrc[pCount-1-i]);	//in-place new won't allocate memory, so it is safe
+			pSrc[pCount-1-i].~Type();
+		}
+	}
+
+	static void Fill(Type* pDest, const Type& pItem, size_t pCount)
+	{
+		for( int i = 0; i < int(pCount); i++ )
+		{
+			new(&(pDest[i])) Type(pItem);	//in-place new won't allocate memory, so it is safe
+		}
+	}
+
+    Type*		mArray;
+    size_t		mCapacity;
+    size_t		mSize;
+    Allocator	mAllocator;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_DYNAMICARRAY_H_ */

+ 257 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxfile.h

@@ -0,0 +1,257 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxfile.h
+#ifndef _FBXSDK_CORE_BASE_FILE_H_
+#define _FBXSDK_CORE_BASE_FILE_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxstring.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+class FbxStream;
+
+/**
+    Class for interfacing with files, providing a similar interface for files independant of the OS or filesystem.
+*/
+class FBXSDK_DLL FbxFile
+{
+public:
+	enum EMode {eNone, eReadOnly, eReadWrite, eCreateWriteOnly, eCreateReadWrite, eCreateAppend};
+	enum ESeekPos {eBegin, eCurrent, eEnd};
+
+    FbxFile();
+    virtual ~FbxFile();
+
+	/** Opens a file on disk using the specified read/write mode.
+	  * \param pFileName_UTF8 Filename in UTF8 (compatible with ASCII)
+      * \param pMode Mode in which to open the file, e.g. eReadOnly, eCreateReadWrite, etc.
+      * \param pBinary Whether the file is to be opened in binary or text mode.
+	  * \return True if opening is successful.
+	  */
+    virtual bool        Open(const char* pFileName_UTF8, const EMode pMode=eCreateReadWrite, const bool pBinary=true);
+
+	/** Opens a file from a data stream using the specified read/write mode.
+	  * \param pStream Stream instance with which the file will be read/written
+      * \param pStreamData User-defined data to pass as a parameter to the stream's Open() method.
+      * \param pMode Deprecated/Unused.
+	  * \return True if opening is successful.
+	  */
+    virtual bool        Open(FbxStream* pStream, void* pStreamData, const char* pMode);
+
+	/** Closes a file, freeing its handle.
+	  * \return True if closing is successful.
+	  */
+    virtual bool        Close();
+
+    /** Seek to a specific position in the file, starting from either beginning, current position or end
+	  * \param pOffset Offset to seek to (advance the file position cursor) starting from pSeekPos
+      * \param pSeekPos Starting position from which to seek to.  Beginning, current position or end.
+	  */
+    virtual void		Seek(const FbxInt64 pOffset, const ESeekPos pSeekPos=eBegin);
+
+	/** Returns the position at which the file cursor currently is.  For example, will be ==0 for beginning and ==FileSize for end.
+	  * \return The position at which the file cursor currently is.
+	  */
+    virtual FbxInt64	Tell() const;
+
+	/** Read a part of the file into a buffer
+      * \param pDstBuf Pre-allocated buffer in which to read data
+      * \param pSize Size of the data chunk to be read in bytes
+	  * \return Number of bytes read.
+	  */
+    virtual	size_t		Read(void* pDstBuf, const size_t pSize);
+
+	/** Read a part of the file as a string into a buffer
+      * \param pDstBuf Pre-allocated buffer in which to read the string
+      * \param pDstSize Size of the data chunk to be read in characters
+      * \param pStopAtFirstWhiteSpace If true, will stop reading at first white space, otherwise it will stop at the first line feed (\n)
+	  * \return Pointer on the data read.  Equivalent to parameter pDstBuf
+	  */
+	virtual char*		ReadString(char* pDstBuf, const size_t pDstSize, bool pStopAtFirstWhiteSpace=false);
+
+	/** Write a buffer to an opened file
+      * \param pSrcBuf Pre-allocated buffer from which to write data
+      * \param pSize Size of the data chunk to be written in bytes
+	  * \return Number of bytes written.
+	  */
+    virtual size_t		Write(const void* pSrcBuf, const size_t pSize);
+
+	/** Write a formatted string to an opened file
+      * \param pFormat Pre-allocated format buffer from which to write data
+      * \param ... Variable number of arguments describing the values in the previous parameter. 
+	  * \return True if data was successfully written
+	  */
+    virtual bool		WriteFormat(const char* pFormat, ...);
+
+	/** Modify the size of a file. Null characters ('\0') are appended if the file is extended. 
+      * If the file is truncated, all data from the end of the shortened file to the original length of the file is lost.
+      * Please note that this function considers the current file cursor as the beginning of the file.
+      * It is therefore required to use Seek(0) prior to calling it if we want the size specified by the
+      * pSize parameter to be absolute.
+      * \param pSize New desired file size
+	  * \return True if file was successfully truncated
+	  */
+    virtual bool		Truncate(const FbxInt64 pSize);
+
+	/** Checks whether the current file cursor position is at the end of file.
+	  * \return True if the cursor is at the end of file, false otherwise.
+	  */
+    virtual bool		EndOfFile() const;
+
+	/** Gets the size of the currently opened file.
+	  * \return File size
+	  */
+	virtual FbxInt64	GetSize();
+
+    /** Unused function in this default implementation.  Must be implemented by memory files.       
+      * \param pMemPtr Unused
+	  * \param pSize Unused
+	  */
+	virtual void		GetMemoryFileInfo(void** pMemPtr, size_t pSize);
+
+	/** Checks whether the file is currently opened.
+	  * \return True if file is opened, false otherwise
+	  */
+    bool                IsOpen() const;
+
+	/** Checks whether the file is currently opened with a user-provided streaming interface instead of just the file name
+	  * \return True if file has been opened with a stream interface, false otherwise
+	  */
+    bool                IsStream() const;
+
+	/** Returns the full file path name, as provided when opening it.
+	  * \return File full path
+	  */
+    const char*			GetFilePathName() const;
+
+	/** Returns the mode with which the file was opened, when calling the Open() method.
+	  * \return Mode with which the file was opened
+	  */
+    EMode				GetFileMode() const;
+
+	/** Returns last encountered error when performing any operation on the file.
+	  * \return Last error code
+	  */
+    int                 GetLastError();
+
+	/** Resets the current error code and the end of file indicator of the opened file
+	  */
+    void                ClearError();
+
+protected:
+	FILE*				mFilePtr;
+    FbxStream*          mStreamPtr;
+	bool                mIsOpen;
+	bool                mIsStream;
+	EMode				mMode;
+	FbxString			mFileName;
+};
+
+class FBXSDK_DLL FbxFileUtils
+{
+public:
+	/** Delete a file from disk.
+	  * \param pFileName_UTF8 The file to be deleted.
+	  * \return True if delete is successful.
+	  */
+    static bool Delete(const char* pFileName_UTF8);
+
+	/** Rename a file on disk.
+	  * \param pFileName_UTF8 The file to be renamed.
+	  * \param pNewName_UTF8 The new file name upon rename.
+	  * \return True if rename is successful.
+	  */
+    static bool Rename(const char* pFileName_UTF8, const char* pNewName_UTF8);
+
+	/** Copy one file's content to another file (if the destination file not exist, it will be created).
+	  * \param pDestination_UTF8 The destination file path
+	  * \param pSource_UTF8 The source file path
+	  * \return Return true if copy is successfully.
+	  */
+	static bool Copy(const char* pDestination_UTF8, const char* pSource_UTF8);
+
+	//! Get given file's size.
+	static FbxInt64 Size(const char* pFilePath_UTF8);
+
+	/** Find if the specified file exist.
+	  * \param pFilePath_UTF8 The file path to test against.
+	  * \return Returns true if the file exist.
+	  */
+	static bool Exist(const char* pFilePath_UTF8);
+
+	/** Find if the specified file is in read-only mode.
+	  * \param pFilePath_UTF8 The file path to test against.
+	  * \return Returns true if the file is in read-only mode.
+	  */
+	static bool IsReadOnly(const char* pFilePath_UTF8);
+
+	// We return a KLong that in fact is a cast of a time_t.
+	//! Get given file's last date.
+	static FbxLong GetLastDate(const char* pPath_UTF8);
+
+	//! Set the given file's last date as the given date.
+	static bool SetLastDate(const char* pPath_UTF8, FbxLong pTime);
+
+	/** Get some content of a file.
+	  * \param pStr The content get from file.
+	  * \param pSize The size of content.
+	  * \param pStream The opened stream of file.
+	  */
+	static char* FGets(char* pStr, int pSize, FILE* pStream);
+};
+
+template<class T> inline const T FbxSwab(const T x)
+{
+	switch( sizeof(x) )
+	{
+		case 2:
+		{
+			FbxUInt8 t[2];
+			t[0] = ((FbxUInt8*)&x)[1];
+			t[1] = ((FbxUInt8*)&x)[0];
+			return *(T*)&t;
+		}
+
+		case 4:
+		{
+			FbxUInt8 t[4];
+			t[0] = ((FbxUInt8*)&x)[3];
+			t[1] = ((FbxUInt8*)&x)[2];
+			t[2] = ((FbxUInt8*)&x)[1];
+			t[3] = ((FbxUInt8*)&x)[0];
+			return *(T*)&t;
+		}
+
+		case 8:
+		{
+			FbxUInt8 t[8];
+			t[0] = ((FbxUInt8*)&x)[7];
+			t[1] = ((FbxUInt8*)&x)[6];
+			t[2] = ((FbxUInt8*)&x)[5];
+			t[3] = ((FbxUInt8*)&x)[4];
+			t[4] = ((FbxUInt8*)&x)[3];
+			t[5] = ((FbxUInt8*)&x)[2];
+			t[6] = ((FbxUInt8*)&x)[1];
+			t[7] = ((FbxUInt8*)&x)[0];
+			return *(T*)&t;
+		}
+
+		default:
+			return x;
+	}
+}
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_FILE_H_ */

+ 80 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxfolder.h

@@ -0,0 +1,80 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxfolder.h
+#ifndef _FBXSDK_CORE_BASE_FOLDER_H_
+#define _FBXSDK_CORE_BASE_FOLDER_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#ifndef FBXSDK_ENV_WINSTORE
+
+#include <fbxsdk/core/base/fbxstring.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** Class for iterating into file system folders and the items contained. */
+class FBXSDK_DLL FbxFolder
+{
+public:
+	//! The different entry type that can be found in folders.
+	enum EEntryType
+	{
+		eRegularEntry,	//!< Regular entry, such as file.
+		eFolderEntry	//!< Folder entry that potentially contain more files.
+	};
+
+	/** Open the specified folder for browsing its content.
+	* \param pFolderPath_UTF8 The folder path to open.
+	* \return True if the folder path was successfully open, false otherwise. */
+	bool Open(const char* pFolderPath_UTF8);
+
+	/** Get the next item in the folder.
+	* \return True if another item was found after the current one. */
+	bool Next();
+
+	/** Get the type of the current entry in the folder.
+	* \return The entry type. */
+	EEntryType GetEntryType() const;
+
+	/** Retrieve the name of the current entry in the folder.
+	* \return The name of the current entry. */
+	FbxString GetEntryName() const;
+
+	/** Retrieve the extension name of the current entry.
+	* \return The extension name of the current entry. */
+	char* GetEntryExtension() const;
+
+	/** Close the folder when done browsing its content. */
+	void Close();
+
+	/** Find out if the folder was successfully opened the last time Open was called.
+	* \return True if the folder is currently open. */
+	bool IsOpen() const;
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	FbxFolder();
+	~FbxFolder();
+
+private:
+	struct FolderImpl;
+	FolderImpl* mImpl;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* !FBXSDK_ENV_WINSTORE */
+
+#endif /* _FBXSDK_CORE_BASE_FOLDER_H_ */

+ 411 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxhashmap.h

@@ -0,0 +1,411 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxhashmap.h
+#ifndef _FBXSDK_CORE_BASE_HASHMAP_H_
+#define _FBXSDK_CORE_BASE_HASHMAP_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxarray.h>
+#include <fbxsdk/core/base/fbxmap.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+template<class T> class FbxNoOpDestruct { public: static inline void DoIt(T&) {} };
+template<class T> class FbxPtrDestruct  { public: static inline void DoIt(T& v) { FbxDelete(v); v = NULL; } };
+
+//True if equal, false otherwise
+template<class T> class FbxDefaultComparator{ public: static inline bool CompareIt( const T& t1, const T& t2 ) { return t1 == t2; } };
+
+/** \brief This object represents a standard hash map.  You must provide the typename of KEY and VALUE as well
+    as the typename of the class that contains the hash function to use to hash values.   The hash class must
+    overload operator() and be built like this.
+    \code
+    class SimpleHash
+    {
+    public:
+        inline unsigned int operator() ( const int pKey ) const
+        {
+            return pKey;
+        }
+    };
+    \endcode
+  * \nosubgrouping
+  */
+template< typename KEY, typename VALUE, typename HASH, class Destruct = FbxNoOpDestruct<VALUE>, class Comparator = FbxDefaultComparator<KEY> >
+class FbxHashMap
+{
+public:
+	typedef KEY KeyType;
+	typedef VALUE ValueType;
+	typedef HASH HashFunctorType;
+
+private:
+
+	class ListItem
+	{
+	public:
+		ListItem* mNext;
+		ValueType mValue;
+		KeyType mKey;
+
+		ListItem()
+			:
+		mNext(NULL)
+		{
+		}
+
+        ~ListItem()
+        {
+            Destruct::DoIt(mValue);        
+        }
+	};
+
+public:
+    /**
+    Iterate through every element in a hash map.
+    */
+	class Iterator
+	{
+	public:
+
+		typedef ListItem ListItemType;
+		typedef FbxPair< KeyType, ValueType > KeyValuePair;
+
+        /**
+        Copy constructor
+        */
+		Iterator( const Iterator& pOther )
+			:
+			mMap( pOther.mMap ),
+			mBucketIndex( pOther.mBucketIndex ),
+			mCurrentItem( pOther.mCurrentItem )
+		{
+
+		}
+
+        /**
+        Destructor
+        */
+		~Iterator(){};
+
+        /**
+        Used to dereference an iterator and give it a behavior more similar to a pointer.
+        \return The KeyValuePair currently referenced by the iterator
+        */
+		KeyValuePair operator*() const
+		{
+			KeyValuePair lItem;
+
+			if( mCurrentItem )
+			{
+				lItem.mFirst = mCurrentItem->mKey;
+				lItem.mSecond = mCurrentItem->mValue;
+				return lItem;
+			}
+
+			FBX_ASSERT_NOW("Accessing out of bounds iterator");
+
+			return lItem;
+		}
+
+        /**
+        Advances the iterator to the next keyvaluepair in the hashmap.  It does not wrap around so 
+        advancing after reaching the last element will not point back to the first one.
+        */
+		void Next()
+		{
+			if( !mCurrentItem )
+				return;
+
+			if( mCurrentItem->mNext )
+			{
+				mCurrentItem = mCurrentItem->mNext;
+				return;
+			}
+			else
+			{
+				mBucketIndex++;
+				for( ; mBucketIndex < mMap->mBuckets.GetCount(); ++mBucketIndex )
+				{
+					if( mMap->mBuckets[ mBucketIndex ] )
+					{
+						mCurrentItem = mMap->mBuckets[ mBucketIndex ];
+						return;
+					}
+				}
+				
+				if( mBucketIndex >= mMap->mBuckets.GetCount() )
+				{
+					*this = mMap->End();
+					return;
+				}
+			}
+		}
+
+        /**
+        Check equivalence between two iterators.  There are 3 conditions for equivalence between 2 iterators:
+        1) Item being referenced by the iterator must be equivalent
+        2) They must point at the same index
+        3) They must point on the same map
+        \return true if both iterators are equal, false otherwise
+        */
+		bool operator==( const Iterator& pOther ) const
+		{
+			return	mCurrentItem == pOther.mCurrentItem && 
+					mBucketIndex == pOther.mBucketIndex &&
+					mMap == pOther.mMap;
+		}
+
+        /**
+        Check inequivalence between 2 iterators.  Please see operator== for more information.
+        \return true if both iterators are NOT equal, false if they are
+        */
+		bool operator!=( const Iterator& pOther ) const
+		{
+			return !(*this == pOther);
+		}
+
+		/**
+        Assign the current iterator to the one on the right hand side of the operator.  After assignment they will
+        reference the same object, at the same index, in the same map.
+        \return The new iterator
+        */
+		Iterator& operator=( const Iterator& pOther )
+		{
+			this->mBucketIndex = pOther.mBucketIndex;
+			this->mMap = pOther.mMap;
+			this->mCurrentItem = pOther.mCurrentItem;
+			return *this;
+		}
+
+    private:
+		const FbxHashMap* mMap;		
+
+		int mBucketIndex;
+		ListItemType* mCurrentItem;
+		
+		Iterator(const FbxHashMap* pMap, int pBucketIndex, ListItemType* pCurrentItem)
+			:
+			mMap( pMap ),
+			mBucketIndex(pBucketIndex),
+			mCurrentItem(pCurrentItem)
+		{
+
+		}
+
+		friend class FbxHashMap;
+	};
+	
+	/**
+    Construct a FbxHashMap with an user-defined maximum number of elements.
+    \param pBucketSize Initial maximum number of elements.
+    */
+	FbxHashMap( int pBucketSize )
+	{
+		mBuckets.Resize( pBucketSize );
+	}
+
+	/**
+    Construct a FbxHashMap with the default maximum number of elements (30)
+    */
+    FbxHashMap()
+    {
+        mBuckets.Resize(30);
+    }
+
+	/**
+    Clear all elements in the hash map before destroying itself
+    */
+	~FbxHashMap()
+	{
+		Clear();
+		mBuckets.Clear();
+	}
+
+	/**
+    Calls operator delete on all elements of the hashmap, de-allocating all memory and destroying them
+    */
+	void Clear()
+	{
+		for( int i = 0; i < mBuckets.GetCount(); ++i)
+		{
+			if( mBuckets[i] )
+			{
+				ListItem* lNext = mBuckets[i]->mNext;
+				while( lNext )
+				{
+					ListItem* lNextNext = lNext->mNext;
+					FbxDelete(lNext);
+					lNext = lNextNext;
+				}
+
+				FbxDelete(mBuckets[i]);
+				mBuckets[i] = NULL;
+			}
+		}
+	}
+
+	/**
+    Find an element in the hashmap.  If no element exist with the specified key, returns an iterator pointing on the
+    end of the map (not an actual KeyValuePair).
+    \param pKey The value of the key corresponding to the element
+    \return An Iterator referencing that element
+    */
+	const Iterator Find( const KeyType& pKey ) const
+	{
+		unsigned int lIndex = mHashFunctor(pKey);
+		lIndex = lIndex % mBuckets.GetCount();
+		ListItem* lItem = mBuckets[lIndex];
+		while( lItem )
+		{
+            if( Comparator::CompareIt( lItem->mKey, pKey ) )
+			{
+				Iterator lIt( this, lIndex, lItem );
+				return lIt;
+			}
+			lItem = lItem->mNext;
+		}
+		
+		return End();
+	}
+	
+	/**
+    Remove an element in the hashmap.
+    \param pKey The key value of the element to remove
+    \return The value of the element that was just deleted.  If the element does not exist, a value created with its default constructor will be returned
+    */
+	VALUE Remove( const KEY& pKey )
+    {
+		unsigned int lIndex = mHashFunctor(pKey);
+		lIndex = lIndex % mBuckets.GetCount();
+		ListItem* lItem = mBuckets.GetAt(lIndex);
+        ListItem* lLastItem = NULL;
+		
+        while( lItem )
+		{
+			if( lItem->mKey == pKey )
+			{
+                if( lLastItem )
+                    lLastItem->mNext = lItem->mNext;
+
+                if( mBuckets.GetAt(lIndex) == lItem ) 
+                    mBuckets.SetAt(lIndex, lItem->mNext );
+
+                VALUE lValue = lItem->mValue;
+                FbxDelete(lItem);
+                
+                return lValue;
+			}
+
+            lLastItem = lItem;
+			lItem = lItem->mNext;
+		}
+		
+        return VALUE();
+    }
+
+    /** Add or retrieve a KeyValuePair from the Hashmap.  If there is already an entry in the map for an element
+    with key value specified in parameter, the value will be returned.  Otherwise, a new entry will be created
+    with this key value and the default value for ValueType will be returned.  It can be modified using the 
+    assignment operator
+    \param pKey The key for which to retrieve/add a value.
+    \return Value of the element referenced by the key specified in parameter.
+    */
+	ValueType& operator[]( const KeyType& pKey )
+	{
+        unsigned int lIndex = 0;
+		Iterator lIt = InternalFind( pKey, lIndex);
+		if( lIt != End() )
+		{
+			return lIt.mCurrentItem->mValue;
+		}
+
+		lIndex = lIndex % mBuckets.GetCount();
+		ListItem* lItem = FbxNew< ListItem >();
+		lItem->mNext = NULL;
+		lItem->mKey = pKey;
+
+		if( !mBuckets.GetAt(lIndex) )
+		{
+			mBuckets.SetAt(lIndex, lItem);
+		}
+		else
+		{
+			lItem->mNext = mBuckets.GetAt(lIndex);
+			mBuckets.SetAt(lIndex, lItem);
+		}
+
+		return lItem->mValue;
+	}
+
+    /** Returns an iterator pointing on the first non-null element in the map
+    \return An iterator pointing on the first non-null element in the map.
+    */
+	Iterator Start() const
+	{
+		for( int i = 0; i < mBuckets.GetCount(); ++i )
+		{
+			if( mBuckets[i] )
+			{
+				Iterator lIt( this, i, mBuckets[i] );
+				return lIt;
+			}
+		}
+
+		return End();
+	}
+
+    /** Returns an iterator pointing on the last element in the map.  This is not an actual KeyValuePair but 
+    * but an iterator pointing on a null element. 
+    \return Iterator pointing on a null value at the end of the map
+    */
+	Iterator End() const
+	{
+		Iterator lIt( this, 0, NULL );
+		return lIt;
+	}
+
+private:
+
+    // Avoid calculating the hashvalue twice
+	const Iterator InternalFind( const KeyType& pKey, unsigned int& pOutCalculatedIndex ) const
+	{
+		pOutCalculatedIndex = mHashFunctor(pKey);
+		unsigned int lIndex = pOutCalculatedIndex % mBuckets.GetCount();
+		ListItem* lItem = mBuckets[lIndex];
+		while( lItem )
+		{
+            if( Comparator::CompareIt( lItem->mKey, pKey ) )
+			{
+				Iterator lIt( this, lIndex, lItem );
+				return lIt;
+			}
+			lItem = lItem->mNext;
+		}
+		
+		return End();
+	}
+
+
+	// not implemented yet!
+	FbxHashMap( const FbxHashMap& pOther ) {};
+
+	FbxArray<ListItem*> mBuckets;
+	HashFunctorType mHashFunctor;
+
+	friend class Iterator;
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_HASHMAP_H_ */

+ 262 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxintrusivelist.h

@@ -0,0 +1,262 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxintrusivelist.h
+#ifndef _FBXSDK_CORE_BASE_INTRUSIVE_LIST_H_
+#define _FBXSDK_CORE_BASE_INTRUSIVE_LIST_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+#define FBXSDK_INTRUSIVE_LIST_NODE(Class, NodeCount)\
+    public: inline FbxListNode<Class>& GetListNode(int index = 0){ return this->mNode[index]; }\
+    private: FbxListNode<Class> mNode[NodeCount];
+
+template <typename T> class FbxListNode
+{
+    typedef FbxListNode<T> NodeT; 
+
+public:
+	explicit FbxListNode(T* pData = 0):mNext(0),mPrev(0),mData(pData){}
+	~FbxListNode(){ Disconnect(); }
+
+	void Disconnect()
+	{
+		if ( mPrev != 0 )
+			mPrev->mNext = mNext;
+
+		if ( mNext != 0 )
+			mNext->mPrev = mPrev;
+
+		mPrev = mNext = 0;
+	}
+
+	NodeT*	mNext;
+	NodeT*	mPrev;
+	T*		mData;
+};
+
+//-----------------------------------------------------------------
+// template arg T: Type listed
+//          arg NodeIndex: If an object listed has  multiple list node, which
+//                         index corresponds to the right node
+template <typename T, int NodeIndex=0> class FbxIntrusiveList
+{
+public:
+    typedef T         allocator_type;
+    typedef T         value_type;
+    typedef T&        reference;
+    typedef const T&  const_reference;
+    typedef T*        pointer;
+    typedef const T*  const_pointer;
+
+    typedef FbxListNode<T> NodeT;
+
+    // Construction / Destruction
+    FbxIntrusiveList():mHead(0)
+    {
+        mHead.mNext = mHead.mPrev = &mHead;
+    }
+    ~FbxIntrusiveList()
+    {
+        while(!Empty())
+            Begin().Get()->Disconnect();  // LINUXNote:  should be Erase(Begin()); but there's an issue with gcc 4.2
+    };
+
+    // true if the list's size is 0.
+    bool Empty() const
+    {
+        return ((mHead.mNext==&mHead)&&(mHead.mPrev==&mHead));
+    }
+
+    // Back Insertion Sequence  Inserts a new element at the end.  
+    void PushBack(T& pElement)
+    {
+        NodeT* pNode = &pElement.GetListNode(NodeIndex);
+        pNode->mData = &pElement;
+
+        if (Empty())
+        {
+            pNode->mNext = &mHead;
+            pNode->mPrev = &mHead;
+            mHead.mNext = pNode;
+            mHead.mPrev = pNode;
+        }
+        else
+        {
+            pNode->mNext = &mHead;
+            pNode->mPrev = mHead.mPrev;
+
+            pNode->mPrev->mNext = pNode;
+            mHead.mPrev = pNode;
+        }
+    }
+
+    void PushFront(T& pElement)
+    {
+        NodeT* pNode = &pElement.GetListNode(NodeIndex);
+        pNode->mData = &pElement;
+
+        if (Empty())
+        {
+            pNode->mNext = &mHead;
+            pNode->mPrev = &mHead;
+            mHead.mNext = pNode;
+            mHead.mPrev = pNode;
+        }
+        else
+        {
+            pNode->mNext = mHead.mNext;
+            pNode->mPrev = &mHead;
+
+            pNode->mNext->mPrev = pNode;
+            mHead.mNext = pNode;
+        }
+    }
+
+    void PopFront()
+    {
+        iterator begin = Begin();
+        Erase(begin);
+    }
+
+    void PopBack()
+    {
+        Erase(--(End()));
+    }
+
+public:
+    class IntrusiveListIterator
+    {
+    public:
+        explicit IntrusiveListIterator(NodeT* ptr=0):mPtr(ptr){}
+
+        // pre-increment
+        IntrusiveListIterator& operator++()
+        {
+            mPtr = mPtr->mNext;return (*this);
+        }
+        // post-increment
+        const IntrusiveListIterator operator++(int)
+        {
+            IntrusiveListIterator temp = *this;
+            ++*this;
+            return (temp);
+        }
+        // pre-decrement
+        IntrusiveListIterator& operator--()
+        {
+            mPtr = mPtr->mPrev;return *this;
+        }
+        // post-decrement
+        const IntrusiveListIterator operator--(int)
+        {
+            IntrusiveListIterator temp = *this;
+            --*this;
+            return (temp);
+        }
+        IntrusiveListIterator& operator=(const IntrusiveListIterator &other){mPtr = other.mPtr; return *this;}
+
+        reference operator*() const { return *(mPtr->mData); }
+        pointer operator->() const { return (&**this); }
+        bool operator==(const IntrusiveListIterator& other)const{ return mPtr==other.mPtr; } 
+        bool operator!=(const IntrusiveListIterator& other)const{ return !(*this == other); } 
+
+        inline NodeT* Get()const { return mPtr; }
+
+    private:
+        NodeT* mPtr;
+    };
+
+    class  IntrusiveListConstIterator
+    {
+    public:
+        explicit IntrusiveListConstIterator(const NodeT* ptr=0):mPtr(ptr){}
+
+       // pre-increment
+        IntrusiveListConstIterator& operator++()
+        {
+            mPtr = mPtr->mNext;return (*this);
+        }
+        // post-increment
+        const IntrusiveListConstIterator operator++(int)
+        {
+            IntrusiveListConstIterator temp = *this;
+            ++*this;
+            return (temp);
+        }
+        // pre-decrement
+        IntrusiveListConstIterator& operator--()
+        {
+            mPtr = mPtr->mPrev;return *this;
+        }
+        // post-decrement
+        const IntrusiveListConstIterator operator--(int)
+        {
+            IntrusiveListConstIterator temp = *this;
+            --*this;
+            return (temp);
+        }
+        IntrusiveListConstIterator& operator=(const IntrusiveListConstIterator &other){mPtr = other.mPtr; return *this;}
+
+        const_reference operator*() const { return *(mPtr->mData); }
+        const_pointer operator->() const { return (&**this); }
+        bool operator==(const IntrusiveListConstIterator& other)const{ return mPtr==other.mPtr; } 
+        bool operator!=(const IntrusiveListConstIterator& other)const{ return !(*this == other); } 
+
+        inline const NodeT* Get()const { return mPtr; }
+
+    private:
+        mutable const NodeT* mPtr;
+    };
+
+    // --- Iterator definitions ---
+    typedef IntrusiveListIterator iterator;
+    typedef IntrusiveListConstIterator const_iterator;
+
+    // iterator support
+    inline iterator Begin() { return iterator(mHead.mNext); }
+    inline const_iterator Begin() const { return const_iterator(mHead.mNext); }
+    inline iterator End() { return iterator(&mHead); }
+    inline const_iterator End() const { return const_iterator(&mHead); }
+
+    // Because there is no real use, for the reverse iterators, 
+    // they have not been implemented. 
+
+    reference Front(){return (*Begin());}
+    const_reference Front() const { return (*Begin()); }
+    reference Back(){ return (*(--End())); }
+    const_reference Back() const{ return (*(--End())); }
+
+    iterator& Erase(iterator& it)
+    {
+        it.Get()->Disconnect();
+        return (++it);
+    }
+private:
+    NodeT mHead;
+
+    // Not copyable
+    FbxIntrusiveList(const FbxIntrusiveList&);
+    FbxIntrusiveList& operator=(const FbxIntrusiveList& Right){return (*this);}
+};
+
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_INTRUSIVE_LIST_H_ */

+ 408 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxmap.h

@@ -0,0 +1,408 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxmap.h
+#ifndef _FBXSDK_CORE_BASE_MAP_H_
+#define _FBXSDK_CORE_BASE_MAP_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxstring.h>
+#include <fbxsdk/core/base/fbxredblacktree.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+class FbxObject;
+
+/** Default compare functor for FbxMap and FbxSet, which assumes operator < is defined.
+Here is examples of different compare class implementations:
+With Key = int
+\code
+class IntCompare
+{
+    inline int operator()(int pKeyA, int pKeyB) const
+    {
+        return pKeyA < pKeyB ? -1 : (pKeyA > pKeyB ? 1 : 0);
+    }
+};
+\endcode
+With Key = Class
+\code
+class ClassCompare
+{
+	inline int operator()(const Class& pKeyA, const Class& pKeyB) const
+	{
+		return pKeyA < pKeyB ? -1 : (pKeyA > pKeyB ? 1 : 0);
+	}
+};
+\endcode
+With Key = char*
+\code
+class StrCompare
+{
+	inline int operator()(const char* pKeyA, const char* pKeyB) const
+	{
+		return strcmp(pKeyA, pKeyB);
+	}
+};
+\endcode
+*/
+template <typename Type> struct FbxLessCompare
+{
+    inline int operator()(const Type& pLeft, const Type& pRight) const
+    {
+        return (pLeft < pRight) ? -1 : ((pRight < pLeft) ? 1 : 0);
+    }
+};
+
+/** This class implements an efficient map based on key comparison, which stores key-value pairs.
+It executes insertion, deletion and query operations in O(log(n)) time. */
+template <typename Key, typename Type, typename Compare=FbxLessCompare<Key>, typename Allocator=FbxBaseAllocator> class FbxMap
+{
+protected:
+	//! This class defines the key-value pairs used by the map.
+	class KeyValuePair : private FbxPair<const Key, Type>
+	{
+	/*****************************************************************************************************************************
+	** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+	*****************************************************************************************************************************/
+	#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	public:
+		typedef const Key	KeyType;
+		typedef const Key	ConstKeyType;
+		typedef Type		ValueType;
+		typedef const Type	ConstValueType;
+
+		KeyValuePair(const Key& pFirst, const Type& pSecond) : FbxPair<const Key, Type>(pFirst, pSecond){}
+		ConstKeyType& GetKey() const { return this->mFirst; }
+		KeyType& GetKey(){ return this->mFirst; }
+		ConstValueType& GetValue() const { return this->mSecond; }
+		ValueType& GetValue(){ return this->mSecond; }
+	#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+	};
+
+	//! Declaration of the storage type used by the map.
+	typedef FbxRedBlackTree<KeyValuePair, Compare, Allocator> StorageType;
+
+public:
+	typedef Type									ValueType;
+	typedef Key										KeyType;
+	typedef typename StorageType::RecordType		RecordType;
+	typedef typename StorageType::IteratorType		Iterator;
+	typedef typename StorageType::ConstIteratorType	ConstIterator;
+
+	/** Preallocate memory.
+	* \param pRecordCount The number of elements. */
+	inline void Reserve(unsigned int pRecordCount)
+	{
+		mTree.Reserve(pRecordCount);
+	}
+
+	//! Retrieve the number of key-value pairs it holds.
+	inline int GetSize() const
+	{
+		return mTree.GetSize();
+	}
+
+	/** Insert a key-value pair.
+	* \param pKey The key.
+	* \param pValue The value.
+	* \return If the key is already present in the map, returns the existing pair and false; else returns the pointer to the new key-value and true. */
+	inline FbxPair<RecordType*, bool> Insert(const KeyType& pKey, const ValueType& pValue)
+	{
+		return mTree.Insert(KeyValuePair(pKey, pValue));
+	}
+
+	/** Delete a key-value pair.
+	* \param pKey The key.
+	* \return \c true if success, \c false if key is not found. */
+	inline bool Remove(const KeyType& pKey)
+	{
+		return mTree.Remove(pKey);
+	}
+
+	//! Clear the map.
+	inline void Clear()
+	{
+		mTree.Clear();
+	}
+
+	//! Query whether the map is empty.
+	inline bool Empty() const
+	{
+		return mTree.Empty();
+	}
+
+	//! Retrieve the begin iterator of the map.
+	Iterator Begin()
+	{
+		return Iterator(Minimum());
+	}
+
+	//! Retrieve the end iterator of the map.
+	Iterator End()
+	{
+		return Iterator();
+	}
+
+	//! Retrieve the begin iterator of the map.
+	ConstIterator Begin() const
+	{
+		return ConstIterator(Minimum());
+	}
+
+	//! Retrieve the end iterator of the map.
+	ConstIterator End() const
+	{
+		return ConstIterator();
+	}
+
+	/** Query a key.
+	* \param pKey The key.
+	* \return A key-value pair if success, NULL if the key is not found. */
+	inline const RecordType* Find(const KeyType& pKey) const
+	{
+		return mTree.Find(pKey);
+	}
+
+	/** Query a key.
+	* \param pKey The key.
+	* \return A key-value pair if success, NULL if it's not found. */
+	inline RecordType* Find(const KeyType& pKey)
+	{
+		return mTree.Find(pKey);
+	}
+
+	/** Find the key-value pair with the smallest key greater than a specified key.
+	* \param pKey The key.
+	* \return The found key-value pair. */
+	inline const RecordType* UpperBound(const KeyType& pKey) const
+	{
+		return mTree.UpperBound(pKey);
+	}
+
+	/** Find the key-value pair with the smallest key greater than a specified key.
+	* \param pKey The key.
+	* \return The found key-value pair. */
+	inline RecordType* UpperBound(const KeyType& pKey)
+	{
+		return mTree.UpperBound(pKey);
+	}
+
+	/** Retrieve the reference of the value in the key-value pairs in map.
+	* \param pKey The key.
+	* \return The reference of the value.
+	* \remark If the key is not found, a new key-value pair will be inserted. */
+	inline ValueType& operator[](const KeyType& pKey)
+	{
+		RecordType* lRecord = Find(pKey);
+
+		if( !lRecord )
+		{
+			lRecord = Insert(pKey, ValueType()).mFirst;
+		}
+
+		return lRecord->GetValue();
+	}
+
+	//! Retrieve the key-value pair which is the minimum key in map.
+	inline const RecordType* Minimum() const
+	{
+		return mTree.Minimum();
+	}
+
+	//! Retrieve the key-value pair which is the minimum key in map.
+	inline RecordType* Minimum()
+	{
+		return mTree.Minimum();
+	}
+
+	//! Retrieve the key-value pair which is the maximum key in map.
+	inline const RecordType* Maximum() const
+	{
+		return mTree.Maximum();
+	}
+
+	//! Retrieve the key-value pair which is the maximum key in map.
+	inline RecordType* Maximum()
+	{
+		return mTree.Maximum();
+	}
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	inline FbxMap(){}
+	inline FbxMap(const FbxMap& pMap) : mTree(pMap.mTree){}
+	inline ~FbxMap(){ Clear(); }
+
+private:
+	StorageType mTree;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+/** A simple map class representing a dictionary-like data structure.
+* \nosubgrouping */
+template <class Key, class Type, class Compare> class FBXSDK_DLL FbxSimpleMap
+{
+public:
+    typedef typename FbxMap<Key, Type, Compare>::RecordType* Iterator;
+
+	/** Add a key-value pair as an element.
+	* \param pKey The new key.
+	* \param pValue The new value. */
+	inline void Add(const Key& pKey, const Type& pValue)
+	{
+		mMap.Insert(pKey, pValue);
+	}
+
+	/** Find an element with a given key.
+	* \param pKey The given key.
+	* \return The iterator pointing to the found element or NULL if fails. */
+	inline Iterator Find(const Key& pKey) const
+	{
+		return (Iterator)mMap.Find(pKey);
+	}
+
+	/** Find an element with a given value.
+	* \param pValue The given value.
+	* \return The iterator pointing to the found element or NULL if fails. */
+	inline Iterator Find(const Type& pValue) const
+	{
+		Iterator lIterator = GetFirst();
+		while( lIterator )
+		{
+			if( lIterator->GetValue() == pValue )
+			{
+				return lIterator;
+			}
+			lIterator = GetNext(lIterator);
+		}
+		return 0;
+	}
+
+	/** Remove an element from the map.
+	* \param pIterator The given element. */
+	inline void Remove(Iterator pIterator)
+	{
+		if( pIterator ) mMap.Remove(pIterator->GetKey());
+	}
+
+	/** Get the first element.
+	* \return The the heading element. */
+	inline Iterator GetFirst() const
+	{
+		return (Iterator)mMap.Minimum();
+	}
+
+	/** Get the next element of a given element.
+	* \param pIterator The given element.
+	* \return The next element. */
+	inline Iterator GetNext(Iterator pIterator) const
+	{
+		return (Iterator)pIterator ? pIterator->Successor() : 0;
+	}
+
+	//! Remove all of the elements.
+	inline void Clear() 
+	{
+		mMap.Clear();
+	}
+
+	/** Reserve the space for given number elements.
+	* \param pSize The given number. */
+	inline void Reserve(int pSize)
+	{
+		mMap.Reserve(pSize);
+	}
+
+	/** Query the count of elements in the map.
+	* \return The count of elements. */
+	inline int GetCount() const
+	{
+		return mMap.GetSize();
+	}
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	inline FbxSimpleMap(){}
+
+private:
+    FbxMap<Key, Type, Compare> mMap;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+/** This class template declare a simple FbxObject map.
+* \nosubgrouping */
+template <class Type, class Compare> class FBXSDK_DLL FbxObjectMap : public FbxSimpleMap<Type, FbxObject*, Compare>
+{
+public:
+    //! Constructor
+    inline FbxObjectMap(){}
+
+    /** Get the object contained in an element.
+      * \param pIterator The given element.
+      * \return The object.
+      */
+    inline FbxObject* Get(typename FbxSimpleMap<Type, FbxObject*, Compare>::Iterator pIterator)
+    {
+        return pIterator ? pIterator->GetValue() : 0;
+    }
+};
+
+/** A class that maps strings to objects with a basic string comparator.
+* \nosubgrouping */
+class FBXSDK_DLL FbxObjectStringMap : public FbxObjectMap<FbxString, FbxStringCompare>
+{
+public:
+    //! Constructor
+    inline FbxObjectStringMap(){}
+};
+
+//! Call FbxFree on each element of the map, and then clear it.
+template <typename K, typename V, typename C, typename A> inline void FbxMapFree(FbxMap<K, V, C, A>& pMap)
+{
+	for( typename FbxMap<K, V, C, A>::Iterator i = pMap.Begin(); i != pMap.End(); ++i )
+	{
+		FbxFree(i->GetValue());
+	}
+	pMap.Clear();
+}
+
+//! Call FbxDelete on each element of the map, and then clear it.
+template <typename K, typename V, typename C, typename A> inline void FbxMapDelete(FbxMap<K, V, C, A>& pMap)
+{
+	for( typename FbxMap<K, V, C, A>::Iterator i = pMap.Begin(); i != pMap.End(); ++i )
+	{
+		FbxDelete(i->GetValue());
+	}
+	pMap.Clear();
+}
+
+//! Call Destroy on each element of the map, and then clear it.
+template <typename K, typename V, typename C, typename A> inline void FbxMapDestroy(FbxMap<K, V, C, A>& pMap)
+{
+	for( typename FbxMap<K, V, C, A>::Iterator i = pMap.Begin(); i != pMap.End(); ++i )
+	{
+		i->GetValue()->Destroy();
+	}
+	pMap.Clear();
+}
+
+template class FbxSimpleMap<FbxString, FbxObject*, FbxStringCompare>;
+template class FbxObjectMap<FbxString, FbxStringCompare>;
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_MAP_H_ */

+ 67 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxmemorypool.h

@@ -0,0 +1,67 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxmemorypool.h
+#ifndef _FBXSDK_CORE_BASE_MEMORY_H_
+#define _FBXSDK_CORE_BASE_MEMORY_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/sync/fbxatomic.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** \brief Class to create a simple fixed-size-blocks memory pool to allocate memory dynamically. */
+class FBXSDK_DLL FbxMemoryPool
+{
+public:
+	/** Memory pool constructor.
+	* \param pBlockSize		The size of one memory block.
+	* \param pBlockCount	The count of block that should be pre-allocated.
+	* \param pResizable		Whether memory pool can grow if no block are availalbe upon calling Allocate.
+	* \param pConcurrent	Whether the pool supports concurrent allocation and release operations.
+	* \remark				All memory blocks must be released before the memory pool is destroyed, otherwise a memory leak will occur. */
+	FbxMemoryPool(size_t pBlockSize, FbxInt64 pBlockCount=0, bool pResizable=true, bool pConcurrent=true);
+
+	/** Memory pool destructor. Upon destruction, all memory blocks of the pool will be de-allocated. */
+	~FbxMemoryPool();
+
+	/** Free memory of all memory blocks from this memory pool, also effectively resetting the block count to zero.
+	* \remark The block size and alignment/resize/concurrent support will remain unchanged. */
+	void Reset();
+
+	/** Allocate or lock a memory block for usage.
+	* \return An memory block pointer that can be NULL if the memory pool cannot grow in size and no blocks are available. */
+	void* Allocate();
+
+	/** Dispose or unlock a memory block.
+	* \param pMemBlock A pointer to the memory block to release. This will not free the block's memory, instead simply putting it back in the available stack. */
+	void Release(void* pMemBlock);
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+private:
+    void*		Pop();
+
+	FbxInt64	mMaxBlockCount;
+    FbxAtomic	mFreeBlockCount;
+    void*		mFreeBlocksStack;
+    size_t		mBlockSize;
+    bool		mResizable;
+    bool		mSupportConcurrentAccess;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_MEMORY_H_ */

+ 115 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxmultimap.h

@@ -0,0 +1,115 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxmultimap.h
+#ifndef _FBXSDK_CORE_BASE_MULTIMAP_H_
+#define _FBXSDK_CORE_BASE_MULTIMAP_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** Class to manipulate a map that can contain multiple times the same key.
+* \nosubgrouping */
+class FBXSDK_DLL FbxMultiMap
+{
+public:
+	struct Pair
+	{
+		FbxHandle mKey;
+		FbxHandle mItem;
+	};
+
+	/** If can't find the matching item,append a item at the end of the array.
+	* If find the matching item ,insert the new item before the matching item. 
+    * \param pKey The value of Key in new item, also is the character for matching.
+	* \param pItem The value of Item in new item.
+	* \return If add successfully return true,otherwise return false.
+    */
+    bool Add(FbxHandle pKey, FbxHandle pItem);
+	
+	/** Remove the first matching item, whose reference is the same as given.
+	* \param pKey The given reference.
+	* \return If remove successfully return true,otherwise return false.
+	*/
+    bool Remove(FbxHandle pKey);
+	
+	/** Remove all the matching item, whose item is the same as given.
+	* \param pItem The given item.
+	* \return If remove successfully return true,otherwise return false.
+	*/
+    bool RemoveItem(FbxHandle pItem);
+
+    /** Set first matching item with the given parameter.
+    * \param pKey The character for matching.
+	* \param pItem  The value of Item that the matching item will be set.
+	* \return If set successfully return true,otherwise return false.
+    */
+    bool SetItem(FbxHandle pKey, FbxHandle pItem);
+
+    /** Get first matching item with the given parameter.
+    * \param pKey The character for matching.
+	* \param pIndex The pointer to the index of the matching item.
+	* \return The value of Item in the matching item.
+    * \remarks If there are multiple elements that match the character, the index returned is unspecified.
+    */
+    FbxHandle Get(FbxHandle pKey, int* pIndex=NULL);
+
+	//! Delete the array.
+    void Clear();
+
+	/** Get the item of the given index.
+    * \param pIndex The index for matching.
+	* \param pKey The pointer to the Key of the matching item.
+	* \return The value of Item in the matching item.
+    */
+    FbxHandle GetFromIndex(int pIndex, FbxHandle* pKey=NULL);
+
+	/** Remove the item of the given index
+	* \param pIndex The given index.
+	* \return If remove successfully return true,otherwise return false.
+	*/
+    bool RemoveFromIndex(int pIndex);
+
+	/** Get number of items in the array.
+	* \return The number of items in the array. */
+    int GetCount() const { return mSetCount; }
+
+	/** Swap the value of Key and Item in every item of array, and sort the new array with the value of Key. */
+    void Swap();
+
+	/** Sort the array according the value of Key in each item. */
+    void Sort();
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	FbxMultiMap(int pItemPerBlock=20);
+	FbxMultiMap(const FbxMultiMap& pOther);
+	~FbxMultiMap();
+
+    FbxMultiMap& operator=(const FbxMultiMap&);
+
+private:
+    Pair*	FindEqual(FbxHandle pKey) const;
+
+    Pair*	mSetArray;
+    int		mSetCount;
+    int		mBlockCount;
+    int		mItemPerBlock;
+    bool	mIsChanged;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_MULTIMAP_H_ */

+ 62 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxpair.h

@@ -0,0 +1,62 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxpair.h
+#ifndef _FBXSDK_CORE_BASE_PAIR_H_
+#define _FBXSDK_CORE_BASE_PAIR_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** This class template holds a pair of objects.
+* \nosubgrouping */
+template <typename First, typename Second> class FbxPair
+{
+public:
+	//! Constructor.
+	inline FbxPair() : mFirst(), mSecond() {}
+
+	/** Constructor.
+	* \param pFirst The first object.
+	* \param pSecond The second object. */
+	inline FbxPair(const First& pFirst, const Second& pSecond) : mFirst(pFirst), mSecond(pSecond) {}
+
+	/** Assignment operator.
+	* \param pOther The pair to be copied. */
+	inline FbxPair<First, Second>& operator=(const FbxPair<First, Second>& pOther)
+	{
+		mFirst = pOther.mFirst;
+		mSecond = pOther.mSecond;
+		return *this;
+	}
+
+	/** Comparison operator.
+	* \param pOther The pair to be compared. */
+	inline bool operator==(const FbxPair<First, Second>& pOther)
+	{
+		return mFirst == pOther.mFirst && mSecond == pOther.mSecond;
+	}
+
+	/** Inverse comparison operator.
+	* \param pOther The pair to be compared. */
+	inline bool operator!=(const FbxPair<First, Second>& pOther)
+	{
+		return !operator==(pOther);
+	}
+
+	First mFirst;	//!< The first object in the pair.
+	Second mSecond;	//!< The second object in the pair.
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_PAIR_H_ */

File diff suppressed because it is too large
+ 1398 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxredblacktree.h


+ 227 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxset.h

@@ -0,0 +1,227 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxset.h
+#ifndef _FBXSDK_CORE_BASE_SET_H_
+#define _FBXSDK_CORE_BASE_SET_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxredblacktree.h>
+#include <fbxsdk/core/base/fbxmap.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** This class implements an efficient set based on value comparison, which stores values.
+* It executes insertion, deletion and query operations in O(log(n)) time. */
+template <typename Type, typename Compare=FbxLessCompare<Type>, typename Allocator=FbxBaseAllocator> class FbxSet
+{
+protected:
+	//! This class defines the value type used by the set.
+	class Value
+	{
+	/*****************************************************************************************************************************
+	** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+	*****************************************************************************************************************************/
+	#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	public:
+		typedef const Type KeyType;
+		typedef const Type ConstKeyType;
+		typedef const Type ValueType;
+		typedef const Type ConstValueType;
+
+		inline Value(const Type& pValue) : mValue(pValue){}
+		inline KeyType& GetKey() const { return mValue; }
+		inline ConstKeyType& GetKey(){ return mValue; }
+		inline ValueType& GetValue() const { return mValue; }
+		inline ConstValueType& GetValue(){ return mValue; }
+
+	protected:
+		ValueType mValue;
+
+	private:
+		Value& operator=(const Value&);
+	#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+	};
+
+	//! Declaration of the storage type used by the set.
+	typedef FbxRedBlackTree<Value, Compare, Allocator> StorageType;
+
+public:
+	typedef Type ValueType;
+	typedef typename StorageType::RecordType        RecordType;
+	typedef typename StorageType::IteratorType      Iterator;
+	typedef typename StorageType::ConstIteratorType ConstIterator;
+
+	/** Preallocate memory.
+	* \param pRecordCount The number of elements.
+	*/
+	inline void Reserve(unsigned int pRecordCount)
+	{
+		mTree.Reserve(pRecordCount);
+	}
+
+	//! Retrieve the number of values it holds.
+	inline int GetSize() const
+	{
+		return mTree.GetSize();
+	}
+
+	/** Insert a value.
+	* \param pValue The value.
+	* \return If the value is already present in the map, returns the existing value and false; else returns the pointer to the new value and true. */
+	inline FbxPair<RecordType*, bool> Insert(const ValueType& pValue)
+	{
+		return mTree.Insert(Value(pValue));
+	}
+
+	/** Delete a value.
+	* \param pValue The value.
+	* \return \c true if success, \c false if value is not found. */
+	inline int Remove(const ValueType& pValue)
+	{
+		return mTree.Remove(pValue);
+	}
+
+	//! Clear the set.
+	inline void Clear()
+	{
+		mTree.Clear();
+	}
+
+	//! Query whether the set is empty.
+	inline bool Empty() const
+	{
+		return mTree.Empty();
+	}
+
+	//! Retrieve the begin iterator of the set.
+	Iterator Begin()
+	{
+		return Iterator(Minimum());
+	}
+
+	//! Retrieve the end iterator of the set.
+	Iterator End()
+	{
+		return Iterator();
+	}
+
+	//! Retrieve the begin iterator of the set.
+	ConstIterator Begin() const
+	{
+		return ConstIterator(Minimum());
+	}
+
+	//! Retrieve the end iterator of the set.
+	ConstIterator End() const
+	{
+		return ConstIterator();
+	}
+
+	/** Find a given value in the set.
+	* \param pValue The value to find.
+	* \return The value in the set, or NULL if the value is not found in the set. */
+	inline const RecordType* Find(const ValueType& pValue) const
+	{
+		return mTree.Find(pValue);
+	}
+
+	/** Find a given value in the set.
+	* \param pValue The value to find.
+	* \return The value in the set, or NULL if the value is not found in the set. */
+	inline RecordType* Find(const ValueType& pValue)
+	{
+		return mTree.Find(pValue);
+	}
+
+	//! Retrieve the minimum value in the set.
+	inline const RecordType* Minimum() const
+	{
+		return mTree.Minimum();
+	}
+
+	//! Retrieve the minimum value in the set.
+	inline RecordType* Minimum()
+	{
+		return mTree.Minimum();
+	}
+
+	//! Retrieve the maximum value in the set.
+	inline const RecordType* Maximum() const
+	{
+		return mTree.Maximum();
+	}
+
+	//! Retrieve the maximum value in the set.
+	inline RecordType* Maximum()
+	{
+		return mTree.Maximum();
+	}
+
+	//! Equality operator.
+	inline bool operator==(const FbxSet<Type, Compare, Allocator>& pOther) const
+	{
+		return (this == &pOther) || (mTree == pOther.mTree);
+	}
+
+	//! Inequality operator.
+	inline bool operator != (const FbxSet<Type, Compare, Allocator>& pOther) const
+	{
+		return !(*this == pOther);
+	}
+
+	/** Intersect with another set.
+	* \param pOther The other set.
+	* \return The intersection set of the two sets. */
+	inline FbxSet Intersect(const FbxSet& pOther) const
+	{
+		FbxSet lReturn;
+		ConstIterator lBegin = Begin();
+		for (; lBegin != End(); ++lBegin)
+		{
+			if (pOther.Find(lBegin->GetValue()) != NULL)
+				lReturn.Insert(lBegin->GetValue());
+		}
+		return lReturn;
+	}
+
+	/** Unite with another set.
+	* \param pOther The other set.
+	* \return The union set of the two sets (no duplicated items). */
+	inline FbxSet Union(const FbxSet& pOther) const
+	{
+		FbxSet lReturn(*this);
+		ConstIterator lBegin = pOther.Begin();
+		for (; lBegin != End(); ++lBegin)
+		{
+			if (Find(lBegin->GetValue()) == NULL)
+				lReturn.Insert(lBegin->GetValue());
+		}
+		return lReturn;
+	}
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+    inline FbxSet(){}
+    inline FbxSet(const FbxSet& pSet) : mTree(pSet.mTree){}
+    inline ~FbxSet(){ Clear(); }
+
+private:
+    StorageType mTree;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_SET_H_ */

+ 119 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxstatus.h

@@ -0,0 +1,119 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxstatus.h
+#ifndef _FBXSDK_CORE_BASE_STATUS_H_
+#define _FBXSDK_CORE_BASE_STATUS_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxstring.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** This class facilitates the testing/reporting of errors.  It encapsulates the
+  * status code and the internal FBXSDK error code as returned by the API functions.
+  * \nosubgrouping
+  */
+class FBXSDK_DLL FbxStatus
+{
+public:
+
+
+    //! Available status codes.
+    enum EStatusCode {        
+        eSuccess = 0,                           //!< Operation was successful
+        eFailure,                               //!< Operation failed
+        eInsufficientMemory,                    //!< Operation failed due to insufficient memory
+        eInvalidParameter,                      //!< An invalid parameter was provided
+        eIndexOutOfRange,                       //!< Index value outside the valid range
+        ePasswordError,                         //!< Operation on FBX file password failed
+        eInvalidFileVersion,                    //!< File version not supported (anymore or yet)
+        eInvalidFile                            //!< Operation on the file access failed
+    };
+
+    //! Default constructor.
+    FbxStatus();
+
+    FbxStatus(EStatusCode pCode);
+    FbxStatus(const FbxStatus& rhs);
+
+    FbxStatus&      operator=(const FbxStatus& rhs);
+
+    /** Equivalence operator.
+      * \param rhs Status object to compare.
+      * \return \c True if all the members of \e rhs are equal to this instance members and \c False otherwise.
+      */
+    bool            operator==(const FbxStatus& rhs)    const   { return (mCode == rhs.mCode); }
+    /** Equivalence operator.
+      * \param pCode Status code to compare.
+      * \return \c True if the code member of this instance equals \e pCode and \c False otherwise.
+      */
+    bool            operator==(const EStatusCode pCode) const   { return (mCode == pCode); }
+    /** Non-Equivalence operator.
+      * \param rhs Status object to compare.
+      * \return \c True if at least one member of \e rhs is not equal to this instance member and \c True otherwise.
+      */
+    bool            operator!=(const FbxStatus& rhs)    const   { return (mCode != rhs.mCode); }
+    /** Non-Equivalence operator.
+      * \param rhs Status code to compare.
+      * \return \c True if the code member of this instance equals \e rhs and \c False otherwise.
+      */
+    bool            operator!=(const EStatusCode rhs)   const   { return (mCode != rhs); }
+
+    /** The conversion operator that converts a FbxStatus object to bool.
+      *	The result it returns will be \c True if the FbxStatus does not contain
+      * an error, and \c False if it does.
+      */
+    operator        bool() const    { return mCode==eSuccess; }
+
+    /** Determines whether there is an error.
+      * \return \c True if an error occured and \c False if the operation was sucessful.
+      */
+    bool            Error() const   { return !this->operator bool(); }
+
+    //! Clear error code and message from the instance. After this call, it will behave as if it contained eSuccess.
+    void            Clear();
+
+    //! Retrieve the type of error that occurred, as specified in the enumeration.
+    EStatusCode     GetCode() const { return mCode; }
+
+    /** Change the current code of the instance.
+      * \param rhs New code value.
+      */
+    void            SetCode(const EStatusCode rhs);
+
+    /** Change the current code of the instance.
+      * \param rhs New code value.
+      * \param pErrorMsg Optional error description string. This string can have formatting characters
+      *                  The function will use the vsnprintf function to assemble the final string
+      *                  using an internal buffer of 4096 characters.
+      */
+    void            SetCode(const EStatusCode rhs, const char* pErrorMsg, ...);
+
+    //! Get the error message string corresponding to the current code.
+    const char*     GetErrorString() const;
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+private:
+    EStatusCode     mCode;
+    FbxString       mErrorString;
+
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_STATUS_H_ */

+ 505 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxstring.h

@@ -0,0 +1,505 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxstring.h
+#ifndef _FBXSDK_CORE_BASE_STRING_H_
+#define _FBXSDK_CORE_BASE_STRING_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** Convert string from UTF8 to wide-char
+* \param pInUTF8 Input string
+* \param pOutWideChar output string
+* \param pOutWideCharSize size of the allocated output string buffer
+* \remark Output buffer should be release by caller */
+FBXSDK_DLL void FbxUTF8ToWC(const char* pInUTF8, wchar_t*& pOutWideChar, size_t* pOutWideCharSize=NULL);
+
+/** Convert string from wide-char to UTF8
+* \param pInWideChar input string
+* \param pOutUTF8 output string
+* \param pOutUTF8Size size of the allocated output string buffer
+* \remark Output buffer should be release by caller */
+FBXSDK_DLL void FbxWCToUTF8(const wchar_t* pInWideChar, char*& pOutUTF8, size_t* pOutUTF8Size=NULL);
+
+#if defined(FBXSDK_ENV_WIN)
+	/** Convert string from wide-char to ANSI
+	* \param pInWideChar input string
+	* \param pOutANSI output string
+	* \param pOutANSISize size of the allocated output string buffer
+	* \remark Output buffer should be release by caller */
+	FBXSDK_DLL void FbxWCToAnsi(const wchar_t* pInWideChar, char*& pOutANSI, size_t* pOutANSISize=NULL);
+
+	/** Convert string from ANSI to wide-char
+	* \param pInANSI input string
+	* \param pOutWideChar output string
+	* \param pOutWideCharSize size of the allocated output string buffer
+	* \remark Output buffer should be release by caller */
+	FBXSDK_DLL void FbxAnsiToWC(const char* pInANSI, wchar_t*& pOutWideChar, size_t* pOutWideCharSize=NULL);
+
+	/** Convert string from ANSI to UTF8
+	* \param pInANSI input string
+	* \param outUTF8 output string
+	* \param pOutUTF8Size size of the allocated output string buffer
+	* \remark Output buffer should be release by caller */
+	FBXSDK_DLL void FbxAnsiToUTF8(const char* pInANSI, char*& pOutUTF8, size_t* pOutUTF8Size=NULL);
+
+	/** Convert string from UTF8 to ANSI
+	* \param pInUTF8 input string
+	* \param pOutANSI output string
+	* \param pOutANSISize size of the allocated output string buffer
+	* \remark Output buffer should be release by caller */
+	FBXSDK_DLL void FbxUTF8ToAnsi(const char* pInUTF8, char*& pOutANSI, size_t* pOutANSISize=NULL);
+#endif
+
+/** Utility class to manipulate strings.
+* \nosubgrouping */
+class FBXSDK_DLL FbxString
+{
+public:
+	/**
+	* \name Constructors and Destructor
+	*/
+	//@{
+		//! Default constructor.
+		FbxString();
+
+		/** Copy constructor.
+		* \param pString The FbxString to be copied. */
+		FbxString(const FbxString& pString);
+
+		/** String constructor.
+		* \param pString The string used to construct FbxString. */
+		FbxString(const char* pString);
+
+		/** Character constructor.
+		* \param pChar The character used to construct FbxString.
+		* \param pNbRepeat The number of times to repeat the character. Default value is 1 */
+		FbxString(char pChar, size_t pNbRepeat=1);
+
+		/** String constructor with maximum length.
+		* \param pCharPtr The string used to construct FbxString. 
+		* \param pLength  Maximum length. */
+		FbxString(const char* pCharPtr, size_t pLength);
+
+		/** Integer constructor.
+		* \param pValue The int value used to construct FbxString. */
+		FbxString(const int pValue);
+
+		/** Float constructor.
+		* \param pValue The float value used to construct FbxString. */
+		FbxString(const float pValue);
+
+		/** Double constructor.
+		* \param pValue The double value used to construct FbxString. */
+		FbxString(const double pValue);
+
+		//! Destructor.
+		~FbxString();
+	//@}
+
+	/**
+	* \name Buffer Access and Validation
+	*/
+	//@{
+		//! Get string length like "C" strlen().
+		size_t GetLen() const;
+
+		//! Get string length like "C" strlen().
+		size_t Size() const;
+
+		//! Return \c true if string length equal zero.
+		bool IsEmpty() const;
+
+		//! Discard the content of the string.
+		FbxString& Clear();
+
+		/** Access by reference.
+		* \param pIndex   The index.
+		* \return The reference of the char at pIndex. */
+		char& operator[](int pIndex);
+
+		/** Access by copy.
+		* \param pIndex   The index.
+		* \return The char at pIndex. */
+		char operator[](int pIndex) const;
+
+		//! Non-const buffer access.
+		char* Buffer();
+
+		//! Const buffer access.
+		const char* Buffer()const;
+	//@}
+
+	/**
+	* \name String Operations
+	*/
+	//@{
+		/** FbxString assignment operator.
+		* \param pString The FbxString to be assigned. */
+		const FbxString& operator=(const FbxString& pString);
+
+		/** Character assignment operator.
+		* \param pChar The character to be assigned. */
+		const FbxString& operator=(char pChar);
+
+		/** String assignment operator.
+		* \param pString The string to be assigned. */
+		const FbxString& operator=(const char* pString);
+
+		/** Int assignment operator.
+		* \param pValue The int value to be assigned. */
+		const FbxString& operator=(int pValue);
+
+		/** Float assignment operator.
+		* \param pValue The float value to be assigned. */
+		const FbxString& operator=(float pValue);
+
+		/** Double assignment operator.
+		* \param pValue The double value to be assigned. */
+		const FbxString& operator=(double pValue);
+
+		/** FbxString append.
+		* \param pString The FbxString to be appended. */
+		const FbxString& operator+=(const FbxString& pString);
+
+		/** Character append.
+		* \param pChar  The character to be appended. */
+		const FbxString& operator+=(char pChar);
+
+		/** String append.
+		* \param pString The string to be appended. */
+		const FbxString& operator+=(const char* pString);
+
+		/** Integer append.
+		* \param pValue The int value to be appended. */
+		const FbxString& operator+=(int pValue);
+
+		/** Float append.
+		* \param pValue The float value to be appended. */
+		const FbxString& operator+=(float pValue);
+
+		/** Double append.
+		* \param pValue The double value to be appended. */
+		const FbxString& operator+=(double pValue);
+
+		/** Equality operator.
+		* \param pString The FbxString to be compared. */
+		bool operator== (const FbxString& pString) const;
+
+		/** Inequality operator.
+		* \param pString The FbxString to be compared. */
+		bool operator!= (const FbxString& pString) const;
+
+		/** Inferior to operator.
+		* \param pString The FbxString to be compared. */
+		bool operator< (const FbxString& pString) const;
+
+		/** Inferior or equal to operator.
+		* \param pString The FbxString to be compared. */
+		bool operator<= (const FbxString& pString) const;
+
+		/** Superior or equal to operator.
+		* \param pString The FbxString to be compared. */
+		bool operator>= (const FbxString& pString) const;
+
+		/** Superior to operator.
+		* \param pString The FbxString to be compared. */
+		bool operator> (const FbxString& pString) const;
+
+		/** Equality operator.
+		* \param pString The string to be compared. */
+		bool operator== (const char* pString) const;
+
+		/** Inequality operator.
+		* \param pString The string to be compared. */
+		bool operator!= (const char* pString) const;
+
+		/** Inferior to operator.
+		* \param pString The string to be compared. */
+		bool operator< (const char* pString) const;
+
+		/** Inferior or equal to operator.
+		* \param pString The string to be compared. */
+		bool operator<= (const char* pString) const;
+
+		/** Superior or equal to operator.
+		* \param pString The string to be compared. */
+		bool operator>= (const char* pString) const;
+
+		/** Superior to operator.
+		* \param pString The string to be compared. */
+		bool operator> (const char* pString) const;
+
+		/** FbxString concatenation.
+		* \param pString1 FbxString 1 to be concatenated to FbxString 2.
+		* \param pString2 FbxString 2 to be concatenated to FbxString 1 */
+		friend FBXSDK_DLL FbxString operator+(const FbxString& pString1, const FbxString& pString2);
+
+		/** Character concatenation.
+		* \param pString  FbxString to be concatenated to Character.
+		* \param pChar  Character to be concatenated to FbxString */
+		friend FBXSDK_DLL FbxString operator+(const FbxString& pString, char pChar);
+
+		/** Character concatenation.
+		* \param pChar  Character to be concatenated to FbxString
+		* \param pString  FbxString to be concatenated to Character. */
+		friend FBXSDK_DLL FbxString operator+(char pChar, const FbxString& pString);
+
+		/** String concatenation.
+		* \param pString1  FbxString to be concatenated to String.
+		* \param pString2  String to be concatenated to FbxString */
+		friend FBXSDK_DLL FbxString operator+(const FbxString& pString1, const char* pString2);
+
+		/** String concatenation.
+		* \param pString1  String to be concatenated to FbxString
+		* \param pString2  FbxString to be concatenated to String. */
+		friend FBXSDK_DLL FbxString operator+(const char* pString1, const FbxString& pString2);
+
+		/** Integer concatenation.
+		* \param pString  FbxString to be concatenated to Integer.
+		* \param pValue  Integer to be concatenated to FbxString */
+		friend FBXSDK_DLL FbxString operator+(const FbxString& pString, int pValue);
+
+		/** Integer concatenation.
+		* \param pValue  Integer to be concatenated to FbxString 
+		* \param pString  FbxString to be concatenated to Integer. */
+		friend FBXSDK_DLL FbxString operator+(int pValue, const FbxString& pString);
+
+		/** Float concatenation.
+		* \param pString  FbxString to be concatenated to Float.
+		* \param pValue  Float to be concatenated to FbxString */
+		friend FBXSDK_DLL FbxString operator+(const FbxString& pString, float pValue);
+
+		/** Float concatenation.
+		* \param pValue  Float to be concatenated to FbxString
+		* \param pString  FbxString to be concatenated to Float. */
+		friend FBXSDK_DLL FbxString operator+( float pValue, const FbxString& pString);
+
+		/** Double concatenation.
+		* \param pString  FbxString to be concatenated to Double.
+		* \param pValue  Double to be concatenated to FbxString */
+		friend FBXSDK_DLL FbxString operator+(const FbxString& pString, double pValue);
+
+		//! Cast operator.
+		operator const char*() const;
+
+		/** String assignment function with maximum length.
+		  * \param pString The string to be assigned.
+		  * \param pLength The maximum length of string to be assigned. */
+		const FbxString& Copy(const char* pString, size_t pLength);
+
+		/** Append as "C" strncat().
+		* \param pString The string to be appended.
+		* \param pLength The length of chars to be appended. */
+		const FbxString& Append(const char* pString, size_t pLength);
+
+		/** Compare as "C" strcmp().
+		* \param pString    The string to be compared. */
+		int Compare(const char* pString) const;
+
+		/** Compare as "C" stricmp().
+		* \param pString    The string to be compared. */
+		int CompareNoCase(const char* pString) const;
+
+		/** Swap the contents of two strings.
+		* \param pString The FbxString to be swapped. */
+		void Swap(FbxString& pString);
+
+		//! Uppercase conversion.
+		FbxString Upper() const;
+
+		//! Lowercase conversion.
+		FbxString Lower() const;
+	//@}
+
+    /**
+    * \name Substring Extraction
+    */
+    //@{
+		/** Extract middle string for a given length.
+		* \param pFirst The start index of FbxString to be extracted.
+		* \param pCount The length of sub-string to be extracted. */
+		FbxString Mid(size_t pFirst, size_t pCount) const;
+
+		/** Extract middle string up to the end.
+		* \param pFirst The start index of FbxString to be extracted. */
+		FbxString Mid(size_t pFirst) const;
+
+		/** Extract left string.
+		* \param pCount The length of sub-string to be extracted. */
+		FbxString Left(size_t pCount) const;
+
+		/** Extract right string.
+		* \param pCount The length of sub-string to be extracted. */
+		FbxString Right(size_t pCount) const;
+	//@}
+
+	/**
+	* \name Padding
+	*/
+	//@{
+		/** \enum EPaddingType      Padding types.
+		* - \e eRight
+		* - \e eLeft
+		* - \e eBoth */
+		enum EPaddingType {eRight, eLeft, eBoth};
+
+		/** Add padding characters.
+		* \param pPadding The padding type.
+		* \param pLen The length limit of FbxString after padding. 
+		* \param pCar The character to be padded. */
+		FbxString Pad(EPaddingType pPadding, size_t pLen, char pCar=' ') const;
+
+		/** Remove padding characters.
+		* \param pPadding The padding type.
+		* \param pCar The character to be padded. 
+		* \remark If pCar == '\0' the function will remove all the characters that are tested by isspace(). */
+		FbxString UnPad(EPaddingType pPadding, char pCar='\0') const;
+	//@}
+
+	/**
+	* \name Search
+	*/
+	//@{
+		/** Look for a single character match, like "C" strchr().
+		* \param pChar The character to look for.
+		* \param pStartPosition  Start position to look for.
+		* \return Index or -1 if not found. */
+		int Find(char pChar, size_t pStartPosition=0) const;
+
+		/** Look for a substring match, like "C" strstr().
+		* \param pStrSub The substring to look for.
+		* \param pStartPosition  Start position to look for.
+		* \return Starting index or -1 if not found. */
+		int Find(const char* pStrSub, size_t pStartPosition=0) const;
+
+		/** Look for the last occurrence of character in string, like "C" strrchr().
+		* \param pChar The character to look for.
+		* \return Index or -1 if not found. */
+		int ReverseFind(char pChar) const;
+
+		/** Look for a single character match, like "C" strpbrk().
+		* \param pStrCharSet The character set.
+		* \param pStartPosition The start position.
+		* \return Index or -1 if not found. */
+		int FindOneOf(const char* pStrCharSet, size_t pStartPosition=0) const;
+
+		/** Replace a substring.
+		* \param pFind The substring to look for.
+		* \param pReplaceBy The string to replace by.
+		* \param pStartPosition The start position. 
+		* \return \c true if substring found and replaced. */
+		bool FindAndReplace(const char* pFind, const char* pReplaceBy, size_t pStartPosition=0);
+
+		/** Replace all occurrence of a substring.
+		* \param pFind The substring to look for.
+		* \param pReplaceBy The string to replace by.
+		* \return \c true if something got replaced. */
+		bool ReplaceAll(const char* pFind, const char* pReplaceBy);
+
+        /** Replace all occurrence of character to find by replacement character.
+		* \param pFind The character to look for.
+		* \param pReplaceBy The character to replace by.
+		* \return \c true if character found and replaced. */
+		bool ReplaceAll(char pFind, char pReplaceBy);
+	//@}
+
+	/**
+	* \name Token Extraction
+	*/
+	//@{
+		/** Get number of tokens.
+		* \param pSpans The span
+		* \return The number of tokens. */
+		int GetTokenCount(const char* pSpans) const;
+
+		/** Get token at given index.
+		* \param pTokenIndex The token index.
+		* \param pSpans The span */
+		FbxString GetToken(int pTokenIndex, const char* pSpans) const;
+	//@}
+
+private:
+	// Lengths/sizes in characters. 
+	// Note: an extra character is always allocated.
+	char* mData; // Actual string (zero terminated).
+
+	FbxString(size_t pSrc1Len, const char* pSrc1Data, size_t pSrc2Len, const char* pSrc2Data); // Previously ConcatCopy
+	void Init();
+
+	//! Invalidate string.
+	void Invalidate();
+
+	void FreeBuffer();
+	void FreeBuffer(char *&pOldData);
+
+	bool AllocCopy(FbxString& pDest, size_t pCopyLen, size_t pCopyIndex) const;
+	bool AllocBuffer(size_t pLen);
+	bool AllocBuffer(size_t pLen, char*& pOldData);
+
+	bool AssignCopy(size_t pSrcLen, const char* pSrcData);
+	bool ConcatInPlace(size_t pSrcLen, const char* pSrcData);
+
+	bool IsIn(char pChar, const char* pString) const;
+	bool InternalFindAndReplace(const char* pFind, const char* pReplaceBy, size_t& pStartPosition); 
+};
+
+FBXSDK_INCOMPATIBLE_WITH_ARRAY(FbxString);
+
+//! FbxString concatenation.
+FBXSDK_DLL FbxString operator+(const FbxString& pString1, const FbxString& pString2);
+
+//! Character concatenation.
+FBXSDK_DLL FbxString operator+(const FbxString& pString, char pChar);
+
+//! String concatenation.
+FBXSDK_DLL FbxString operator+(const FbxString& pString1, const char* pString2);
+
+//! Integer concatenation.
+FBXSDK_DLL FbxString operator+(const FbxString& pString, int pValue);
+
+//! Float concatenation.
+FBXSDK_DLL FbxString operator+(const FbxString& pString, float pValue);
+
+//! Double concatenation.
+FBXSDK_DLL FbxString operator+(const FbxString& pString, double pValue);
+
+//! Functor to compare FbxString
+struct FbxStringCompare { inline int operator()(const FbxString& pKeyA, const FbxString& pKeyB) const { return pKeyA.Compare(pKeyB); } };
+
+//! Functor to compare FbxString without case sensitivity
+struct FbxStringCompareNoCase { inline int operator()(const FbxString& pKeyA, const FbxString& pKeyB) const { return pKeyA.CompareNoCase(pKeyB); } };
+
+//! Functor to compare "C" strings
+struct FbxCharPtrCompare { inline int operator()(const char* pKeyA, const char* pKeyB) const { return strcmp(pKeyA, pKeyB); } };
+
+//! Functor to compare "C" strings without case sensitivity
+struct FbxCharPtrCompareNoCase { inline int operator()(const char* pKeyA, const char* pKeyB) const { return FBXSDK_stricmp(pKeyA, pKeyB); } };
+
+/** Remove the given char in the given string.
+* \param pString The given string.
+* \param pToRemove The given char that ought to be removed.
+* \remarks Strings used in this function are case-sensitive. */
+inline void FbxRemoveChar(FbxString& pString, char pToRemove)
+{
+    int lPos = pString.ReverseFind(pToRemove);
+    while( lPos >= 0 )
+    {
+        pString = pString.Left(lPos) + pString.Mid(lPos + 1);
+        lPos = pString.ReverseFind(pToRemove);
+    }
+}
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_STRING_H_ */

+ 368 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxstringlist.h

@@ -0,0 +1,368 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxstringlist.h
+#ifndef _FBXSDK_CORE_BASE_STRING_LIST_H_
+#define _FBXSDK_CORE_BASE_STRING_LIST_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxarray.h>
+#include <fbxsdk/core/base/fbxstring.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+//! Wraps a string (FbxString) and a pointer (FbxHandle).
+class FbxStringListItem
+{
+public:
+    FbxStringListItem(){ mReference = 0; }
+    FbxStringListItem(const char* pString, FbxHandle pRef=0){ mString = pString; mReference = pRef; }
+
+    FbxString	mString; 
+    FbxHandle		mReference;
+};
+
+inline int FbxCompareStringListSort(const void* E1, const void* E2)
+{
+	return FBXSDK_stricmp((*(FbxStringListItem**)E1)->mString.Buffer(), (*(FbxStringListItem**)E2)->mString.Buffer());
+}
+
+inline int FbxCompareStringListFindEqual(const void* E1, const void* E2)
+{
+	return FBXSDK_stricmp((*(FbxStringListItem*)E1).mString.Buffer(), (*(FbxStringListItem**)E2)->mString.Buffer());
+}
+
+inline int FbxCompareCaseSensitiveStringList(const void *E1,const void *E2)
+{
+	return strcmp((*(FbxStringListItem*)E1).mString.Buffer(), (*(FbxStringListItem**)E2)->mString.Buffer());
+}
+ 
+//! Base class of FbxStringList.
+template <class Type> class FbxStringListT
+{
+protected:
+    FbxArray<Type*> mList;
+
+public:
+	/**
+     * \name Operation With The Array 
+     */
+   //@{
+
+	 /** Append a item at the end of the array.
+    * \return Index of appended pointer.
+    */
+    int		AddItem( Type* pItem )		{ return mList.Add( pItem ); }
+
+    /** Insert a item in the array.
+    * \param pIndex Position where to insert the item.
+    * \param pItem  Item to insert.
+    * \return Position of the inserted item in the array.
+    * \remarks If the given index is out of range, the pointer is appended at the end of the array.
+    */
+	int		InsertItemAt( int pIndex, Type* pItem )	{ return mList.InsertAt( pIndex, pItem ); }
+
+	//! Access item at given index.
+    Type*   GetItemAt( int pIndex )	const	{ return mList[pIndex]; }
+
+	/** Find first matching item.
+    * \return Index of first matching item found or -1 if there is no matching element.
+    */
+    int		FindItem( Type* pItem )	const	{ return mList.Find( pItem ); }
+	//}@
+
+public : 
+    /**
+     * \name Constructor and Destructor
+     */
+   //@{
+
+	//! Default constructor.
+    FbxStringListT()
+    {
+    }
+
+	//! Destructor.
+    virtual ~FbxStringListT() { Clear(); }
+	//}@
+
+	//!Remove the item at the end of the array and delete the associated object.
+    void RemoveLast() { RemoveAt( mList.GetCount()-1 ); }
+
+	/** Get number of items in the array.
+     * \return The number of items in the array.
+     */
+    inline int		GetCount() const { return mList.GetCount(); }
+
+	//! Access the string in the item at given index.
+    FbxString&   operator[](int pIndex) { return mList[pIndex]->mString; }
+
+    //! Access the value of reference in the item at given index.
+    FbxHandle		GetReferenceAt(int pIndex) const { return mList[pIndex]->mReference; }
+
+    //! Set the value of reference at given index.        
+    void			SetReferenceAt(int pIndex, FbxHandle pRef) { mList[pIndex]->mReference = pRef; }
+
+	//! Access the pointer of string at given index.
+    char*		GetStringAt(int pIndex) const { if (pIndex<mList.GetCount()) return mList[pIndex]->mString.Buffer(); else return NULL; }
+    
+	//! Set string at given index.
+	virtual bool	SetStringAt(int pIndex, const char* pString) 
+    { 
+	    if (pIndex<mList.GetCount()) 
+	    {
+		    mList[pIndex]->mString = pString; 
+		    return true;
+	    } else return false; 
+    }
+   
+    /** Find first matching item.
+    * \return Index of first matching item found or -1 if  there is no
+    * matching element.
+    */
+    int Find( Type& pItem ) const
+    { 
+	    for (int Count=0; Count<mList.GetCount(); Count++) {
+		    if (mList[Count]==&pItem) {
+			    return Count;
+		    }
+	    }
+	    return -1;
+    }
+
+	/** Find first matching item which has the same reference as given parameter.
+    * \return Index of first matching item found or -1 if  there is no
+    * matching element.
+    */
+    int FindIndex( FbxHandle pReference ) const
+    { 
+	    for (int Count=0; Count<mList.GetCount(); Count++) {
+		    if (mList[Count]->mReference==pReference) {
+			    return Count;
+		    }
+	    }
+	    return -1;
+    }
+
+	/** Find first matching item in array whose string address is the same as given pointer.
+    * \return Index of first matching item found or -1 if  there is no
+    * matching element.
+    */
+    int FindIndex( const char* pString ) const
+    { 
+	    for (int lCount=0; lCount<mList.GetCount(); lCount++) {
+		    if (mList[lCount]->mString==pString) {
+			    return lCount;
+		    }
+	    }
+	    return -1;
+    }
+
+	/** Access the value of reference of the first matching item in array 
+	* whose string address is the same as given pointer.
+    * \return The value of reference of the first matching item found or NULL if  there is no
+    * matching element.
+    */
+    FbxHandle FindReference(const char* pString ) const
+    {
+    int lIndex = FindIndex( pString );
+	    if (lIndex!=-1) {
+		    return mList[lIndex]->mReference;
+	    }
+	    return 0; // NULL
+    }
+
+	//! Remove first matching item.
+    bool Remove ( Type& pItem )
+    {
+    int lIndex = Find( pItem );
+        if (lIndex>=0) {
+		    RemoveAt( lIndex );
+		    return true;
+	    }
+	    return false;
+    }
+
+	//! Remove first matching item in array whose string address is the same as given pointer.
+    bool Remove (const char* pString )
+    {
+    int lIndex = FindIndex( pString );
+        if (lIndex>=0) {
+		    RemoveAt( lIndex );
+		    return true;
+	    }
+	    return false;
+    }
+
+	//! Remove first matching item.
+    bool RemoveIt ( Type& pItem )
+    {
+    int lIndex = Find( pItem );
+        if (lIndex>=0) {
+		    RemoveAt( lIndex );
+		    return true;
+	    }
+	    return false;
+    }
+
+	//! Sort the array by the string of every item,not case sensitive.
+    void Sort( )
+    {
+	    qsort( &(mList.GetArray()[0]),mList.GetCount(),sizeof(FbxStringListItem*),FbxCompareStringListSort );
+    }
+
+    /** Find first matching item which has the same string as given parameter,not case sensitive.
+    * \return the pointer of matching item found or NULL if  there is no
+    * matching element.
+	* \remark To cast the returned pointer to the FbxStringListItem you need a double indirection: (FbxStringListItem**)
+    */
+	void* FindEqual(const char* pString) const
+    {
+    FbxStringListItem Key(pString);  
+    
+	    if (mList.GetCount() != 0)
+	    {
+		    return bsearch ( &Key, &(mList.GetArray()[0]),mList.GetCount(),sizeof(FbxStringListItem*),FbxCompareStringListFindEqual );
+	    }
+	    else
+	    {
+		    return NULL ;
+	    }
+    }
+
+	/** Find first matching item which has the same string as given parameter, case sensitive.
+    * \return the pointer of matching item found or NULL if  there is no
+    * matching element.
+	* \remark To cast the returned pointer to the FbxStringListItem you need a double indirection: (FbxStringListItem**)
+    */
+	void* FindCaseSensitive(const char* pString) const
+	{
+    FbxStringListItem Key(pString);  
+    
+	    if (mList.GetCount() != 0)
+	    {
+		    return bsearch ( &Key, &(mList.GetArray()[0]),mList.GetCount(),sizeof(FbxStringListItem*), FbxCompareCaseSensitiveStringList);
+	    }
+	    else
+	    {
+		    return NULL ;
+	    }
+	
+	}
+
+
+	//! Add a new item at the end of array.
+    int Add( const char* pString, FbxHandle pItem=0 ) 
+    { 
+	    return InsertAt( mList.GetCount(),pString,pItem ); 
+    }
+
+    virtual int InsertAt( int pIndex, const char* pString, FbxHandle pItem=0 ) 
+    { 
+	    return mList.InsertAt( pIndex,FbxNew< Type >( pString,(FbxHandle)pItem )); 
+    }
+
+    /** Remove the item at the given position in the array and delete the associated object.
+    * \param pIndex Position of the item to remove.
+    * \remarks If the index is not valid, nothing is performed. Otherwise,
+    * the item is removed from the array and the items are shifted to fill the
+    * empty slot.
+    */
+	virtual void RemoveAt(int pIndex)
+    { 
+	    FbxDelete(mList.RemoveAt(pIndex));
+    }
+
+	//! Delete the array.
+    virtual void Clear()
+    {
+		FbxArrayDelete(mList);
+    }
+
+	/** Get the string of all the item.
+    * \return The text of string, each item's string separated by '~'.
+    */
+   virtual void GetText(FbxString& pText) const
+    {
+	    int	lCount;
+	    for (lCount=0; lCount<mList.GetCount(); lCount++) 
+        {
+            pText += mList[lCount]->mString;
+            if (lCount<mList.GetCount()-1) 
+            {               
+                pText += "~";               
+            }
+	    }
+    }
+
+    /** Clear the array and set the array's new items with the substring separated by '~' from the given string.
+    * \param pList The string which used to generate the new items.
+	* \return The last index of the item in the new array.
+    * \remarks The number of items in the new array is the same as the number of substrings, 
+	* and the string of each item is decided by the content of each substring.
+    */ 
+    virtual int SetText(const char* pList)
+    {
+    int		lPos=0, lOldPos = 0;
+    int		lLastIndex=0;
+    FbxString	lName=pList;
+
+	    Clear();
+	    for (lPos=0; lName.Buffer()[lPos]!=0; lPos++) {
+    	    if (lName.Buffer()[lPos]=='~') {
+        	    lName.Buffer()[lPos]=0;
+        	    lLastIndex = Add(lName.Buffer()+lOldPos);
+        	    lOldPos=lPos+1;
+    	    }
+	    }
+
+	    if(lOldPos != lPos)
+	    {
+	        lLastIndex = Add(lName.Buffer()+lOldPos);
+	    }
+	    return lLastIndex;
+    } 
+
+
+};
+
+/** Array that stores pairs of FbxString and a pointer.
+  */
+class FBXSDK_DLL FbxStringList : public FbxStringListT<FbxStringListItem>
+{
+public:
+	/**
+	  * \name Constructors
+	  */
+	//@{
+		//! Default constructor.
+		FbxStringList(); 
+
+		//! Copy constructor.
+		FbxStringList( const FbxStringList& pOriginal );
+	//@}
+
+	/**
+	 * \name Assignment Operators
+	 */
+	//@{
+		//! FbxStringList assignment function.
+		void CopyFrom( const FbxStringList* pOriginal  );
+
+		//! FbxStringList assignment operator.
+		FbxStringList& operator=(const FbxStringList& pOriginal);
+	//@}
+};
+	  
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_STRING_LIST_H_ */

+ 648 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxtime.h

@@ -0,0 +1,648 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxtime.h
+#ifndef _FBXSDK_CORE_BASE_TIME_H_
+#define _FBXSDK_CORE_BASE_TIME_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxtimecode.h>
+#include <fbxsdk/core/base/fbxstring.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+#define FBXSDK_TIME_INFINITE		FbxTime(FBXSDK_TC_INFINITY)
+#define FBXSDK_TIME_MINUS_INFINITE	FbxTime(FBXSDK_TC_MINFINITY)
+#define FBXSDK_TIME_ZERO			FbxTime(FBXSDK_TC_ZERO)
+#define FBXSDK_TIME_EPSILON			FbxTime(FBXSDK_TC_EPSILON)
+#define FBXSDK_TIME_ONE_SECOND		FbxTime(FBXSDK_TC_SECOND)
+#define FBXSDK_TIME_ONE_MINUTE		FbxTime(FBXSDK_TC_MINUTE)
+#define FBXSDK_TIME_ONE_HOUR		FbxTime(FBXSDK_TC_HOUR)
+#define FBXSDK_TIME_ASSERT_EPSILON	0.5
+#define FBXSDK_TIME_FORWARD			1
+#define FBXSDK_TIME_BACKWARD		-1
+
+class FbxTimeModeObject;
+
+/** Class to encapsulate time units.
+  * \nosubgrouping
+  * FbxTime can measure time in hour, minute, second, frame, field, residual and also combination of these units.
+  * It is recommended to use FbxTime for all time related operations. For example, currently it is used in FbxGlobalSettings,
+  * FbxGlobalTimeSettings, FbxCache, all curve filters and all animation-related classes, etc.
+  * FbxTime is just used to represent a moment, to represent a period of time, FbxTimeSpan should be used.
+  * \see FbxTimeSpan
+  */
+class FBXSDK_DLL FbxTime 
+{
+public:
+	/** Long long constructor.
+	  * \param pTime Initial value defined as a 64bit integer.
+	  */
+	FbxTime(const FbxLongLong pTime=0){ mTime = pTime; }
+
+	/**
+	  * \name Time Modes and Protocols
+	  */
+    //@{
+		/** Time modes.
+		  * \remarks
+		  * EMode \c eNTSCDropFrame is used for broadcasting operations where 
+		  * clock time must be (almost) in sync with time code. To bring back color 
+		  * NTSC time code with clock time, this mode drops 2 frames per minute
+		  * except for every 10 minutes (00, 10, 20, 30, 40, 50). 108 frames are 
+		  * dropped per hour. Over 24 hours the error is 2 frames and 1/4 of a 
+		  * frame. A time-code of 01:00:03:18 equals a clock time of 01:00:00:00
+		  * 
+		  * \par
+		  * EMode \c eNTSCFullFrame represents a time address and therefore is NOT 
+		  * IN SYNC with clock time. A time code of 01:00:00:00 equals a clock time 
+		  * of 01:00:03:18.
+		  * 
+		  * - \e eDefaultMode		
+		  * - \e eFrames120			120 frames/s
+		  * - \e eFrames100			100 frames/s
+		  * - \e eFrames60          60 frames/s
+		  * - \e eFrames50          50 frames/s
+		  * - \e eFrames48          48 frame/s
+		  * - \e eFrames30          30 frames/s (black and white NTSC)
+		  * - \e eFrames30Drop		30 frames/s (use when display in frame is selected, equivalent to NTSC drop)
+		  * - \e eNTSCDropFrame		~29.97 frames/s drop color NTSC
+		  * - \e eNTSCFullFrame		~29.97 frames/s color NTSC
+		  * - \e ePAL				25 frames/s	PAL/SECAM
+		  * - \e eFrames24			24 frames/s Film/Cinema
+		  * - \e eFrames1000		1000 milli/s (use for date time)
+		  * - \e eFilmFullFrame		~23.976 frames/s
+		  * - \e eCustom            Custom frame rate value
+		  * - \e eFrames96			96 frames/s
+		  * - \e eFrames72			72 frames/s
+		  * - \e eFrames59dot94		~59.94 frames/s
+		  * - \e eModesCount		Number of time modes
+		  */
+		enum EMode
+		{
+			eDefaultMode,
+			eFrames120,
+			eFrames100,
+			eFrames60,
+			eFrames50,
+			eFrames48,
+			eFrames30,
+			eFrames30Drop,
+			eNTSCDropFrame,
+			eNTSCFullFrame,
+			ePAL,
+			eFrames24,
+			eFrames1000,
+			eFilmFullFrame,
+			eCustom,
+			eFrames96,
+			eFrames72,
+			eFrames59dot94,
+			eModesCount
+		};
+
+		/** Time protocols enumaration
+		  * - \e eSMPTE				SMPTE EProtocol
+		  * - \e eFrameCount		Frame count
+		  * - \e eDefaultProtocol	Default protocol (initialized to eFRAMES)
+		  */
+		enum EProtocol {eSMPTE, eFrameCount, eDefaultProtocol};
+
+		/** Set default time mode.
+		  * \param pTimeMode  Time mode identifier.
+		  * \param pFrameRate Custom framerate, only have effect in case of pTimeMode = FbxTime::eCustom
+		  * \remarks It is meaningless to set default time mode to \c eDefaultMode.
+		  */
+		static void SetGlobalTimeMode(EMode pTimeMode, double pFrameRate=0.0);
+
+		/** Get default time mode.
+		  * \return Currently set time mode identifier.
+		  * \remarks Default time mode initial value is eFrames30.
+		  */
+		static EMode GetGlobalTimeMode();
+
+		/** Set default time protocol.
+		  * \param pTimeProtocol Time protocol identifier.
+		  * \remarks It is meaningless to set default time protocol to \c eDefaultProtocol.
+		  */
+		static void SetGlobalTimeProtocol(EProtocol pTimeProtocol);
+
+		/** Get default time protocol.
+		  * \return Currently set time protocol identifier.
+		  * \remarks Default time protocol initial value is eSMPTE.
+		  */
+		static EProtocol GetGlobalTimeProtocol();
+
+		/** Get frame rate associated with time mode, in frames per second.
+		  * \param pTimeMode Time mode identifier.
+		  * \return Frame rate value.
+		  */
+		static double GetFrameRate(EMode pTimeMode);
+
+		/** Get time mode associated with frame rate.
+		  * \param pFrameRate The frame rate value.
+		  * \param pPrecision The tolerance value.
+		  * \return The corresponding time mode identifier or \c eDefaultMode if no time 
+		  * mode associated to the given frame rate is found.
+		  */
+		static EMode ConvertFrameRateToTimeMode(double pFrameRate, double pPrecision=0.00000001);
+	//@}
+	
+	/**
+	  * \name Time Conversion
+	  */
+	//@{
+		/** Set time in internal format.
+		  * \param pTime Time value to set.
+		  */
+		inline void Set(FbxLongLong pTime){ mTime = pTime; }
+
+		/** Get time in internal format.
+		  * \return Time value.
+		  */
+		inline FbxLongLong Get() const { return mTime; }
+
+		/** Set time in milliseconds.
+		  * \param pMilliSeconds Time value to set.
+		  */
+		inline void SetMilliSeconds(FbxLongLong pMilliSeconds){ mTime = pMilliSeconds * FBXSDK_TC_MILLISECOND; }
+
+		/** Get time in milliseconds.
+		  * \return Time value.
+		  */
+		inline FbxLongLong GetMilliSeconds() const { return mTime / FBXSDK_TC_MILLISECOND; }
+
+		/** Set time in seconds.
+		  * \param pTime Time value to set.
+		  */
+		void SetSecondDouble(double pTime);
+
+		/** Get time in seconds.
+		  * \return Time value.
+		  */
+		double GetSecondDouble() const;
+
+		/** Set time in hour/minute/second/frame/field format.
+		  * \param pHour The hours value.
+		  * \param pMinute    The minutes value.
+		  * \param pSecond    The seconds value.
+		  * \param pFrame     The frames values.
+		  * \param pField     The field value.
+		  * \param pTimeMode  Time mode identifier.
+		  * \remarks Parameters pHour, pMinute, pSecond, pFrame and pField are summed together.
+		  * For example, it is possible to set the time to 83 seconds in the following
+		  * ways: SetTime(0,1,23) or SetTime(0,0,83).
+		  */
+		void SetTime(int pHour, int pMinute, int pSecond, int pFrame=0, int pField=0, EMode pTimeMode=eDefaultMode);
+
+		/** Set time in hour/minute/second/frame/field/residual format.
+		  * \param pHour The hours value.
+		  * \param pMinute       The minutes value.
+		  * \param pSecond       The seconds value.
+		  * \param pFrame        The frames values.
+		  * \param pField        The field value.
+		  * \param pResidual     The hundredths of frame value.
+		  * \param pTimeMode     Time mode identifier.
+		  * \remarks Parameters pHour, pMinute, pSecond, pFrame, pField and pResidual 
+		  * are summed together, just like above.
+		  * pResidual represents hundredths of frame, and won't necessarily
+		  * correspond to an exact internal value.
+		  *
+		  * \remarks The time mode can't have a default value, because
+		  *         otherwise SetTime(int, int, int, int, int, int)
+		  *         would be ambiguous. Please specify DEFAULT_MODE.
+		  */
+		void SetTime(int pHour, int pMinute, int pSecond, int pFrame, int pField, int pResidual, EMode pTimeMode);
+
+		/** Get time in hour/minute/second/frame/field/residual format.
+		  * \param pHour       The returned hours value.
+		  * \param pMinute     The returned minutes value.
+		  * \param pSecond     The returned seconds value.
+		  * \param pFrame      The returned frames values.
+		  * \param pField      The returned field value.
+		  * \param pResidual   The returned hundredths of frame value.
+		  * \param pTimeMode   The time mode identifier which will dictate the extraction algorithm.
+		  * \return \c true if the pTimeMode parameter is a valid identifier and thus the extraction
+		  * succeeded. If the function returns \c false, all the values are set to 0.
+		  */
+		bool GetTime(int& pHour, int& pMinute, int& pSecond, int& pFrame, int& pField, int& pResidual, EMode pTimeMode=eDefaultMode) const;
+
+		/** Snaps a time value to the time value associated with the nearest frame.
+		  * \param pRound  If \c true the return value is rounded to the nearest integer.
+		  * \return        The snapped time value.
+		  */
+		FbxTime	GetFramedTime(bool pRound=true) const;
+
+		/** Set time in frame format.
+		  * \param pFrames The number of frames.
+		  * \param pTimeMode The time mode identifier which will dictate the extraction algorithm.
+		  */
+		void SetFrame(FbxLongLong pFrames, EMode pTimeMode=eDefaultMode);
+
+		/** Set time in frame format, including fractions.
+		  * \param pFrames The number of frames in decimal value.
+		  * \param pTimeMode The time mode identifier which will dictate the extraction algorithm.
+		  */
+		void SetFramePrecise(FbxDouble pFrames, EMode pTimeMode=eDefaultMode);
+
+		/** Get number of hours in time.
+		  * \return Hours value.
+		  */
+		int GetHourCount() const;
+
+		/** Get number of minutes in time.
+		  * \return Minutes value.
+		  */
+		int GetMinuteCount() const;
+
+		/** Get number of seconds in time.
+		  * \return Seconds value.
+		  */
+		int GetSecondCount() const;
+
+		/** Get number of frames in time.
+		  * \param pTimeMode Time mode identifier.
+		  * \return Integer value representing the frame count.
+		  */
+		FbxLongLong GetFrameCount(EMode pTimeMode=eDefaultMode) const;
+
+		/** Get precise number of frames in time, including fractions.
+		  * \param pTimeMode Time mode identifier.
+		  * \return Decimal value representing the frame count, including fractions.
+		  */
+		FbxDouble GetFrameCountPrecise(EMode pTimeMode=eDefaultMode) const;
+
+		/** Get number of fields in time.
+		  * \param pTimeMode Time mode identifier.
+		  * \return Fields value.
+		  */
+		FbxLongLong GetFieldCount(EMode pTimeMode=eDefaultMode) const;
+
+		/** Get residual time exceeding last full field.
+		  * \param pTimeMode Time mode identifier.
+		  * \return Residual value.
+		  */
+		int GetResidual(EMode pTimeMode=eDefaultMode) const;
+
+		/** Test for Drop Frame mode
+		  * \param pTimeMode Time mode identifier.
+		  * \return True if the pTimeMode is a Drop Frame mode.
+		  */
+		static bool IsDropFrame(EMode pTimeMode=eDefaultMode);
+
+		/** Separator char between second and frame.
+		  * \param pTimeMode Time mode identifier.
+		  * \return ';' is returned if pTimeMode is a DropFrame mode otherwise ':'.
+		  */
+		char GetFrameSeparator(EMode pTimeMode=eDefaultMode) const;
+
+		/** Get time in a human readable format.
+		  * \param pTimeString An array large enough to contain a minimum of 19 characters.
+          * \param pTimeStringSize Size of the pTimeString buffer used with secure functions.
+		  * \param pInfo The amount of information if time protocol is \c eSMPTE:
+		  * <ul><li>1 means hours only
+		  *     <li>2 means hours and minutes
+		  *     <li>3 means hours, minutes and seconds
+		  *     <li>4 means hours, minutes, seconds and frames
+		  *     <li>5 means hours, minutes, seconds, frames and field
+		  *     <li>6 means hours, minutes, seconds, frames, field and residual value</ul>
+		  * \param pTimeMode Requested time mode.
+		  * \param pTimeFormat Requested time protocol.
+		  * \return pTimeString parameter filled with a time value or set to a empty string
+		  * if parameter pInfo is not valid.
+		  */
+		char* GetTimeString(char* pTimeString, const FbxUShort& pTimeStringSize, int pInfo=5, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol) const;
+
+		enum EElement {eHours, eMinutes, eSeconds, eFrames, eField, eResidual};
+
+		/** Get the time in a human readable format.
+		* \param pStart The starting element type used to format the time string.
+		* \param pEnd The last element type used to format the time string.
+		* \param pTimeMode The time mode requested.
+		* \param pTimeFormat The time format requested.
+		* \return The human readable time string. */
+		FbxString GetTimeString(EElement pStart=eHours, EElement pEnd=eResidual, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol) const;
+
+        /** Set time in a human readable format.
+		  * \param pTime An array of a maximum of 18 characters.
+		  * If time protocol is \c eSMPTE, pTimeString must be formatted this way:
+		  * "[hours:]minutes[:seconds[.frames[.fields]]]". Hours, minutes, seconds, 
+		  * frames and fields are parsed as integers and brackets indicate optional 
+		  * parts. 
+		  * If time protocol is \c eFRAME, pTimeString must be formatted this way:
+		  * "frames". Frames is parsed as a 64 bits integer.
+		  * \param pTimeMode   Given time mode.
+		  * \param pTimeFormat Given time protocol.
+		  * \return True if the set time string succeed, otherwise return false.
+		  */
+		bool SetTimeString(const char* pTime, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol);
+    //@}
+
+	/**
+	  * \name Time Operators
+	  */
+	//@{
+		/** Equality operator.
+		  * \param pTime The FbxTime to be compared.
+		  * \return \c true if equal, \c false otherwise.
+		  */
+		inline bool operator==(const FbxTime& pTime) const { return mTime == pTime.mTime; }
+
+		/** Inequality operator.
+		  * \param pTime The FbxTime to be compared.
+		  * \return \c true if unequal, \c false otherwise.
+		  */
+		inline bool operator!=(const FbxTime& pTime) const { return mTime != pTime.mTime; }
+
+		/** Superior or equal to operator.
+		  * \param pTime The FbxTime to be compared.
+		  * \return \c true if this FbxTime is superior or equal to the passed FbxTime, \c false otherwise.
+		  */
+		inline bool operator>=(const FbxTime& pTime) const { return mTime >= pTime.mTime; }
+
+		/** Inferior or equal to operator.
+		  * \param pTime The FbxTime to be compared.
+		  * \return \c true if this FbxTime is inferior or equal to the passed FbxTime, \c false otherwise.
+		  */
+		inline bool operator<=(const FbxTime& pTime) const { return mTime <= pTime.mTime; }
+
+		/** Superior to operator.
+		  * \param pTime The FbxTime to be compared.
+		  * \return \c true if this FbxTime is superior to the passed FbxTime, \c false otherwise.
+		  */
+		inline bool operator>(const FbxTime& pTime) const { return mTime > pTime.mTime; }
+
+		/** Inferior to operator.
+		  * \param pTime The FbxTime to be compared.
+		  * \return \c true if this FbxTime is inferior to the passed FbxTime, \c false otherwise.
+		  */
+		inline bool operator<(const FbxTime& pTime) const { return mTime < pTime.mTime; } 
+
+		/** Assignment operator.
+		  * \param pTime The FbxTime to be assigned.
+		  */
+		inline FbxTime& operator=(const FbxTime& pTime) { mTime = pTime.mTime; return *this; }
+
+		/** Addition operator.
+		  * \param  pTime The FbxTime to be added.
+		  * \return This FbxTime after addition.
+		  */
+		inline FbxTime& operator+=(const FbxTime& pTime) { mTime += pTime.mTime; return *this; }
+
+		/** Subtraction operator.
+		  * \param pTime The FbxTime to be subtracted.
+		  * \return This FbxTime after subtraction.
+		  */
+		inline FbxTime& operator-=(const FbxTime& pTime) { mTime -= pTime.mTime; return *this; }
+
+		/** Addition operator.
+		  * \param pTime The FbxTime to be added.
+		  * \return A temporary FbxTime after addition. 
+		  */
+		FbxTime operator+(const FbxTime& pTime) const;
+
+		/** Subtraction operator.
+		  * \param pTime The FbxTime to be subtracted.
+		  * \return A temporary FbxTime after subtraction. 
+		  */
+		FbxTime operator-(const FbxTime& pTime) const;
+
+		/** Multiplication operator.
+		  * \param Mult Multiply this FbxTime by int Mult.
+		  * \return A temporary FbxTime after multiplication. 
+		  */
+		FbxTime operator*(const int Mult) const;
+
+		/** Division operator.
+		  * \param pTime Divide this FbxTime by pTime.
+		  * \return A temporary FbxTime after division. 
+		  */
+		FbxTime operator/(const FbxTime& pTime) const;
+
+		/** Multiplication operator.
+		  * \param pTime Multiply this FbxTime by pTime.
+		  * \return A temporary FbxTime after multiplication. 
+		  */
+		FbxTime operator*(const FbxTime& pTime) const;
+/*
+		//! Increment time of one unit of the internal format (prefix form).
+		inline FbxTime& operator++() { mTime += 1; return (*this); }
+
+		//! Increment time of one unit of the internal format (postfix form).
+		inline const FbxTime operator++(int) { FbxTime lOld = *this; ++(*this); return lOld; }
+
+		//! Decrement time of one unit of the internal format (prefix form).
+		inline FbxTime& operator--() { mTime -= 1; return (*this); }
+
+		//! Decrement time of one unit of the internal format (postfix form).
+		inline const FbxTime operator--(int) { FbxTime lOld = *this; --(*this); return lOld; }*/
+	//@}
+
+	/** One frame value for a specified time mode.
+	  * \param pTimeMode Time mode identifier.
+	  * \return the time code of a one frame.
+	  */
+	static FbxLongLong GetOneFrameValue(EMode pTimeMode=eDefaultMode);
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	// Keep compatibility with old fbx format
+	enum EOldMode
+	{
+		eOLD_DEFAULT_MODE,		//Default mode set using FbxTime::SetGlobalTimeMode(EMode pTimeMode)
+		eOLD_CINEMA,			//24 frameOLD_s/s
+		eOLD_PAL,				//25 frameOLD_s/s	 PAL/SECAM
+		eOLD_FRAMES30,			//30 frameOLD_s/s	 BLACK & WHITE NTSC
+		eOLD_NTSC_DROP_FRAME,   //29.97002617 frameOLD_s/s COLOR NTSC
+		eOLD_FRAMES50,			//50 frameOLD_s/s
+		eOLD_FRAMES60,			//60 frameOLD_s/s
+		eOLD_FRAMES100,			//100 frameOLD_s/s
+		eOLD_FRAMES120,			//120 frameOLD_s/s
+		eOLD_NTSC_FULL_FRAME,	//29.97002617 frameOLD_s/s COLOR NTSC
+		eOLD_FRAMES30_DROP,		//30 frameOLD_s/s
+		eOLD_FRAMES1000			//1000 frameOLD_s/s
+	};
+
+private:
+	FbxLongLong					mTime; //In 1 / 46,186,158,000 Seconds
+
+	static EMode				gsGlobalTimeMode;
+	static EProtocol			gsGlobalTimeProtocol;
+	static FbxTimeModeObject*	gsTimeObject;
+
+	void InternalSetTime(int pHour, int pMinute, int pSecond, FbxLongLong pFrame, int pField, EMode pTimeMode);
+
+    friend FBXSDK_DLL FbxTime::EMode		FbxGetGlobalTimeMode();
+	friend FBXSDK_DLL FbxTimeModeObject*	FbxGetGlobalTimeModeObject();
+    friend FBXSDK_DLL FbxTime::EProtocol	FbxGetGlobalTimeFormat();
+	friend FBXSDK_DLL void					FbxSetGlobalTimeMode(FbxTime::EMode pTimeMode, double pFrameRate);
+    friend FBXSDK_DLL void					FbxSetGlobalTimeFormat(FbxTime::EProtocol pTimeFormat);
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+/** FbxTime in seconds constructor.
+  * \param pTime 
+  */
+FBXSDK_DLL inline FbxTime FbxTimeSeconds(const FbxDouble& pTime=0.0)
+{
+	FbxTime lTime;
+	lTime.SetSecondDouble(pTime);
+	return lTime;
+}
+
+/** Class to encapsulate time intervals.
+  * \nosubgrouping
+  * \see FbxTime 
+  */
+class FBXSDK_DLL FbxTimeSpan
+{
+public:
+	//! Constructor.
+	FbxTimeSpan() {}
+
+	/** Constructor.
+	  * \param pStart Beginning of the time interval.
+	  * \param pStop  Ending of the time interval.
+	  */
+	FbxTimeSpan(FbxTime pStart, FbxTime pStop){ mStart = pStart; mStop = pStop; }
+
+	/** Set start and stop time.
+	  * \param pStart Beginning of the time interval.
+	  * \param pStop  Ending of the time interval.
+	  */
+	inline void Set(FbxTime pStart, FbxTime pStop){ mStart = pStart; mStop = pStop; }
+
+	/** Set start time.
+	  * \param pStart Beginning of the time interval.
+	  */
+	inline void SetStart(FbxTime pStart){ mStart = pStart; }
+
+	/** Set stop time.
+	  * \param pStop  Ending of the time interval.
+	  */
+	inline void SetStop(FbxTime pStop){ mStop = pStop; }
+
+	/** Get start time.
+	  * \return Beginning of time interval.
+	  */
+	inline FbxTime GetStart() const { return mStart; }
+
+	/** Get stop time.
+	  * \return Ending of time interval.
+	  */
+	inline FbxTime GetStop() const { return mStop; }
+
+	/** Get time interval in absolute value.
+	  * \return Time interval.
+	  */
+	inline FbxTime GetDuration() const { if( mStop > mStart ) return mStop - mStart; else return mStart - mStop; }
+
+	/** Get time interval.
+	  * \return Signed time interval.
+	  */
+	inline FbxTime GetSignedDuration() const { return mStop - mStart; }
+
+	/** Get direction of the time interval.
+	  * \return \c FBXSDK_TIME_FORWARD if time interval is forward, \c FBXSDK_TIME_BACKWARD if backward.
+	  */
+	inline int GetDirection() const { if( mStop >= mStart ) return FBXSDK_TIME_FORWARD; else return FBXSDK_TIME_BACKWARD; }
+
+	/** Return \c true if the time is inside the timespan.
+	  * \param pTime Judge whether pTime is inside the timespan.
+	  * \return \c True if is, \c false otherwise.
+	  */
+	bool IsInside(FbxTime pTime) const;
+
+	/** Return the intersection of the two time spans.
+	  * \param pTime 
+	  * \return The intersection of pTime and this FbxTimeSpan.
+	  */
+	FbxTimeSpan Intersect(const FbxTimeSpan& pTime) const;
+
+	/** Inequality operator.
+	  * \param pTime FbxTimeSpan compared with this one.
+	  * \return \c True if unequal, \c false otherwise.
+	  */
+	bool operator!=(const FbxTimeSpan& pTime) const;
+
+	/** Equality operator.
+	  * \param pTime FbxTimeSpan compared with this one.
+	  * \return \c True if equal, \c false otherwise.
+	  */
+	bool operator==(const FbxTimeSpan& pTime) const;
+
+	/** Unite with another FbxTimeSpan
+	  * \param pSpan The FbxTimeSpan
+	  * \param pDirection FBXSDK_TIME_FORWARD or FBXSDK_TIME_BACKWARD
+	  * \remarks This function assumes both of the FbxTimeSpan objects are in the same direction.
+	  * Use FBXSDK_TIME_FORWARD when start < stop in both timespan
+	  * Use FBXSDK_TIME_BACKWARD when start > stop in both timespan
+	  */
+	void UnionAssignment(const FbxTimeSpan& pSpan, int pDirection=FBXSDK_TIME_FORWARD);
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+private:
+	FbxTime mStart;
+	FbxTime mStop;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+class FBXSDK_DLL FbxLocalTime
+{
+public:
+	FbxLocalTime();
+
+	int mYear;
+	int mMonth;
+	int mDay;
+	int mHour;
+	int mMinute;
+	int mSecond;
+	int mMillisecond;
+};
+
+FBXSDK_DLL void					FbxGetCurrentLocalTime(FbxLocalTime& pLocalTime);
+
+FBXSDK_DLL FbxTime::EMode		FbxGetGlobalTimeMode();
+FBXSDK_DLL FbxTimeModeObject*	FbxGetGlobalTimeModeObject();
+FBXSDK_DLL FbxTime::EProtocol	FbxGetGlobalTimeFormat();
+FBXSDK_DLL void					FbxSetGlobalTimeMode(FbxTime::EMode pTimeMode, double pFrameRate=0.0);
+FBXSDK_DLL void					FbxSetGlobalTimeFormat(FbxTime::EProtocol pTimeFormat);
+
+// Use those functions to keep the compatibility with old time mode since we added new time mode.
+FBXSDK_DLL FbxTime::EOldMode		FbxGetOldTimeModeCorrespondance(FbxTime::EMode pMode);
+FBXSDK_DLL FbxTime::EMode		FbxGetTimeModeFromOldValue(FbxTime::EOldMode pOldMode);
+
+// We now store the framerate instead of the time mode.
+FBXSDK_DLL FbxTime::EMode		FbxGetTimeModeFromFrameRate(char* pFrameRate);
+FBXSDK_DLL void					FbxGetControlStringList(char* pControlString, FbxTime::EProtocol pTimeFormat);
+FBXSDK_DLL const char*			FbxGetGlobalFrameRateString(FbxTime::EMode pTimeMode);
+FBXSDK_DLL const char*			FbxGetGlobalTimeModeString(FbxTime::EMode pTimeMode);
+FBXSDK_DLL double				FbxGetFrameRate(FbxTime::EMode pTimeMode);
+
+// Time format
+FBXSDK_DLL FbxTime::EProtocol	FbxSelectionToTimeFormat(int pSelection);
+FBXSDK_DLL FbxTime::EMode		FbxSelectionToTimeMode(int pSelection);
+FBXSDK_DLL int					FbxTimeToSelection(FbxTime::EMode pTimeMode=FbxTime::eDefaultMode, int pTimeFormat=FbxTime::eDefaultProtocol);
+FBXSDK_DLL const char*			FbxGetTimeModeName(FbxTime::EMode pTimeMode);
+FBXSDK_DLL int					FbxGetFrameRateStringListIndex(FbxTime::EMode pTimeMode);
+FBXSDK_DLL bool					FbxIsValidCustomFrameRate(double pFramerate);
+FBXSDK_DLL bool					FbxGetNearestCustomFrameRate(double pFramerate, double& pNearestRate);
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_TIME_H_ */

+ 99 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxtimecode.h

@@ -0,0 +1,99 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxtimecode.h
+#ifndef _FBXSDK_CORE_BASE_TIMECODE_H_
+#define _FBXSDK_CORE_BASE_TIMECODE_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+#define FBXSDK_TC_ZERO					FBXSDK_LONGLONG(0)  
+#define FBXSDK_TC_EPSILON				FBXSDK_LONGLONG(1)
+#define FBXSDK_TC_MINFINITY				FBXSDK_LONGLONG(-0x7fffffffffffffff)
+#define FBXSDK_TC_INFINITY				FBXSDK_LONGLONG(0x7fffffffffffffff)
+#define FBXSDK_TC_FIX_DEN				FBXSDK_LONGLONG(100000000)
+
+#define FBXSDK_TC_MILLISECOND			FBXSDK_LONGLONG(46186158)
+#define FBXSDK_TC_SECOND				FbxLongLong(FBXSDK_TC_MILLISECOND*1000)
+#define FBXSDK_TC_MINUTE				FbxLongLong(FBXSDK_TC_SECOND*60)
+#define FBXSDK_TC_HOUR					FbxLongLong(FBXSDK_TC_MINUTE*60)
+#define FBXSDK_TC_DAY					FbxLongLong(FBXSDK_TC_HOUR*24)
+
+// Frame @ 30 Hz
+#define FBXSDK_TC_NTSC_FIELD			FbxLongLong(FBXSDK_TC_SECOND/30/2)
+#define FBXSDK_TC_NTSC_FRAME			FbxLongLong(FBXSDK_TC_SECOND/30)
+
+// Frame @ 29.9700299700 Hz
+#define FBXSDK_TC_MNTSC_FIELD			FbxLongLong(FBXSDK_TC_MNTSC_FRAME/2)
+#define FBXSDK_TC_MNTSC_FRAME			FbxLongLong(FBXSDK_TC_SECOND/30*1001/1000)
+#define FBXSDK_TC_MNTSC_2_FRAMES		FbxLongLong(FBXSDK_TC_MNTSC_FRAME*2)
+#define FBXSDK_TC_MNTSC_30_FRAMES		FbxLongLong(FBXSDK_TC_MNTSC_FRAME*30)
+#define FBXSDK_TC_MNTSC_1798_FRAMES		FbxLongLong(FBXSDK_TC_MNTSC_FRAME*1798)		// leap minute
+#define FBXSDK_TC_MNTSC_1800_FRAMES		FbxLongLong(FBXSDK_TC_MNTSC_FRAME*1800)		// ~1 minute
+#define FBXSDK_TC_MNTSC_17982_FRAMES	FbxLongLong(FBXSDK_TC_MNTSC_FRAME*17982)	// ~10 minutes
+#define FBXSDK_TC_MNTSC_107892_FRAMES	FbxLongLong(FBXSDK_TC_MNTSC_FRAME*107892)	// ~1 hour
+#define FBXSDK_TC_MNTSC_108000_FRAMES	FbxLongLong(FBXSDK_TC_MNTSC_FRAME*108000)
+
+// For 29.9700299700 non-drop, btw : same values as with 23.976
+#define FBXSDK_TC_MNTSC_1_SECOND		FbxLongLong(FBXSDK_TC_MNTSC_FRAME*30)		// 1 frame * 30
+#define FBXSDK_TC_MNTSC_1_MINUTE		FbxLongLong(FBXSDK_TC_MNTSC_1_SECOND*60)	// 1 minute (1800 frames)
+#define FBXSDK_TC_MNTSC_1_HOUR			FbxLongLong(FBXSDK_TC_MNTSC_1_SECOND*3600)	// 1 hour
+
+#define FBXSDK_TC_MNTSC_NUM				FbxULong(FBXSDK_TC_FIX_DEN*1000*30/1001)
+#define FBXSDK_TC_MNTSC_DEN				FBXSDK_TC_FIX_DEN
+
+// Frame @ 25 Hz
+#define FBXSDK_TC_PAL_FIELD				FbxLongLong(FBXSDK_TC_SECOND/25/2)
+#define FBXSDK_TC_PAL_FRAME				FbxLongLong(FBXSDK_TC_SECOND/25)
+
+// Frame @ 24 Hz
+#define FBXSDK_TC_FILM_FRAME			FbxLongLong(FBXSDK_TC_SECOND/24)
+
+// Frame @ 23.9760239760 Hz
+#define FBXSDK_TC_MFILM_FIELD			FbxLongLong(FBXSDK_TC_MFILM_FRAME/2)
+#define FBXSDK_TC_MFILM_FRAME			FbxLongLong(FBXSDK_TC_SECOND/24*1001/1000)
+#define FBXSDK_TC_MFILM_1_SECOND		FbxLongLong(FBXSDK_TC_MFILM_FRAME*24)		// 1 frame * 24   
+#define FBXSDK_TC_MFILM_1_MINUTE		FbxLongLong(FBXSDK_TC_MFILM_1_SECOND*60)	// 1 minute (1440 frames)
+#define FBXSDK_TC_MFILM_1_HOUR			FbxLongLong(FBXSDK_TC_MFILM_1_SECOND*3600)	// 1 hour
+
+#define FBXSDK_TC_MFILM_NUM				FbxULong(FBXSDK_TC_FIX_DEN*1000*24/1001)
+#define FBXSDK_TC_MFILM_DEN				FBXSDK_TC_FIX_DEN
+
+//////////////////////////////////////////////////////////////////////////////////////////
+
+#define FBXSDK_TC_REM(quot, num, den)		((quot) = (num) / (den), (quot) * (den))
+#define FBXSDK_TC_HOUR_REM(quot, num, den)	((quot) = ((num - (-FbxLongLong(num < 0) & (den - 1))) / (den)), (quot) * (den))
+
+FBXSDK_DLL FbxLongLong FbxTCSeconds(FbxLongLong pTime);
+FBXSDK_DLL FbxLongLong FbxTCMinutes(FbxLongLong pTime);
+FBXSDK_DLL FbxLongLong FbxTCHours(FbxLongLong pTime);
+FBXSDK_DLL FbxLongLong FbxTCSetRate(int pHour, int pMinute, int pSecond, FbxLongLong pFrame, FbxLongLong pPeriod);
+FBXSDK_DLL FbxLongLong FbxTCGetRate(FbxLongLong pTime, int& pHour, int& pMinute, int& pSecond, int& pFrame, FbxLongLong pPeriod);
+FBXSDK_DLL FbxLongLong FbxTCSetNTSC(int pHour, int pMinute, int pSecond, FbxLongLong pFrame, int pField);
+FBXSDK_DLL FbxLongLong FbxTCGetNTSC(FbxLongLong pTime, int& pHour, int& pMinute, int& pSecond, int& pFrame, int& pField);
+FBXSDK_DLL FbxLongLong FbxTCSetMNTSCnd(int pHour, int pMinute, int pSecond, FbxLongLong pFrame, int pField);
+FBXSDK_DLL FbxLongLong FbxTCGetMNTSCnd(FbxLongLong pTime, int& pHour, int& pMinute, int& pSecond, int& pFrame, int& pField);
+FBXSDK_DLL FbxLongLong FbxTCSetMNTSC_2Xnd(int pHour, int pMinute, int pSecond, FbxLongLong pFrame, int pField);
+FBXSDK_DLL FbxLongLong FbxTCGetMNTSC_2Xnd(FbxLongLong pTime, int& pHour, int& pMinute, int& pSecond, int& pFrame, int& pField);
+FBXSDK_DLL FbxLongLong FbxTCSetMNTSC(int pHour, int pMinute, int pSecond, FbxLongLong pFrame, int pField);
+FBXSDK_DLL FbxLongLong FbxTCGetMNTSC(FbxLongLong pTime, int& pHour, int& pMinute, int& pSecond, int& pFrame, int& pField);
+FBXSDK_DLL FbxLongLong FbxTCSetPAL(int pHour, int pMinute, int pSecond, FbxLongLong pFrame, int pField);
+FBXSDK_DLL FbxLongLong FbxTCGetPAL(FbxLongLong pTime, int& pHour, int& pMinute, int& pSecond, int& pFrame, int& pField);
+FBXSDK_DLL FbxLongLong FbxTCSetFILM(int pHour, int pMinute, int pSecond, FbxLongLong pFrame);
+FBXSDK_DLL FbxLongLong FbxTCGetFILM(FbxLongLong pTime, int& pHour, int& pMinute, int& pSecond, int& pFrame);
+FBXSDK_DLL FbxLongLong FbxTCSetFILMND(int pHour, int pMinute, int pSecond, FbxLongLong pFrame, int pField);
+FBXSDK_DLL FbxLongLong FbxTCGetFILMND(FbxLongLong pTime, int& pHour, int& pMinute, int& pSecond, int& pFrame, int& pField);
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_TIMECODE_H_ */

+ 168 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/base/fbxutils.h

@@ -0,0 +1,168 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxutils.h
+#ifndef _FBXSDK_CORE_BASE_UTILITIES_H_
+#define _FBXSDK_CORE_BASE_UTILITIES_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxstring.h>
+#include <fbxsdk/core/base/fbxstatus.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+#ifndef FBXSDK_ENV_WINSTORE
+	/** Retrieve the environment variable value.
+	* \return A new string containing the environment variable value. */
+	FBXSDK_DLL FbxString FbxGetEnv(const char* pEnvVar);
+
+	/** Get the application directory
+	* \return The application directory. */
+	FBXSDK_DLL FbxString FbxGetApplicationDirectory();
+#endif
+
+/** Retrieve the system temporary folder path name.
+* \return A new string containing the system temporary folder path name. */
+FBXSDK_DLL FbxString FbxGetSystemTempPath();
+
+/** Override the system temporary folder path name.
+* \param pPathUTF8 The system temporary folder to use for override. */
+FBXSDK_DLL void FbxSetSystemTempPath(const char* pPathUTF8);
+
+/** Retrieve the working directory of the system in UTF8 format.
+* \return A string that contain the current working directory of the system. */
+FBXSDK_DLL FbxString FbxGetCurrentWorkPath();
+
+/** Change the working directory of the system. */
+FBXSDK_DLL void FbxSetCurrentWorkPath(const char* pPath_UTF8);
+
+class FBXSDK_DLL FbxPathUtils
+{
+public:
+	/** Bind together a root path with a file path.
+	  * \param pRootPath The root path that will get binded to the file path.
+	  * \param pFilePath The file path to bind to the root path.
+	  * \param pCleanPath If true, the resulting path will be cleaned via FbxPathUtils::Clean().
+	  * \return Both paths binded together forming a new file path.
+	  * \remark If the file path is already a full valid path, pFilePath is returned.
+	  */
+	static FbxString Bind(const char* pRootPath, const char* pFilePath, bool pCleanPath=true);
+
+	/** Extract the folder name from the given file path.
+	  * \param pFilePath The given file path.
+	  * \return The folder name. If there isn't any '\\' or '/' in  the given file path, it will return pFilePath.
+	  */
+	static FbxString GetFolderName(const char* pFilePath);
+
+	/** Extract file name from the given file path.
+	  * \param pFilePath The given file path.
+	  * \param pWithExtension Decide the file name with extension or without extension.
+	  * If it is true, return the file name with extension;
+	  * if it is false, return the file name without extension.
+	  */
+	static FbxString GetFileName(const char* pFilePath, bool pWithExtension=true);
+
+	/** Extract the file extension in the given file path.
+	  * \param pFilePath The file path to extract the extension.
+	  * \return The file extension without the '.' character.
+	  * \remark Return empty string if the file path doesn't contain a valid extension.
+	  */
+	static FbxString GetExtensionName(const char* pFilePath);
+
+	/** Change or append a file extension to the specified file path.
+	  * \param pFilePath The file path to change the file extension
+	  * \param pExtension The extension to change or append to the file path.
+	  * \return The file path with the file extension changed/added.
+	  * \remark If the file path doesn't end with a valid file name, pFilePath is returned.
+	  */
+	static FbxString ChangeExtension(const char* pFilePath, const char* pExtension);
+
+	//! Test if the given path is relative path, if it is return true.
+	static bool IsRelative(const char* pPath);
+
+	/** Get the given new path's relative path to the given root path.
+	  * \param pRootPath The given root path
+	  * \param pNewPath The given new path. If it is only file name, the default directory is work directory.
+	  * \return The relative path.
+	  * \remarks If the given two paths have the same drive, the function will turn  '\\' in the relative path to  '/'.
+	  */
+	static FbxString GetRelativePath(const char* pRootPath, const char* pNewPath);
+
+	//! Get the given new path's relative path to the given root path.
+	static FbxString GetRelativeFilePath(const char* pRootPath, const char* pNewFilePath);
+
+	/** Get the full path of given path (if the given path is relative path,
+	  * it will take current directory as default root path.)
+	  */
+	static FbxString Resolve(const char* pRelPath);
+
+	//! Clean the redundant and useless denotations in given path name.
+	static FbxString Clean(const char* pPath);
+
+	/** Generate full safe file path name you can use to create new file.
+	  * \param pFolder The folder where the file name should be attempted to be created.
+	  * \param pPrefix The prefix of generated file name.
+	  * \return A valid file path that can safely be used to create a new file.
+	  */
+	static FbxString GenerateFileName(const char* pFolder, const char* pPrefix);
+
+	/** Verify if the specified folder path exist.
+	* \param pFolderPathUTF8 The folder path to test its existance.
+	* \return True if the folder path exist, false otherwise.
+	* \remark This function work for relative paths. It will search from the current work path. */
+	static bool Exist(const char* pFolderPathUTF8);
+
+	/** Create the specified folder path if it doesn't exist.
+	* \param pFolderPathUTF8 The folder path to create, in UTF8 encoding.
+	* \return True if folder path already exist, or if it was successfully created, false otherwise.
+	* \remark This function will create multiple folders if needed, and it also work for relative paths. */
+	static bool Create(const char* pFolderPathUTF8);
+
+	/** Delete the specified folder path and all its content recursively.
+	* \param pFolderPathUTF8 The folder path to delete, in UTF8 encoding.
+	* \return True if folder path was successfully deleted, false otherwise.
+	* \remark This function work for relative paths. It will search from the current work path. */
+	static bool Delete(const char* pFolderPathUTF8);
+
+#ifndef FBXSDK_ENV_WINSTORE
+	/** Verify if the folder contains items or not.
+	* \param pFolderPath_UTF8 The folder path to test if it contains items.
+	* \return True if the folder contain any kind of entry type. */
+	static bool IsEmpty(const char* pFolderPath_UTF8);
+#endif
+};
+
+/** Global accessor to an FbxStatus object.
+* This object is not used internally by the FBX SDK. It is provided for convenience and its usage is shown in the custom reader/writers samples. */
+class FBXSDK_DLL FbxStatusGlobal
+{
+public:
+	static FbxStatus& GetRef() 
+	{ 
+		if( !mStatusPtr )
+		{ 
+			mStatusPtr = FbxNew<FbxStatus>(); 
+		} 
+		return *mStatusPtr; 
+	}
+
+private:
+	FbxStatusGlobal(){ mStatusPtr = NULL; }
+	~FbxStatusGlobal(){ FbxDelete<FbxStatus>(mStatusPtr); }
+	static FbxStatusGlobal sgFbxStatusGlobal;
+	static FbxStatus* mStatusPtr;
+};
+
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_BASE_UTILITIES_H_ */

+ 166 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/fbxclassid.h

@@ -0,0 +1,166 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxclassid.h
+#ifndef _FBXSDK_CORE_CLASSID_H_
+#define _FBXSDK_CORE_CLASSID_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+class FbxClassIdInfo;
+class FbxObject;
+class FbxPropertyHandle;
+class FbxManager;
+
+//! The function pointer type for object constructor functions.
+typedef FbxObject* (*FbxObjectCreateProc)(FbxManager& pManager, const char* pName, const FbxObject* pFrom);
+
+/** Internal class used to differentiate objects during run-time. Essentially, each class has an unique ClassId, that the
+* system can request in order to test if the class match the description. This class implement the necessary tools to be able
+* to perform hierarchic class testing. This means that a class B that inherits from the class A will answer yes to a "Is A"
+* query of type A or B, but will answer no to a class C that can still inherit from A. All class must inherit from FbxObject
+* before they can have their own ClassId. When using the standard macros to create new types of objects in the FBX SDK, a
+* static ClassId will automatically be generated for that new class.
+*
+* When objects are exported to an FBX file, their class type is maintained using 3 sort of strings. They are the Object Type
+* string, the Object Sub Type string and the Object Type Prefix. There is no good or bad way to choose the value of these
+* identifiers, but it is preferable to use meaningful values to keep the ASCII version of FBX readable and easy to understand.
+* \see FbxObject */
+class FBXSDK_DLL FbxClassId
+{
+public:
+	//! Constructor.
+	FbxClassId();
+
+	/** Advanced constructor were we can specify the general parameters for this ClassId.
+	* \param pClassName The name of the class represented.
+	* \param pParentClassId The parent ClassId of this class.
+	* \param pConstructor A function pointer to a construction method for this ClassId.
+	* \param pFBXType The FBX file Object Type string associated to this class.
+	* \param pFBXSubType The FBX file Object Sub Type string associated to this class. */
+	FbxClassId(const char* pClassName, const FbxClassId& pParentClassId, FbxObjectCreateProc pConstructor=0, const char* pFBXType=NULL, const char* pFBXSubType=NULL);
+
+	//! Destructor.
+	void Destroy();
+
+	/** Retrieve the class name.
+	* \return The class identification string name. */
+	const char* GetName() const;
+
+    /** Retrieve the parent ClassId.
+	* \return The parent ClassId. */
+	FbxClassId GetParent() const;
+
+	/** Create an instance of this class.
+	* \param pManager The FBX SDK Manager to be used to instantiate this object. This allow the object to use the same memory manager as the provided manager.
+	* \param pName The name to assign to this new object instance.
+	* \param pFrom An object to clone if it matches the same ClassId. This is an optional parameter.
+	* \return The newly created instance of this class. */
+	FbxObject* Create(FbxManager& pManager, const char* pName, const FbxObject* pFrom);
+
+	/** Override the function pointer method to construct this object.
+	* \param pConstructor A newly defined function pointer to a construction method to replace the existing one.
+	* \return True if the operation was successful. */
+	bool Override(FbxObjectCreateProc pConstructor);
+
+	/** Test if this class is a hierarchical children of the specified class type. This is the standard method to differentiate object classes.
+	* \param pId The class type to test against self.
+	* \return True if the object is a hierarchical children of the type specified.
+	* \remark This function will perform a complete search until it reaches the top level class, but it will stop as soon as one ClassId matches the test. */
+	bool Is(const FbxClassId& pId) const;
+
+	/** Equivalence operator.
+	* \param pClassId The class type to test against self.
+	* \return \c true if the ClassId is exactly the same, \c false otherwise.
+	* \remark This function only perform direct equality test, and doesn't test hierarchic children. */
+	bool operator==(const FbxClassId& pClassId) const;
+
+	/** Inequivalence operator.
+	* \param pClassId The class type to test against self.
+	* \return \c true if the ClassId is not the same, \c false otherwise.
+	* \remark This function only perform direct inequality test, and doesn't test hierarchic children. */
+	bool operator!=(const FbxClassId& pClassId) const;
+
+	/** Retrieve the FBX file Object Type string associated to this class.
+	* \param pAskParent If \c true, retrieve the parent ClassId, but only if self ClassId is not valid.
+	* \return The FBX file Object Type string associated to this class. */
+	const char* GetFbxFileTypeName(bool pAskParent=false) const;
+
+	/** Retrieve the FBX file Object Sub Type string associated to this class.
+	* \return The FBX file Object Sub Type string associated to this class. */
+	const char* GetFbxFileSubTypeName() const;
+
+	/** Find out if self ClassId is valid or not.
+	* \return \c true if self ClassId is valid, \c false otherwise. */
+	inline bool IsValid() const { return mClassInfo ? true : false; }
+    
+	/** Set the Object Type Prefix string associated to this class. This will change the "ObjectTypePrefix::" found in front
+	* of object name in the FBX file. This is useful to differentiate objects by their name without using the Object Type or
+	* Sub Type strings in the file.
+	* \param pObjectTypePrefix The Object Type prefix string. */
+	void SetObjectTypePrefix(const char* pObjectTypePrefix);
+
+	/** Retrieve the Object Type Prefix string associated to this class.
+	* \return The Object Type Prefix string. */
+	const char* GetObjectTypePrefix();
+   
+	/** Retrieve the root property handle of this class. This is useful to access the default property hierarchy for this
+	* class. This allow users to retrieve information such as the default value for all properties of this class.
+	* \return The root property handle for this class. */
+	FbxPropertyHandle* GetRootClassDefaultPropertyHandle();
+
+	/** Increase the instance reference count for this class type.
+	* \return the new count of reference to this class after increment. */
+	int ClassInstanceIncRef();
+
+	/** Decrease the instance reference count for this class type.
+	* \return the new count of reference to this class after decrement. */
+	int ClassInstanceDecRef();
+	 
+	/** Retrieve the instance reference count for this class type.
+	* \return The reference count of this class type. */
+	int GetInstanceRef();
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+	inline FbxClassIdInfo* GetClassIdInfo() { return mClassInfo; }
+    inline const FbxClassIdInfo* GetClassIdInfo() const { return mClassInfo; }
+
+private:
+	FbxClassId(FbxClassIdInfo* mClassInfo);
+
+	bool SetFbxFileTypeName(const char* pName);
+	bool SetFbxFileSubTypeName(const char* pName);
+
+	FbxClassIdInfo* mClassInfo;
+
+	friend class FbxManager;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+//! Functor to compare FbxClassId
+struct FbxClassIdCompare
+{
+	inline int operator()(const FbxClassId& pKeyA, const FbxClassId& pKeyB) const
+	{
+		const FbxClassIdInfo* lKeyA = pKeyA.GetClassIdInfo();
+		const FbxClassIdInfo* lKeyB = pKeyB.GetClassIdInfo();
+		return lKeyA < lKeyB ? -1 : (lKeyA > lKeyB ? 1 : 0);
+	}
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_CLASSID_H_ */

+ 312 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/fbxconnectionpoint.h

@@ -0,0 +1,312 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxconnectionpoint.h
+#ifndef _FBXSDK_CORE_CONNECTION_POINT_H_
+#define _FBXSDK_CORE_CONNECTION_POINT_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/base/fbxarray.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+class FBXSDK_DLL FbxConnection
+{
+public:
+	enum EType
+	{ 
+		eNone = 0,
+		// System or user
+		eSystem = 1 << 0,
+		eUser = 1 << 1,
+		eSystemOrUser = eUser | eSystem,
+		// Type of Link
+		eReference = 1 << 2,
+		eContains = 1 << 3,
+		eData = 1 << 4,
+		eLinkType = eReference | eContains | eData,
+		eDefault = eUser | eReference,
+		eUnidirectional = 1 << 7
+	};
+};
+
+class FbxConnectionPointFilter;
+
+class FBXSDK_DLL FbxConnectionPoint
+{
+public:
+	enum EDirection
+	{ 
+		eDirSrc = 1 << 0,	// Contains sources
+		eDirDst = 1 << 1,	// Contains destinations
+		eDirUni = 1 << 2,	// Connection is not 2 ways
+		eDirBoth = eDirSrc | eDirDst,
+		eDirMask = eDirSrc | eDirDst | eDirUni
+	};
+
+	enum EType
+	{
+		eStandard = 0,
+		eSubConnection = 1 << 3,		// Connect is a sub Connect of another
+		eTypeMask = eSubConnection
+	}; 
+
+	enum EAttribute
+	{
+		eDefault = 0,
+		eCache = 1 << 4,			
+		eAttributeMask = eCache
+	}; 
+
+	enum EAllocFlag
+	{
+		eNotAllocated = 0,
+		eAllocated = 1 << 5,
+		eAllocFlagMask = eAllocated
+	};
+
+	enum ECleanedFlag
+	{
+		eNotCleaned = 0,
+		eCleaned = 1 << 6,
+		eCleanedFlagMask = eCleaned
+	};
+
+	enum EEvent
+	{
+		eSrcConnectRequest,
+		eDstConnectRequest,
+		eSrcConnect,
+		eDstConnect,
+		eSrcConnected,
+		eDstConnected,
+		eSrcDisconnect,
+		eDstDisconnect,
+		eSrcDisconnected,
+		eDstDisconnected,
+		eSrcReplaceBegin,
+		eSrcReplaceEnd,
+		eDstReplaceBegin,
+		eDstReplaceEnd,
+		eSrcReorder,
+		eSrcReordered
+	};
+
+	// Constructor/Destructor	
+	FbxConnectionPoint(void* pData=0);
+	virtual ~FbxConnectionPoint();
+
+	void SetFilter(FbxConnectionPointFilter* pConnectFilter, EType pType=eStandard);
+	void InternalClear();
+
+	//! Clear the ConnectList without any regards to what is connected
+	void WipeConnectionList();
+	void Destroy();
+	void SubConnectRemoveAll();
+
+	inline FbxConnectionPoint*			GetSubOwnerConnect(){ return GetConnectType() == eSubConnection ? mOwner : NULL; }
+	inline FbxConnectionPointFilter*	GetFilter(){ return mFilter; }
+
+	virtual bool		IsInReplace(FbxConnectionPoint* p1, FbxConnectionPoint* p2);
+
+	inline void			SetConnectType(EType pType){ mFlags = (mFlags & ~eTypeMask) | pType; }
+	inline EType		GetConnectType(){ return EType(mFlags & eTypeMask); }
+	inline void			SetDirection(int pDirections){ mFlags = (mFlags & ~eDirMask) | pDirections; }
+	inline EDirection	GetDirection(){ return EDirection(mFlags & eDirMask); }
+	inline void			SetAttribute(int pAttributes){ mFlags = (mFlags & ~eAttributeMask) | pAttributes; }
+	inline EAttribute	GetAttribute(){ return EAttribute(mFlags & eAttributeMask); }
+	inline void			SetAllocatedFlag(bool pBool){ mFlags = ( pBool ) ? mFlags | eAllocated : mFlags & ~eAllocFlagMask; }
+	inline bool			GetAllocatedFlag(){ return ( mFlags & eAllocFlagMask ) ? true : false; }
+	inline void			SetCleanedFlag(bool pBool){ mFlags = ( pBool ) ? mFlags | eCleaned : mFlags & ~eCleanedFlagMask; }
+	inline bool			GetCleanedFlag(){ return ( mFlags & eCleanedFlagMask ) ? true : false; }		
+
+	bool				IsValidSrc(FbxConnectionPoint* pConnect);
+	bool				IsValidDst(FbxConnectionPoint* pConnect);
+	bool				IsValidSrcConnection(FbxConnectionPoint* pConnect, FbxConnection::EType pConnectionType);
+	bool				IsValidDstConnection(FbxConnectionPoint* pConnect, FbxConnection::EType pConnectionType);
+	bool				RequestValidSrcConnection(FbxConnectionPoint* pConnect, FbxConnection::EType pConnectionType );
+	bool				RequestValidDstConnection(FbxConnectionPoint* pConnect, FbxConnection::EType pConnectionType );
+
+	bool				ConnectSrc(FbxConnectionPoint* pSrc,FbxConnection::EType pConnectionType=FbxConnection::eNone);
+	bool				ConnectDst(FbxConnectionPoint* pDst,FbxConnection::EType pConnectionType=FbxConnection::eNone);
+	bool				ConnectSrcAt(int pDst_SrcIndex, FbxConnectionPoint* pSrc, FbxConnection::EType pConnectionType=FbxConnection::eNone);
+	bool				ConnectDstAt(int pSrc_DstIndex, FbxConnectionPoint* pDst, FbxConnection::EType pConnectionType=FbxConnection::eNone);
+	static bool			ConnectConnect(FbxConnectionPoint* pSrc,FbxConnectionPoint* pDst,FbxConnection::EType pConnectionType);
+	static bool			ConnectAt(FbxConnectionPoint* pSrc, int pSrc_DstIndex, FbxConnectionPoint* pDst, int pDst_SrcIndex, FbxConnection::EType pConnectionType);
+
+	bool				DisconnectDst(FbxConnectionPoint* pSrc);
+	bool				DisconnectSrc(FbxConnectionPoint* pSrc);
+	void				DisconnectAllSrc();
+	void				DisconnectAllDst();
+	static bool			DisconnectConnect(FbxConnectionPoint* pSrc,FbxConnectionPoint* pDst);
+	bool				DisconnectDstAt(int pIndex);
+	bool				DisconnectSrcAt(int pIndex);
+
+	bool				ReplaceInDst(FbxConnectionPoint* pDstOld, FbxConnectionPoint* pDstNew, int pIndexInNew);
+	bool				ReplaceInSrc(FbxConnectionPoint* pSrcOld, FbxConnectionPoint* pSrcNew, int pIndexInNew);
+	bool				ReplaceDstAt(int pIndex, FbxConnectionPoint* pDst);
+	bool				ReplaceSrcAt(int pIndex, FbxConnectionPoint* pSrc);
+	bool				SwapSrc(int pIndexA, int pIndexB);
+
+	/** Change the position of a source Connect.
+	* \param pIndex	Position of the Connect to move.
+	* \param pAtIndex	Position where to move the Connect.
+	* \return			\c True if the Connect was moved.
+	* \remarks After the move, the Connect will be precisely at position pAtIndex.
+	*/
+	bool MoveSrcAt(int pIndex, int pAtIndex);
+
+	/** Change the position of a source Connect.
+	* \param pSrc		Connect to move.
+	* \param pAtSrc	Connect at which position to move.
+	* \return			\c True if the Connect was moved.
+	* \remarks After the move, the Connect will be precisely at the position where pAtSrc was before the move.
+	*/
+	bool MoveSrcAt(FbxConnectionPoint* pSrc, FbxConnectionPoint* pAtSrc);
+
+	// Access services
+	bool IsConnectedSrc(FbxConnectionPoint*);
+	bool IsConnectedDst(FbxConnectionPoint*);
+	inline bool IsConnected(FbxConnectionPoint* pConnect) { return IsConnectedSrc(pConnect) || IsConnectedDst(pConnect); }
+
+	inline int					GetSrcCount() const { return mConnectionList.GetSrcCount(); }
+	inline FbxConnectionPoint*	GetSrc(int pIndex) const { return mConnectionList.GetSrc(pIndex);}
+	inline FbxConnection::EType	GetSrcType(int pIndex) const { return mConnectionList.GetSrcType(pIndex);}
+	inline int					GetDstCount() const { return mConnectionList.GetDstCount(); }
+	inline FbxConnectionPoint*	GetDst(int pIndex) const { return mConnectionList.GetDst(pIndex);}
+	inline FbxConnection::EType	GetDstType(int pIndex) const { return mConnectionList.GetDstType(pIndex);}
+
+	inline int					FindSrc(FbxConnectionPoint* pConnect){ return mConnectionList.FindSrc(pConnect); }
+	inline int					FindDst(FbxConnectionPoint* pConnect){ return mConnectionList.FindDst(pConnect); }
+
+	// Filtered versions	
+	inline int					GetSrcCount(FbxConnectionPointFilter* pFilter){ return (pFilter) ? SubConnectGetOrCreate(pFilter)->GetSrcCount() : GetSrcCount(); }
+	inline FbxConnectionPoint*	GetSrc(int pIndex,FbxConnectionPointFilter* pFilter){ return (pFilter) ? SubConnectGetOrCreate(pFilter)->GetSrc(pIndex) : GetSrc(pIndex); }
+	inline FbxConnection::EType	GetSrcType(int pIndex,FbxConnectionPointFilter* pFilter){ return (pFilter) ? SubConnectGetOrCreate(pFilter)->GetSrcType(pIndex) : GetSrcType(pIndex); }
+	inline int					GetDstCount(FbxConnectionPointFilter* pFilter){ return (pFilter) ? SubConnectGetOrCreate(pFilter)->GetDstCount() : GetDstCount(); }
+	inline FbxConnectionPoint*	GetDst(int pIndex,FbxConnectionPointFilter* pFilter){ return (pFilter) ? SubConnectGetOrCreate(pFilter)->GetDst(pIndex): GetDst(pIndex); }
+	inline FbxConnection::EType	GetDstType(int pIndex,FbxConnectionPointFilter* pFilter){ return (pFilter) ? SubConnectGetOrCreate(pFilter)->GetDstType(pIndex) : GetDstType(pIndex); }
+
+	void* GetData(){ return mData; }
+
+/*****************************************************************************************************************************
+** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
+*****************************************************************************************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+protected:
+	class ConnectionList
+	{
+	public:
+		ConnectionList();
+		~ConnectionList();
+
+		void					Clear();
+
+		void					InsertSrcAt(int pIndex, FbxConnectionPoint* pConnect, FbxConnection::EType pType);
+		void					AddSrc(FbxConnectionPoint* pConnect, FbxConnection::EType pType);
+		void					RemoveSrcAt(int pIndex);
+		int						FindSrc(FbxConnectionPoint* pConnect) const;
+		int						GetSrcCount() const; 
+		FbxConnectionPoint*		GetSrc(int pIndex) const;
+		FbxConnection::EType	GetSrcType(int pIndex) const;
+
+		void					InsertDstAt(int pIndex, FbxConnectionPoint* pConnect, FbxConnection::EType pType);
+		void					AddDst(FbxConnectionPoint* pConnect, FbxConnection::EType pType);
+		void					RemoveDstAt(int pIndex);
+		int						FindDst(FbxConnectionPoint* pConnect) const;
+		int						GetDstCount() const;
+		FbxConnectionPoint*		GetDst(int pIndex) const;
+		FbxConnection::EType	GetDstType(int pIndex) const;
+
+	protected:
+		struct Connection {
+			Connection(FbxConnectionPoint* pPoint, FbxConnection::EType pType) : mPoint(pPoint), mType(pType){}
+			FbxConnectionPoint* mPoint; FbxConnection::EType mType;
+		};
+		FbxArray<Connection>	mSrcList;
+		FbxArray<Connection>	mDstList;
+	};
+
+	void				SubConnectAdd(FbxConnectionPoint* pConnect);
+	void				SubConnectRemove(FbxConnectionPoint* pConnect);
+	FbxConnectionPoint* SubConnectFind(FbxConnectionPointFilter* pFilter);
+	FbxConnectionPoint* SubConnectGetOrCreate(FbxConnectionPointFilter* pFilter);
+	void				SubConnectFill(FbxConnectionPoint*	pConnect);
+
+	virtual	bool		ConnectNotify(EEvent pAction, FbxConnectionPoint* pThis, int pIndex, FbxConnectionPoint* pConnect=NULL, FbxConnection::EType pConnectionType=FbxConnection::eNone, FbxConnectionPoint* pNewConnect=NULL);
+	virtual void		ConnectCleanUp(FbxConnectionPoint* pThis);
+
+	int					FindSrcIndexFromOwnerConnectIndex(FbxConnectionPoint* pOwner, int pOwnerIndex);
+	int					FindDstIndexFromOwnerConnectIndex(FbxConnectionPoint* pOwner, int pOwnerIndex);
+
+	bool				InternalMoveSrcBefore(int pIndex, int pBeforeIndex);
+
+private:
+	inline void			InsertSrcAt(int pIndex, FbxConnectionPoint* pConnect, FbxConnection::EType pConnectionType){ mConnectionList.InsertSrcAt(pIndex, pConnect, pConnectionType); }
+	inline void			InsertDstAt(int pIndex, FbxConnectionPoint* pConnect, FbxConnection::EType pConnectionType){ mConnectionList.InsertDstAt(pIndex, pConnect, pConnectionType); }
+	inline void			RemoveSrcAt(int pIndex){ mConnectionList.RemoveSrcAt(pIndex); }
+	inline void			RemoveDstAt(int pIndex){ mConnectionList.RemoveDstAt(pIndex); }    	
+
+	static bool			InternalConnectBefore(FbxConnectionPoint* pSrc, FbxConnectionPoint* pSrc_BeforeDst, FbxConnectionPoint* pDst, FbxConnectionPoint* pDst_BeforeSrc, FbxConnection::EType pConnectionType);
+	static bool			UserConnectBefore(FbxConnectionPoint* pSrc, FbxConnectionPoint* pSrc_BeforeDst, FbxConnectionPoint* pDst, FbxConnectionPoint* pDst_BeforeSrc, FbxConnection::EType pConnectionType);
+	static bool			EmitReplaceNotify(FbxConnectionPoint* pDstOwner, FbxConnectionPoint* pSrcOwner, FbxConnectionPoint* pDst, FbxConnectionPoint* pSrc, EEvent pConnectAction, FbxConnectionPoint* pNew);
+
+	virtual bool				SetOwnerConnect(FbxConnectionPoint* pConnect);
+	inline FbxConnectionPoint*	GetOwnerConnect(){ return mOwner;  }
+	bool						ConnectOwnedConnect(FbxConnectionPoint* pConnect);
+	bool						DisconnectOwnedConnect(FbxConnectionPoint* pConnect);
+
+	void*							mData;
+	int								mFlags;
+	FbxConnectionPoint*				mOwner;
+	ConnectionList					mConnectionList;
+	FbxArray<FbxConnectionPoint*>	mSubConnectList;
+	FbxArray<FbxConnectionPoint*>	mSubConnectCreatedList;		
+	FbxConnectionPointFilter*		mFilter;
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
+};
+
+/** Class to manage Connect Filter */
+class FBXSDK_DLL FbxConnectionPointFilter
+{
+public: 
+    virtual ~FbxConnectionPointFilter() {};
+    
+	//! Return reference ConnectionPoint filter.
+	virtual FbxConnectionPointFilter* Ref();
+
+	//! Cancel reference
+	virtual void Unref();
+
+	//! Get unique filter ID
+	virtual FbxInt GetUniqueId() const { return 0; }
+
+	/** Judge if the given Connection Point is valid
+	* \param pConnect The given Connection Point.
+	* \return \c True if valid, \c false if not valid. */
+	virtual bool IsValid(FbxConnectionPoint* pConnect) const;
+
+	/** Judge if the given Connection Point is a valid connection
+	* \param pConnect The given Connection Point.
+	* \param pType Connection type.
+	* \return \c True if valid, \c false if not valid. */
+	virtual bool IsValidConnection(FbxConnectionPoint* pConnect, FbxConnection::EType pType) const;
+
+	/** Judge if it is equal with the given  ConnectionPoint filter.
+	* \param pConnectFilter The given  ConnectionPoint filter.
+	* \return \c True if equal, \c false if unequal. */
+	virtual bool IsEqual(FbxConnectionPointFilter* pConnectFilter) const;
+};
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_CONNECTION_POINT_H_ */

+ 267 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/fbxdatatypes.h

@@ -0,0 +1,267 @@
+/****************************************************************************************
+ 
+   Copyright (C) 2015 Autodesk, Inc.
+   All rights reserved.
+ 
+   Use of this software is subject to the terms of the Autodesk license agreement
+   provided at the time of installation or download, or which otherwise accompanies
+   this software in either electronic or hard copy form.
+ 
+****************************************************************************************/
+
+//! \file fbxdatatypes.h
+#ifndef _FBXSDK_CORE_DATA_TYPES_H_
+#define _FBXSDK_CORE_DATA_TYPES_H_
+
+#include <fbxsdk/fbxsdk_def.h>
+
+#include <fbxsdk/core/fbxpropertytypes.h>
+#include <fbxsdk/core/fbxpropertyhandle.h>
+
+#include <fbxsdk/fbxsdk_nsbegin.h>
+
+/** FBX SDK data type class
+  * \nosubgrouping
+  */
+class FBXSDK_DLL FbxDataType
+{
+public:
+	static FbxDataType Create(const char* pName, const EFbxType pType);
+	static FbxDataType Create(const char* pName, const FbxDataType& pDataType);
+
+	/**
+	  *\name Constructor and Destructor.
+	  */
+	//@{
+		//! Constructor.
+		FbxDataType();
+
+		/** Copy constructor.
+		  * \param pDataType Another FbxDataType object copied to this one.
+		  */
+		FbxDataType(const FbxDataType& pDataType);
+
+		//! Destroy this datatype.
+		void Destroy();
+
+		/** Constructor.
+		  * \param pTypeInfoHandle Type information handle
+		  */
+		FbxDataType(const FbxPropertyHandle& pTypeInfoHandle);
+
+		//! Destructor.
+		~FbxDataType();
+	//@}
+
+	/** Assignment operator
+	  * \param pDataType Datatype whose value is assigned to this datatype.
+	  * \return This datatype
+	  */
+    inline FbxDataType& operator=(const FbxDataType& pDataType){ mTypeInfoHandle=pDataType.mTypeInfoHandle; return *this; }
+
+	/**
+	  * \name boolean operation
+	  */
+	//@{
+		/** Equality operator
+		  * \param pDataType Datatype to compare to.
+		  * \return \c true if equal,\c false otherwise.
+		  */
+		inline bool operator==(const FbxDataType& pDataType) const { return mTypeInfoHandle==pDataType.mTypeInfoHandle; }
+
+		/** Non-equality operator
+		  * \param pDataType Datatype to compare to.
+		  * \return \c true if unequal,\c false otherwise.
+		  */
+		inline bool operator!=(const FbxDataType& pDataType) const { return mTypeInfoHandle!=pDataType.mTypeInfoHandle; }
+	//@}
+
+	/** Test whether this datatype is a valid datatype.
+	  * \return \c true if valid, \c false otherwise.
+	  */
+	inline bool Valid() const { return mTypeInfoHandle.Valid(); }
+
+	/** Test if this datatype is the specified datatype. 
+	  * \param pDataType Datatype to compare to.
+	  * \return \c true if this datatype is the specified datatype, \c false otherwise. 
+	  */
+	inline bool Is(const FbxDataType& pDataType) const { return mTypeInfoHandle.Is(pDataType.mTypeInfoHandle); }
+
+	/** Retrieve this data type.
+	  * \return This data type.
+	  */
+	EFbxType GetType() const;
+
+	/** Retrieve data type name.
+	  * \return Data type name.
+	  */
+	const char* GetName() const;
+
+	/** Retrieve the information handle of this data type.
+	  * \return Information handle of this data type.
+	  */
+	inline const FbxPropertyHandle& GetTypeInfoHandle() const { return mTypeInfoHandle; }
+
+private:
+	FbxPropertyHandle mTypeInfoHandle;
+    friend class FbxManager;
+};
+
+/** Retrieve data type from type enumeration index
+  * \param pType The type enumeration index
+  * \return The corresponding data type
+  */
+FBXSDK_DLL const FbxDataType& FbxGetDataTypeFromEnum(const EFbxType pType);
+
+/** Retrieve data type name string used by I/O operations
+  * \param pDataType The data type instance to retrieve its I/O name string
+  * \return The data type name string
+  * \remark This function is only used during I/O operations. It is not equal
+  *         to the actual data type name.
+  */
+FBXSDK_DLL const char* FbxGetDataTypeNameForIO(const FbxDataType& pDataType);
+
+//! \name Basic Data Types
+//@{
+	extern FBXSDK_DLL FbxDataType FbxUndefinedDT;
+	extern FBXSDK_DLL FbxDataType FbxBoolDT;
+	extern FBXSDK_DLL FbxDataType FbxCharDT;
+	extern FBXSDK_DLL FbxDataType FbxUCharDT;
+	extern FBXSDK_DLL FbxDataType FbxShortDT;
+	extern FBXSDK_DLL FbxDataType FbxUShortDT;
+	extern FBXSDK_DLL FbxDataType FbxIntDT;
+	extern FBXSDK_DLL FbxDataType FbxUIntDT;
+	extern FBXSDK_DLL FbxDataType FbxLongLongDT;
+	extern FBXSDK_DLL FbxDataType FbxULongLongDT;
+	extern FBXSDK_DLL FbxDataType FbxFloatDT;
+	extern FBXSDK_DLL FbxDataType FbxHalfFloatDT;
+	extern FBXSDK_DLL FbxDataType FbxDoubleDT;
+	extern FBXSDK_DLL FbxDataType FbxDouble2DT;
+	extern FBXSDK_DLL FbxDataType FbxDouble3DT;
+	extern FBXSDK_DLL FbxDataType FbxDouble4DT;
+	extern FBXSDK_DLL FbxDataType FbxDouble4x4DT;
+	extern FBXSDK_DLL FbxDataType FbxEnumDT;
+	extern FBXSDK_DLL FbxDataType FbxStringDT;
+	extern FBXSDK_DLL FbxDataType FbxTimeDT;
+	extern FBXSDK_DLL FbxDataType FbxReferenceDT;
+	extern FBXSDK_DLL FbxDataType FbxBlobDT;
+	extern FBXSDK_DLL FbxDataType FbxDistanceDT;
+	extern FBXSDK_DLL FbxDataType FbxDateTimeDT;
+//@}
+
+//! \name Extended Data Types
+//@{
+	extern FBXSDK_DLL FbxDataType FbxColor3DT;
+	extern FBXSDK_DLL FbxDataType FbxColor4DT;
+	extern FBXSDK_DLL FbxDataType FbxCompoundDT;
+	extern FBXSDK_DLL FbxDataType FbxReferenceObjectDT;
+	extern FBXSDK_DLL FbxDataType FbxReferencePropertyDT;
+	extern FBXSDK_DLL FbxDataType FbxVisibilityDT;
+	extern FBXSDK_DLL FbxDataType FbxVisibilityInheritanceDT;
+	extern FBXSDK_DLL FbxDataType FbxUrlDT;
+	extern FBXSDK_DLL FbxDataType FbxXRefUrlDT;
+//@}
+
+//! \name Transform Data Types
+//@{
+	extern FBXSDK_DLL FbxDataType FbxTranslationDT;
+	extern FBXSDK_DLL FbxDataType FbxRotationDT;
+	extern FBXSDK_DLL FbxDataType FbxScalingDT;
+	extern FBXSDK_DLL FbxDataType FbxQuaternionDT;
+	extern FBXSDK_DLL FbxDataType FbxLocalTranslationDT;
+	extern FBXSDK_DLL FbxDataType FbxLocalRotationDT;
+	extern FBXSDK_DLL FbxDataType FbxLocalScalingDT;
+	extern FBXSDK_DLL FbxDataType FbxLocalQuaternionDT;
+	extern FBXSDK_DLL FbxDataType FbxTransformMatrixDT;
+	extern FBXSDK_DLL FbxDataType FbxTranslationMatrixDT;
+	extern FBXSDK_DLL FbxDataType FbxRotationMatrixDT;
+	extern FBXSDK_DLL FbxDataType FbxScalingMatrixDT;
+//@}
+
+//! \name Material Data Types
+//@{
+	extern FBXSDK_DLL FbxDataType FbxMaterialEmissiveDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialEmissiveFactorDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialAmbientDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialAmbientFactorDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialDiffuseDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialDiffuseFactorDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialBumpDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialNormalMapDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialTransparentColorDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialTransparencyFactorDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialSpecularDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialSpecularFactorDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialShininessDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialReflectionDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialReflectionFactorDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialDisplacementDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialVectorDisplacementDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialCommonFactorDT;
+	extern FBXSDK_DLL FbxDataType FbxMaterialCommonTextureDT;
+//@}
+
+//! \name Layer Element Data Types
+//@{
+	extern FBXSDK_DLL FbxDataType FbxLayerElementUndefinedDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementNormalDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementBinormalDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementTangentDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementMaterialDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementTextureDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementPolygonGroupDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementUVDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementVertexColorDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementSmoothingDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementCreaseDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementHoleDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementUserDataDT;
+	extern FBXSDK_DLL FbxDataType FbxLayerElementVisibilityDT;
+//@}
+
+//! \name I/O Specialized Data Types
+//@{
+	extern FBXSDK_DLL FbxDataType FbxAliasDT;
+	extern FBXSDK_DLL FbxDataType FbxPresetsDT;
+	extern FBXSDK_DLL FbxDataType FbxStatisticsDT;
+	extern FBXSDK_DLL FbxDataType FbxTextLineDT;
+	extern FBXSDK_DLL FbxDataType FbxUnitsDT;
+	extern FBXSDK_DLL FbxDataType FbxWarningDT;
+	extern FBXSDK_DLL FbxDataType FbxWebDT;
+//@}
+
+//! \name External Support Data Types
+//@{
+	extern FBXSDK_DLL FbxDataType FbxActionDT;
+	extern FBXSDK_DLL FbxDataType FbxCameraIndexDT;
+	extern FBXSDK_DLL FbxDataType FbxCharPtrDT;
+	extern FBXSDK_DLL FbxDataType FbxConeAngleDT;
+	extern FBXSDK_DLL FbxDataType FbxEventDT;
+	extern FBXSDK_DLL FbxDataType FbxFieldOfViewDT;
+	extern FBXSDK_DLL FbxDataType FbxFieldOfViewXDT;
+	extern FBXSDK_DLL FbxDataType FbxFieldOfViewYDT;
+	extern FBXSDK_DLL FbxDataType FbxFogDT;
+	extern FBXSDK_DLL FbxDataType FbxHSBDT;
+	extern FBXSDK_DLL FbxDataType FbxIKReachTranslationDT;
+	extern FBXSDK_DLL FbxDataType FbxIKReachRotationDT;
+	extern FBXSDK_DLL FbxDataType FbxIntensityDT;
+	extern FBXSDK_DLL FbxDataType FbxLookAtDT;
+	extern FBXSDK_DLL FbxDataType FbxOcclusionDT;
+	extern FBXSDK_DLL FbxDataType FbxOpticalCenterXDT;
+	extern FBXSDK_DLL FbxDataType FbxOpticalCenterYDT;
+	extern FBXSDK_DLL FbxDataType FbxOrientationDT;
+	extern FBXSDK_DLL FbxDataType FbxRealDT;
+	extern FBXSDK_DLL FbxDataType FbxRollDT;
+	extern FBXSDK_DLL FbxDataType FbxScalingUVDT;
+	extern FBXSDK_DLL FbxDataType FbxShapeDT;
+	extern FBXSDK_DLL FbxDataType FbxStringListDT;
+	extern FBXSDK_DLL FbxDataType FbxTextureRotationDT;
+	extern FBXSDK_DLL FbxDataType FbxTimeCodeDT;
+	extern FBXSDK_DLL FbxDataType FbxTimeWarpDT;
+	extern FBXSDK_DLL FbxDataType FbxTranslationUVDT;
+	extern FBXSDK_DLL FbxDataType FbxWeightDT;
+//@}
+
+#include <fbxsdk/fbxsdk_nsend.h>
+
+#endif /* _FBXSDK_CORE_DATA_TYPES_H_ */

+ 0 - 0
Exporters/FBX/3rdParty/Fbx2016.1/include/fbxsdk/core/fbxemitter.h


Some files were not shown because too many files changed in this diff