瀏覽代碼

Merge pull request #1 from BabylonJS/master

Update from Original
Fernando Garcia 9 年之前
父節點
當前提交
0b82c1cf6b
共有 100 個文件被更改,包括 9450 次插入12055 次删除
  1. 1 0
      .gitattributes
  2. 7 0
      .gitignore
  3. 2 2
      .travis.yml
  4. 48 48
      Exporters/3ds Max/BabylonExport.Entities/BabylonAbstractMesh.cs
  5. 39 39
      Exporters/3ds Max/BabylonExport.Entities/BabylonActions.cs
  6. 42 41
      Exporters/3ds Max/BabylonExport.Entities/BabylonAnimation.cs
  7. 14 14
      Exporters/3ds Max/BabylonExport.Entities/BabylonAnimationKey.cs
  8. 28 28
      Exporters/3ds Max/BabylonExport.Entities/BabylonBone.cs
  9. 84 84
      Exporters/3ds Max/BabylonExport.Entities/BabylonCamera.cs
  10. 27 27
      Exporters/3ds Max/BabylonExport.Entities/BabylonFresnelParameters.cs
  11. 19 19
      Exporters/3ds Max/BabylonExport.Entities/BabylonIAnimatable.cs
  12. 20 20
      Exporters/3ds Max/BabylonExport.Entities/BabylonLensFlare.cs
  13. 17 17
      Exporters/3ds Max/BabylonExport.Entities/BabylonLensFlareSystem.cs
  14. 76 76
      Exporters/3ds Max/BabylonExport.Entities/BabylonLight.cs
  15. 85 80
      Exporters/3ds Max/BabylonExport.Entities/BabylonMaterial.cs
  16. 122 122
      Exporters/3ds Max/BabylonExport.Entities/BabylonMesh.cs
  17. 17 17
      Exporters/3ds Max/BabylonExport.Entities/BabylonMultiMaterial.cs
  18. 86 86
      Exporters/3ds Max/BabylonExport.Entities/BabylonParticleSystem.cs
  19. 185 185
      Exporters/3ds Max/BabylonExport.Entities/BabylonScene.cs
  20. 39 36
      Exporters/3ds Max/BabylonExport.Entities/BabylonShadowGenerator.cs
  21. 20 17
      Exporters/3ds Max/BabylonExport.Entities/BabylonSkeleton.cs
  22. 86 86
      Exporters/3ds Max/BabylonExport.Entities/BabylonSound.cs
  23. 24 24
      Exporters/3ds Max/BabylonExport.Entities/BabylonSubMesh.cs
  24. 87 87
      Exporters/3ds Max/BabylonExport.Entities/BabylonTexture.cs
  25. 36 36
      Exporters/3ds Max/BabylonExport.Entities/BabylonVector3.cs
  26. 二進制
      Exporters/3ds Max/Max2Babylon-0.17.zip
  27. 二進制
      Exporters/3ds Max/Max2Babylon-0.4.6.zip
  28. 8 8
      Exporters/3ds Max/Max2Babylon/BabylonActionCallback.cs
  29. 71 71
      Exporters/3ds Max/Max2Babylon/BabylonExportActionItem.cs
  30. 91 91
      Exporters/3ds Max/Max2Babylon/BabylonPropertiesActionItem.cs
  31. 52 52
      Exporters/3ds Max/Max2Babylon/Descriptor.cs
  32. 0 98
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/action.js
  33. 0 234
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/actionkinds.js
  34. 0 141
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/contextmenu.js
  35. 0 152
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/fonts.css
  36. 0 210
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/index.css
  37. 0 207
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/index.html
  38. 0 284
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/list.js
  39. 0 307
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/parametersManager.js
  40. 0 11
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/raphael.js
  41. 0 216
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/utils.js
  42. 0 750
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/viewer.js
  43. 0 87
      Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/viewsertoolbar.js
  44. 315 299
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Animation.cs
  45. 127 127
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Camera.cs
  46. 223 218
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Light.cs
  47. 149 149
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Material.cs
  48. 726 726
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Mesh.cs
  49. 66 65
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.ShadowGenerator.cs
  50. 135 132
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Skeleton.cs
  51. 244 238
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Texture.cs
  52. 322 322
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.cs
  53. 69 69
      Exporters/3ds Max/Max2Babylon/Exporter/GlobalVertex.cs
  54. 98 98
      Exporters/3ds Max/Max2Babylon/Forms/ActionsBuilderForm.Designer.cs
  55. 170 170
      Exporters/3ds Max/Max2Babylon/Forms/ActionsBuilderForm.cs
  56. 119 119
      Exporters/3ds Max/Max2Babylon/Forms/ActionsBuilderForm.resx
  57. 415 415
      Exporters/3ds Max/Max2Babylon/Forms/CameraPropertiesForm.Designer.cs
  58. 71 71
      Exporters/3ds Max/Max2Babylon/Forms/CameraPropertiesForm.cs
  59. 119 119
      Exporters/3ds Max/Max2Babylon/Forms/CameraPropertiesForm.resx
  60. 319 319
      Exporters/3ds Max/Max2Babylon/Forms/ExporterForm.Designer.cs
  61. 229 229
      Exporters/3ds Max/Max2Babylon/Forms/ExporterForm.cs
  62. 320 320
      Exporters/3ds Max/Max2Babylon/Forms/ExporterForm.resx
  63. 419 405
      Exporters/3ds Max/Max2Babylon/Forms/LightPropertiesForm.Designer.cs
  64. 67 65
      Exporters/3ds Max/Max2Babylon/Forms/LightPropertiesForm.cs
  65. 119 119
      Exporters/3ds Max/Max2Babylon/Forms/LightPropertiesForm.resx
  66. 943 943
      Exporters/3ds Max/Max2Babylon/Forms/ObjectPropertiesForm.Designer.cs
  67. 122 122
      Exporters/3ds Max/Max2Babylon/Forms/ObjectPropertiesForm.cs
  68. 122 122
      Exporters/3ds Max/Max2Babylon/Forms/ObjectPropertiesForm.resx
  69. 286 272
      Exporters/3ds Max/Max2Babylon/Forms/ScenePropertiesForm.Designer.cs
  70. 49 47
      Exporters/3ds Max/Max2Babylon/Forms/ScenePropertiesForm.cs
  71. 122 122
      Exporters/3ds Max/Max2Babylon/Forms/ScenePropertiesForm.resx
  72. 152 152
      Exporters/3ds Max/Max2Babylon/Forms/Vector3Control.Designer.cs
  73. 30 30
      Exporters/3ds Max/Max2Babylon/Forms/Vector3Control.cs
  74. 119 119
      Exporters/3ds Max/Max2Babylon/Forms/Vector3Control.resx
  75. 128 128
      Exporters/3ds Max/Max2Babylon/GlobalUtility.cs
  76. 19 19
      Exporters/3ds Max/Max2Babylon/JsonTextWriterOptimized.cs
  77. 29 29
      Exporters/3ds Max/Max2Babylon/Loader.cs
  78. 二進制
      Exporters/3ds Max/Max2Babylon/Refs/BabylonFileConverter.dll
  79. 16 16
      Exporters/3ds Max/Max2Babylon/Tools/Tools.cs
  80. 4 3
      Exporters/3ds Max/readme.md
  81. 589 264
      Exporters/Blender/io_export_babylon.py
  82. 0 122
      Exporters/Blender/io_scene_map/__init__.py
  83. 0 508
      Exporters/Blender/io_scene_map/export_map.py
  84. 8 4
      Exporters/Blender/readme.md
  85. 64 59
      Exporters/FBX/BabylonFbxNative/BabylonMesh.cpp
  86. 2 0
      Exporters/FBX/readme.md
  87. 1 1
      Exporters/Unity 5/Unity3D2Babylon/ExporterWindow.cs
  88. 103 20
      Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.Meshes.cs
  89. 69 9
      Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.cs
  90. 1 0
      Tools/ActionsBuilder/Sources/actionsbuilder.actionNode.js
  91. 1 0
      Tools/ActionsBuilder/Sources/actionsbuilder.contextMenu.js
  92. 1 0
      Tools/ActionsBuilder/Sources/actionsbuilder.js
  93. 6 1
      Tools/ActionsBuilder/Sources/actionsbuilder.list.js
  94. 4 0
      Tools/ActionsBuilder/Sources/actionsbuilder.main.js
  95. 95 20
      Tools/ActionsBuilder/Sources/actionsbuilder.max.js
  96. 87 19
      Tools/ActionsBuilder/Sources/actionsbuilder.parameters.js
  97. 1 0
      Tools/ActionsBuilder/Sources/actionsbuilder.toolbar.js
  98. 1 0
      Tools/ActionsBuilder/Sources/actionsbuilder.utils.js
  99. 2 0
      Tools/ActionsBuilder/Sources/actionsbuilder.viewer.js
  100. 0 0
      Tools/ActionsBuilder/Sources/babylon.max.js

+ 1 - 0
.gitattributes

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

+ 7 - 0
.gitignore

@@ -119,3 +119,10 @@ UpgradeLog*.XML
 
 # Do not ignore loaders/obj
 !loaders/*
+node_modules
+
+# for JetBrains IDE
+.idea
+
+# for VSCode
+.vscode

+ 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

+ 48 - 48
Exporters/3ds Max/BabylonExport.Entities/BabylonAbstractMesh.cs

@@ -1,48 +1,48 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonAbstractMesh: BabylonIAnimatable
-    {
-        [DataMember]
-        public string name { get; set; }
-        
-        [DataMember]
-        public float[] position { get; set; }
-
-        [DataMember]
-        public float[] rotation { get; set; }
-
-        [DataMember]
-        public float[] scaling { get; set; }
-
-        [DataMember]
-        public float[] rotationQuaternion { get; set; }
-
-        [DataMember]
-        public BabylonActions actions { get; set; }
-
-        [DataMember]
-        public BabylonAnimation[] animations { get; set; }
-
-        [DataMember]
-        public bool autoAnimate { get; set; }
-
-        [DataMember]
-        public int autoAnimateFrom { get; set; }
-
-        [DataMember]
-        public int autoAnimateTo { get; set; }
-
-        [DataMember]
-        public bool autoAnimateLoop { get; set; }
-
-        public BabylonAbstractMesh()
-        {
-            position = new[] { 0f, 0f, 0f };
-            rotation = new[] { 0f, 0f, 0f };
-            scaling = new[] { 1f, 1f, 1f };
-        }
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonAbstractMesh: BabylonIAnimatable
+    {
+        [DataMember]
+        public string name { get; set; }
+        
+        [DataMember]
+        public float[] position { get; set; }
+
+        [DataMember]
+        public float[] rotation { get; set; }
+
+        [DataMember]
+        public float[] scaling { get; set; }
+
+        [DataMember]
+        public float[] rotationQuaternion { get; set; }
+
+        [DataMember]
+        public BabylonActions actions { get; set; }
+
+        [DataMember]
+        public BabylonAnimation[] animations { get; set; }
+
+        [DataMember]
+        public bool autoAnimate { get; set; }
+
+        [DataMember]
+        public int autoAnimateFrom { get; set; }
+
+        [DataMember]
+        public int autoAnimateTo { get; set; }
+
+        [DataMember]
+        public bool autoAnimateLoop { get; set; }
+
+        public BabylonAbstractMesh()
+        {
+            position = new[] { 0f, 0f, 0f };
+            rotation = new[] { 0f, 0f, 0f };
+            scaling = new[] { 1f, 1f, 1f };
+        }
+    }
+}

+ 39 - 39
Exporters/3ds Max/BabylonExport.Entities/BabylonActions.cs

@@ -1,39 +1,39 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonActionsProperties
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string value { get; set; }
-
-        [DataMember]
-        public string targetType { get; set; }
-    }
-
-    [DataContract]
-    public class BabylonActions
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public int type { get; set; }
-
-        [DataMember]
-        public bool detached { get; set; }
-
-        [DataMember]
-        public BabylonActions[] children { get; set; }
-
-        [DataMember]
-        public BabylonActions[] combine { get; set; }
-
-        [DataMember]
-        public BabylonActionsProperties[] properties { get; set; }
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonActionsProperties
+    {
+        [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public string value { get; set; }
+
+        [DataMember]
+        public string targetType { get; set; }
+    }
+
+    [DataContract]
+    public class BabylonActions
+    {
+        [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public int type { get; set; }
+
+        [DataMember]
+        public bool detached { get; set; }
+
+        [DataMember]
+        public BabylonActions[] children { get; set; }
+
+        [DataMember]
+        public BabylonActions[] combine { get; set; }
+
+        [DataMember]
+        public BabylonActionsProperties[] properties { get; set; }
+    }
+}

+ 42 - 41
Exporters/3ds Max/BabylonExport.Entities/BabylonAnimation.cs

@@ -1,41 +1,42 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonAnimation
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string property { get; set; }
-
-        [DataMember]
-        public int dataType { get; set; }
-
-        [DataMember]
-        public int loopBehavior { get; set; }
-
-        [DataMember]
-        public int framePerSecond { get; set; }
-
-        [DataMember]
-        public BabylonAnimationKey[] keys { get; set; }
-
-        public enum DataType
-        {
-            Float = 0,
-            Vector3 = 1,
-            Quaternion = 2,
-            Matrix = 3
-        }
-
-        public enum LoopBehavior
-        {
-            Relative = 0,
-            Cycle = 1,
-            Constant = 2
-        }
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonAnimation
+    {
+        [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public string property { get; set; }
+
+        [DataMember]
+        public int dataType { get; set; }
+
+        [DataMember]
+        public int loopBehavior { get; set; }
+
+        [DataMember]
+        public int framePerSecond { get; set; }
+
+        [DataMember]
+        public BabylonAnimationKey[] keys { get; set; }
+
+        public enum DataType
+        {
+            Float = 0,
+            Vector3 = 1,
+            Quaternion = 2,
+            Matrix = 3,
+            Color3 = 4,
+        }
+
+        public enum LoopBehavior
+        {
+            Relative = 0,
+            Cycle = 1,
+            Constant = 2
+        }
+    }
+}

+ 14 - 14
Exporters/3ds Max/BabylonExport.Entities/BabylonAnimationKey.cs

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

+ 28 - 28
Exporters/3ds Max/BabylonExport.Entities/BabylonBone.cs

@@ -1,28 +1,28 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonBone
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public int index { get; set; }
-
-        [DataMember]
-        public int parentBoneIndex { get; set; }
-
-        [DataMember]
-        public float[] matrix { get; set; }
-
-        [DataMember]
-        public BabylonAnimation animation { get; set; }
-
-        public BabylonBone()
-        {
-            parentBoneIndex = -1;
-        }
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonBone
+    {
+        [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public int index { get; set; }
+
+        [DataMember]
+        public int parentBoneIndex { get; set; }
+
+        [DataMember]
+        public float[] matrix { get; set; }
+
+        [DataMember]
+        public BabylonAnimation animation { get; set; }
+
+        public BabylonBone()
+        {
+            parentBoneIndex = -1;
+        }
+    }
+}

+ 84 - 84
Exporters/3ds Max/BabylonExport.Entities/BabylonCamera.cs

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

+ 27 - 27
Exporters/3ds Max/BabylonExport.Entities/BabylonFresnelParameters.cs

@@ -1,27 +1,27 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonFresnelParameters
-    {
-        [DataMember]
-        public float[] leftColor { get; set; }
-
-        [DataMember]
-        public float[] rightColor { get; set; }
-
-        [DataMember]
-        public bool isEnabled { get; set; }
-
-        [DataMember]
-        public float bias { get; set; }
-
-        [DataMember]
-        public float power { get; set; }
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonFresnelParameters
+    {
+        [DataMember]
+        public float[] leftColor { get; set; }
+
+        [DataMember]
+        public float[] rightColor { get; set; }
+
+        [DataMember]
+        public bool isEnabled { get; set; }
+
+        [DataMember]
+        public float bias { get; set; }
+
+        [DataMember]
+        public float power { get; set; }
+    }
+}

+ 19 - 19
Exporters/3ds Max/BabylonExport.Entities/BabylonIAnimatable.cs

@@ -1,19 +1,19 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace BabylonExport.Entities
-{
-    public interface BabylonIAnimatable
-    {
-        BabylonAnimation[] animations { get; set; }
-        bool autoAnimate { get; set; }
-
-        int autoAnimateFrom { get; set; }
-
-        int autoAnimateTo { get; set; }
-
-        bool autoAnimateLoop { get; set; }
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace BabylonExport.Entities
+{
+    public interface BabylonIAnimatable
+    {
+        BabylonAnimation[] animations { get; set; }
+        bool autoAnimate { get; set; }
+
+        int autoAnimateFrom { get; set; }
+
+        int autoAnimateTo { get; set; }
+
+        bool autoAnimateLoop { get; set; }
+    }
+}

+ 20 - 20
Exporters/3ds Max/BabylonExport.Entities/BabylonLensFlare.cs

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

+ 17 - 17
Exporters/3ds Max/BabylonExport.Entities/BabylonLensFlareSystem.cs

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

+ 76 - 76
Exporters/3ds Max/BabylonExport.Entities/BabylonLight.cs

@@ -1,76 +1,76 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonLight : BabylonIAnimatable
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string id { get; set; }
-
-        [DataMember]
-        public string parentId { get; set; }
-
-        [DataMember]
-        public float[] position { get; set; }
-
-        [DataMember]
-        public float[] direction { get; set; }
-
-        [DataMember]
-        public int type { get; set; }
-
-        [DataMember]
-        public float[] diffuse { get; set; }
-
-        [DataMember]
-        public float[] specular { get; set; }
-
-        [DataMember]
-        public float intensity { get; set; }
-
-        [DataMember]
-        public float range { get; set; }
-
-        [DataMember]
-        public float exponent { get; set; }
-
-        [DataMember]
-        public float angle { get; set; }
-
-        [DataMember]
-        public float[] groundColor { get; set; }
-
-        [DataMember]
-        public string[] excludedMeshesIds { get; set; }
-
-        [DataMember]
-        public string[] includedOnlyMeshesIds { get; set; }
-
-        [DataMember]
-        public bool autoAnimate { get; set; }
-
-        [DataMember]
-        public int autoAnimateFrom { get; set; }
-
-        [DataMember]
-        public int autoAnimateTo { get; set; }
-
-        [DataMember]
-        public bool autoAnimateLoop { get; set; }
-
-        [DataMember]
-        public BabylonAnimation[] animations { get; set; }
-
-        public BabylonLight()
-        {
-            diffuse = new[] {1.0f, 1.0f, 1.0f};
-            specular = new[] { 1.0f, 1.0f, 1.0f };
-            intensity = 1.0f;
-            range = float.MaxValue;
-        }
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonLight : BabylonIAnimatable
+    {
+        [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public string id { get; set; }
+
+        [DataMember]
+        public string parentId { get; set; }
+
+        [DataMember]
+        public float[] position { get; set; }
+
+        [DataMember]
+        public float[] direction { get; set; }
+
+        [DataMember]
+        public int type { get; set; }
+
+        [DataMember]
+        public float[] diffuse { get; set; }
+
+        [DataMember]
+        public float[] specular { get; set; }
+
+        [DataMember]
+        public float intensity { get; set; }
+
+        [DataMember]
+        public float range { get; set; }
+
+        [DataMember]
+        public float exponent { get; set; }
+
+        [DataMember]
+        public float angle { get; set; }
+
+        [DataMember]
+        public float[] groundColor { get; set; }
+
+        [DataMember]
+        public string[] excludedMeshesIds { get; set; }
+
+        [DataMember]
+        public string[] includedOnlyMeshesIds { get; set; }
+
+        [DataMember]
+        public bool autoAnimate { get; set; }
+
+        [DataMember]
+        public int autoAnimateFrom { get; set; }
+
+        [DataMember]
+        public int autoAnimateTo { get; set; }
+
+        [DataMember]
+        public bool autoAnimateLoop { get; set; }
+
+        [DataMember]
+        public BabylonAnimation[] animations { get; set; }
+
+        public BabylonLight()
+        {
+            diffuse = new[] {1.0f, 1.0f, 1.0f};
+            specular = new[] { 1.0f, 1.0f, 1.0f };
+            intensity = 1.0f;
+            range = float.MaxValue;
+        }
+    }
+}

+ 85 - 80
Exporters/3ds Max/BabylonExport.Entities/BabylonMaterial.cs

@@ -1,80 +1,85 @@
-using System.Runtime.Serialization;
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonMaterial
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public string id { get; set; }
-
-        [DataMember]
-        public bool backFaceCulling { get; set; }
-
-        [DataMember]
-        public bool wireframe { get; set; }
-
-        [DataMember]
-        public float[] ambient { get; set; }
-
-        [DataMember]
-        public float[] diffuse { get; set; }
-
-        [DataMember]
-        public float[] specular { get; set; }
-
-        [DataMember]
-        public float[] emissive { get; set; }
-
-        [DataMember]
-        public float specularPower { get; set; }
-
-        [DataMember]
-        public float alpha { get; set; }
-
-        [DataMember]
-        public BabylonTexture diffuseTexture { get; set; }
-
-        [DataMember]
-        public BabylonFresnelParameters diffuseFresnelParameters { get; set; }
-
-        [DataMember]
-        public BabylonTexture ambientTexture { get; set; }
-
-        [DataMember]
-        public BabylonTexture opacityTexture { get; set; }
-
-        [DataMember]
-        public BabylonFresnelParameters opacityFresnelParameters { get; set; }
-
-        [DataMember]
-        public BabylonTexture reflectionTexture { get; set; }
-
-        [DataMember]
-        public BabylonFresnelParameters reflectionFresnelParameters { get; set; }
-
-        [DataMember]
-        public BabylonTexture emissiveTexture { get; set; }
-        [DataMember]
-        public BabylonFresnelParameters emissiveFresnelParameters { get; set; }
-
-        [DataMember]
-        public BabylonTexture specularTexture { get; set; }
-
-        [DataMember]
-        public BabylonTexture bumpTexture { get; set; }
-
-        public BabylonMaterial()
-        {
-            backFaceCulling = true;
-            ambient = new[] {1.0f, 1.0f, 1.0f};
-            diffuse = new[] { 1.0f, 1.0f, 1.0f };
-            specular = new[] { 1.0f, 1.0f, 1.0f };
-            emissive = new[] { 0f, 0f, 0f };
-            specularPower = 64;
-            alpha = 1.0f;
-        }
-    }
-}
+using System.Runtime.Serialization;
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonMaterial
+    {
+        [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public string id { get; set; }
+
+        [DataMember]
+        public bool backFaceCulling { get; set; }
+
+        [DataMember]
+        public bool wireframe { get; set; }
+
+        [DataMember]
+        public float[] ambient { get; set; }
+
+        [DataMember]
+        public float[] diffuse { get; set; }
+
+        [DataMember]
+        public float[] specular { get; set; }
+
+        [DataMember]
+        public float[] emissive { get; set; }
+
+        [DataMember]
+        public float specularPower { get; set; }
+
+        [DataMember]
+        public float alpha { get; set; }
+
+        [DataMember]
+        public BabylonTexture diffuseTexture { get; set; }
+
+        [DataMember]
+        public BabylonFresnelParameters diffuseFresnelParameters { get; set; }
+
+        [DataMember]
+        public BabylonTexture ambientTexture { get; set; }
+
+        [DataMember]
+        public BabylonTexture opacityTexture { get; set; }
+
+        [DataMember]
+        public BabylonFresnelParameters opacityFresnelParameters { get; set; }
+
+        [DataMember]
+        public BabylonTexture reflectionTexture { get; set; }
+
+        [DataMember]
+        public BabylonFresnelParameters reflectionFresnelParameters { get; set; }
+
+        [DataMember]
+        public BabylonTexture emissiveTexture { get; set; }
+        [DataMember]
+        public BabylonTexture lightmapTexture { get; set; }
+        [DataMember]
+        public bool useLightmapAsShadowmap { get; set; }
+
+        [DataMember]
+        public BabylonFresnelParameters emissiveFresnelParameters { get; set; }
+
+        [DataMember]
+        public BabylonTexture specularTexture { get; set; }
+
+        [DataMember]
+        public BabylonTexture bumpTexture { get; set; }
+
+        public BabylonMaterial()
+        {
+            backFaceCulling = true;
+            ambient = new[] {1.0f, 1.0f, 1.0f};
+            diffuse = new[] { 1.0f, 1.0f, 1.0f };
+            specular = new[] { 1.0f, 1.0f, 1.0f };
+            emissive = new[] { 0f, 0f, 0f };
+            specularPower = 64;
+            alpha = 1.0f;
+        }
+    }
+}

+ 122 - 122
Exporters/3ds Max/BabylonExport.Entities/BabylonMesh.cs

@@ -1,122 +1,122 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonMesh : BabylonAbstractMesh
-    {
-        [DataMember]
-        public string id { get; set; }
-
-        [DataMember]
-        public string parentId { get; set; }
-
-        [DataMember]
-        public string materialId { get; set; }
-
-        [DataMember]
-        public bool isEnabled { get; set; }
-
-        [DataMember]
-        public bool isVisible { get; set; }
-
-        [DataMember]
-        public bool pickable { get; set; }
-
-        [DataMember]
-        public float[] pivotMatrix { get; set; }
-
-        [DataMember]
-        public float[] positions { get; set; }
-
-        [DataMember]
-        public float[] normals { get; set; }
-
-        [DataMember]
-        public float[] uvs { get; set; }
-
-        [DataMember]
-        public float[] uvs2 { get; set; }
-
-        [DataMember]
-        public float[] colors { get; set; }
-
-        [DataMember]
-        public bool hasVertexAlpha { get; set; }
-
-        [DataMember]
-        public int[] matricesIndices { get; set; }
-
-        [DataMember]
-        public float[] matricesWeights { get; set; }
-
-        [DataMember]
-        public int[] indices { get; set; }
-
-        [DataMember]
-        public bool checkCollisions { get; set; }
-
-        [DataMember]
-        public bool receiveShadows { get; set; }    
-    
-        [DataMember]
-        public bool infiniteDistance { get; set; }
-        
-        [DataMember]
-        public int billboardMode { get; set; }
-
-        [DataMember]
-        public float visibility { get; set; }
-
-        [DataMember]
-        public BabylonSubMesh[] subMeshes { get; set; }
-
-        [DataMember]
-        public BabylonAbstractMesh[] instances { get; set; }
-
-        [DataMember]
-        public int skeletonId { get; set; }
-
-        [DataMember]
-        public bool showBoundingBox { get; set; }
-
-        [DataMember]
-        public bool showSubMeshesBoundingBox { get; set; }
-
-        [DataMember]
-        public bool applyFog { get; set; }
-
-        [DataMember]
-        public int alphaIndex { get; set; }
-
-        [DataMember]
-        public int physicsImpostor { get; set; }
-
-        [DataMember]
-        public float physicsMass { get; set; }
-
-        [DataMember]
-        public float physicsFriction { get; set; }
-
-        [DataMember]
-        public float physicsRestitution { get; set; }
-
-        public BabylonMesh()
-        {
-            isEnabled = true;
-            isVisible = true;
-
-            position = new[] { 0f, 0f, 0f };
-            rotation = new[] { 0f, 0f, 0f };
-            scaling = new[] { 1f, 1f, 1f };
-
-            billboardMode = 0;
-
-            visibility = 1.0f;
-
-            skeletonId = -1;
-
-            pickable = true;
-        }
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonMesh : BabylonAbstractMesh
+    {
+        [DataMember]
+        public string id { get; set; }
+
+        [DataMember]
+        public string parentId { get; set; }
+
+        [DataMember]
+        public string materialId { get; set; }
+
+        [DataMember]
+        public bool isEnabled { get; set; }
+
+        [DataMember]
+        public bool isVisible { get; set; }
+
+        [DataMember]
+        public bool pickable { get; set; }
+
+        [DataMember]
+        public float[] pivotMatrix { get; set; }
+
+        [DataMember]
+        public float[] positions { get; set; }
+
+        [DataMember]
+        public float[] normals { get; set; }
+
+        [DataMember]
+        public float[] uvs { get; set; }
+
+        [DataMember]
+        public float[] uvs2 { get; set; }
+
+        [DataMember]
+        public float[] colors { get; set; }
+
+        [DataMember]
+        public bool hasVertexAlpha { get; set; }
+
+        [DataMember]
+        public int[] matricesIndices { get; set; }
+
+        [DataMember]
+        public float[] matricesWeights { get; set; }
+
+        [DataMember]
+        public int[] indices { get; set; }
+
+        [DataMember]
+        public bool checkCollisions { get; set; }
+
+        [DataMember]
+        public bool receiveShadows { get; set; }    
+    
+        [DataMember]
+        public bool infiniteDistance { get; set; }
+        
+        [DataMember]
+        public int billboardMode { get; set; }
+
+        [DataMember]
+        public float visibility { get; set; }
+
+        [DataMember]
+        public BabylonSubMesh[] subMeshes { get; set; }
+
+        [DataMember]
+        public BabylonAbstractMesh[] instances { get; set; }
+
+        [DataMember]
+        public int skeletonId { get; set; }
+
+        [DataMember]
+        public bool showBoundingBox { get; set; }
+
+        [DataMember]
+        public bool showSubMeshesBoundingBox { get; set; }
+
+        [DataMember]
+        public bool applyFog { get; set; }
+
+        [DataMember]
+        public int alphaIndex { get; set; }
+
+        [DataMember]
+        public int physicsImpostor { get; set; }
+
+        [DataMember]
+        public float physicsMass { get; set; }
+
+        [DataMember]
+        public float physicsFriction { get; set; }
+
+        [DataMember]
+        public float physicsRestitution { get; set; }
+
+        public BabylonMesh()
+        {
+            isEnabled = true;
+            isVisible = true;
+
+            position = new[] { 0f, 0f, 0f };
+            rotation = new[] { 0f, 0f, 0f };
+            scaling = new[] { 1f, 1f, 1f };
+
+            billboardMode = 0;
+
+            visibility = 1.0f;
+
+            skeletonId = -1;
+
+            pickable = true;
+        }
+    }
+}

+ 17 - 17
Exporters/3ds Max/BabylonExport.Entities/BabylonMultiMaterial.cs

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

+ 86 - 86
Exporters/3ds Max/BabylonExport.Entities/BabylonParticleSystem.cs

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

+ 185 - 185
Exporters/3ds Max/BabylonExport.Entities/BabylonScene.cs

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

+ 39 - 36
Exporters/3ds Max/BabylonExport.Entities/BabylonShadowGenerator.cs

@@ -1,36 +1,39 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonShadowGenerator
-    {
-        [DataMember]
-        public int mapSize { get; set; }
-
-        [DataMember]
-        public float bias { get; set; }
-
-        [DataMember]
-        public string lightId { get; set; }
-
-        [DataMember]
-        public bool useVarianceShadowMap { get; set; }
-
-        [DataMember]
-        public bool usePoissonSampling { get; set; }
-
-        [DataMember]
-        public bool useBlurVarianceShadowMap { get; set; }
-
-        [DataMember]
-        public float blurScale { get; set; }
-
-        [DataMember]
-        public float blurBoxOffset { get; set; }
-
-        [DataMember]
-        public string[] renderList { get; set; }
-
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonShadowGenerator
+    {
+        [DataMember]
+        public int mapSize { get; set; }
+
+        [DataMember]
+        public float bias { get; set; }
+
+        [DataMember]
+        public string lightId { get; set; }
+
+        [DataMember]
+        public bool useVarianceShadowMap { get; set; }
+
+        [DataMember]
+        public bool usePoissonSampling { get; set; }
+
+        [DataMember]
+        public bool useBlurVarianceShadowMap { get; set; }
+
+        [DataMember]
+        public float blurScale { get; set; }
+
+        [DataMember]
+        public float blurBoxOffset { get; set; }
+
+        [DataMember]
+        public string[] renderList { get; set; }
+
+        [DataMember]
+        public bool forceBackFacesOnly { get; set; }
+
+    }
+}

+ 20 - 17
Exporters/3ds Max/BabylonExport.Entities/BabylonSkeleton.cs

@@ -1,17 +1,20 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonSkeleton
-    {
-        [DataMember]
-        public int id { get; set; }
-        
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public BabylonBone[] bones { get; set; }
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonSkeleton
+    {
+        [DataMember]
+        public int id { get; set; }
+        
+        [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public BabylonBone[] bones { get; set; }
+
+        [DataMember]
+        public bool needInitialSkinMatrix { get; set; }
+    }
+}

+ 86 - 86
Exporters/3ds Max/BabylonExport.Entities/BabylonSound.cs

@@ -1,86 +1,86 @@
-using System.Runtime.Serialization;
-
-namespace BabylonExport.Entities
-{
-    [DataContract]
-    public class BabylonSound
-    {
-        [DataMember]
-        public string name { get; set; }
-
-        [DataMember]
-        public float volume { get; set; }
-
-        [DataMember]
-        public float playbackRate { get; set; }
-
-        [DataMember]
-        public bool autoplay { get; set; }
-
-        [DataMember]
-        public bool loop { get; set; }
-
-        [DataMember]
-        public int soundTrackId { get; set; }
-
-        [DataMember]
-        public bool spatialSound { get; set; }
-
-        [DataMember]
-        public float[] position { get; set; }
-
-        [DataMember]
-        public float refDistance { get; set; }
-
-        [DataMember]
-        public float rolloffFactor { get; set; }
-
-        [DataMember]
-        public float maxDistance { get; set; }
-
-        [DataMember]
-        public string distanceModel { get; set; }
-
-        [DataMember]
-        public string panningModel { get; set; }
-
-        [DataMember]
-        public bool isDirectional { get; set; }
-
-        [DataMember]
-        public float coneInnerAngle { get; set; }
-
-        [DataMember]
-        public float coneOuterAngle { get; set; }
-
-        [DataMember]
-        public float coneOuterGain { get; set; }
-
-        [DataMember]
-        public string connectedMeshId { get; set; }
-
-        [DataMember]
-        public float[] localDirectionToMesh { get; set; }
-
-        public BabylonSound()
-        {
-            volume = 1;
-            playbackRate = 1;
-            autoplay = false;
-            loop = false;
-            soundTrackId = -1;
-            spatialSound = false;
-            position = new[] { 0f, 0f, 0f };
-            refDistance = 1;
-            rolloffFactor = 1;
-            maxDistance = 100;
-            distanceModel = "linear";
-            panningModel = "equalpower";
-            isDirectional = false;
-            coneInnerAngle = 360;
-            coneOuterAngle = 360;
-            coneOuterGain = 0;
-            localDirectionToMesh = new[] { 1f, 0f, 0f };
-        }
-    }
-}
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonSound
+    {
+        [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public float volume { get; set; }
+
+        [DataMember]
+        public float playbackRate { get; set; }
+
+        [DataMember]
+        public bool autoplay { get; set; }
+
+        [DataMember]
+        public bool loop { get; set; }
+
+        [DataMember]
+        public int soundTrackId { get; set; }
+
+        [DataMember]
+        public bool spatialSound { get; set; }
+
+        [DataMember]
+        public float[] position { get; set; }
+
+        [DataMember]
+        public float refDistance { get; set; }
+
+        [DataMember]
+        public float rolloffFactor { get; set; }
+
+        [DataMember]
+        public float maxDistance { get; set; }
+
+        [DataMember]
+        public string distanceModel { get; set; }
+
+        [DataMember]
+        public string panningModel { get; set; }
+
+        [DataMember]
+        public bool isDirectional { get; set; }
+
+        [DataMember]
+        public float coneInnerAngle { get; set; }
+
+        [DataMember]
+        public float coneOuterAngle { get; set; }
+
+        [DataMember]
+        public float coneOuterGain { get; set; }
+
+        [DataMember]
+        public string connectedMeshId { get; set; }
+
+        [DataMember]
+        public float[] localDirectionToMesh { get; set; }
+
+        public BabylonSound()
+        {
+            volume = 1;
+            playbackRate = 1;
+            autoplay = false;
+            loop = false;
+            soundTrackId = -1;
+            spatialSound = false;
+            position = new[] { 0f, 0f, 0f };
+            refDistance = 1;
+            rolloffFactor = 1;
+            maxDistance = 100;
+            distanceModel = "linear";
+            panningModel = "equalpower";
+            isDirectional = false;
+            coneInnerAngle = 360;
+            coneOuterAngle = 360;
+            coneOuterGain = 0;
+            localDirectionToMesh = new[] { 1f, 0f, 0f };
+        }
+    }
+}

+ 24 - 24
Exporters/3ds Max/BabylonExport.Entities/BabylonSubMesh.cs

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

+ 87 - 87
Exporters/3ds Max/BabylonExport.Entities/BabylonTexture.cs

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

+ 36 - 36
Exporters/3ds Max/BabylonExport.Entities/BabylonVector3.cs

@@ -1,36 +1,36 @@
-using System;
-
-namespace BabylonExport.Entities
-{
-    public class BabylonVector3
-    {
-        public float X { get; set; }
-        public float Y { get; set; }
-        public float Z { get; set; }
-
-        public float[] ToArray()
-        {
-            return new [] {X, Y, Z};
-        }
-
-        public float Length()
-        {
-            return (float)Math.Sqrt(X * X + Y * Y + Z * Z);
-        }
-
-        public static BabylonVector3 operator +(BabylonVector3 a, BabylonVector3 b)
-        {
-            return new BabylonVector3 {X = a.X + b.X, Y = a.Y + b.Y, Z = a.Z + b.Z};
-        }
-
-        public static BabylonVector3 operator -(BabylonVector3 a, BabylonVector3 b)
-        {
-            return new BabylonVector3 { X = a.X - b.X, Y = a.Y - b.Y, Z = a.Z - b.Z };
-        }
-
-        public static BabylonVector3 operator /(BabylonVector3 a, float b)
-        {
-            return new BabylonVector3 { X = a.X / b, Y = a.Y / b, Z = a.Z / b };
-        }
-    }
-}
+using System;
+
+namespace BabylonExport.Entities
+{
+    public class BabylonVector3
+    {
+        public float X { get; set; }
+        public float Y { get; set; }
+        public float Z { get; set; }
+
+        public float[] ToArray()
+        {
+            return new [] {X, Y, Z};
+        }
+
+        public float Length()
+        {
+            return (float)Math.Sqrt(X * X + Y * Y + Z * Z);
+        }
+
+        public static BabylonVector3 operator +(BabylonVector3 a, BabylonVector3 b)
+        {
+            return new BabylonVector3 {X = a.X + b.X, Y = a.Y + b.Y, Z = a.Z + b.Z};
+        }
+
+        public static BabylonVector3 operator -(BabylonVector3 a, BabylonVector3 b)
+        {
+            return new BabylonVector3 { X = a.X - b.X, Y = a.Y - b.Y, Z = a.Z - b.Z };
+        }
+
+        public static BabylonVector3 operator /(BabylonVector3 a, float b)
+        {
+            return new BabylonVector3 { X = a.X / b, Y = a.Y / b, Z = a.Z / b };
+        }
+    }
+}

二進制
Exporters/3ds Max/Max2Babylon-0.17.zip


二進制
Exporters/3ds Max/Max2Babylon-0.4.6.zip


+ 8 - 8
Exporters/3ds Max/Max2Babylon/BabylonActionCallback.cs

@@ -1,8 +1,8 @@
-using Autodesk.Max.Plugins;
-
-namespace Max2Babylon
-{
-    class BabylonActionCallback : ActionCallback
-    {
-    }
-}
+using Autodesk.Max.Plugins;
+
+namespace Max2Babylon
+{
+    class BabylonActionCallback : ActionCallback
+    {
+    }
+}

+ 71 - 71
Exporters/3ds Max/Max2Babylon/BabylonExportActionItem.cs

@@ -1,71 +1,71 @@
-using System.Windows.Forms;
-using ActionItem = Autodesk.Max.Plugins.ActionItem;
-
-namespace Max2Babylon
-{
-    public class BabylonExportActionItem : ActionItem
-    {
-        private ExporterForm form;
-
-        public override bool ExecuteAction()
-        {
-            if (form == null)
-                form = new ExporterForm(this);
-            form.Show();
-            form.BringToFront();
-            form.WindowState = FormWindowState.Normal;
-
-            return true;
-        }
-
-        public void Close()
-        {
-            if (form == null)
-            {
-                return;
-            }
-            form.Dispose();
-            form = null;
-        }
-
-        public override int Id_
-        {
-            get { return 1; }
-        }
-
-        public override string ButtonText
-        {
-            get { return "Babylon File Exporter"; }
-        }
-
-        public override string MenuText
-        {
-            get { return "&Babylon File Exporter..."; }
-        }
-
-        public override string DescriptionText
-        {
-            get { return "Generate a babylon.js scene file2"; }
-        }
-
-        public override string CategoryText
-        {
-            get { return "Babylon"; }
-        }
-
-        public override bool IsChecked_
-        {
-            get { return false; }
-        }
-
-        public override bool IsItemVisible
-        {
-            get { return true; }
-        }
-
-        public override bool IsEnabled_
-        {
-            get { return true; }
-        }
-    }
-}
+using System.Windows.Forms;
+using ActionItem = Autodesk.Max.Plugins.ActionItem;
+
+namespace Max2Babylon
+{
+    public class BabylonExportActionItem : ActionItem
+    {
+        private ExporterForm form;
+
+        public override bool ExecuteAction()
+        {
+            if (form == null)
+                form = new ExporterForm(this);
+            form.Show();
+            form.BringToFront();
+            form.WindowState = FormWindowState.Normal;
+
+            return true;
+        }
+
+        public void Close()
+        {
+            if (form == null)
+            {
+                return;
+            }
+            form.Dispose();
+            form = null;
+        }
+
+        public override int Id_
+        {
+            get { return 1; }
+        }
+
+        public override string ButtonText
+        {
+            get { return "Babylon File Exporter"; }
+        }
+
+        public override string MenuText
+        {
+            get { return "&Babylon File Exporter..."; }
+        }
+
+        public override string DescriptionText
+        {
+            get { return "Generate a babylon.js scene file2"; }
+        }
+
+        public override string CategoryText
+        {
+            get { return "Babylon"; }
+        }
+
+        public override bool IsChecked_
+        {
+            get { return false; }
+        }
+
+        public override bool IsItemVisible
+        {
+            get { return true; }
+        }
+
+        public override bool IsEnabled_
+        {
+            get { return true; }
+        }
+    }
+}

+ 91 - 91
Exporters/3ds Max/Max2Babylon/BabylonPropertiesActionItem.cs

@@ -1,91 +1,91 @@
-using Autodesk.Max;
-using ActionItem = Autodesk.Max.Plugins.ActionItem;
-
-namespace Max2Babylon
-{
-    public class BabylonPropertiesActionItem : ActionItem
-    {
-        public override bool ExecuteAction()
-        {
-            if (Loader.Core.SelNodeCount == 0)
-            {
-                using (var frm = new ScenePropertiesForm())
-                {
-                    frm.ShowDialog();
-                    return true;
-                }
-            }
-
-            var firstNode = Loader.Core.GetSelNode(0);
-
-            if (firstNode.ObjectRef != null && firstNode.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Camera)
-            {
-                using (var frm = new CameraPropertiesForm())
-                {
-                    frm.ShowDialog();
-                    return true;
-                }
-            }
-
-           
-
-            if (firstNode.ObjectRef != null && firstNode.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Light)
-            {
-                using (var frm = new LightPropertiesForm())
-                {
-                    frm.ShowDialog();
-                    return true;
-                }
-            }
-           
-            // consider non-recognized objects as meshes so they can be animated intermediate nodes
-            using (var frm = new ObjectPropertiesForm())
-            {
-                frm.ShowDialog();
-                return true;
-            }
-            
-
-        }
-
-        public override int Id_
-        {
-            get { return 1; }
-        }
-
-        public override string ButtonText
-        {
-            get { return "Babylon Properties"; }
-        }
-
-        public override string MenuText
-        {
-            get { return "Babylon Properties"; }
-        }
-
-        public override string DescriptionText
-        {
-            get { return "UI for setting Babylon.js specific properties"; }
-        }
-
-        public override string CategoryText
-        {
-            get { return "Babylon"; }
-        }
-
-        public override bool IsChecked_
-        {
-            get { return false; }
-        }
-
-        public override bool IsItemVisible
-        {
-            get { return true; }
-        }
-
-        public override bool IsEnabled_
-        {
-            get { return true; }
-        }
-    }
-}
+using Autodesk.Max;
+using ActionItem = Autodesk.Max.Plugins.ActionItem;
+
+namespace Max2Babylon
+{
+    public class BabylonPropertiesActionItem : ActionItem
+    {
+        public override bool ExecuteAction()
+        {
+            if (Loader.Core.SelNodeCount == 0)
+            {
+                using (var frm = new ScenePropertiesForm())
+                {
+                    frm.ShowDialog();
+                    return true;
+                }
+            }
+
+            var firstNode = Loader.Core.GetSelNode(0);
+
+            if (firstNode.ObjectRef != null && firstNode.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Camera)
+            {
+                using (var frm = new CameraPropertiesForm())
+                {
+                    frm.ShowDialog();
+                    return true;
+                }
+            }
+
+           
+
+            if (firstNode.ObjectRef != null && firstNode.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Light)
+            {
+                using (var frm = new LightPropertiesForm())
+                {
+                    frm.ShowDialog();
+                    return true;
+                }
+            }
+           
+            // consider non-recognized objects as meshes so they can be animated intermediate nodes
+            using (var frm = new ObjectPropertiesForm())
+            {
+                frm.ShowDialog();
+                return true;
+            }
+            
+
+        }
+
+        public override int Id_
+        {
+            get { return 1; }
+        }
+
+        public override string ButtonText
+        {
+            get { return "Babylon Properties"; }
+        }
+
+        public override string MenuText
+        {
+            get { return "Babylon Properties"; }
+        }
+
+        public override string DescriptionText
+        {
+            get { return "UI for setting Babylon.js specific properties"; }
+        }
+
+        public override string CategoryText
+        {
+            get { return "Babylon"; }
+        }
+
+        public override bool IsChecked_
+        {
+            get { return false; }
+        }
+
+        public override bool IsItemVisible
+        {
+            get { return true; }
+        }
+
+        public override bool IsEnabled_
+        {
+            get { return true; }
+        }
+    }
+}

+ 52 - 52
Exporters/3ds Max/Max2Babylon/Descriptor.cs

@@ -1,52 +1,52 @@
-using Autodesk.Max;
-
-namespace Max2Babylon
-{
-    public class Descriptor : Autodesk.Max.Plugins.ClassDesc2
-    {
-        public override object Create(bool loading)
-        {
-            return new GlobalUtility();
-        }
-
-        public override bool IsPublic
-        {
-            get
-            {
-                return true;
-            }
-        }
-
-        public override string ClassName
-        {
-            get
-            {
-                return "Babylon File Exporter";
-            }
-        }
-
-        public override SClass_ID SuperClassID
-        {
-            get
-            {
-                return SClass_ID.Gup;
-            }
-        }
-
-        public override IClass_ID ClassID
-        {
-            get
-            {
-                return Loader.Class_ID;
-            }
-        }
-
-        public override string Category
-        {
-            get
-            {
-                return "Babylon";
-            }
-        }
-    }
-}
+using Autodesk.Max;
+
+namespace Max2Babylon
+{
+    public class Descriptor : Autodesk.Max.Plugins.ClassDesc2
+    {
+        public override object Create(bool loading)
+        {
+            return new GlobalUtility();
+        }
+
+        public override bool IsPublic
+        {
+            get
+            {
+                return true;
+            }
+        }
+
+        public override string ClassName
+        {
+            get
+            {
+                return "Babylon File Exporter";
+            }
+        }
+
+        public override SClass_ID SuperClassID
+        {
+            get
+            {
+                return SClass_ID.Gup;
+            }
+        }
+
+        public override IClass_ID ClassID
+        {
+            get
+            {
+                return Loader.Class_ID;
+            }
+        }
+
+        public override string Category
+        {
+            get
+            {
+                return "Babylon";
+            }
+        }
+    }
+}

+ 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%;
-}

文件差異過大導致無法顯示
+ 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 - 11
Exporters/3ds Max/Max2Babylon/Exporter/ActionBuilder/ActionsBuilder/raphael.js


+ 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 = {}));

+ 315 - 299
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Animation.cs

@@ -1,299 +1,315 @@
-using System;
-using System.Collections.Generic;
-using Autodesk.Max;
-using BabylonExport.Entities;
-
-namespace Max2Babylon
-{
-    partial class BabylonExporter
-    {
-        const int Ticks = 160;
-
-        private static BabylonAnimationKey GenerateFloatFunc(int index, IIKeyControl keyControl)
-        {
-            var key = Loader.Global.ILinFloatKey.Create();
-            keyControl.GetKey(index, key);
-
-            return new BabylonAnimationKey
-            {
-                frame = key.Time / Ticks,
-                values = new[] { key.Val }
-            };
-        }
-
-        private static bool ExportFloatController(IControl control, string property, List<BabylonAnimation> animations)
-        {
-            return ExportController(control, property, animations, 0x2001, BabylonAnimation.DataType.Float, GenerateFloatFunc);
-        }
-
-        private static bool ExportQuaternionController(IControl control, string property, List<BabylonAnimation> animations)
-        {
-            IQuat previousQuat = null;
-
-            return ExportController(control, property, animations, 0x2003, BabylonAnimation.DataType.Quaternion,
-                (index, keyControl) =>
-                {
-                    var key = Loader.Global.ILinRotKey.Create();
-                    keyControl.GetKey(index, key);
-                    var newQuat = key.Val;
-
-                    if (index > 0)
-                    {
-                        newQuat = previousQuat.Multiply(newQuat);
-                    }
-
-                    previousQuat = newQuat;
-
-                    return new BabylonAnimationKey
-                    {
-                        frame = key.Time / Ticks,
-                        values = newQuat.ToArray()
-                    };
-                });
-        }
-
-        private static bool ExportVector3Controller(IControl control, string property, List<BabylonAnimation> animations)
-        {
-            var result = false;
-
-            if (control == null)
-            {
-                return false;
-            }
-
-            if (control.XController != null || control.YController != null || control.ZController != null)
-            {
-                result |= ExportFloatController(control.XController, property + ".x", animations);
-                result |= ExportFloatController(control.ZController, property + ".y", animations);
-                result |= ExportFloatController(control.YController, property + ".z", animations);
-
-                return result;
-            }
-
-            if (ExportController(control, property, animations, 0x2002, BabylonAnimation.DataType.Vector3,
-                (index, keyControl) =>
-                {
-                    var key = Loader.Global.ILinPoint3Key.Create();
-                    keyControl.GetKey(index, key);
-
-                    return new BabylonAnimationKey
-                    {
-                        frame = key.Time / Ticks,
-                        values = key.Val.ToArraySwitched()
-                    };
-                }))
-            {
-                return true;
-            }
-
-            return ExportController(control, property, animations, 0x2004, BabylonAnimation.DataType.Vector3,
-                (index, keyControl) =>
-                {
-                    var key = Loader.Global.ILinScaleKey.Create();
-                    keyControl.GetKey(index, key);
-
-                    return new BabylonAnimationKey
-                    {
-                        frame = key.Time / Ticks,
-                        values = key.Val.S.ToArraySwitched()
-                    };
-                });
-        }
-
-        private static bool ExportController(IControl control, string property, List<BabylonAnimation> animations, uint classId, BabylonAnimation.DataType dataType, Func<int, IIKeyControl, BabylonAnimationKey> generateFunc)
-        {
-            if (control == null)
-            {
-                return false;
-            }
-
-            var keyControl = control.GetInterface(InterfaceID.Keycontrol) as IIKeyControl;
-
-            if (keyControl == null)
-            {
-                return false;
-            }
-
-            if (control.ClassID.PartA != classId)
-            {
-                return false;
-            }
-
-            var keys = new List<BabylonAnimationKey>();
-            BabylonAnimation.LoopBehavior loopBehavior;
-
-            switch (control.GetORT(2))
-            {
-                case 2:
-                    loopBehavior = BabylonAnimation.LoopBehavior.Cycle;
-                    break;
-                default:
-                    loopBehavior = BabylonAnimation.LoopBehavior.Relative;
-                    break;
-            }
-
-            for (var index = 0; index < keyControl.NumKeys; index++)
-            {
-                keys.Add(generateFunc(index, keyControl));
-            }
-
-            if (keys.Count == 0)
-            {
-                return false;
-            }
-
-            var end = Loader.Core.AnimRange.End;
-            if (keys[keys.Count - 1].frame != end / Ticks)
-            {
-                keys.Add(new BabylonAnimationKey()
-                {
-                    frame = end / Ticks,
-                    values = keys[keys.Count - 1].values
-                });
-            }
-
-            var babylonAnimation = new BabylonAnimation
-            {
-                dataType = (int)dataType,
-                name = property + " animation",
-                keys = keys.ToArray(),
-                framePerSecond = Loader.Global.FrameRate,
-                loopBehavior = (int)loopBehavior,
-                property = property
-            };
-
-            animations.Add(babylonAnimation);
-
-            return true;
-        }
-
-        private static void ExportVector3Animation(string property, List<BabylonAnimation> animations,
-            Func<int, float[]> extractValueFunc)
-        {
-            ExportAnimation(property, animations, extractValueFunc, BabylonAnimation.DataType.Vector3);
-        }
-
-        private static void ExportQuaternionAnimation(string property, List<BabylonAnimation> animations,
-            Func<int, float[]> extractValueFunc)
-        {
-            ExportAnimation(property, animations, extractValueFunc, BabylonAnimation.DataType.Quaternion);
-        }
-
-        private static void ExportFloatAnimation(string property, List<BabylonAnimation> animations,
-            Func<int, float[]> extractValueFunc)
-        {
-            ExportAnimation(property, animations, extractValueFunc, BabylonAnimation.DataType.Float);
-        }
-
-        static void RemoveLinearAnimationKeys(List<BabylonAnimationKey> keys)
-        {
-            for (int ixFirst = keys.Count - 3; ixFirst >= 0; --ixFirst)
-            {
-                while (keys.Count - ixFirst >= 3)
-                {
-                    if (!RemoveAnimationKey(keys, ixFirst))
-                    {
-                        break;
-                    }
-                }
-            }
-        }
-
-        static float[] weightedLerp(int frame0, int frame1, int frame2, float[] value0, float[] value2)
-        {
-            double weight2 = (double)(frame1 - frame0) / (double)(frame2 - frame0);
-            double weight0 = 1 - weight2;
-            float[] result = new float[value0.Length];
-            for (int i = 0; i < result.Length; ++i)
-            {
-                result[i] = (float)(value0[i] * weight0 + value2[i] * weight2);
-            }
-            return result;
-        }
-
-        private static bool RemoveAnimationKey(List<BabylonAnimationKey> keys, int ixFirst)
-        {
-            var first = keys[ixFirst];
-            var middle = keys[ixFirst + 1];
-            var last = keys[ixFirst + 2];
-
-            // first pass, frame equality
-            if (first.values.IsEqualTo(last.values) && first.values.IsEqualTo(middle.values))
-            {
-                keys.RemoveAt(ixFirst + 1);
-                return true;
-            }
-
-            // second pass : linear interpolation detection
-            var computedMiddleValue = weightedLerp(first.frame, middle.frame, last.frame, first.values, last.values);
-            if (computedMiddleValue.IsEqualTo(middle.values))
-            {
-                keys.RemoveAt(ixFirst + 1);
-                return true;
-            }
-            return false;
-
-        }
-
-        private static void ExportAnimation(string property, List<BabylonAnimation> animations, Func<int, float[]> extractValueFunc, BabylonAnimation.DataType dataType)
-        {
-            var start = Loader.Core.AnimRange.Start;
-            var end = Loader.Core.AnimRange.End;
-
-            float[] previous = null;
-            var keys = new List<BabylonAnimationKey>();
-            for (var key = start; key <= end; key += Ticks)
-            {
-                var current = extractValueFunc(key);
-
-
-                keys.Add(new BabylonAnimationKey()
-                {
-                    frame = key / Ticks,
-                    values = current
-                });
-
-
-                previous = current;
-            }
-            RemoveLinearAnimationKeys(keys);
-            if (keys.Count > 0)
-            {
-                var animationPresent = true;
-
-                if (keys.Count == 2)
-                {
-                    if (keys[0].values.IsEqualTo(keys[1].values))
-                    {
-                        animationPresent = false;
-                    }
-                }
-
-                if (animationPresent)
-                {
-
-                    if (keys[keys.Count - 1].frame != end / Ticks)
-                    {
-                        keys.Add(new BabylonAnimationKey()
-                        {
-                            frame = end / Ticks,
-                            values = keys[keys.Count - 1].values
-                        });
-                    }
-
-                    var babylonAnimation = new BabylonAnimation
-                    {
-                        dataType = (int)dataType,
-                        name = property + " animation",
-                        keys = keys.ToArray(),
-                        framePerSecond = Loader.Global.FrameRate,
-                        loopBehavior = (int)BabylonAnimation.LoopBehavior.Cycle,
-                        property = property
-                    };
-
-                    animations.Add(babylonAnimation);
-                }
-            }
-        }
-    }
-}
+using System;
+using System.Collections.Generic;
+using Autodesk.Max;
+using BabylonExport.Entities;
+
+namespace Max2Babylon
+{
+    partial class BabylonExporter
+    {
+        const int Ticks = 160;
+
+        private static BabylonAnimationKey GenerateFloatFunc(int index, IIKeyControl keyControl)
+        {
+            var key = Loader.Global.ILinFloatKey.Create();
+            keyControl.GetKey(index, key);
+
+            return new BabylonAnimationKey
+            {
+                frame = key.Time / Ticks,
+                values = new[] { key.Val }
+            };
+        }
+
+        private static bool ExportFloatController(IControl control, string property, List<BabylonAnimation> animations)
+        {
+            return ExportController(control, property, animations, 0x2001, BabylonAnimation.DataType.Float, GenerateFloatFunc);
+        }
+
+        private static bool ExportQuaternionController(IControl control, string property, List<BabylonAnimation> animations)
+        {
+            IQuat previousQuat = null;
+
+            return ExportController(control, property, animations, 0x2003, BabylonAnimation.DataType.Quaternion,
+                (index, keyControl) =>
+                {
+                    var key = Loader.Global.ILinRotKey.Create();
+                    keyControl.GetKey(index, key);
+                    var newQuat = key.Val;
+
+                    if (index > 0)
+                    {
+                        newQuat = previousQuat.Multiply(newQuat);
+                    }
+
+                    previousQuat = newQuat;
+
+                    return new BabylonAnimationKey
+                    {
+                        frame = key.Time / Ticks,
+                        values = newQuat.ToArray()
+                    };
+                });
+        }
+
+        private static bool ExportVector3Controller(IControl control, string property, List<BabylonAnimation> animations)
+        {
+            var result = false;
+
+            if (control == null)
+            {
+                return false;
+            }
+
+            if (control.XController != null || control.YController != null || control.ZController != null)
+            {
+                result |= ExportFloatController(control.XController, property + ".x", animations);
+                result |= ExportFloatController(control.ZController, property + ".y", animations);
+                result |= ExportFloatController(control.YController, property + ".z", animations);
+
+                return result;
+            }
+
+            if (ExportController(control, property, animations, 0x2002, BabylonAnimation.DataType.Vector3,
+                (index, keyControl) =>
+                {
+                    var key = Loader.Global.ILinPoint3Key.Create();
+                    keyControl.GetKey(index, key);
+
+                    return new BabylonAnimationKey
+                    {
+                        frame = key.Time / Ticks,
+                        values = key.Val.ToArraySwitched()
+                    };
+                }))
+            {
+                return true;
+            }
+
+            return ExportController(control, property, animations, 0x2004, BabylonAnimation.DataType.Vector3,
+                (index, keyControl) =>
+                {
+                    var key = Loader.Global.ILinScaleKey.Create();
+                    keyControl.GetKey(index, key);
+
+                    return new BabylonAnimationKey
+                    {
+                        frame = key.Time / Ticks,
+                        values = key.Val.S.ToArraySwitched()
+                    };
+                });
+        }
+
+        private static bool ExportController(IControl control, string property, List<BabylonAnimation> animations, uint classId, BabylonAnimation.DataType dataType, Func<int, IIKeyControl, BabylonAnimationKey> generateFunc)
+        {
+            if (control == null)
+            {
+                return false;
+            }
+
+            var keyControl = control.GetInterface(InterfaceID.Keycontrol) as IIKeyControl;
+
+            if (keyControl == null)
+            {
+                return false;
+            }
+
+            if (control.ClassID.PartA != classId)
+            {
+                return false;
+            }
+
+            var keys = new List<BabylonAnimationKey>();
+            BabylonAnimation.LoopBehavior loopBehavior;
+
+            switch (control.GetORT(2))
+            {
+                case 2:
+                    loopBehavior = BabylonAnimation.LoopBehavior.Cycle;
+                    break;
+                default:
+                    loopBehavior = BabylonAnimation.LoopBehavior.Relative;
+                    break;
+            }
+
+            for (var index = 0; index < keyControl.NumKeys; index++)
+            {
+                keys.Add(generateFunc(index, keyControl));
+            }
+
+            if (keys.Count == 0)
+            {
+                return false;
+            }
+
+            var end = Loader.Core.AnimRange.End;
+            if (keys[keys.Count - 1].frame != end / Ticks)
+            {
+                keys.Add(new BabylonAnimationKey()
+                {
+                    frame = end / Ticks,
+                    values = keys[keys.Count - 1].values
+                });
+            }
+
+            var babylonAnimation = new BabylonAnimation
+            {
+                dataType = (int)dataType,
+                name = property + " animation",
+                keys = keys.ToArray(),
+                framePerSecond = Loader.Global.FrameRate,
+                loopBehavior = (int)loopBehavior,
+                property = property
+            };
+
+            animations.Add(babylonAnimation);
+
+            return true;
+        }
+
+        private static void ExportColor3Animation(string property, List<BabylonAnimation> animations,
+            Func<int, float[]> extractValueFunc)
+        {
+            ExportAnimation(property, animations, extractValueFunc, BabylonAnimation.DataType.Color3);
+        }
+
+        private static void ExportVector3Animation(string property, List<BabylonAnimation> animations,
+            Func<int, float[]> extractValueFunc)
+        {
+            ExportAnimation(property, animations, extractValueFunc, BabylonAnimation.DataType.Vector3);
+        }
+
+        private static void ExportQuaternionAnimation(string property, List<BabylonAnimation> animations,
+            Func<int, float[]> extractValueFunc)
+        {
+            ExportAnimation(property, animations, extractValueFunc, BabylonAnimation.DataType.Quaternion);
+        }
+
+        private static void ExportFloatAnimation(string property, List<BabylonAnimation> animations,
+            Func<int, float[]> extractValueFunc)
+        {
+            ExportAnimation(property, animations, extractValueFunc, BabylonAnimation.DataType.Float);
+        }
+
+        static void RemoveLinearAnimationKeys(List<BabylonAnimationKey> keys)
+        {
+            for (int ixFirst = keys.Count - 3; ixFirst >= 0; --ixFirst)
+            {
+                while (keys.Count - ixFirst >= 3)
+                {
+                    if (!RemoveAnimationKey(keys, ixFirst))
+                    {
+                        break;
+                    }
+                }
+            }
+        }
+
+        static float[] weightedLerp(int frame0, int frame1, int frame2, float[] value0, float[] value2)
+        {
+            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)
+            {
+                result[i] = (float)(value0[i] * weight0 + value2[i] * weight2);
+            }
+            return result;
+        }
+
+        private static bool RemoveAnimationKey(List<BabylonAnimationKey> keys, int ixFirst)
+        {
+            var first = keys[ixFirst];
+            var middle = keys[ixFirst + 1];
+            var last = keys[ixFirst + 2];
+
+            // first pass, frame equality
+            if (first.values.IsEqualTo(last.values) && first.values.IsEqualTo(middle.values))
+            {
+                keys.RemoveAt(ixFirst + 1);
+                return true;
+            }
+
+            // second pass : linear interpolation detection
+            var computedMiddleValue = weightedLerp(first.frame, middle.frame, last.frame, first.values, last.values);
+            if (computedMiddleValue.IsEqualTo(middle.values))
+            {
+                keys.RemoveAt(ixFirst + 1);
+                return true;
+            }
+            return false;
+
+        }
+
+        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;
+
+            float[] previous = null;
+            var keys = new List<BabylonAnimationKey>();
+            for (var key = start; key <= end; key += Ticks)
+            {
+                var current = extractValueFunc(key);
+
+                if (exportNonOptimizedAnimations && previous != null && previous.IsEqualTo(current))
+                {
+                    continue; // Do not add key
+                }
+
+                keys.Add(new BabylonAnimationKey()
+                {
+                    frame = key / Ticks,
+                    values = current
+                });
+
+                previous = current;
+            }
+
+            if (!exportNonOptimizedAnimations)
+            {
+                RemoveLinearAnimationKeys(keys);
+            }
+
+            if (keys.Count > 1)
+            {
+                var animationPresent = true;
+
+                if (keys.Count == 2)
+                {
+                    if (keys[0].values.IsEqualTo(keys[1].values))
+                    {
+                        animationPresent = false;
+                    }
+                }
+
+                if (animationPresent)
+                {
+
+                    if (keys[keys.Count - 1].frame != end / Ticks)
+                    {
+                        keys.Add(new BabylonAnimationKey()
+                        {
+                            frame = end / Ticks,
+                            values = keys[keys.Count - 1].values
+                        });
+                    }
+
+                    var babylonAnimation = new BabylonAnimation
+                    {
+                        dataType = (int)dataType,
+                        name = property + " animation",
+                        keys = keys.ToArray(),
+                        framePerSecond = Loader.Global.FrameRate,
+                        loopBehavior = (int)BabylonAnimation.LoopBehavior.Cycle,
+                        property = property
+                    };
+
+                    animations.Add(babylonAnimation);
+                }
+            }
+        }
+    }
+}

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

@@ -1,127 +1,127 @@
-using System.Collections.Generic;
-using Autodesk.Max;
-using BabylonExport.Entities;
-using System.Linq;
-
-namespace Max2Babylon
-{
-    partial class BabylonExporter
-    {
-        private void ExportCamera(IIGameScene scene,  IIGameNode cameraNode, BabylonScene babylonScene)
-        {
-            if (cameraNode.MaxNode.GetBoolProperty("babylonjs_noexport"))
-            {
-                return;
-            }
-            var gameCamera = cameraNode.IGameObject.AsGameCamera();
-            var maxCamera = gameCamera.MaxObject as ICameraObject;
-            var initialized = gameCamera.InitializeData;
-            var babylonCamera = new BabylonCamera();
-
-            RaiseMessage(cameraNode.Name, 1);
-            babylonCamera.name = cameraNode.Name;
-            babylonCamera.id = cameraNode.MaxNode.GetGuid().ToString();
-            if (cameraNode.NodeParent != null)
-            {
-                babylonCamera.parentId = GetParentID(cameraNode.NodeParent, babylonScene, scene);
-            }
-
-            babylonCamera.fov = Tools.ConvertFov(maxCamera.GetFOV(0, Tools.Forever));
-
-            if (maxCamera.ManualClip == 1)
-            {
-                babylonCamera.minZ = maxCamera.GetClipDist(0, 1, Tools.Forever);
-                babylonCamera.maxZ = maxCamera.GetClipDist(0, 2, Tools.Forever);
-            }
-            else
-            {
-                babylonCamera.minZ = 0.1f;
-                babylonCamera.maxZ = 10000.0f;
-            }
-
-            if (babylonCamera.minZ == 0.0f)
-            {
-                babylonCamera.minZ = 0.1f;
-            }
-
-            // Type
-            babylonCamera.type = cameraNode.MaxNode.GetStringProperty("babylonjs_type", "FreeCamera");
-
-            // Control
-            babylonCamera.speed = cameraNode.MaxNode.GetFloatProperty("babylonjs_speed", 1.0f);
-            babylonCamera.inertia = cameraNode.MaxNode.GetFloatProperty("babylonjs_inertia", 0.9f);
-
-            // Collisions
-            babylonCamera.checkCollisions = cameraNode.MaxNode.GetBoolProperty("babylonjs_checkcollisions");
-            babylonCamera.applyGravity = cameraNode.MaxNode.GetBoolProperty("babylonjs_applygravity");
-            babylonCamera.ellipsoid = cameraNode.MaxNode.GetVector3Property("babylonjs_ellipsoid");
-
-            // Position
-            var wm = cameraNode.GetLocalTM(0);
-            if (cameraNode.NodeParent != null)
-            {
-                var parentWorld = cameraNode.NodeParent.GetObjectTM(0);
-                wm.MultiplyBy(parentWorld.Inverse);
-            }
-            var position = wm.Translation;
-            babylonCamera.position = new float[] { position.X, position.Y, position.Z };
-
-            // Target
-            var target = gameCamera.CameraTarget;
-            if (target != null)
-            {
-                babylonCamera.lockedTargetId = target.MaxNode.GetGuid().ToString();
-            }
-            else
-            {
-                var dir = wm.GetRow(3);
-                babylonCamera.target = new float[] { position.X - dir.X, position.Y - dir.Y, position.Z - dir.Z };
-            }
-
-            // Animations
-            var animations = new List<BabylonAnimation>();
-
-            ExportVector3Animation("position", animations, key =>
-            {
-                var tm = cameraNode.GetLocalTM(key);
-                if (cameraNode.NodeParent != null)
-                {
-                    var parentWorld = cameraNode.NodeParent.GetObjectTM(key);
-                    tm.MultiplyBy(parentWorld.Inverse);
-                }
-                var translation = tm.Translation;
-                return new float[] { translation.X, translation.Y, translation.Z };
-            });
-
-            if (gameCamera.CameraTarget == null)
-            {
-                ExportVector3Animation("target", animations, key =>
-                {
-                    var tm = cameraNode.GetLocalTM(key);
-                    if (cameraNode.NodeParent != null)
-                    {
-                        var parentWorld = cameraNode.NodeParent.GetObjectTM(key);
-                        tm.MultiplyBy(parentWorld.Inverse);
-                    }
-                    var translation = tm.Translation;
-                    var dir = tm.GetRow(3);
-                    return new float[] { translation.X - dir.X, translation.Y - dir.Y, translation.Z - dir.Z };
-                });
-            }
-
-            ExportFloatAnimation("fov", animations, key => new[] { Tools.ConvertFov((gameCamera.MaxObject as ICameraObject).GetFOV(key, Tools.Forever)) });
-
-            babylonCamera.animations = animations.ToArray();
-
-            if (cameraNode.MaxNode.GetBoolProperty("babylonjs_autoanimate"))
-            {
-                babylonCamera.autoAnimate = true;
-                babylonCamera.autoAnimateFrom = (int)cameraNode.MaxNode.GetFloatProperty("babylonjs_autoanimate_from");
-                babylonCamera.autoAnimateTo = (int)cameraNode.MaxNode.GetFloatProperty("babylonjs_autoanimate_to");
-                babylonCamera.autoAnimateLoop = cameraNode.MaxNode.GetBoolProperty("babylonjs_autoanimateloop");
-            }
-
-            babylonScene.CamerasList.Add(babylonCamera);
-        }
-    }
-}
+using System.Collections.Generic;
+using Autodesk.Max;
+using BabylonExport.Entities;
+using System.Linq;
+
+namespace Max2Babylon
+{
+    partial class BabylonExporter
+    {
+        private void ExportCamera(IIGameScene scene,  IIGameNode cameraNode, BabylonScene babylonScene)
+        {
+            if (cameraNode.MaxNode.GetBoolProperty("babylonjs_noexport"))
+            {
+                return;
+            }
+            var gameCamera = cameraNode.IGameObject.AsGameCamera();
+            var maxCamera = gameCamera.MaxObject as ICameraObject;
+            var initialized = gameCamera.InitializeData;
+            var babylonCamera = new BabylonCamera();
+
+            RaiseMessage(cameraNode.Name, 1);
+            babylonCamera.name = cameraNode.Name;
+            babylonCamera.id = cameraNode.MaxNode.GetGuid().ToString();
+            if (cameraNode.NodeParent != null)
+            {
+                babylonCamera.parentId = GetParentID(cameraNode.NodeParent, babylonScene, scene);
+            }
+
+            babylonCamera.fov = Tools.ConvertFov(maxCamera.GetFOV(0, Tools.Forever));
+
+            if (maxCamera.ManualClip == 1)
+            {
+                babylonCamera.minZ = maxCamera.GetClipDist(0, 1, Tools.Forever);
+                babylonCamera.maxZ = maxCamera.GetClipDist(0, 2, Tools.Forever);
+            }
+            else
+            {
+                babylonCamera.minZ = 0.1f;
+                babylonCamera.maxZ = 10000.0f;
+            }
+
+            if (babylonCamera.minZ == 0.0f)
+            {
+                babylonCamera.minZ = 0.1f;
+            }
+
+            // Type
+            babylonCamera.type = cameraNode.MaxNode.GetStringProperty("babylonjs_type", "FreeCamera");
+
+            // Control
+            babylonCamera.speed = cameraNode.MaxNode.GetFloatProperty("babylonjs_speed", 1.0f);
+            babylonCamera.inertia = cameraNode.MaxNode.GetFloatProperty("babylonjs_inertia", 0.9f);
+
+            // Collisions
+            babylonCamera.checkCollisions = cameraNode.MaxNode.GetBoolProperty("babylonjs_checkcollisions");
+            babylonCamera.applyGravity = cameraNode.MaxNode.GetBoolProperty("babylonjs_applygravity");
+            babylonCamera.ellipsoid = cameraNode.MaxNode.GetVector3Property("babylonjs_ellipsoid");
+
+            // Position
+            var wm = cameraNode.GetLocalTM(0);
+            if (cameraNode.NodeParent != null)
+            {
+                var parentWorld = cameraNode.NodeParent.GetObjectTM(0);
+                wm.MultiplyBy(parentWorld.Inverse);
+            }
+            var position = wm.Translation;
+            babylonCamera.position = new [] { position.X, position.Y, position.Z };
+
+            // Target
+            var target = gameCamera.CameraTarget;
+            if (target != null)
+            {
+                babylonCamera.lockedTargetId = target.MaxNode.GetGuid().ToString();
+            }
+            else
+            {
+                var dir = wm.GetRow(3);
+                babylonCamera.target = new [] { position.X - dir.X, position.Y - dir.Y, position.Z - dir.Z };
+            }
+
+            // Animations
+            var animations = new List<BabylonAnimation>();
+
+            ExportVector3Animation("position", animations, key =>
+            {
+                var tm = cameraNode.GetLocalTM(key);
+                if (cameraNode.NodeParent != null)
+                {
+                    var parentWorld = cameraNode.NodeParent.GetObjectTM(key);
+                    tm.MultiplyBy(parentWorld.Inverse);
+                }
+                var translation = tm.Translation;
+                return new [] { translation.X, translation.Y, translation.Z };
+            });
+
+            if (gameCamera.CameraTarget == null)
+            {
+                ExportVector3Animation("target", animations, key =>
+                {
+                    var tm = cameraNode.GetLocalTM(key);
+                    if (cameraNode.NodeParent != null)
+                    {
+                        var parentWorld = cameraNode.NodeParent.GetObjectTM(key);
+                        tm.MultiplyBy(parentWorld.Inverse);
+                    }
+                    var translation = tm.Translation;
+                    var dir = tm.GetRow(3);
+                    return new float[] { translation.X - dir.X, translation.Y - dir.Y, translation.Z - dir.Z };
+                });
+            }
+
+            ExportFloatAnimation("fov", animations, key => new[] { Tools.ConvertFov((gameCamera.MaxObject as ICameraObject).GetFOV(key, Tools.Forever)) });
+
+            babylonCamera.animations = animations.ToArray();
+
+            if (cameraNode.MaxNode.GetBoolProperty("babylonjs_autoanimate"))
+            {
+                babylonCamera.autoAnimate = true;
+                babylonCamera.autoAnimateFrom = (int)cameraNode.MaxNode.GetFloatProperty("babylonjs_autoanimate_from");
+                babylonCamera.autoAnimateTo = (int)cameraNode.MaxNode.GetFloatProperty("babylonjs_autoanimate_to");
+                babylonCamera.autoAnimateLoop = cameraNode.MaxNode.GetBoolProperty("babylonjs_autoanimateloop");
+            }
+
+            babylonScene.CamerasList.Add(babylonCamera);
+        }
+    }
+}

+ 223 - 218
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Light.cs

@@ -1,218 +1,223 @@
-using System;
-using System.Collections.Generic;
-using Autodesk.Max;
-using BabylonExport.Entities;
-using System.Linq;
-
-namespace Max2Babylon
-{
-    partial class BabylonExporter
-    {
-        void ExportDefaultLight(BabylonScene babylonScene)
-        {
-            var babylonLight = new BabylonLight();
-            babylonLight.name = "Default light";
-            babylonLight.id = Guid.NewGuid().ToString();
-            babylonLight.type = 3;
-            babylonLight.groundColor = new float[] { 0, 0, 0 };
-            babylonLight.direction = new[] { 0, 1.0f, 0 };
-
-            babylonLight.intensity = 1;
-
-            babylonLight.diffuse = new[] { 1.0f, 1.0f, 1.0f };
-            babylonLight.specular = new[] { 1.0f, 1.0f, 1.0f };
-
-            babylonScene.LightsList.Add(babylonLight);
-        }
-
-        private void ExportLight(IIGameScene scene, IIGameNode lightNode, BabylonScene babylonScene)
-        {
-            if (lightNode.MaxNode.GetBoolProperty("babylonjs_noexport"))
-            {
-                return;
-            }
-
-            var gameLight = lightNode.IGameObject.AsGameLight();
-            var initialized = gameLight.InitializeData;
-            var babylonLight = new BabylonLight();
-
-            RaiseMessage(lightNode.Name, 1);
-            babylonLight.name = lightNode.Name;
-            babylonLight.id = lightNode.MaxNode.GetGuid().ToString();
-            if (lightNode.NodeParent != null)
-            {
-                babylonLight.parentId = GetParentID(lightNode.NodeParent, babylonScene, scene);
-            }
-
-            // Type
-
-            var maxLight = (lightNode.MaxNode.ObjectRef as ILightObject);
-            var lightState = Loader.Global.LightState.Create();
-            maxLight.EvalLightState(0, Tools.Forever, lightState);
-
-            switch (lightState.Type)
-            {
-                case LightType.OmniLgt:
-                    babylonLight.type = 0;
-                    break;
-                case LightType.SpotLgt:
-                    babylonLight.type = 2;
-                    babylonLight.angle = (float)(maxLight.GetFallsize(0, Tools.Forever) * Math.PI / 180.0f);
-                    babylonLight.exponent = 1;
-                    break;
-                case LightType.DirectLgt:
-                    babylonLight.type = 1;
-                    break;
-                case LightType.AmbientLgt:
-                    babylonLight.type = 3;
-                    babylonLight.groundColor = new float[] { 0, 0, 0 };
-                    break;
-            }
-
-
-            // Shadows 
-            if (maxLight.ShadowMethod == 1)
-            {
-                if (lightState.Type == LightType.DirectLgt || lightState.Type == LightType.SpotLgt)
-                {
-                    ExportShadowGenerator(lightNode.MaxNode, babylonScene);
-                }
-                else
-                {
-                    RaiseWarning("Shadows maps are only supported for directional and spot lights", 2);
-                }
-            }
-
-            // Position
-            var wm = lightNode.GetObjectTM(0);
-            if (lightNode.NodeParent != null)
-            {
-                var parentWorld = lightNode.NodeParent.GetObjectTM(0);
-                wm.MultiplyBy(parentWorld.Inverse);
-            }
-            var position = wm.Translation;
-            babylonLight.position = new[] { position.X, position.Y, position.Z };
-
-            // Direction
-            var target = gameLight.LightTarget;
-            if (target != null)
-            {
-                var targetWm = target.GetObjectTM(0);
-                var targetPosition = targetWm.Translation;
-
-                var direction = targetPosition.Subtract(position).Normalize;
-                babylonLight.direction = new[] { direction.X, direction.Y, direction.Z };
-            }
-            else
-            {
-                var vDir = Loader.Global.Point3.Create(0, -1, 0);
-                vDir = wm.ExtractMatrix3().VectorTransform(vDir).Normalize;
-                babylonLight.direction = new[] { vDir.X, vDir.Y, vDir.Z };
-            }
-
-            var maxScene = Loader.Core.RootNode;
-
-            // Exclusion
-            var inclusion = maxLight.ExclList.TestFlag(1); //NT_INCLUDE 
-            var checkExclusionList = maxLight.ExclList.TestFlag(2); //NT_AFFECT_ILLUM
-
-            if (checkExclusionList)
-            {
-                var excllist = new List<string>();
-                var incllist = new List<string>();
-
-                foreach (var meshNode in maxScene.NodesListBySuperClass(SClass_ID.Geomobject))
-                {
-                    if (meshNode.CastShadows == 1)
-                    {
-                        var inList = maxLight.ExclList.FindNode(meshNode) != -1;
-
-                        if (inList)
-                        {
-                            if (inclusion)
-                            {
-                                incllist.Add(meshNode.GetGuid().ToString());
-                            }
-                            else
-                            {
-                                excllist.Add(meshNode.GetGuid().ToString());
-                            }
-                        }
-                    }
-                }
-
-                babylonLight.includedOnlyMeshesIds = incllist.ToArray();
-                babylonLight.excludedMeshesIds = excllist.ToArray();
-            }
-
-            // Other fields 
-            babylonLight.intensity = maxLight.GetIntensity(0, Tools.Forever);
-
-
-            babylonLight.diffuse = lightState.AffectDiffuse ? maxLight.GetRGBColor(0, Tools.Forever).ToArray() : new float[] { 0, 0, 0 };
-            babylonLight.specular = lightState.AffectDiffuse ? maxLight.GetRGBColor(0, Tools.Forever).ToArray() : new float[] { 0, 0, 0 };
-
-
-            if (maxLight.UseAtten)
-            {
-                babylonLight.range = maxLight.GetAtten(0, 1, Tools.Forever);
-            }
-
-
-            // Animations
-            var animations = new List<BabylonAnimation>();
-
-            ExportVector3Animation("position", animations, key =>
-            {
-                var mat = lightNode.GetObjectTM(key);
-                if (lightNode.NodeParent != null)
-                {
-                    var parentWorld = lightNode.NodeParent.GetObjectTM(key);
-                    mat.MultiplyBy(parentWorld.Inverse);
-                }
-                var pos = mat.Translation;
-                return new[] { pos.X, pos.Y, pos.Z };
-            });
-
-            ExportVector3Animation("direction", animations, key =>
-            {
-                var wmLight = lightNode.GetObjectTM(key);
-                if (lightNode.NodeParent != null)
-                {
-                    var parentWorld = lightNode.NodeParent.GetObjectTM(key);
-                    wmLight.MultiplyBy(parentWorld.Inverse);
-                }
-                var positionLight = wmLight.Translation;
-                var lightTarget = gameLight.LightTarget;
-                if (lightTarget != null)
-                {
-                    var targetWm = lightTarget.GetObjectTM(key);
-                    var targetPosition = targetWm.Translation;
-
-                    var direction = targetPosition.Subtract(positionLight).Normalize;
-                    return new[] { direction.X, direction.Y, direction.Z };
-                }
-                else
-                {
-                    var vDir = Loader.Global.Point3.Create(0, -1, 0);
-                    vDir = wmLight.ExtractMatrix3().VectorTransform(vDir).Normalize;
-                    return new[] { vDir.X, vDir.Y, vDir.Z };
-                }
-            });
-
-            ExportFloatAnimation("intensity", animations, key => new[] { maxLight.GetIntensity(key, Tools.Forever) });
-
-            babylonLight.animations = animations.ToArray();
-
-            if (lightNode.MaxNode.GetBoolProperty("babylonjs_autoanimate"))
-            {
-                babylonLight.autoAnimate = true;
-                babylonLight.autoAnimateFrom = (int)lightNode.MaxNode.GetFloatProperty("babylonjs_autoanimate_from");
-                babylonLight.autoAnimateTo = (int)lightNode.MaxNode.GetFloatProperty("babylonjs_autoanimate_to");
-                babylonLight.autoAnimateLoop = lightNode.MaxNode.GetBoolProperty("babylonjs_autoanimateloop");
-            }
-
-            babylonScene.LightsList.Add(babylonLight);
-        }
-    }
-}
+using System;
+using System.Collections.Generic;
+using Autodesk.Max;
+using BabylonExport.Entities;
+using System.Linq;
+
+namespace Max2Babylon
+{
+    partial class BabylonExporter
+    {
+        void ExportDefaultLight(BabylonScene babylonScene)
+        {
+            var babylonLight = new BabylonLight();
+            babylonLight.name = "Default light";
+            babylonLight.id = Guid.NewGuid().ToString();
+            babylonLight.type = 3;
+            babylonLight.groundColor = new float[] { 0, 0, 0 };
+            babylonLight.direction = new[] { 0, 1.0f, 0 };
+
+            babylonLight.intensity = 1;
+
+            babylonLight.diffuse = new[] { 1.0f, 1.0f, 1.0f };
+            babylonLight.specular = new[] { 1.0f, 1.0f, 1.0f };
+
+            babylonScene.LightsList.Add(babylonLight);
+        }
+
+        private void ExportLight(IIGameScene scene, IIGameNode lightNode, BabylonScene babylonScene)
+        {
+            if (lightNode.MaxNode.GetBoolProperty("babylonjs_noexport"))
+            {
+                return;
+            }
+
+            var gameLight = lightNode.IGameObject.AsGameLight();
+            var initialized = gameLight.InitializeData;
+            var babylonLight = new BabylonLight();
+
+            RaiseMessage(lightNode.Name, 1);
+            babylonLight.name = lightNode.Name;
+            babylonLight.id = lightNode.MaxNode.GetGuid().ToString();
+            if (lightNode.NodeParent != null)
+            {
+                babylonLight.parentId = GetParentID(lightNode.NodeParent, babylonScene, scene);
+            }
+
+            // Type
+
+            var maxLight = (lightNode.MaxNode.ObjectRef as ILightObject);
+            var lightState = Loader.Global.LightState.Create();
+            maxLight.EvalLightState(0, Tools.Forever, lightState);
+
+            switch (lightState.Type)
+            {
+                case LightType.OmniLgt:
+                    babylonLight.type = 0;
+                    break;
+                case LightType.SpotLgt:
+                    babylonLight.type = 2;
+                    babylonLight.angle = (float)(maxLight.GetFallsize(0, Tools.Forever) * Math.PI / 180.0f);
+                    babylonLight.exponent = 1;
+                    break;
+                case LightType.DirectLgt:
+                    babylonLight.type = 1;
+                    break;
+                case LightType.AmbientLgt:
+                    babylonLight.type = 3;
+                    babylonLight.groundColor = new float[] { 0, 0, 0 };
+                    break;
+            }
+
+
+            // Shadows 
+            if (maxLight.ShadowMethod == 1)
+            {
+                if (lightState.Type == LightType.DirectLgt || lightState.Type == LightType.SpotLgt || lightState.Type == LightType.OmniLgt)
+                {
+                    ExportShadowGenerator(lightNode.MaxNode, babylonScene);
+                }
+                else
+                {
+                    RaiseWarning("Shadows maps are only supported for point, directional and spot lights", 2);
+                }
+            }
+
+            // Position
+            var wm = lightNode.GetObjectTM(0);
+            if (lightNode.NodeParent != null)
+            {
+                var parentWorld = lightNode.NodeParent.GetObjectTM(0);
+                wm.MultiplyBy(parentWorld.Inverse);
+            }
+            var position = wm.Translation;
+            babylonLight.position = new[] { position.X, position.Y, position.Z };
+
+            // Direction
+            var target = gameLight.LightTarget;
+            if (target != null)
+            {
+                var targetWm = target.GetObjectTM(0);
+                var targetPosition = targetWm.Translation;
+
+                var direction = targetPosition.Subtract(position).Normalize;
+                babylonLight.direction = new[] { direction.X, direction.Y, direction.Z };
+            }
+            else
+            {
+                var vDir = Loader.Global.Point3.Create(0, -1, 0);
+                vDir = wm.ExtractMatrix3().VectorTransform(vDir).Normalize;
+                babylonLight.direction = new[] { vDir.X, vDir.Y, vDir.Z };
+            }
+
+            var maxScene = Loader.Core.RootNode;
+
+            // Exclusion
+            var inclusion = maxLight.ExclList.TestFlag(1); //NT_INCLUDE 
+            var checkExclusionList = maxLight.ExclList.TestFlag(2); //NT_AFFECT_ILLUM
+
+            if (checkExclusionList)
+            {
+                var excllist = new List<string>();
+                var incllist = new List<string>();
+
+                foreach (var meshNode in maxScene.NodesListBySuperClass(SClass_ID.Geomobject))
+                {
+                    if (meshNode.CastShadows == 1)
+                    {
+                        var inList = maxLight.ExclList.FindNode(meshNode) != -1;
+
+                        if (inList)
+                        {
+                            if (inclusion)
+                            {
+                                incllist.Add(meshNode.GetGuid().ToString());
+                            }
+                            else
+                            {
+                                excllist.Add(meshNode.GetGuid().ToString());
+                            }
+                        }
+                    }
+                }
+
+                babylonLight.includedOnlyMeshesIds = incllist.ToArray();
+                babylonLight.excludedMeshesIds = excllist.ToArray();
+            }
+
+            // Other fields 
+            babylonLight.intensity = maxLight.GetIntensity(0, Tools.Forever);
+
+
+            babylonLight.diffuse = lightState.AffectDiffuse ? maxLight.GetRGBColor(0, Tools.Forever).ToArray() : new float[] { 0, 0, 0 };
+            babylonLight.specular = lightState.AffectDiffuse ? maxLight.GetRGBColor(0, Tools.Forever).ToArray() : new float[] { 0, 0, 0 };
+
+
+            if (maxLight.UseAtten)
+            {
+                babylonLight.range = maxLight.GetAtten(0, 3, Tools.Forever);
+            }
+
+
+            // Animations
+            var animations = new List<BabylonAnimation>();
+
+            ExportVector3Animation("position", animations, key =>
+            {
+                var mat = lightNode.GetObjectTM(key);
+                if (lightNode.NodeParent != null)
+                {
+                    var parentWorld = lightNode.NodeParent.GetObjectTM(key);
+                    mat.MultiplyBy(parentWorld.Inverse);
+                }
+                var pos = mat.Translation;
+                return new[] { pos.X, pos.Y, pos.Z };
+            });
+
+            ExportVector3Animation("direction", animations, key =>
+            {
+                var wmLight = lightNode.GetObjectTM(key);
+                if (lightNode.NodeParent != null)
+                {
+                    var parentWorld = lightNode.NodeParent.GetObjectTM(key);
+                    wmLight.MultiplyBy(parentWorld.Inverse);
+                }
+                var positionLight = wmLight.Translation;
+                var lightTarget = gameLight.LightTarget;
+                if (lightTarget != null)
+                {
+                    var targetWm = lightTarget.GetObjectTM(key);
+                    var targetPosition = targetWm.Translation;
+
+                    var direction = targetPosition.Subtract(positionLight).Normalize;
+                    return new[] { direction.X, direction.Y, direction.Z };
+                }
+                else
+                {
+                    var vDir = Loader.Global.Point3.Create(0, -1, 0);
+                    vDir = wmLight.ExtractMatrix3().VectorTransform(vDir).Normalize;
+                    return new[] { vDir.X, vDir.Y, vDir.Z };
+                }
+            });
+
+            ExportFloatAnimation("intensity", animations, key => new[] { maxLight.GetIntensity(key, Tools.Forever) });
+
+            ExportColor3Animation("diffuse", animations, key =>
+            {
+                return lightState.AffectDiffuse? maxLight.GetRGBColor(key, Tools.Forever).ToArray() : new float[] { 0, 0, 0 };
+            });
+
+            babylonLight.animations = animations.ToArray();
+
+            if (lightNode.MaxNode.GetBoolProperty("babylonjs_autoanimate"))
+            {
+                babylonLight.autoAnimate = true;
+                babylonLight.autoAnimateFrom = (int)lightNode.MaxNode.GetFloatProperty("babylonjs_autoanimate_from");
+                babylonLight.autoAnimateTo = (int)lightNode.MaxNode.GetFloatProperty("babylonjs_autoanimate_to");
+                babylonLight.autoAnimateLoop = lightNode.MaxNode.GetBoolProperty("babylonjs_autoanimateloop");
+            }
+
+            babylonScene.LightsList.Add(babylonLight);
+        }
+    }
+}

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

@@ -1,149 +1,149 @@
-using System;
-using System.Collections.Generic;
-using Autodesk.Max;
-using BabylonExport.Entities;
-
-namespace Max2Babylon
-{
-    partial class BabylonExporter
-    {
-        readonly List<IIGameMaterial> referencedMaterials = new List<IIGameMaterial>();
-
-        private void ExportMaterial(IIGameMaterial materialNode, BabylonScene babylonScene)
-        {
-            var name = materialNode.MaterialName;
-            var id = materialNode.MaxMaterial.GetGuid().ToString();
-
-            RaiseMessage(name, 1);
-
-            if (materialNode.SubMaterialCount > 0)
-            {
-                var babylonMultimaterial = new BabylonMultiMaterial { name = name, id = id };
-
-                var guids = new List<string>();
-
-                for (var index = 0; index < materialNode.SubMaterialCount; index++)
-                {
-                    var subMat = materialNode.GetSubMaterial(index);
-
-                    if (subMat != null)
-                    {
-                        guids.Add(subMat.MaxMaterial.GetGuid().ToString());
-
-                        if (!referencedMaterials.Contains(subMat))
-                        {
-                            referencedMaterials.Add(subMat);
-                            ExportMaterial(subMat, babylonScene);
-                        }
-                    }
-                    else
-                    {
-                        guids.Add(Guid.Empty.ToString());
-                    }
-                }
-
-                babylonMultimaterial.materials = guids.ToArray();
-
-                babylonScene.MultiMaterialsList.Add(babylonMultimaterial);
-                return;
-            }
-
-            var babylonMaterial = new BabylonMaterial
-            {
-                name = name,
-                id = id,
-                ambient = materialNode.MaxMaterial.GetAmbient(0, false).ToArray(),
-                diffuse = materialNode.MaxMaterial.GetDiffuse(0, false).ToArray(),
-                specular = materialNode.MaxMaterial.GetSpecular(0, false).Scale(materialNode.MaxMaterial.GetShinStr(0, false)),
-                specularPower = materialNode.MaxMaterial.GetShininess(0, false) * 256,
-                emissive =
-                    materialNode.MaxMaterial.GetSelfIllumColorOn(0, false)
-                        ? materialNode.MaxMaterial.GetSelfIllumColor(0, false).ToArray()
-                        : materialNode.MaxMaterial.GetDiffuse(0, false).Scale(materialNode.MaxMaterial.GetSelfIllum(0, false)),
-                alpha = 1.0f - materialNode.MaxMaterial.GetXParency(0, false)
-            };
-
-
-            var stdMat = materialNode.MaxMaterial.GetParamBlock(0).Owner as IStdMat2;
-
-            if (stdMat != null)
-            {
-                babylonMaterial.backFaceCulling = !stdMat.TwoSided;
-                babylonMaterial.wireframe = stdMat.Wire;
-
-                // Textures
-                BabylonFresnelParameters fresnelParameters;
-
-                babylonMaterial.ambientTexture = ExportTexture(stdMat, 0, out fresnelParameters, babylonScene);                // Ambient
-                babylonMaterial.diffuseTexture = ExportTexture(stdMat, 1, out fresnelParameters, babylonScene);                // Diffuse
-                if (fresnelParameters != null)
-                {
-                    babylonMaterial.diffuseFresnelParameters = fresnelParameters;
-                }
-
-                babylonMaterial.specularTexture = ExportTexture(stdMat, 2, out fresnelParameters, babylonScene);               // Specular
-                babylonMaterial.emissiveTexture = ExportTexture(stdMat, 5, out fresnelParameters, babylonScene);               // Emissive
-                if (fresnelParameters != null)
-                {
-                    babylonMaterial.emissiveFresnelParameters = fresnelParameters;
-                    if (babylonMaterial.emissive[0] == 0 &&
-                        babylonMaterial.emissive[1] == 0 &&
-                        babylonMaterial.emissive[2] == 0 &&
-                        babylonMaterial.emissiveTexture == null)
-                    {
-                        babylonMaterial.emissive = new float[] { 1, 1, 1 };
-                    }
-                }
-
-                babylonMaterial.opacityTexture = ExportTexture(stdMat, 6, out fresnelParameters, babylonScene, false, true);   // Opacity
-                if (fresnelParameters != null)
-                {
-                    babylonMaterial.opacityFresnelParameters = fresnelParameters;
-                    if (babylonMaterial.alpha == 1 &&
-                         babylonMaterial.opacityTexture == null)
-                    {
-                        babylonMaterial.alpha = 0;
-                    }
-                }
-
-                babylonMaterial.bumpTexture = ExportTexture(stdMat, 8, out fresnelParameters, babylonScene);                   // Bump
-                babylonMaterial.reflectionTexture = ExportTexture(stdMat, 9, out fresnelParameters, babylonScene, true);       // Reflection
-                if (fresnelParameters != null)
-                {
-                    if (babylonMaterial.reflectionTexture == null)
-                    {
-                        RaiseWarning("Fallout cannot be used with reflection channel without a texture", 2);
-                    }
-                    else
-                    {
-                        babylonMaterial.reflectionFresnelParameters = fresnelParameters;
-                    }
-                }
-
-                // Constraints
-                if (babylonMaterial.diffuseTexture != null)
-                {
-                    babylonMaterial.diffuse = new[] { 1.0f, 1.0f, 1.0f };
-                }
-
-                if (babylonMaterial.emissiveTexture != null)
-                {
-                    babylonMaterial.emissive = new float[] { 0, 0, 0 };
-                }
-
-                if (babylonMaterial.opacityTexture != null && babylonMaterial.diffuseTexture != null &&
-                    babylonMaterial.diffuseTexture.name == babylonMaterial.opacityTexture.name &&
-                    babylonMaterial.diffuseTexture.hasAlpha && !babylonMaterial.opacityTexture.getAlphaFromRGB)
-                {
-                    // This is a alpha testing purpose
-                    babylonMaterial.opacityTexture = null;
-                    babylonMaterial.diffuseTexture.hasAlpha = true;
-                    RaiseWarning("Opacity texture was removed because alpha from diffuse texture can be use instead", 2);
-                    RaiseWarning("If you do not want this behavior, just set Alpha Source = None on your diffuse texture", 2);
-                }
-            }
-
-            babylonScene.MaterialsList.Add(babylonMaterial);
-        }
-    }
-}
+using System;
+using System.Collections.Generic;
+using Autodesk.Max;
+using BabylonExport.Entities;
+
+namespace Max2Babylon
+{
+    partial class BabylonExporter
+    {
+        readonly List<IIGameMaterial> referencedMaterials = new List<IIGameMaterial>();
+
+        private void ExportMaterial(IIGameMaterial materialNode, BabylonScene babylonScene)
+        {
+            var name = materialNode.MaterialName;
+            var id = materialNode.MaxMaterial.GetGuid().ToString();
+
+            RaiseMessage(name, 1);
+
+            if (materialNode.SubMaterialCount > 0)
+            {
+                var babylonMultimaterial = new BabylonMultiMaterial { name = name, id = id };
+
+                var guids = new List<string>();
+
+                for (var index = 0; index < materialNode.SubMaterialCount; index++)
+                {
+                    var subMat = materialNode.GetSubMaterial(index);
+
+                    if (subMat != null)
+                    {
+                        guids.Add(subMat.MaxMaterial.GetGuid().ToString());
+
+                        if (!referencedMaterials.Contains(subMat))
+                        {
+                            referencedMaterials.Add(subMat);
+                            ExportMaterial(subMat, babylonScene);
+                        }
+                    }
+                    else
+                    {
+                        guids.Add(Guid.Empty.ToString());
+                    }
+                }
+
+                babylonMultimaterial.materials = guids.ToArray();
+
+                babylonScene.MultiMaterialsList.Add(babylonMultimaterial);
+                return;
+            }
+
+            var babylonMaterial = new BabylonMaterial
+            {
+                name = name,
+                id = id,
+                ambient = materialNode.MaxMaterial.GetAmbient(0, false).ToArray(),
+                diffuse = materialNode.MaxMaterial.GetDiffuse(0, false).ToArray(),
+                specular = materialNode.MaxMaterial.GetSpecular(0, false).Scale(materialNode.MaxMaterial.GetShinStr(0, false)),
+                specularPower = materialNode.MaxMaterial.GetShininess(0, false) * 256,
+                emissive =
+                    materialNode.MaxMaterial.GetSelfIllumColorOn(0, false)
+                        ? materialNode.MaxMaterial.GetSelfIllumColor(0, false).ToArray()
+                        : materialNode.MaxMaterial.GetDiffuse(0, false).Scale(materialNode.MaxMaterial.GetSelfIllum(0, false)),
+                alpha = 1.0f - materialNode.MaxMaterial.GetXParency(0, false)
+            };
+
+
+            var stdMat = materialNode.MaxMaterial.GetParamBlock(0).Owner as IStdMat2;
+
+            if (stdMat != null)
+            {
+                babylonMaterial.backFaceCulling = !stdMat.TwoSided;
+                babylonMaterial.wireframe = stdMat.Wire;
+
+                // Textures
+                BabylonFresnelParameters fresnelParameters;
+
+                babylonMaterial.ambientTexture = ExportTexture(stdMat, 0, out fresnelParameters, babylonScene);                // Ambient
+                babylonMaterial.diffuseTexture = ExportTexture(stdMat, 1, out fresnelParameters, babylonScene);                // Diffuse
+                if (fresnelParameters != null)
+                {
+                    babylonMaterial.diffuseFresnelParameters = fresnelParameters;
+                }
+
+                babylonMaterial.specularTexture = ExportTexture(stdMat, 2, out fresnelParameters, babylonScene);               // Specular
+                babylonMaterial.emissiveTexture = ExportTexture(stdMat, 5, out fresnelParameters, babylonScene);               // Emissive
+                if (fresnelParameters != null)
+                {
+                    babylonMaterial.emissiveFresnelParameters = fresnelParameters;
+                    if (babylonMaterial.emissive[0] == 0 &&
+                        babylonMaterial.emissive[1] == 0 &&
+                        babylonMaterial.emissive[2] == 0 &&
+                        babylonMaterial.emissiveTexture == null)
+                    {
+                        babylonMaterial.emissive = new float[] { 1, 1, 1 };
+                    }
+                }
+
+                babylonMaterial.opacityTexture = ExportTexture(stdMat, 6, out fresnelParameters, babylonScene, false, true);   // Opacity
+                if (fresnelParameters != null)
+                {
+                    babylonMaterial.opacityFresnelParameters = fresnelParameters;
+                    if (babylonMaterial.alpha == 1 &&
+                         babylonMaterial.opacityTexture == null)
+                    {
+                        babylonMaterial.alpha = 0;
+                    }
+                }
+
+                babylonMaterial.bumpTexture = ExportTexture(stdMat, 8, out fresnelParameters, babylonScene);                   // Bump
+                babylonMaterial.reflectionTexture = ExportTexture(stdMat, 9, out fresnelParameters, babylonScene, true);       // Reflection
+                if (fresnelParameters != null)
+                {
+                    if (babylonMaterial.reflectionTexture == null)
+                    {
+                        RaiseWarning("Fallout cannot be used with reflection channel without a texture", 2);
+                    }
+                    else
+                    {
+                        babylonMaterial.reflectionFresnelParameters = fresnelParameters;
+                    }
+                }
+
+                // Constraints
+                if (babylonMaterial.diffuseTexture != null)
+                {
+                    babylonMaterial.diffuse = new[] { 1.0f, 1.0f, 1.0f };
+                }
+
+                if (babylonMaterial.emissiveTexture != null)
+                {
+                    babylonMaterial.emissive = new float[] { 0, 0, 0 };
+                }
+
+                if (babylonMaterial.opacityTexture != null && babylonMaterial.diffuseTexture != null &&
+                    babylonMaterial.diffuseTexture.name == babylonMaterial.opacityTexture.name &&
+                    babylonMaterial.diffuseTexture.hasAlpha && !babylonMaterial.opacityTexture.getAlphaFromRGB)
+                {
+                    // This is a alpha testing purpose
+                    babylonMaterial.opacityTexture = null;
+                    babylonMaterial.diffuseTexture.hasAlpha = true;
+                    RaiseWarning("Opacity texture was removed because alpha from diffuse texture can be use instead", 2);
+                    RaiseWarning("If you do not want this behavior, just set Alpha Source = None on your diffuse texture", 2);
+                }
+            }
+
+            babylonScene.MaterialsList.Add(babylonMaterial);
+        }
+    }
+}

文件差異過大導致無法顯示
+ 726 - 726
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Mesh.cs


+ 66 - 65
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.ShadowGenerator.cs

@@ -1,65 +1,66 @@
-using System.Collections.Generic;
-using Autodesk.Max;
-using BabylonExport.Entities;
-
-namespace Max2Babylon
-{
-    partial class BabylonExporter
-    {
-        private BabylonShadowGenerator ExportShadowGenerator(IINode lightNode, BabylonScene babylonScene)
-        {
-            var maxLight = (lightNode.ObjectRef as ILightObject);
-            var babylonShadowGenerator = new BabylonShadowGenerator();
-
-            RaiseMessage("Exporting shadow map", 2);
-
-            babylonShadowGenerator.lightId = lightNode.GetGuid().ToString();
-
-            babylonShadowGenerator.mapSize = maxLight.GetMapSize(0, Tools.Forever);
-
-            babylonShadowGenerator.bias = lightNode.GetFloatProperty("babylonjs_shadows_bias", 0.00005f);
-
-            var shadowsType = lightNode.GetStringProperty("babylonjs_shadows_type", "Blurred Variance");
-
-            switch (shadowsType)
-            {
-                case "Hard shadows":
-                    break;
-                case "Poisson Sampling":
-                    babylonShadowGenerator.usePoissonSampling = true;
-                    break;
-                case "Variance":
-                    babylonShadowGenerator.useVarianceShadowMap = true;
-                    break;
-                case"Blurred Variance":
-                    babylonShadowGenerator.useBlurVarianceShadowMap = true;
-                    babylonShadowGenerator.blurScale = lightNode.GetFloatProperty("babylonjs_shadows_blurScale", 2);
-                    babylonShadowGenerator.blurBoxOffset = lightNode.GetFloatProperty("babylonjs_shadows_blurBoxOffset", 1);
-                    break;
-            }
-
-            
-            var list = new List<string>();
-
-            var inclusion = maxLight.ExclList.TestFlag(1); //NT_INCLUDE 
-            var checkExclusionList = maxLight.ExclList.TestFlag(4); //NT_AFFECT_SHADOWCAST 
-
-            foreach (var meshNode in Loader.Core.RootNode.NodesListBySuperClass(SClass_ID.Geomobject))
-            {
-                if (meshNode.CastShadows == 1)
-                {
-                    var inList = maxLight.ExclList.FindNode(meshNode) != -1;
-
-                    if (!checkExclusionList || (inList && inclusion) || (!inList && !inclusion))
-                    {
-                        list.Add(meshNode.GetGuid().ToString());
-                    }
-                }
-            }
-            babylonShadowGenerator.renderList = list.ToArray();
-
-            babylonScene.ShadowGeneratorsList.Add(babylonShadowGenerator);
-            return babylonShadowGenerator;
-        }
-    }
-}
+using System.Collections.Generic;
+using Autodesk.Max;
+using BabylonExport.Entities;
+
+namespace Max2Babylon
+{
+    partial class BabylonExporter
+    {
+        private BabylonShadowGenerator ExportShadowGenerator(IINode lightNode, BabylonScene babylonScene)
+        {
+            var maxLight = (lightNode.ObjectRef as ILightObject);
+            var babylonShadowGenerator = new BabylonShadowGenerator();
+
+            RaiseMessage("Exporting shadow map", 2);
+
+            babylonShadowGenerator.lightId = lightNode.GetGuid().ToString();
+
+            babylonShadowGenerator.mapSize = maxLight.GetMapSize(0, Tools.Forever);
+
+            babylonShadowGenerator.bias = lightNode.GetFloatProperty("babylonjs_shadows_bias", 0.00005f);
+            babylonShadowGenerator.forceBackFacesOnly = lightNode.GetBoolProperty("babylonjs_forcebackfaces");
+
+            var shadowsType = lightNode.GetStringProperty("babylonjs_shadows_type", "Blurred Variance");
+
+            switch (shadowsType)
+            {
+                case "Hard shadows":
+                    break;
+                case "Poisson Sampling":
+                    babylonShadowGenerator.usePoissonSampling = true;
+                    break;
+                case "Variance":
+                    babylonShadowGenerator.useVarianceShadowMap = true;
+                    break;
+                case"Blurred Variance":
+                    babylonShadowGenerator.useBlurVarianceShadowMap = true;
+                    babylonShadowGenerator.blurScale = lightNode.GetFloatProperty("babylonjs_shadows_blurScale", 2);
+                    babylonShadowGenerator.blurBoxOffset = lightNode.GetFloatProperty("babylonjs_shadows_blurBoxOffset", 1);
+                    break;
+            }
+
+            
+            var list = new List<string>();
+
+            var inclusion = maxLight.ExclList.TestFlag(1); //NT_INCLUDE 
+            var checkExclusionList = maxLight.ExclList.TestFlag(4); //NT_AFFECT_SHADOWCAST 
+
+            foreach (var meshNode in Loader.Core.RootNode.NodesListBySuperClass(SClass_ID.Geomobject))
+            {
+                if (meshNode.CastShadows == 1)
+                {
+                    var inList = maxLight.ExclList.FindNode(meshNode) != -1;
+
+                    if (!checkExclusionList || (inList && inclusion) || (!inList && !inclusion))
+                    {
+                        list.Add(meshNode.GetGuid().ToString());
+                    }
+                }
+            }
+            babylonShadowGenerator.renderList = list.ToArray();
+
+            babylonScene.ShadowGeneratorsList.Add(babylonShadowGenerator);
+            return babylonShadowGenerator;
+        }
+    }
+}

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

@@ -1,132 +1,135 @@
-using System;
-using System.Collections.Generic;
-using Autodesk.Max;
-using BabylonExport.Entities;
-using SharpDX;
-
-namespace Max2Babylon
-{
-    internal class BonePoseInfo
-    {
-        public IGMatrix AbsoluteTransform { get; set; }
-        public IGMatrix LocalTransform { get; set; }
-    }
-    partial class BabylonExporter
-    {
-        readonly List<IIGameSkin> skins = new List<IIGameSkin>();
-        readonly List<IIGameNode> skinnedNodes = new List<IIGameNode>();
-
-        IGMatrix WithNoScale(IGMatrix mat)
-        {
-            var mat3 = mat.ExtractMatrix3();
-            mat3.NoScale();
-            return Loader.Global.GMatrix.Create(mat3);
-        }
-        private void ExportSkin(IIGameSkin skin, BabylonScene babylonScene)
-        {
-            var babylonSkeleton = new BabylonSkeleton { id = skins.IndexOf(skin) };
-            babylonSkeleton.name = "skeleton #" + babylonSkeleton.id;
-
-            RaiseMessage(babylonSkeleton.name, 1);
-
-            var skinIndex = skins.IndexOf(skin);
-            var meshNode = skinnedNodes[skinIndex];
-            var skinInitMatrix = meshNode.GetObjectTM(0);
-
-            var bones = new List<BabylonBone>();
-            var gameBones = new List<IIGameNode>();
-            var boneIds = new List<int>();
-            var bindPoseInfos = new List<BonePoseInfo>();
-            for(int i = 0; i < skin.TotalSkinBoneCount; ++i)
-            {
-                bones.Add(null);
-                gameBones.Add(null);
-                boneIds.Add(-1);
-                bindPoseInfos.Add(null);
-            }
-            for (var index = 0; index < skin.TotalSkinBoneCount; index++)
-            {
-                var gameBone = skin.GetIGameBone(index, false);
-
-                var sortedIndex = skinSortedBones[skin].IndexOf(gameBone.NodeID);
-
-                gameBones[sortedIndex] = (gameBone);
-                boneIds[sortedIndex] =(gameBone.NodeID);
-                bones[sortedIndex]=(new BabylonBone { index = sortedIndex, name = gameBone.Name });
-
-                var boneInitMatrix = gameBone.GetObjectTM(0);
-                bindPoseInfos[sortedIndex] = (new BonePoseInfo { AbsoluteTransform = boneInitMatrix });
-            }
-
-            // fix hierarchy an generate animation keys
-            for (var index = 0; index < skin.TotalSkinBoneCount; index++)
-            {
-                var gameBone = gameBones[index];
-                var parent = gameBone.NodeParent;
-                var babBone = bones[index];
-                if (parent != null)
-                {
-                    babBone.parentBoneIndex = boneIds.IndexOf(parent.NodeID);
-                }
-                if (babBone.parentBoneIndex == -1)
-                {
-                    bindPoseInfos[index].LocalTransform = bindPoseInfos[index].AbsoluteTransform.Multiply(skinInitMatrix.Inverse);
-                }
-                else
-                {
-                    var parentBindPoseInfos = bindPoseInfos[babBone.parentBoneIndex];
-                    bindPoseInfos[index].LocalTransform = bindPoseInfos[index].AbsoluteTransform.Multiply(parentBindPoseInfos.AbsoluteTransform.Inverse);
-                }
-                babBone.matrix = bindPoseInfos[index].LocalTransform.ToArray();
-
-                var babylonAnimation = new BabylonAnimation
-                {
-                    name = gameBone.Name + "Animation",
-                    property = "_matrix",
-                    dataType = (int)BabylonAnimation.DataType.Matrix,
-                    loopBehavior = (int)BabylonAnimation.LoopBehavior.Cycle,
-                    framePerSecond = Loader.Global.FrameRate
-                };
-
-                var start = Loader.Core.AnimRange.Start;
-                var end = Loader.Core.AnimRange.End;
-
-                float[] previous = null;
-                var keys = new List<BabylonAnimationKey>();
-                for (var key = start; key <= end; key += Ticks)
-                {
-                    var objectTM = gameBone.GetObjectTM(key);
-                    var parentNode = gameBone.NodeParent;
-                    IGMatrix mat;
-                    if (parentNode == null || babBone.parentBoneIndex == -1)
-                    {
-                        mat = objectTM.Multiply(meshNode.GetObjectTM(key).Inverse);
-                    }
-                    else
-                    {
-                        mat = objectTM.Multiply(parentNode.GetObjectTM(key).Inverse);
-                    }
-
-                    var current = mat.ToArray();
-                    if (key == start || key == end || !(previous.IsEqualTo(current)))
-                    {
-                        keys.Add(new BabylonAnimationKey
-                        {
-                            frame = key / Ticks,
-                            values = current
-                        });
-                    }
-
-                    previous = current;
-                }
-
-                babylonAnimation.keys = keys.ToArray();
-                babBone.animation = babylonAnimation;
-            }
-
-            babylonSkeleton.bones = bones.ToArray();
-
-            babylonScene.SkeletonsList.Add(babylonSkeleton);
-        }
-    }
-}
+using System;
+using System.Collections.Generic;
+using Autodesk.Max;
+using BabylonExport.Entities;
+using SharpDX;
+
+namespace Max2Babylon
+{
+    internal class BonePoseInfo
+    {
+        public IGMatrix AbsoluteTransform { get; set; }
+        public IGMatrix LocalTransform { get; set; }
+    }
+    partial class BabylonExporter
+    {
+        readonly List<IIGameSkin> skins = new List<IIGameSkin>();
+        readonly List<IIGameNode> skinnedNodes = new List<IIGameNode>();
+
+        IGMatrix WithNoScale(IGMatrix mat)
+        {
+            var mat3 = mat.ExtractMatrix3();
+            mat3.NoScale();
+            return Loader.Global.GMatrix.Create(mat3);
+        }
+        private void ExportSkin(IIGameSkin skin, BabylonScene babylonScene)
+        {
+            var babylonSkeleton = new BabylonSkeleton { id = skins.IndexOf(skin) };
+            babylonSkeleton.name = "skeleton #" + babylonSkeleton.id;
+
+            RaiseMessage(babylonSkeleton.name, 1);
+
+            var skinIndex = skins.IndexOf(skin);
+
+            var bones = new List<BabylonBone>();
+            var gameBones = new List<IIGameNode>();
+            var boneIds = new List<int>();
+            var bindPoseInfos = new List<BonePoseInfo>();
+            for(int i = 0; i < skin.TotalSkinBoneCount; ++i)
+            {
+                bones.Add(null);
+                gameBones.Add(null);
+                boneIds.Add(-1);
+                bindPoseInfos.Add(null);
+            }
+            for (var index = 0; index < skin.TotalSkinBoneCount; index++)
+            {
+                var gameBone = skin.GetIGameBone(index, false);
+
+                var sortedIndex = skinSortedBones[skin].IndexOf(gameBone.NodeID);
+
+                gameBones[sortedIndex] = (gameBone);
+                boneIds[sortedIndex] =(gameBone.NodeID);
+                bones[sortedIndex]=(new BabylonBone { index = sortedIndex, name = gameBone.Name });
+
+                var boneInitMatrix = gameBone.GetObjectTM(0);
+                bindPoseInfos[sortedIndex] = (new BonePoseInfo { AbsoluteTransform = boneInitMatrix });
+            }
+
+            // 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];
+                var parent = gameBone.NodeParent;
+                var babBone = bones[index];
+                if (parent != null)
+                {
+                    babBone.parentBoneIndex = boneIds.IndexOf(parent.NodeID);
+                }
+
+                if (babBone.parentBoneIndex == -1)
+                {
+                    bindPoseInfos[index].LocalTransform = bindPoseInfos[index].AbsoluteTransform;
+                }
+                else
+                {
+                    var parentBindPoseInfos = bindPoseInfos[babBone.parentBoneIndex];
+                    bindPoseInfos[index].LocalTransform = bindPoseInfos[index].AbsoluteTransform.Multiply(parentBindPoseInfos.AbsoluteTransform.Inverse);
+                }
+
+                babBone.matrix = bindPoseInfos[index].LocalTransform.ToArray();
+
+                var babylonAnimation = new BabylonAnimation
+                {
+                    name = gameBone.Name + "Animation",
+                    property = "_matrix",
+                    dataType = (int)BabylonAnimation.DataType.Matrix,
+                    loopBehavior = (int)BabylonAnimation.LoopBehavior.Cycle,
+                    framePerSecond = Loader.Global.FrameRate
+                };
+
+                var start = Loader.Core.AnimRange.Start;
+                var end = Loader.Core.AnimRange.End;
+
+                float[] previous = null;
+                var keys = new List<BabylonAnimationKey>();
+                for (var key = start; key <= end; key += Ticks)
+                {
+                    var objectTM = gameBone.GetObjectTM(key);
+                    var parentNode = gameBone.NodeParent;
+                    IGMatrix mat;
+                    if (parentNode == null || babBone.parentBoneIndex == -1)
+                    {
+                        mat = objectTM;
+                    }
+                    else
+                    {
+                        mat = objectTM.Multiply(parentNode.GetObjectTM(key).Inverse);
+                    }
+
+                    var current = mat.ToArray();
+                    if (key == start || key == end || exportNonOptimizedAnimations || !(previous.IsEqualTo(current)))
+                    {
+                        keys.Add(new BabylonAnimationKey
+                        {
+                            frame = key / Ticks,
+                            values = current
+                        });
+                    }
+
+                    previous = current;
+                }
+
+                babylonAnimation.keys = keys.ToArray();
+                babBone.animation = babylonAnimation;
+            }
+
+            babylonSkeleton.needInitialSkinMatrix = true;
+            babylonSkeleton.bones = bones.ToArray();
+
+            babylonScene.SkeletonsList.Add(babylonSkeleton);
+        }
+    }
+}

+ 244 - 238
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Texture.cs

@@ -1,238 +1,244 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Autodesk.Max;
-using BabylonExport.Entities;
-
-namespace Max2Babylon
-{
-    partial class BabylonExporter
-    {
-        bool IsTextureCube(string filepath)
-        {
-            try
-            {
-                if (Path.GetExtension(filepath).ToLower() != ".dds")
-                {
-                    return false;
-                }
-
-                var data = File.ReadAllBytes(filepath);
-                var intArray = new int[data.Length / 4];
-
-                Buffer.BlockCopy(data, 0, intArray, 0, intArray.Length * 4);
-
-
-                int width = intArray[4];
-                int height = intArray[3];
-                int mipmapsCount = intArray[7];
-
-                if ((width >> (mipmapsCount - 1)) > 1)
-                {
-                    var expected = 1;
-                    var currentSize = Math.Max(width, height);
-
-                    while (currentSize > 1)
-                    {
-                        currentSize = currentSize >> 1;
-                        expected++;
-                    }
-
-                    RaiseWarning(string.Format("Mipmaps chain is not complete: {0} maps instead of {1} (based on texture max size: {2})", mipmapsCount, expected, width), 2);
-                    RaiseWarning(string.Format("You must generate a complete mipmaps chain for .dds)"), 2);
-                    RaiseWarning(string.Format("Mipmaps will be disabled for this texture. If you want automatic texture generation you cannot use a .dds)"), 2);
-                }
-
-                bool isCube = (intArray[28] & 0x200) == 0x200;
-
-                return isCube;
-            }
-            catch
-            {
-                return false;
-            }
-        }
-
-        private BabylonTexture ExportTexture(IStdMat2 stdMat, int index, out BabylonFresnelParameters fresnelParameters, BabylonScene babylonScene, bool allowCube = false, bool forceAlpha = false)
-        {
-            fresnelParameters = null;
-
-            if (!stdMat.MapEnabled(index))
-            {
-                return null;
-            }
-            var babylonTexture = new BabylonTexture();
-
-            var texMap = stdMat.GetSubTexmap(index);
-
-            // Fallout
-            if (texMap.ClassName == "Falloff") // This is the only way I found to detect it. This is crappy but it works
-            {
-                fresnelParameters = new BabylonFresnelParameters();
-
-                var paramBlock = texMap.GetParamBlock(0);
-                var color1 = paramBlock.GetColor(0, 0, 0);
-                var color2 = paramBlock.GetColor(4, 0, 0);
-
-                fresnelParameters.isEnabled = true;
-                fresnelParameters.leftColor = color2.ToArray();
-                fresnelParameters.rightColor = color1.ToArray();
-
-                if (paramBlock.GetInt(8, 0, 0) == 2)
-                {
-                    fresnelParameters.power = paramBlock.GetFloat(12, 0, 0);
-                }
-                else
-                {
-                    fresnelParameters.power = 1;
-                }
-                var texMap1 = paramBlock.GetTexmap(2, 0, 0);
-                var texMap1On = paramBlock.GetInt(3, 0, 0);
-
-                var texMap2 = paramBlock.GetTexmap(6, 0, 0);
-                var texMap2On = paramBlock.GetInt(7, 0, 0);
-
-                if (texMap1 != null && texMap1On != 0)
-                {
-                    texMap = texMap1;
-                    fresnelParameters.rightColor = new float[] { 1, 1, 1 };
-
-                    if (texMap2 != null && texMap2On != 0)
-                    {
-                        RaiseWarning(string.Format("You cannot specify two textures for falloff. Only one is supported"), 2);
-                    }
-                }
-                else if (texMap2 != null && texMap2On != 0)
-                {
-                    fresnelParameters.leftColor = new float[] { 1, 1, 1 };
-                    texMap = texMap2;
-                }
-                else
-                {
-                    return null;
-                }
-            }
-
-            // Bitmap
-            var texture = texMap.GetParamBlock(0).Owner as IBitmapTex;
-
-            if (texture == null)
-            {
-                return null;
-            }
-
-            if (forceAlpha)
-            {
-                babylonTexture.hasAlpha = true;
-                babylonTexture.getAlphaFromRGB = (texture.AlphaSource == 2) || (texture.AlphaSource == 3);
-            }
-            else
-            {
-                babylonTexture.hasAlpha = (texture.AlphaSource != 3);
-                babylonTexture.getAlphaFromRGB = (texture.AlphaSource == 2);
-            }
-
-
-            babylonTexture.level = stdMat.GetTexmapAmt(index, 0);
-
-            var uvGen = texture.UVGen;
-
-            switch (uvGen.GetCoordMapping(0))
-            {
-                case 1: //MAP_SPHERICAL
-                    babylonTexture.coordinatesMode = 1;
-                    break;
-                case 2: //MAP_PLANAR
-                    babylonTexture.coordinatesMode = 2;
-                    break;
-                default:
-                    babylonTexture.coordinatesMode = 0;
-                    break;
-            }
-
-            babylonTexture.coordinatesIndex = uvGen.MapChannel - 1;
-            if (uvGen.MapChannel > 2)
-            {
-                RaiseWarning(string.Format("Unsupported map channel, Only channel 1 and 2 are supported."), 2);
-            }
-
-            babylonTexture.uOffset = uvGen.GetUOffs(0);
-            babylonTexture.vOffset = uvGen.GetVOffs(0);
-
-            babylonTexture.uScale = uvGen.GetUScl(0);
-            babylonTexture.vScale = uvGen.GetVScl(0);
-
-            if (Path.GetExtension(texture.MapName).ToLower() == ".dds")
-            {
-                babylonTexture.vScale *= -1; // Need to invert Y-axis for DDS texture
-            }
-
-            babylonTexture.uAng = uvGen.GetUAng(0);
-            babylonTexture.vAng = uvGen.GetVAng(0);
-            babylonTexture.wAng = uvGen.GetWAng(0);
-
-            babylonTexture.wrapU = 0; // CLAMP
-            if ((uvGen.TextureTiling & 1) != 0) // WRAP
-            {
-                babylonTexture.wrapU = 1;
-            }
-            else if ((uvGen.TextureTiling & 4) != 0) // MIRROR
-            {
-                babylonTexture.wrapU = 2;
-            }
-
-            babylonTexture.wrapV = 0; // CLAMP
-            if ((uvGen.TextureTiling & 2) != 0) // WRAP
-            {
-                babylonTexture.wrapV = 1;
-            }
-            else if ((uvGen.TextureTiling & 8) != 0) // MIRROR
-            {
-                babylonTexture.wrapV = 2;
-            }
-
-            babylonTexture.name = Path.GetFileName(texture.MapName);
-
-            // Animations
-            var animations = new List<BabylonAnimation>();
-            ExportFloatAnimation("uOffset", animations, key => new[] { uvGen.GetUOffs(key) });
-            ExportFloatAnimation("vOffset", animations, key => new[] { uvGen.GetVOffs(key) });
-            ExportFloatAnimation("uScale", animations, key => new[] { uvGen.GetUScl(key) });
-            ExportFloatAnimation("vScale", animations, key => new[] { uvGen.GetVScl(key) });
-            ExportFloatAnimation("uAng", animations, key => new[] { uvGen.GetUAng(key) });
-            ExportFloatAnimation("vAng", animations, key => new[] { uvGen.GetVAng(key) });
-            ExportFloatAnimation("wAng", animations, key => new[] { uvGen.GetWAng(key) });
-
-            babylonTexture.animations = animations.ToArray();
-            var absolutePath = texture.Map.FullFilePath;
-            // Copy texture to output
-            try
-            {
-                if (File.Exists(absolutePath))
-                {
-                    babylonTexture.isCube = IsTextureCube(absolutePath);
-                    if (CopyTexturesToOutput)
-                    {
-                        File.Copy(absolutePath, Path.Combine(babylonScene.OutputPath, babylonTexture.name), true);
-                    }
-                }
-                else
-                {
-                    RaiseWarning(string.Format("Texture {0} not found.", babylonTexture.name), 2);
-                }
-
-            }
-            catch
-            {
-                // silently fails
-            }
-
-            if (babylonTexture.isCube && !allowCube)
-            {
-                RaiseWarning(string.Format("Cube texture are only supported for reflection channel"), 2);
-            }
-
-            return babylonTexture;
-        }
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.IO;
+using Autodesk.Max;
+using BabylonExport.Entities;
+
+namespace Max2Babylon
+{
+    partial class BabylonExporter
+    {
+        bool IsTextureCube(string filepath)
+        {
+            try
+            {
+                if (Path.GetExtension(filepath).ToLower() != ".dds")
+                {
+                    return false;
+                }
+
+                var data = File.ReadAllBytes(filepath);
+                var intArray = new int[data.Length / 4];
+
+                Buffer.BlockCopy(data, 0, intArray, 0, intArray.Length * 4);
+
+
+                int width = intArray[4];
+                int height = intArray[3];
+                int mipmapsCount = intArray[7];
+
+                if ((width >> (mipmapsCount - 1)) > 1)
+                {
+                    var expected = 1;
+                    var currentSize = Math.Max(width, height);
+
+                    while (currentSize > 1)
+                    {
+                        currentSize = currentSize >> 1;
+                        expected++;
+                    }
+
+                    RaiseWarning(string.Format("Mipmaps chain is not complete: {0} maps instead of {1} (based on texture max size: {2})", mipmapsCount, expected, width), 2);
+                    RaiseWarning(string.Format("You must generate a complete mipmaps chain for .dds)"), 2);
+                    RaiseWarning(string.Format("Mipmaps will be disabled for this texture. If you want automatic texture generation you cannot use a .dds)"), 2);
+                }
+
+                bool isCube = (intArray[28] & 0x200) == 0x200;
+
+                return isCube;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        private BabylonTexture ExportTexture(IStdMat2 stdMat, int index, out BabylonFresnelParameters fresnelParameters, BabylonScene babylonScene, bool allowCube = false, bool forceAlpha = false)
+        {
+            fresnelParameters = null;
+
+            if (!stdMat.MapEnabled(index))
+            {
+                return null;
+            }
+            var babylonTexture = new BabylonTexture();
+
+            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
+            {
+                fresnelParameters = new BabylonFresnelParameters();
+
+                var paramBlock = texMap.GetParamBlock(0);
+                var color1 = paramBlock.GetColor(0, 0, 0);
+                var color2 = paramBlock.GetColor(4, 0, 0);
+
+                fresnelParameters.isEnabled = true;
+                fresnelParameters.leftColor = color2.ToArray();
+                fresnelParameters.rightColor = color1.ToArray();
+
+                if (paramBlock.GetInt(8, 0, 0) == 2)
+                {
+                    fresnelParameters.power = paramBlock.GetFloat(12, 0, 0);
+                }
+                else
+                {
+                    fresnelParameters.power = 1;
+                }
+                var texMap1 = paramBlock.GetTexmap(2, 0, 0);
+                var texMap1On = paramBlock.GetInt(3, 0, 0);
+
+                var texMap2 = paramBlock.GetTexmap(6, 0, 0);
+                var texMap2On = paramBlock.GetInt(7, 0, 0);
+
+                if (texMap1 != null && texMap1On != 0)
+                {
+                    texMap = texMap1;
+                    fresnelParameters.rightColor = new float[] { 1, 1, 1 };
+
+                    if (texMap2 != null && texMap2On != 0)
+                    {
+                        RaiseWarning(string.Format("You cannot specify two textures for falloff. Only one is supported"), 2);
+                    }
+                }
+                else if (texMap2 != null && texMap2On != 0)
+                {
+                    fresnelParameters.leftColor = new float[] { 1, 1, 1 };
+                    texMap = texMap2;
+                }
+                else
+                {
+                    return null;
+                }
+            }
+
+            // Bitmap
+            var texture = texMap.GetParamBlock(0).Owner as IBitmapTex;
+
+            if (texture == null)
+            {
+                return null;
+            }
+
+            if (forceAlpha)
+            {
+                babylonTexture.hasAlpha = true;
+                babylonTexture.getAlphaFromRGB = (texture.AlphaSource == 2) || (texture.AlphaSource == 3);
+            }
+            else
+            {
+                babylonTexture.hasAlpha = (texture.AlphaSource != 3);
+                babylonTexture.getAlphaFromRGB = (texture.AlphaSource == 2);
+            }
+
+
+            babylonTexture.level = stdMat.GetTexmapAmt(index, 0);
+
+            var uvGen = texture.UVGen;
+
+            switch (uvGen.GetCoordMapping(0))
+            {
+                case 1: //MAP_SPHERICAL
+                    babylonTexture.coordinatesMode = 1;
+                    break;
+                case 2: //MAP_PLANAR
+                    babylonTexture.coordinatesMode = 2;
+                    break;
+                default:
+                    babylonTexture.coordinatesMode = 0;
+                    break;
+            }
+
+            babylonTexture.coordinatesIndex = uvGen.MapChannel - 1;
+            if (uvGen.MapChannel > 2)
+            {
+                RaiseWarning(string.Format("Unsupported map channel, Only channel 1 and 2 are supported."), 2);
+            }
+
+            babylonTexture.uOffset = uvGen.GetUOffs(0);
+            babylonTexture.vOffset = uvGen.GetVOffs(0);
+
+            babylonTexture.uScale = uvGen.GetUScl(0);
+            babylonTexture.vScale = uvGen.GetVScl(0);
+
+            if (Path.GetExtension(texture.MapName).ToLower() == ".dds")
+            {
+                babylonTexture.vScale *= -1; // Need to invert Y-axis for DDS texture
+            }
+
+            babylonTexture.uAng = uvGen.GetUAng(0);
+            babylonTexture.vAng = uvGen.GetVAng(0);
+            babylonTexture.wAng = uvGen.GetWAng(0);
+
+            babylonTexture.wrapU = 0; // CLAMP
+            if ((uvGen.TextureTiling & 1) != 0) // WRAP
+            {
+                babylonTexture.wrapU = 1;
+            }
+            else if ((uvGen.TextureTiling & 4) != 0) // MIRROR
+            {
+                babylonTexture.wrapU = 2;
+            }
+
+            babylonTexture.wrapV = 0; // CLAMP
+            if ((uvGen.TextureTiling & 2) != 0) // WRAP
+            {
+                babylonTexture.wrapV = 1;
+            }
+            else if ((uvGen.TextureTiling & 8) != 0) // MIRROR
+            {
+                babylonTexture.wrapV = 2;
+            }
+
+            babylonTexture.name = Path.GetFileName(texture.MapName);
+
+            // Animations
+            var animations = new List<BabylonAnimation>();
+            ExportFloatAnimation("uOffset", animations, key => new[] { uvGen.GetUOffs(key) });
+            ExportFloatAnimation("vOffset", animations, key => new[] { uvGen.GetVOffs(key) });
+            ExportFloatAnimation("uScale", animations, key => new[] { uvGen.GetUScl(key) });
+            ExportFloatAnimation("vScale", animations, key => new[] { uvGen.GetVScl(key) });
+            ExportFloatAnimation("uAng", animations, key => new[] { uvGen.GetUAng(key) });
+            ExportFloatAnimation("vAng", animations, key => new[] { uvGen.GetVAng(key) });
+            ExportFloatAnimation("wAng", animations, key => new[] { uvGen.GetWAng(key) });
+
+            babylonTexture.animations = animations.ToArray();
+            var absolutePath = texture.Map.FullFilePath;
+            // Copy texture to output
+            try
+            {
+                if (File.Exists(absolutePath))
+                {
+                    babylonTexture.isCube = IsTextureCube(absolutePath);
+                    if (CopyTexturesToOutput)
+                    {
+                        File.Copy(absolutePath, Path.Combine(babylonScene.OutputPath, babylonTexture.name), true);
+                    }
+                }
+                else
+                {
+                    RaiseWarning(string.Format("Texture {0} not found.", babylonTexture.name), 2);
+                }
+
+            }
+            catch
+            {
+                // silently fails
+            }
+
+            if (babylonTexture.isCube && !allowCube)
+            {
+                RaiseWarning(string.Format("Cube texture are only supported for reflection channel"), 2);
+            }
+
+            return babylonTexture;
+        }
+    }
+}

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

@@ -1,322 +1,322 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using Autodesk.Max;
-using BabylonExport.Entities;
-using Newtonsoft.Json;
-using Color = System.Drawing.Color;
-using System.Runtime.InteropServices;
-
-namespace Max2Babylon
-{
-    internal partial class BabylonExporter
-    {
-        public event Action<int> OnImportProgressChanged;
-        public event Action<string, int> OnWarning;
-        public event Action<string, Color, int, bool> OnMessage;
-        public event Action<string, int> OnError;
-
-        public bool AutoSave3dsMaxFile { get; set; }
-        public bool ExportHiddenObjects { get; set; }
-        public bool IsCancelled { get; set; }
-
-        public bool CopyTexturesToOutput { get; set; }
-
-        public string MaxSceneFileName { get; set; }
-
-        public bool ExportQuaternionsInsteadOfEulers { get; set; }
-
-        void ReportProgressChanged(int progress)
-        {
-            if (OnImportProgressChanged != null)
-            {
-                OnImportProgressChanged(progress);
-            }
-        }
-
-        void RaiseError(string error, int rank = 0)
-        {
-            if (OnError != null)
-            {
-                OnError(error, rank);
-            }
-        }
-
-        void RaiseWarning(string warning, int rank = 0)
-        {
-            if (OnWarning != null)
-            {
-                OnWarning(warning, rank);
-            }
-        }
-
-        void RaiseMessage(string message, int rank = 0, bool emphasis = false)
-        {
-            RaiseMessage(message, Color.Black, rank, emphasis);
-        }
-
-        void RaiseMessage(string message, Color color, int rank = 0, bool emphasis = false)
-        {
-            if (OnMessage != null)
-            {
-                OnMessage(message, color, rank, emphasis);
-            }
-        }
-
-        void CheckCancelled()
-        {
-            Application.DoEvents();
-            if (IsCancelled)
-            {
-                throw new OperationCanceledException();
-            }
-        }
-
-        public async Task ExportAsync(string outputFile, bool generateManifest, bool onlySelected, bool generateBinary, Form callerForm)
-        {
-            var gameConversionManger = Loader.Global.ConversionManager;
-            gameConversionManger.CoordSystem = Autodesk.Max.IGameConversionManager.CoordSystem.D3d;
-
-            var gameScene = Loader.Global.IGameInterface;
-            gameScene.InitialiseIGame(onlySelected);
-            gameScene.SetStaticFrame(0);
-
-            MaxSceneFileName = gameScene.SceneFileName;
-
-            IsCancelled = false;
-            RaiseMessage("Exportation started", Color.Blue);
-            ReportProgressChanged(0);
-            var babylonScene = new BabylonScene(Path.GetDirectoryName(outputFile));
-            var rawScene = Loader.Core.RootNode;
-
-            if (!Directory.Exists(babylonScene.OutputPath))
-            {
-                RaiseError("Exportation stopped: Output folder does not exist");
-                ReportProgressChanged(100);
-                return;
-            }
-
-            var watch = new Stopwatch();
-            watch.Start();
-
-            // Save scene
-            RaiseMessage("Saving 3ds max file");
-
-            if (AutoSave3dsMaxFile)
-            {
-                var forceSave = Loader.Core.FileSave;
-
-                if (callerForm != null)
-                {
-                    callerForm.BringToFront();
-                }
-            }
-
-            // Global
-            babylonScene.autoClear = true;
-            babylonScene.clearColor = Loader.Core.GetBackGround(0, Tools.Forever).ToArray();
-            babylonScene.ambientColor = Loader.Core.GetAmbient(0, Tools.Forever).ToArray();
-
-            babylonScene.gravity = rawScene.GetVector3Property("babylonjs_gravity");
-            ExportQuaternionsInsteadOfEulers = rawScene.GetBoolProperty("babylonjs_exportquaternions", 1);
-
-            // Sounds
-            var soundName = rawScene.GetStringProperty("babylonjs_sound_filename", "");
-
-            if (!string.IsNullOrEmpty(soundName))
-            {
-                var filename = Path.GetFileName(soundName);
-
-                var globalSound = new BabylonSound
-                {
-                    autoplay = rawScene.GetBoolProperty("babylonjs_sound_autoplay", 1),
-                    loop = rawScene.GetBoolProperty("babylonjs_sound_loop", 1),
-                    name = filename
-                };
-
-                babylonScene.SoundsList.Add(globalSound);
-
-                try
-                {
-                    File.Copy(soundName, Path.Combine(babylonScene.OutputPath, filename), true);
-                }
-                catch
-                {
-                }
-            }
-
-            // Cameras
-            BabylonCamera mainCamera = null;
-            ICameraObject mainCameraNode = null;
-
-            RaiseMessage("Exporting cameras");
-            var camerasTab = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Camera);
-            for (int ix = 0; ix < camerasTab.Count; ++ix)
-            {
-                var indexer = new IntPtr(ix);
-                var cameraNode = camerasTab[indexer];
-                Marshal.FreeHGlobal(indexer);
-                ExportCamera(gameScene, cameraNode, babylonScene);
-
-                if (mainCamera == null && babylonScene.CamerasList.Count > 0)
-                {
-                    mainCameraNode = (cameraNode.MaxNode.ObjectRef as ICameraObject);
-                    mainCamera = babylonScene.CamerasList[0];
-                    babylonScene.activeCameraID = mainCamera.id;
-                    RaiseMessage("Active camera set to " + mainCamera.name, Color.Green, 1, true);
-                }
-            }
-
-            if (mainCamera == null)
-            {
-                RaiseWarning("No camera defined", 1);
-            }
-            else
-            {
-                RaiseMessage(string.Format("Total: {0}", babylonScene.CamerasList.Count), Color.Gray, 1);
-            }
-
-            // Fog
-            for (var index = 0; index < Loader.Core.NumAtmospheric; index++)
-            {
-                var atmospheric = Loader.Core.GetAtmospheric(index);
-
-                if (atmospheric.Active(0) && atmospheric.ClassName == "Fog")
-                {
-                    var fog = atmospheric as IStdFog;
-
-                    RaiseMessage("Exporting fog");
-
-                    if (fog != null)
-                    {
-                        babylonScene.fogColor = fog.GetColor(0).ToArray();
-                        babylonScene.fogMode = 3;
-                    }
-#if !MAX2015
-                    else
-                    {
-                        var paramBlock = atmospheric.GetReference(0) as IIParamBlock;
-
-                        babylonScene.fogColor = Tools.GetParamBlockValueColor(paramBlock, "Fog Color");
-                        babylonScene.fogMode = 3;
-                    }
-#endif
-                    if (mainCamera != null)
-                    {
-                        babylonScene.fogStart = mainCameraNode.GetEnvRange(0, 0, Tools.Forever);
-                        babylonScene.fogEnd = mainCameraNode.GetEnvRange(0, 1, Tools.Forever);
-                    }
-                }
-            }
-
-            // Meshes
-            ReportProgressChanged(10);
-            RaiseMessage("Exporting meshes");
-            var meshes = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Mesh);
-            var progressionStep = 80.0f / meshes.Count;
-            var progression = 10.0f;
-            for (int ix = 0; ix < meshes.Count; ++ix)
-            {
-                var indexer = new IntPtr(ix);
-                var meshNode = meshes[indexer];
-                Marshal.FreeHGlobal(indexer);
-                ExportMesh(gameScene, meshNode, babylonScene);
-
-
-                ReportProgressChanged((int)progression);
-
-                progression += progressionStep;
-
-                CheckCancelled();
-            }
-
-
-            // Materials
-            RaiseMessage("Exporting materials");
-            var matsToExport = referencedMaterials.ToArray(); // Snapshot because multimaterials can export new materials
-            foreach (var mat in matsToExport)
-            {
-                ExportMaterial(mat, babylonScene);
-                CheckCancelled();
-            }
-            RaiseMessage(string.Format("Total: {0}", babylonScene.MaterialsList.Count + babylonScene.MultiMaterialsList.Count), Color.Gray, 1);
-
-            // Lights
-            RaiseMessage("Exporting lights");
-            var lightNodes = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Light);
-            for (var i = 0; i < lightNodes.Count; ++i)
-            {
-                ExportLight(gameScene, lightNodes[new IntPtr(i)], babylonScene);
-                CheckCancelled();
-            }
-
-
-            if (babylonScene.LightsList.Count == 0)
-            {
-                RaiseWarning("No light defined", 1);
-                RaiseWarning("A default hemispheric light was added for your convenience", 1);
-                ExportDefaultLight(babylonScene);
-            }
-            else
-            {
-                RaiseMessage(string.Format("Total: {0}", babylonScene.LightsList.Count), Color.Gray, 1);
-            }
-
-            // Skeletons
-            if (skins.Count > 0)
-            {
-                RaiseMessage("Exporting skeletons");
-                foreach (var skin in skins)
-                {
-                    ExportSkin(skin, babylonScene);
-                }
-            }
-
-            // Actions
-            babylonScene.actions = ExportNodeAction(gameScene.GetIGameNode(rawScene));
-
-            // Output
-            RaiseMessage("Saving to output file");
-            babylonScene.Prepare(false);
-            var jsonSerializer = JsonSerializer.Create(new JsonSerializerSettings());
-            var sb = new StringBuilder();
-            var sw = new StringWriter(sb, CultureInfo.InvariantCulture);
-
-            await Task.Run(() =>
-            {
-                using (var jsonWriter = new JsonTextWriterOptimized(sw))
-                {
-                    jsonWriter.Formatting = Formatting.None;
-                    jsonSerializer.Serialize(jsonWriter, babylonScene);
-                }
-                File.WriteAllText(outputFile, sb.ToString());
-
-                if (generateManifest)
-                {
-                    File.WriteAllText(outputFile + ".manifest",
-                        "{\r\n\"version\" : 1,\r\n\"enableSceneOffline\" : true,\r\n\"enableTexturesOffline\" : true\r\n}");
-                }
-            });
-
-            // Binary
-            if (generateBinary)
-            {
-                RaiseMessage("Generating binary files");
-                BabylonFileConverter.BinaryConverter.Convert(outputFile, Path.GetDirectoryName(outputFile) + "\\Binary",
-                    message => RaiseMessage(message, 1),
-                    error => RaiseError(error, 1));
-            }
-
-            ReportProgressChanged(100);
-            watch.Stop();
-            RaiseMessage(string.Format("Exportation done in {0:0.00}s", watch.ElapsedMilliseconds / 1000.0), Color.Blue);
-        }
-
-
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.IO;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using Autodesk.Max;
+using BabylonExport.Entities;
+using Newtonsoft.Json;
+using Color = System.Drawing.Color;
+using System.Runtime.InteropServices;
+
+namespace Max2Babylon
+{
+    internal partial class BabylonExporter
+    {
+        public event Action<int> OnImportProgressChanged;
+        public event Action<string, int> OnWarning;
+        public event Action<string, Color, int, bool> OnMessage;
+        public event Action<string, int> OnError;
+
+        public bool AutoSave3dsMaxFile { get; set; }
+        public bool ExportHiddenObjects { get; set; }
+        public bool IsCancelled { get; set; }
+
+        public bool CopyTexturesToOutput { get; set; }
+
+        public string MaxSceneFileName { get; set; }
+
+        public bool ExportQuaternionsInsteadOfEulers { get; set; }
+
+        void ReportProgressChanged(int progress)
+        {
+            if (OnImportProgressChanged != null)
+            {
+                OnImportProgressChanged(progress);
+            }
+        }
+
+        void RaiseError(string error, int rank = 0)
+        {
+            if (OnError != null)
+            {
+                OnError(error, rank);
+            }
+        }
+
+        void RaiseWarning(string warning, int rank = 0)
+        {
+            if (OnWarning != null)
+            {
+                OnWarning(warning, rank);
+            }
+        }
+
+        void RaiseMessage(string message, int rank = 0, bool emphasis = false)
+        {
+            RaiseMessage(message, Color.Black, rank, emphasis);
+        }
+
+        void RaiseMessage(string message, Color color, int rank = 0, bool emphasis = false)
+        {
+            if (OnMessage != null)
+            {
+                OnMessage(message, color, rank, emphasis);
+            }
+        }
+
+        void CheckCancelled()
+        {
+            Application.DoEvents();
+            if (IsCancelled)
+            {
+                throw new OperationCanceledException();
+            }
+        }
+
+        public async Task ExportAsync(string outputFile, bool generateManifest, bool onlySelected, bool generateBinary, Form callerForm)
+        {
+            var gameConversionManger = Loader.Global.ConversionManager;
+            gameConversionManger.CoordSystem = Autodesk.Max.IGameConversionManager.CoordSystem.D3d;
+
+            var gameScene = Loader.Global.IGameInterface;
+            gameScene.InitialiseIGame(onlySelected);
+            gameScene.SetStaticFrame(0);
+
+            MaxSceneFileName = gameScene.SceneFileName;
+
+            IsCancelled = false;
+            RaiseMessage("Exportation started", Color.Blue);
+            ReportProgressChanged(0);
+            var babylonScene = new BabylonScene(Path.GetDirectoryName(outputFile));
+            var rawScene = Loader.Core.RootNode;
+
+            if (!Directory.Exists(babylonScene.OutputPath))
+            {
+                RaiseError("Exportation stopped: Output folder does not exist");
+                ReportProgressChanged(100);
+                return;
+            }
+
+            var watch = new Stopwatch();
+            watch.Start();
+
+            // Save scene
+            RaiseMessage("Saving 3ds max file");
+
+            if (AutoSave3dsMaxFile)
+            {
+                var forceSave = Loader.Core.FileSave;
+
+                if (callerForm != null)
+                {
+                    callerForm.BringToFront();
+                }
+            }
+
+            // Global
+            babylonScene.autoClear = true;
+            babylonScene.clearColor = Loader.Core.GetBackGround(0, Tools.Forever).ToArray();
+            babylonScene.ambientColor = Loader.Core.GetAmbient(0, Tools.Forever).ToArray();
+
+            babylonScene.gravity = rawScene.GetVector3Property("babylonjs_gravity");
+            ExportQuaternionsInsteadOfEulers = rawScene.GetBoolProperty("babylonjs_exportquaternions", 1);
+
+            // Sounds
+            var soundName = rawScene.GetStringProperty("babylonjs_sound_filename", "");
+
+            if (!string.IsNullOrEmpty(soundName))
+            {
+                var filename = Path.GetFileName(soundName);
+
+                var globalSound = new BabylonSound
+                {
+                    autoplay = rawScene.GetBoolProperty("babylonjs_sound_autoplay", 1),
+                    loop = rawScene.GetBoolProperty("babylonjs_sound_loop", 1),
+                    name = filename
+                };
+
+                babylonScene.SoundsList.Add(globalSound);
+
+                try
+                {
+                    File.Copy(soundName, Path.Combine(babylonScene.OutputPath, filename), true);
+                }
+                catch
+                {
+                }
+            }
+
+            // Cameras
+            BabylonCamera mainCamera = null;
+            ICameraObject mainCameraNode = null;
+
+            RaiseMessage("Exporting cameras");
+            var camerasTab = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Camera);
+            for (int ix = 0; ix < camerasTab.Count; ++ix)
+            {
+                var indexer = new IntPtr(ix);
+                var cameraNode = camerasTab[indexer];
+                Marshal.FreeHGlobal(indexer);
+                ExportCamera(gameScene, cameraNode, babylonScene);
+
+                if (mainCamera == null && babylonScene.CamerasList.Count > 0)
+                {
+                    mainCameraNode = (cameraNode.MaxNode.ObjectRef as ICameraObject);
+                    mainCamera = babylonScene.CamerasList[0];
+                    babylonScene.activeCameraID = mainCamera.id;
+                    RaiseMessage("Active camera set to " + mainCamera.name, Color.Green, 1, true);
+                }
+            }
+
+            if (mainCamera == null)
+            {
+                RaiseWarning("No camera defined", 1);
+            }
+            else
+            {
+                RaiseMessage(string.Format("Total: {0}", babylonScene.CamerasList.Count), Color.Gray, 1);
+            }
+
+            // Fog
+            for (var index = 0; index < Loader.Core.NumAtmospheric; index++)
+            {
+                var atmospheric = Loader.Core.GetAtmospheric(index);
+
+                if (atmospheric.Active(0) && atmospheric.ClassName == "Fog")
+                {
+                    var fog = atmospheric as IStdFog;
+
+                    RaiseMessage("Exporting fog");
+
+                    if (fog != null)
+                    {
+                        babylonScene.fogColor = fog.GetColor(0).ToArray();
+                        babylonScene.fogMode = 3;
+                    }
+#if !MAX2015 && !MAX2016
+                    else
+                    {
+                        var paramBlock = atmospheric.GetReference(0) as IIParamBlock;
+
+                        babylonScene.fogColor = Tools.GetParamBlockValueColor(paramBlock, "Fog Color");
+                        babylonScene.fogMode = 3;
+                    }
+#endif
+                    if (mainCamera != null)
+                    {
+                        babylonScene.fogStart = mainCameraNode.GetEnvRange(0, 0, Tools.Forever);
+                        babylonScene.fogEnd = mainCameraNode.GetEnvRange(0, 1, Tools.Forever);
+                    }
+                }
+            }
+
+            // Meshes
+            ReportProgressChanged(10);
+            RaiseMessage("Exporting meshes");
+            var meshes = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Mesh);
+            var progressionStep = 80.0f / meshes.Count;
+            var progression = 10.0f;
+            for (int ix = 0; ix < meshes.Count; ++ix)
+            {
+                var indexer = new IntPtr(ix);
+                var meshNode = meshes[indexer];
+                Marshal.FreeHGlobal(indexer);
+                ExportMesh(gameScene, meshNode, babylonScene);
+
+
+                ReportProgressChanged((int)progression);
+
+                progression += progressionStep;
+
+                CheckCancelled();
+            }
+
+
+            // Materials
+            RaiseMessage("Exporting materials");
+            var matsToExport = referencedMaterials.ToArray(); // Snapshot because multimaterials can export new materials
+            foreach (var mat in matsToExport)
+            {
+                ExportMaterial(mat, babylonScene);
+                CheckCancelled();
+            }
+            RaiseMessage(string.Format("Total: {0}", babylonScene.MaterialsList.Count + babylonScene.MultiMaterialsList.Count), Color.Gray, 1);
+
+            // Lights
+            RaiseMessage("Exporting lights");
+            var lightNodes = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Light);
+            for (var i = 0; i < lightNodes.Count; ++i)
+            {
+                ExportLight(gameScene, lightNodes[new IntPtr(i)], babylonScene);
+                CheckCancelled();
+            }
+
+
+            if (babylonScene.LightsList.Count == 0)
+            {
+                RaiseWarning("No light defined", 1);
+                RaiseWarning("A default hemispheric light was added for your convenience", 1);
+                ExportDefaultLight(babylonScene);
+            }
+            else
+            {
+                RaiseMessage(string.Format("Total: {0}", babylonScene.LightsList.Count), Color.Gray, 1);
+            }
+
+            // Skeletons
+            if (skins.Count > 0)
+            {
+                RaiseMessage("Exporting skeletons");
+                foreach (var skin in skins)
+                {
+                    ExportSkin(skin, babylonScene);
+                }
+            }
+
+            // Actions
+            babylonScene.actions = ExportNodeAction(gameScene.GetIGameNode(rawScene));
+
+            // Output
+            RaiseMessage("Saving to output file");
+            babylonScene.Prepare(false);
+            var jsonSerializer = JsonSerializer.Create(new JsonSerializerSettings());
+            var sb = new StringBuilder();
+            var sw = new StringWriter(sb, CultureInfo.InvariantCulture);
+
+            await Task.Run(() =>
+            {
+                using (var jsonWriter = new JsonTextWriterOptimized(sw))
+                {
+                    jsonWriter.Formatting = Formatting.None;
+                    jsonSerializer.Serialize(jsonWriter, babylonScene);
+                }
+                File.WriteAllText(outputFile, sb.ToString());
+
+                if (generateManifest)
+                {
+                    File.WriteAllText(outputFile + ".manifest",
+                        "{\r\n\"version\" : 1,\r\n\"enableSceneOffline\" : true,\r\n\"enableTexturesOffline\" : true\r\n}");
+                }
+            });
+
+            // Binary
+            if (generateBinary)
+            {
+                RaiseMessage("Generating binary files");
+                BabylonFileConverter.BinaryConverter.Convert(outputFile, Path.GetDirectoryName(outputFile) + "\\Binary",
+                    message => RaiseMessage(message, 1),
+                    error => RaiseError(error, 1));
+            }
+
+            ReportProgressChanged(100);
+            watch.Stop();
+            RaiseMessage(string.Format("Exportation done in {0:0.00}s", watch.ElapsedMilliseconds / 1000.0), Color.Blue);
+        }
+
+
+    }
+}

+ 69 - 69
Exporters/3ds Max/Max2Babylon/Exporter/GlobalVertex.cs

@@ -1,69 +1,69 @@
-using Autodesk.Max;
-
-namespace Max2Babylon
-{
-    public struct GlobalVertex
-    {
-        public int BaseIndex { get; set; }
-        public int CurrentIndex { get; set; }
-        public IPoint3 Position { get; set; }
-        public IPoint3 Normal { get; set; }
-        public IPoint2 UV { get; set; }
-        public IPoint2 UV2 { get; set; }
-        public int BonesIndices { get; set; }
-        public IPoint4 Weights { get; set; }
-        public float[] Color { get; set; }
-
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        public override bool Equals(object obj)
-        {
-            if (!(obj is GlobalVertex))
-            {
-                return false;
-            }
-
-            var other = (GlobalVertex)obj;
-
-            if (other.BaseIndex != BaseIndex)
-            {
-                return false;
-            }
-
-            if (!other.Position.IsAlmostEqualTo(Position, Tools.Epsilon))
-            {
-                return false;
-            }
-
-            if (!other.Normal.IsAlmostEqualTo(Normal, Tools.Epsilon))
-            {
-                return false;
-            }
-
-            if (UV != null && !other.UV.IsAlmostEqualTo(UV, Tools.Epsilon))
-            {
-                return false;
-            }
-
-            if (UV2 != null && !other.UV2.IsAlmostEqualTo(UV2, Tools.Epsilon))
-            {
-                return false;
-            }
-
-            if (Weights != null && !other.Weights.IsAlmostEqualTo(Weights, Tools.Epsilon))
-            {
-                return false;
-            }
-
-            if (Color != null && !other.Color.IsAlmostEqualTo(Color, Tools.Epsilon))
-            {
-                return false;
-            }
-
-            return other.BonesIndices == BonesIndices;
-        }
-    }
-}
+using Autodesk.Max;
+
+namespace Max2Babylon
+{
+    public struct GlobalVertex
+    {
+        public int BaseIndex { get; set; }
+        public int CurrentIndex { get; set; }
+        public IPoint3 Position { get; set; }
+        public IPoint3 Normal { get; set; }
+        public IPoint2 UV { get; set; }
+        public IPoint2 UV2 { get; set; }
+        public int BonesIndices { get; set; }
+        public IPoint4 Weights { get; set; }
+        public float[] Color { get; set; }
+
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (!(obj is GlobalVertex))
+            {
+                return false;
+            }
+
+            var other = (GlobalVertex)obj;
+
+            if (other.BaseIndex != BaseIndex)
+            {
+                return false;
+            }
+
+            if (!other.Position.IsAlmostEqualTo(Position, Tools.Epsilon))
+            {
+                return false;
+            }
+
+            if (!other.Normal.IsAlmostEqualTo(Normal, Tools.Epsilon))
+            {
+                return false;
+            }
+
+            if (UV != null && !other.UV.IsAlmostEqualTo(UV, Tools.Epsilon))
+            {
+                return false;
+            }
+
+            if (UV2 != null && !other.UV2.IsAlmostEqualTo(UV2, Tools.Epsilon))
+            {
+                return false;
+            }
+
+            if (Weights != null && !other.Weights.IsAlmostEqualTo(Weights, Tools.Epsilon))
+            {
+                return false;
+            }
+
+            if (Color != null && !other.Color.IsAlmostEqualTo(Color, Tools.Epsilon))
+            {
+                return false;
+            }
+
+            return other.BonesIndices == BonesIndices;
+        }
+    }
+}

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

@@ -1,99 +1,99 @@
-namespace Max2Babylon
-{
-    partial class ActionsBuilderForm
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.ActionsBuilderWebView = new System.Windows.Forms.WebBrowser();
-            this.butCancel = new System.Windows.Forms.Button();
-            this.butOK = new System.Windows.Forms.Button();
-            this.SuspendLayout();
-            // 
-            // ActionsBuilderWebView
-            // 
-            this.ActionsBuilderWebView.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
-            this.ActionsBuilderWebView.AllowNavigation = false;
-            this.ActionsBuilderWebView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.ActionsBuilderWebView.IsWebBrowserContextMenuEnabled = false;
-            this.ActionsBuilderWebView.Location = new System.Drawing.Point(0, 0);
-            this.ActionsBuilderWebView.MinimumSize = new System.Drawing.Size(20, 20);
-            this.ActionsBuilderWebView.Name = "ActionsBuilderWebView";
-            this.ActionsBuilderWebView.Size = new System.Drawing.Size(723, 537);
-            this.ActionsBuilderWebView.TabIndex = 0;
-            this.ActionsBuilderWebView.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.ActionsBuilderWebView_DocumentCompleted);
-            // 
-            // butCancel
-            // 
-            this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.butCancel.Location = new System.Drawing.Point(636, 544);
-            this.butCancel.Name = "butCancel";
-            this.butCancel.Size = new System.Drawing.Size(75, 23);
-            this.butCancel.TabIndex = 1;
-            this.butCancel.Text = "Cancel";
-            this.butCancel.UseVisualStyleBackColor = true;
-            this.butCancel.Click += new System.EventHandler(this.butCancel_Click);
-            // 
-            // butOK
-            // 
-            this.butOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.butOK.DialogResult = System.Windows.Forms.DialogResult.OK;
-            this.butOK.Location = new System.Drawing.Point(555, 544);
-            this.butOK.Name = "butOK";
-            this.butOK.Size = new System.Drawing.Size(75, 23);
-            this.butOK.TabIndex = 2;
-            this.butOK.Text = "OK";
-            this.butOK.UseVisualStyleBackColor = true;
-            this.butOK.Click += new System.EventHandler(this.butOK_Click);
-            // 
-            // ActionsBuilderForm
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(723, 579);
-            this.Controls.Add(this.butOK);
-            this.Controls.Add(this.butCancel);
-            this.Controls.Add(this.ActionsBuilderWebView);
-            this.Name = "ActionsBuilderForm";
-            this.Text = "Babylon.js Actions Builder";
-            this.Activated += new System.EventHandler(this.ActionsBuilderForm_Activated);
-            this.Deactivate += new System.EventHandler(this.ActionsBuilderForm_Deactivate);
-            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ActionsBuilderForm_FormClosed);
-            this.Load += new System.EventHandler(this.ActionsBuilderForm_Load);
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.WebBrowser ActionsBuilderWebView;
-        private System.Windows.Forms.Button butCancel;
-        private System.Windows.Forms.Button butOK;
-    }
+namespace Max2Babylon
+{
+    partial class ActionsBuilderForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.ActionsBuilderWebView = new System.Windows.Forms.WebBrowser();
+            this.butCancel = new System.Windows.Forms.Button();
+            this.butOK = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // ActionsBuilderWebView
+            // 
+            this.ActionsBuilderWebView.AccessibleRole = System.Windows.Forms.AccessibleRole.Window;
+            this.ActionsBuilderWebView.AllowNavigation = false;
+            this.ActionsBuilderWebView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.ActionsBuilderWebView.IsWebBrowserContextMenuEnabled = false;
+            this.ActionsBuilderWebView.Location = new System.Drawing.Point(0, 0);
+            this.ActionsBuilderWebView.MinimumSize = new System.Drawing.Size(20, 20);
+            this.ActionsBuilderWebView.Name = "ActionsBuilderWebView";
+            this.ActionsBuilderWebView.Size = new System.Drawing.Size(723, 537);
+            this.ActionsBuilderWebView.TabIndex = 0;
+            this.ActionsBuilderWebView.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.ActionsBuilderWebView_DocumentCompleted);
+            // 
+            // butCancel
+            // 
+            this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.butCancel.Location = new System.Drawing.Point(636, 544);
+            this.butCancel.Name = "butCancel";
+            this.butCancel.Size = new System.Drawing.Size(75, 23);
+            this.butCancel.TabIndex = 1;
+            this.butCancel.Text = "Cancel";
+            this.butCancel.UseVisualStyleBackColor = true;
+            this.butCancel.Click += new System.EventHandler(this.butCancel_Click);
+            // 
+            // butOK
+            // 
+            this.butOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.butOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.butOK.Location = new System.Drawing.Point(555, 544);
+            this.butOK.Name = "butOK";
+            this.butOK.Size = new System.Drawing.Size(75, 23);
+            this.butOK.TabIndex = 2;
+            this.butOK.Text = "OK";
+            this.butOK.UseVisualStyleBackColor = true;
+            this.butOK.Click += new System.EventHandler(this.butOK_Click);
+            // 
+            // ActionsBuilderForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(723, 579);
+            this.Controls.Add(this.butOK);
+            this.Controls.Add(this.butCancel);
+            this.Controls.Add(this.ActionsBuilderWebView);
+            this.Name = "ActionsBuilderForm";
+            this.Text = "Babylon.js Actions Builder";
+            this.Activated += new System.EventHandler(this.ActionsBuilderForm_Activated);
+            this.Deactivate += new System.EventHandler(this.ActionsBuilderForm_Deactivate);
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ActionsBuilderForm_FormClosed);
+            this.Load += new System.EventHandler(this.ActionsBuilderForm_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.WebBrowser ActionsBuilderWebView;
+        private System.Windows.Forms.Button butCancel;
+        private System.Windows.Forms.Button butOK;
+    }
 }

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

@@ -1,170 +1,170 @@
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using Autodesk.Max;
-using System.Runtime.InteropServices;
-
-namespace Max2Babylon
-{
-
-    public partial class ActionsBuilderForm : Form
-    {
-        private readonly BabylonActionsBuilderActionItem _babylonActionsBuilderAction;
-        private IINode _node = null;
-
-        private HtmlDocument _document;
-        private string _objectName;
-        private string _propertyName = "babylon_actionsbuilder";
-        private string _jsonResult = "";
-        private bool isRootNode;
-
-        public ActionsBuilderForm(BabylonActionsBuilderActionItem babylonActionsBuilderAction)
-        {
-            InitializeComponent();
-
-            // Finish
-            _babylonActionsBuilderAction = babylonActionsBuilderAction;
-        }
-         
-        private void ActionsBuilderForm_Load(object sender, EventArgs e)
-        {
-            if (Loader.Core.SelNodeCount > 0)
-            {
-                isRootNode = false;
-                _node = Loader.Core.GetSelNode(0);
-            }
-            else
-            {
-                isRootNode = true;
-                _node = Loader.Core.RootNode;
-            }
-            _objectName = _node.Name;
-
-            // Set url (webview)
-            string assemblyPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
-            ActionsBuilderWebView.Url = new Uri(string.Format("{0}/BabylonActionsBuilder/index.html", assemblyPath), System.UriKind.Absolute);
-        }
-
-        private void ActionsBuilderForm_FormClosed(object sender, FormClosedEventArgs e)
-        {
-            _babylonActionsBuilderAction.Close();
-        }
-
-        private void fillObjectsList(ITab<IIGameNode> list, string scriptName)
-        {
-            object[] names = new object[list.Count];
-            for (int i = 0; i < list.Count; i++)
-            {
-                var indexer = new IntPtr(i);
-                var node = list[indexer];
-                names[i] = node.MaxNode.Name;
-            }
-            _document.InvokeScript(scriptName, names);
-        }
-
-        private void fillSoundsList(ITab<IIGameNode> list, string scriptName)
-        {
-            object[] names = new object[list.Count];
-            for (int i = 0; i < list.Count; i++)
-            {
-                var indexer = new IntPtr(i);
-                var node = list[indexer].MaxNode;
-                string soundFile = "";
-
-                soundFile = Tools.GetStringProperty(node, "babylonjs_sound_filename", soundFile);
-                names[i] = Path.GetFileName(soundFile);
-            }
-            _document.InvokeScript(scriptName, names);
-        }
-
-        private void ActionsBuilderWebView_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
-        {
-            // Set common properties (name, is scene or object, etc.)
-            _document = ActionsBuilderWebView.Document;
-
-            // Update screen
-            _document.InvokeScript("hideButtons");
-
-            // Set object name
-            _document.GetElementById("ActionsBuilderObjectName").SetAttribute("value", _objectName);
-            _document.InvokeScript("updateObjectName");
-
-            if (isRootNode)
-                _document.InvokeScript("setIsScene");
-            else
-                _document.InvokeScript("setIsObject");
-
-            //_document.InvokeScript("updateObjectName");
-
-            if (getProperty())
-            {
-                _document.GetElementById("ActionsBuilderJSON").SetAttribute("value", _jsonResult);
-                _document.InvokeScript("loadFromJSON");
-            }
-
-            // Set lists of meshes, lights, cameras etc.
-            var gameScene = Loader.Global.IGameInterface;
-            gameScene.InitialiseIGame(false);
-
-            var meshes = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Mesh);
-            fillObjectsList(meshes, "setMeshesNames");
-
-            var lights = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Light);
-            fillObjectsList(lights, "setLightsNames");
-
-            var cameras = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Camera);
-            fillObjectsList(cameras, "setCamerasNames");
-
-            fillSoundsList(meshes, "setSoundsNames");
-
-            // Finish
-            _document.InvokeScript("resetList");
-
-            // Need to subclass this, then allow 3ds Max usage 
-            //Win32.SubClass(this.ActionsBuilderWebView.Handle);
-        }
-
-        private void butOK_Click(object sender, EventArgs e)
-        {
-            _document.InvokeScript("createJSON");
-            _jsonResult = _document.GetElementById("ActionsBuilderJSON").GetAttribute("value");
-
-            setProperty();
-
-            _babylonActionsBuilderAction.Close();
-        }
-
-        private void ActionsBuilderForm_Activated(object sender, EventArgs e)
-        {
-            Loader.Global.DisableAccelerators();
-        }
-
-        private void ActionsBuilderForm_Deactivate(object sender, EventArgs e)
-        {
-            Loader.Global.EnableAccelerators();
-        }
-
-        private void setProperty()
-        {
-            if (_node != null)
-                Tools.SetStringProperty(_node, _propertyName, _jsonResult);
-        }
-
-        private bool getProperty()
-        {
-            if (_node != null)
-                _jsonResult = Tools.GetStringProperty(_node, _propertyName, _jsonResult);
-            else
-                return false;
-
-            return true;
-        }
-
-        private void butCancel_Click(object sender, EventArgs e)
-        {
-            _babylonActionsBuilderAction.Close();
-        }
-    }
-
-}
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using Autodesk.Max;
+using System.Runtime.InteropServices;
+
+namespace Max2Babylon
+{
+
+    public partial class ActionsBuilderForm : Form
+    {
+        private readonly BabylonActionsBuilderActionItem _babylonActionsBuilderAction;
+        private IINode _node = null;
+
+        private HtmlDocument _document;
+        private string _objectName;
+        private string _propertyName = "babylon_actionsbuilder";
+        private string _jsonResult = "";
+        private bool isRootNode;
+
+        public ActionsBuilderForm(BabylonActionsBuilderActionItem babylonActionsBuilderAction)
+        {
+            InitializeComponent();
+
+            // Finish
+            _babylonActionsBuilderAction = babylonActionsBuilderAction;
+        }
+        
+        private void ActionsBuilderForm_Load(object sender, EventArgs e)
+        {
+            if (Loader.Core.SelNodeCount > 0)
+            {
+                isRootNode = false;
+                _node = Loader.Core.GetSelNode(0);
+            }
+            else
+            {
+                isRootNode = true;
+                _node = Loader.Core.RootNode;
+            }
+            _objectName = _node.Name;
+
+            // Set url (web view)
+            string assemblyPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
+            ActionsBuilderWebView.Url = new Uri(string.Format("{0}/BabylonActionsBuilder/index.html", assemblyPath), System.UriKind.Absolute);
+        }
+
+        private void ActionsBuilderForm_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            _babylonActionsBuilderAction.Close();
+        }
+
+        private void fillObjectsList(ITab<IIGameNode> list, string scriptName)
+        {
+            object[] names = new object[list.Count];
+            for (int i = 0; i < list.Count; i++)
+            {
+                var indexer = new IntPtr(i);
+                var node = list[indexer];
+                names[i] = node.MaxNode.Name;
+            }
+            _document.InvokeScript(scriptName, names);
+        }
+
+        private void fillSoundsList(ITab<IIGameNode> list, string scriptName)
+        {
+            object[] names = new object[list.Count];
+            for (int i = 0; i < list.Count; i++)
+            {
+                var indexer = new IntPtr(i);
+                var node = list[indexer].MaxNode;
+                string soundFile = "";
+
+                soundFile = Tools.GetStringProperty(node, "babylonjs_sound_filename", soundFile);
+                names[i] = Path.GetFileName(soundFile);
+            }
+            _document.InvokeScript(scriptName, names);
+        }
+
+        private void ActionsBuilderWebView_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
+        {
+            // Set common properties (name, is scene or object, etc.)
+            _document = ActionsBuilderWebView.Document;
+
+            // Update version (no buttons for 3ds Max)
+            _document.InvokeScript("hideButtons");
+
+            // Set object name
+            _document.GetElementById("ActionsBuilderObjectName").SetAttribute("value", _objectName);
+            _document.InvokeScript("updateObjectName");
+
+            if (isRootNode)
+                _document.InvokeScript("setIsScene");
+            else
+                _document.InvokeScript("setIsObject");
+
+            //_document.InvokeScript("updateObjectName");
+
+            if (getProperty())
+            {
+                _document.GetElementById("ActionsBuilderJSON").SetAttribute("value", _jsonResult);
+                _document.InvokeScript("loadFromJSON");
+            }
+
+            // Set lists of meshes, lights, cameras etc.
+            var gameScene = Loader.Global.IGameInterface;
+            gameScene.InitialiseIGame(false);
+
+            var meshes = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Mesh);
+            fillObjectsList(meshes, "setMeshesNames");
+
+            var lights = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Light);
+            fillObjectsList(lights, "setLightsNames");
+
+            var cameras = gameScene.GetIGameNodeByType(Autodesk.Max.IGameObject.ObjectTypes.Camera);
+            fillObjectsList(cameras, "setCamerasNames");
+
+            fillSoundsList(meshes, "setSoundsNames");
+
+            // Finish
+            _document.InvokeScript("resetList");
+
+            // Need to subclass this, then allow 3ds Max usage 
+            //Win32.SubClass(this.ActionsBuilderWebView.Handle);
+        }
+
+        private void butOK_Click(object sender, EventArgs e)
+        {
+            _document.InvokeScript("createJSON");
+            _jsonResult = _document.GetElementById("ActionsBuilderJSON").GetAttribute("value");
+
+            setProperty();
+
+            _babylonActionsBuilderAction.Close();
+        }
+
+        private void ActionsBuilderForm_Activated(object sender, EventArgs e)
+        {
+            Loader.Global.DisableAccelerators();
+        }
+
+        private void ActionsBuilderForm_Deactivate(object sender, EventArgs e)
+        {
+            Loader.Global.EnableAccelerators();
+        }
+
+        private void setProperty()
+        {
+            if (_node != null)
+                Tools.SetStringProperty(_node, _propertyName, _jsonResult);
+        }
+
+        private bool getProperty()
+        {
+            if (_node != null)
+                _jsonResult = Tools.GetStringProperty(_node, _propertyName, _jsonResult);
+            else
+                return false;
+
+            return true;
+        }
+
+        private void butCancel_Click(object sender, EventArgs e)
+        {
+            _babylonActionsBuilderAction.Close();
+        }
+    }
+
+}

+ 119 - 119
Exporters/3ds Max/Max2Babylon/Forms/ActionsBuilderForm.resx

@@ -1,120 +1,120 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
 </root>

+ 415 - 415
Exporters/3ds Max/Max2Babylon/Forms/CameraPropertiesForm.Designer.cs

@@ -1,416 +1,416 @@
-namespace Max2Babylon
-{
-    partial class CameraPropertiesForm
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
-            this.ellipsoidControl = new Max2Babylon.Vector3Control();
-            this.label3 = new System.Windows.Forms.Label();
-            this.chkGravity = new System.Windows.Forms.CheckBox();
-            this.chkCollisions = new System.Windows.Forms.CheckBox();
-            this.butOK = new System.Windows.Forms.Button();
-            this.butCancel = new System.Windows.Forms.Button();
-            this.groupBox2 = new System.Windows.Forms.GroupBox();
-            this.label2 = new System.Windows.Forms.Label();
-            this.nupInertia = new System.Windows.Forms.NumericUpDown();
-            this.label1 = new System.Windows.Forms.Label();
-            this.nupSpeed = new System.Windows.Forms.NumericUpDown();
-            this.groupBox3 = new System.Windows.Forms.GroupBox();
-            this.grpAutoAnimate = new System.Windows.Forms.GroupBox();
-            this.chkLoop = new System.Windows.Forms.CheckBox();
-            this.nupTo = new System.Windows.Forms.NumericUpDown();
-            this.label4 = new System.Windows.Forms.Label();
-            this.nupFrom = new System.Windows.Forms.NumericUpDown();
-            this.label5 = new System.Windows.Forms.Label();
-            this.chkAutoAnimate = new System.Windows.Forms.CheckBox();
-            this.groupBox4 = new System.Windows.Forms.GroupBox();
-            this.label6 = new System.Windows.Forms.Label();
-            this.cbCameraType = new System.Windows.Forms.ComboBox();
-            this.chkNoExport = new System.Windows.Forms.CheckBox();
-            this.groupBox1.SuspendLayout();
-            this.groupBox2.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupInertia)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupSpeed)).BeginInit();
-            this.groupBox3.SuspendLayout();
-            this.grpAutoAnimate.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupTo)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupFrom)).BeginInit();
-            this.groupBox4.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // groupBox1
-            // 
-            this.groupBox1.Controls.Add(this.ellipsoidControl);
-            this.groupBox1.Controls.Add(this.label3);
-            this.groupBox1.Controls.Add(this.chkGravity);
-            this.groupBox1.Controls.Add(this.chkCollisions);
-            this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox1.Location = new System.Drawing.Point(12, 119);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(319, 138);
-            this.groupBox1.TabIndex = 0;
-            this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "Collisions";
-            // 
-            // ellipsoidControl
-            // 
-            this.ellipsoidControl.Location = new System.Drawing.Point(21, 95);
-            this.ellipsoidControl.Name = "ellipsoidControl";
-            this.ellipsoidControl.Size = new System.Drawing.Size(294, 28);
-            this.ellipsoidControl.TabIndex = 3;
-            this.ellipsoidControl.X = 0F;
-            this.ellipsoidControl.Y = 0F;
-            this.ellipsoidControl.Z = 0F;
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(18, 79);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(48, 13);
-            this.label3.TabIndex = 2;
-            this.label3.Text = "Ellipsoid:";
-            // 
-            // chkGravity
-            // 
-            this.chkGravity.AutoSize = true;
-            this.chkGravity.Location = new System.Drawing.Point(21, 51);
-            this.chkGravity.Name = "chkGravity";
-            this.chkGravity.Size = new System.Drawing.Size(86, 17);
-            this.chkGravity.TabIndex = 1;
-            this.chkGravity.Text = "Apply gravity";
-            this.chkGravity.ThreeState = true;
-            this.chkGravity.UseVisualStyleBackColor = true;
-            // 
-            // chkCollisions
-            // 
-            this.chkCollisions.AutoSize = true;
-            this.chkCollisions.Location = new System.Drawing.Point(21, 28);
-            this.chkCollisions.Name = "chkCollisions";
-            this.chkCollisions.Size = new System.Drawing.Size(102, 17);
-            this.chkCollisions.TabIndex = 0;
-            this.chkCollisions.Text = "Check collisions";
-            this.chkCollisions.ThreeState = true;
-            this.chkCollisions.UseVisualStyleBackColor = true;
-            // 
-            // butOK
-            // 
-            this.butOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
-            this.butOK.DialogResult = System.Windows.Forms.DialogResult.OK;
-            this.butOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butOK.Location = new System.Drawing.Point(93, 578);
-            this.butOK.Name = "butOK";
-            this.butOK.Size = new System.Drawing.Size(75, 23);
-            this.butOK.TabIndex = 1;
-            this.butOK.Text = "OK";
-            this.butOK.UseVisualStyleBackColor = true;
-            this.butOK.Click += new System.EventHandler(this.butOK_Click);
-            // 
-            // butCancel
-            // 
-            this.butCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
-            this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.butCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butCancel.Location = new System.Drawing.Point(174, 578);
-            this.butCancel.Name = "butCancel";
-            this.butCancel.Size = new System.Drawing.Size(75, 23);
-            this.butCancel.TabIndex = 2;
-            this.butCancel.Text = "Cancel";
-            this.butCancel.UseVisualStyleBackColor = true;
-            // 
-            // groupBox2
-            // 
-            this.groupBox2.Controls.Add(this.label2);
-            this.groupBox2.Controls.Add(this.nupInertia);
-            this.groupBox2.Controls.Add(this.label1);
-            this.groupBox2.Controls.Add(this.nupSpeed);
-            this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox2.Location = new System.Drawing.Point(12, 263);
-            this.groupBox2.Name = "groupBox2";
-            this.groupBox2.Size = new System.Drawing.Size(319, 140);
-            this.groupBox2.TabIndex = 3;
-            this.groupBox2.TabStop = false;
-            this.groupBox2.Text = "Control";
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(21, 81);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(36, 13);
-            this.label2.TabIndex = 3;
-            this.label2.Text = "Inertia";
-            // 
-            // nupInertia
-            // 
-            this.nupInertia.DecimalPlaces = 2;
-            this.nupInertia.Location = new System.Drawing.Point(24, 103);
-            this.nupInertia.Name = "nupInertia";
-            this.nupInertia.Size = new System.Drawing.Size(120, 20);
-            this.nupInertia.TabIndex = 2;
-            this.nupInertia.Value = new decimal(new int[] {
-            9,
-            0,
-            0,
-            65536});
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(21, 28);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(41, 13);
-            this.label1.TabIndex = 1;
-            this.label1.Text = "Speed:";
-            // 
-            // nupSpeed
-            // 
-            this.nupSpeed.DecimalPlaces = 1;
-            this.nupSpeed.Location = new System.Drawing.Point(24, 50);
-            this.nupSpeed.Name = "nupSpeed";
-            this.nupSpeed.Size = new System.Drawing.Size(120, 20);
-            this.nupSpeed.TabIndex = 0;
-            this.nupSpeed.Value = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
-            // 
-            // groupBox3
-            // 
-            this.groupBox3.Controls.Add(this.grpAutoAnimate);
-            this.groupBox3.Controls.Add(this.chkAutoAnimate);
-            this.groupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox3.Location = new System.Drawing.Point(12, 409);
-            this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(319, 156);
-            this.groupBox3.TabIndex = 5;
-            this.groupBox3.TabStop = false;
-            this.groupBox3.Text = "Animations";
-            // 
-            // grpAutoAnimate
-            // 
-            this.grpAutoAnimate.Controls.Add(this.chkLoop);
-            this.grpAutoAnimate.Controls.Add(this.nupTo);
-            this.grpAutoAnimate.Controls.Add(this.label4);
-            this.grpAutoAnimate.Controls.Add(this.nupFrom);
-            this.grpAutoAnimate.Controls.Add(this.label5);
-            this.grpAutoAnimate.Enabled = false;
-            this.grpAutoAnimate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.grpAutoAnimate.Location = new System.Drawing.Point(21, 51);
-            this.grpAutoAnimate.Name = "grpAutoAnimate";
-            this.grpAutoAnimate.Size = new System.Drawing.Size(292, 99);
-            this.grpAutoAnimate.TabIndex = 3;
-            this.grpAutoAnimate.TabStop = false;
-            // 
-            // chkLoop
-            // 
-            this.chkLoop.AutoSize = true;
-            this.chkLoop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkLoop.Location = new System.Drawing.Point(9, 66);
-            this.chkLoop.Name = "chkLoop";
-            this.chkLoop.Size = new System.Drawing.Size(47, 17);
-            this.chkLoop.TabIndex = 5;
-            this.chkLoop.Text = "Loop";
-            this.chkLoop.ThreeState = true;
-            this.chkLoop.UseVisualStyleBackColor = true;
-            // 
-            // nupTo
-            // 
-            this.nupTo.Location = new System.Drawing.Point(47, 40);
-            this.nupTo.Maximum = new decimal(new int[] {
-            1000,
-            0,
-            0,
-            0});
-            this.nupTo.Name = "nupTo";
-            this.nupTo.Size = new System.Drawing.Size(120, 20);
-            this.nupTo.TabIndex = 3;
-            // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(6, 42);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(23, 13);
-            this.label4.TabIndex = 4;
-            this.label4.Text = "To:";
-            // 
-            // nupFrom
-            // 
-            this.nupFrom.Location = new System.Drawing.Point(47, 14);
-            this.nupFrom.Maximum = new decimal(new int[] {
-            1000,
-            0,
-            0,
-            0});
-            this.nupFrom.Name = "nupFrom";
-            this.nupFrom.Size = new System.Drawing.Size(120, 20);
-            this.nupFrom.TabIndex = 1;
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(6, 16);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(33, 13);
-            this.label5.TabIndex = 2;
-            this.label5.Text = "From:";
-            // 
-            // chkAutoAnimate
-            // 
-            this.chkAutoAnimate.AutoSize = true;
-            this.chkAutoAnimate.Location = new System.Drawing.Point(21, 28);
-            this.chkAutoAnimate.Name = "chkAutoAnimate";
-            this.chkAutoAnimate.Size = new System.Drawing.Size(88, 17);
-            this.chkAutoAnimate.TabIndex = 0;
-            this.chkAutoAnimate.Text = "Auto animate";
-            this.chkAutoAnimate.ThreeState = true;
-            this.chkAutoAnimate.UseVisualStyleBackColor = true;
-            this.chkAutoAnimate.CheckedChanged += new System.EventHandler(this.chkAutoAnimate_CheckedChanged);
-            // 
-            // groupBox4
-            // 
-            this.groupBox4.Controls.Add(this.label6);
-            this.groupBox4.Controls.Add(this.cbCameraType);
-            this.groupBox4.Controls.Add(this.chkNoExport);
-            this.groupBox4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox4.Location = new System.Drawing.Point(12, 12);
-            this.groupBox4.Name = "groupBox4";
-            this.groupBox4.Size = new System.Drawing.Size(319, 101);
-            this.groupBox4.TabIndex = 6;
-            this.groupBox4.TabStop = false;
-            this.groupBox4.Text = "Misc.";
-            // 
-            // label6
-            // 
-            this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(16, 58);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(34, 13);
-            this.label6.TabIndex = 6;
-            this.label6.Text = "Type:";
-            // 
-            // cbCameraType
-            // 
-            this.cbCameraType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cbCameraType.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.cbCameraType.FormattingEnabled = true;
-            this.cbCameraType.Items.AddRange(new object[] {
-            "AnaglyphArcRotateCamera",
-            "AnaglyphFreeCamera",
-            "ArcRotateCamera",
-            "DeviceOrientationCamera",
-            "FollowCamera",
-            "FreeCamera",
-            "GamepadCamera",
-            "TouchCamera",
-            "VirtualJoysticksCamera",
-            "WebVRFreeCamera",
-            "VRDeviceOrientationFreeCamera"});
-            this.cbCameraType.Location = new System.Drawing.Point(23, 74);
-            this.cbCameraType.Name = "cbCameraType";
-            this.cbCameraType.Size = new System.Drawing.Size(290, 21);
-            this.cbCameraType.TabIndex = 5;
-            // 
-            // chkNoExport
-            // 
-            this.chkNoExport.AutoSize = true;
-            this.chkNoExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkNoExport.Location = new System.Drawing.Point(21, 28);
-            this.chkNoExport.Name = "chkNoExport";
-            this.chkNoExport.Size = new System.Drawing.Size(87, 17);
-            this.chkNoExport.TabIndex = 4;
-            this.chkNoExport.Text = "Do not export";
-            this.chkNoExport.ThreeState = true;
-            this.chkNoExport.UseVisualStyleBackColor = true;
-            // 
-            // CameraPropertiesForm
-            // 
-            this.AcceptButton = this.butOK;
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.CancelButton = this.butCancel;
-            this.ClientSize = new System.Drawing.Size(343, 613);
-            this.Controls.Add(this.groupBox4);
-            this.Controls.Add(this.groupBox3);
-            this.Controls.Add(this.groupBox2);
-            this.Controls.Add(this.butCancel);
-            this.Controls.Add(this.butOK);
-            this.Controls.Add(this.groupBox1);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
-            this.Name = "CameraPropertiesForm";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "Babylon.js - Camera Properties";
-            this.Load += new System.EventHandler(this.CameraPropertiesForm_Load);
-            this.groupBox1.ResumeLayout(false);
-            this.groupBox1.PerformLayout();
-            this.groupBox2.ResumeLayout(false);
-            this.groupBox2.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupInertia)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupSpeed)).EndInit();
-            this.groupBox3.ResumeLayout(false);
-            this.groupBox3.PerformLayout();
-            this.grpAutoAnimate.ResumeLayout(false);
-            this.grpAutoAnimate.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupTo)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupFrom)).EndInit();
-            this.groupBox4.ResumeLayout(false);
-            this.groupBox4.PerformLayout();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.GroupBox groupBox1;
-        private System.Windows.Forms.Button butOK;
-        private System.Windows.Forms.Button butCancel;
-        private System.Windows.Forms.CheckBox chkCollisions;
-        private System.Windows.Forms.CheckBox chkGravity;
-        private System.Windows.Forms.GroupBox groupBox2;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.NumericUpDown nupSpeed;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.NumericUpDown nupInertia;
-        private System.Windows.Forms.Label label3;
-        private Vector3Control ellipsoidControl;
-        private System.Windows.Forms.GroupBox groupBox3;
-        private System.Windows.Forms.GroupBox grpAutoAnimate;
-        private System.Windows.Forms.CheckBox chkLoop;
-        private System.Windows.Forms.NumericUpDown nupTo;
-        private System.Windows.Forms.Label label4;
-        private System.Windows.Forms.NumericUpDown nupFrom;
-        private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.CheckBox chkAutoAnimate;
-        private System.Windows.Forms.GroupBox groupBox4;
-        private System.Windows.Forms.CheckBox chkNoExport;
-        private System.Windows.Forms.Label label6;
-        private System.Windows.Forms.ComboBox cbCameraType;
-    }
+namespace Max2Babylon
+{
+    partial class CameraPropertiesForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.ellipsoidControl = new Max2Babylon.Vector3Control();
+            this.label3 = new System.Windows.Forms.Label();
+            this.chkGravity = new System.Windows.Forms.CheckBox();
+            this.chkCollisions = new System.Windows.Forms.CheckBox();
+            this.butOK = new System.Windows.Forms.Button();
+            this.butCancel = new System.Windows.Forms.Button();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.nupInertia = new System.Windows.Forms.NumericUpDown();
+            this.label1 = new System.Windows.Forms.Label();
+            this.nupSpeed = new System.Windows.Forms.NumericUpDown();
+            this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.grpAutoAnimate = new System.Windows.Forms.GroupBox();
+            this.chkLoop = new System.Windows.Forms.CheckBox();
+            this.nupTo = new System.Windows.Forms.NumericUpDown();
+            this.label4 = new System.Windows.Forms.Label();
+            this.nupFrom = new System.Windows.Forms.NumericUpDown();
+            this.label5 = new System.Windows.Forms.Label();
+            this.chkAutoAnimate = new System.Windows.Forms.CheckBox();
+            this.groupBox4 = new System.Windows.Forms.GroupBox();
+            this.label6 = new System.Windows.Forms.Label();
+            this.cbCameraType = new System.Windows.Forms.ComboBox();
+            this.chkNoExport = new System.Windows.Forms.CheckBox();
+            this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupInertia)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupSpeed)).BeginInit();
+            this.groupBox3.SuspendLayout();
+            this.grpAutoAnimate.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupTo)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupFrom)).BeginInit();
+            this.groupBox4.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.ellipsoidControl);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.Controls.Add(this.chkGravity);
+            this.groupBox1.Controls.Add(this.chkCollisions);
+            this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox1.Location = new System.Drawing.Point(12, 119);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(319, 138);
+            this.groupBox1.TabIndex = 0;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Collisions";
+            // 
+            // ellipsoidControl
+            // 
+            this.ellipsoidControl.Location = new System.Drawing.Point(21, 95);
+            this.ellipsoidControl.Name = "ellipsoidControl";
+            this.ellipsoidControl.Size = new System.Drawing.Size(294, 28);
+            this.ellipsoidControl.TabIndex = 3;
+            this.ellipsoidControl.X = 0F;
+            this.ellipsoidControl.Y = 0F;
+            this.ellipsoidControl.Z = 0F;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(18, 79);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(48, 13);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "Ellipsoid:";
+            // 
+            // chkGravity
+            // 
+            this.chkGravity.AutoSize = true;
+            this.chkGravity.Location = new System.Drawing.Point(21, 51);
+            this.chkGravity.Name = "chkGravity";
+            this.chkGravity.Size = new System.Drawing.Size(86, 17);
+            this.chkGravity.TabIndex = 1;
+            this.chkGravity.Text = "Apply gravity";
+            this.chkGravity.ThreeState = true;
+            this.chkGravity.UseVisualStyleBackColor = true;
+            // 
+            // chkCollisions
+            // 
+            this.chkCollisions.AutoSize = true;
+            this.chkCollisions.Location = new System.Drawing.Point(21, 28);
+            this.chkCollisions.Name = "chkCollisions";
+            this.chkCollisions.Size = new System.Drawing.Size(102, 17);
+            this.chkCollisions.TabIndex = 0;
+            this.chkCollisions.Text = "Check collisions";
+            this.chkCollisions.ThreeState = true;
+            this.chkCollisions.UseVisualStyleBackColor = true;
+            // 
+            // butOK
+            // 
+            this.butOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.butOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.butOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butOK.Location = new System.Drawing.Point(93, 578);
+            this.butOK.Name = "butOK";
+            this.butOK.Size = new System.Drawing.Size(75, 23);
+            this.butOK.TabIndex = 1;
+            this.butOK.Text = "OK";
+            this.butOK.UseVisualStyleBackColor = true;
+            this.butOK.Click += new System.EventHandler(this.butOK_Click);
+            // 
+            // butCancel
+            // 
+            this.butCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.butCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butCancel.Location = new System.Drawing.Point(174, 578);
+            this.butCancel.Name = "butCancel";
+            this.butCancel.Size = new System.Drawing.Size(75, 23);
+            this.butCancel.TabIndex = 2;
+            this.butCancel.Text = "Cancel";
+            this.butCancel.UseVisualStyleBackColor = true;
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.label2);
+            this.groupBox2.Controls.Add(this.nupInertia);
+            this.groupBox2.Controls.Add(this.label1);
+            this.groupBox2.Controls.Add(this.nupSpeed);
+            this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox2.Location = new System.Drawing.Point(12, 263);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(319, 140);
+            this.groupBox2.TabIndex = 3;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "Control";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(21, 81);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(36, 13);
+            this.label2.TabIndex = 3;
+            this.label2.Text = "Inertia";
+            // 
+            // nupInertia
+            // 
+            this.nupInertia.DecimalPlaces = 2;
+            this.nupInertia.Location = new System.Drawing.Point(24, 103);
+            this.nupInertia.Name = "nupInertia";
+            this.nupInertia.Size = new System.Drawing.Size(120, 20);
+            this.nupInertia.TabIndex = 2;
+            this.nupInertia.Value = new decimal(new int[] {
+            9,
+            0,
+            0,
+            65536});
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(21, 28);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(41, 13);
+            this.label1.TabIndex = 1;
+            this.label1.Text = "Speed:";
+            // 
+            // nupSpeed
+            // 
+            this.nupSpeed.DecimalPlaces = 1;
+            this.nupSpeed.Location = new System.Drawing.Point(24, 50);
+            this.nupSpeed.Name = "nupSpeed";
+            this.nupSpeed.Size = new System.Drawing.Size(120, 20);
+            this.nupSpeed.TabIndex = 0;
+            this.nupSpeed.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // groupBox3
+            // 
+            this.groupBox3.Controls.Add(this.grpAutoAnimate);
+            this.groupBox3.Controls.Add(this.chkAutoAnimate);
+            this.groupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox3.Location = new System.Drawing.Point(12, 409);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(319, 156);
+            this.groupBox3.TabIndex = 5;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "Animations";
+            // 
+            // grpAutoAnimate
+            // 
+            this.grpAutoAnimate.Controls.Add(this.chkLoop);
+            this.grpAutoAnimate.Controls.Add(this.nupTo);
+            this.grpAutoAnimate.Controls.Add(this.label4);
+            this.grpAutoAnimate.Controls.Add(this.nupFrom);
+            this.grpAutoAnimate.Controls.Add(this.label5);
+            this.grpAutoAnimate.Enabled = false;
+            this.grpAutoAnimate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.grpAutoAnimate.Location = new System.Drawing.Point(21, 51);
+            this.grpAutoAnimate.Name = "grpAutoAnimate";
+            this.grpAutoAnimate.Size = new System.Drawing.Size(292, 99);
+            this.grpAutoAnimate.TabIndex = 3;
+            this.grpAutoAnimate.TabStop = false;
+            // 
+            // chkLoop
+            // 
+            this.chkLoop.AutoSize = true;
+            this.chkLoop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkLoop.Location = new System.Drawing.Point(9, 66);
+            this.chkLoop.Name = "chkLoop";
+            this.chkLoop.Size = new System.Drawing.Size(47, 17);
+            this.chkLoop.TabIndex = 5;
+            this.chkLoop.Text = "Loop";
+            this.chkLoop.ThreeState = true;
+            this.chkLoop.UseVisualStyleBackColor = true;
+            // 
+            // nupTo
+            // 
+            this.nupTo.Location = new System.Drawing.Point(47, 40);
+            this.nupTo.Maximum = new decimal(new int[] {
+            100000,
+            0,
+            0,
+            0});
+            this.nupTo.Name = "nupTo";
+            this.nupTo.Size = new System.Drawing.Size(120, 20);
+            this.nupTo.TabIndex = 3;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(6, 42);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(23, 13);
+            this.label4.TabIndex = 4;
+            this.label4.Text = "To:";
+            // 
+            // nupFrom
+            // 
+            this.nupFrom.Location = new System.Drawing.Point(47, 14);
+            this.nupFrom.Maximum = new decimal(new int[] {
+            100000,
+            0,
+            0,
+            0});
+            this.nupFrom.Name = "nupFrom";
+            this.nupFrom.Size = new System.Drawing.Size(120, 20);
+            this.nupFrom.TabIndex = 1;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(6, 16);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(33, 13);
+            this.label5.TabIndex = 2;
+            this.label5.Text = "From:";
+            // 
+            // chkAutoAnimate
+            // 
+            this.chkAutoAnimate.AutoSize = true;
+            this.chkAutoAnimate.Location = new System.Drawing.Point(21, 28);
+            this.chkAutoAnimate.Name = "chkAutoAnimate";
+            this.chkAutoAnimate.Size = new System.Drawing.Size(88, 17);
+            this.chkAutoAnimate.TabIndex = 0;
+            this.chkAutoAnimate.Text = "Auto animate";
+            this.chkAutoAnimate.ThreeState = true;
+            this.chkAutoAnimate.UseVisualStyleBackColor = true;
+            this.chkAutoAnimate.CheckedChanged += new System.EventHandler(this.chkAutoAnimate_CheckedChanged);
+            // 
+            // groupBox4
+            // 
+            this.groupBox4.Controls.Add(this.label6);
+            this.groupBox4.Controls.Add(this.cbCameraType);
+            this.groupBox4.Controls.Add(this.chkNoExport);
+            this.groupBox4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox4.Location = new System.Drawing.Point(12, 12);
+            this.groupBox4.Name = "groupBox4";
+            this.groupBox4.Size = new System.Drawing.Size(319, 101);
+            this.groupBox4.TabIndex = 6;
+            this.groupBox4.TabStop = false;
+            this.groupBox4.Text = "Misc.";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(16, 58);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(34, 13);
+            this.label6.TabIndex = 6;
+            this.label6.Text = "Type:";
+            // 
+            // cbCameraType
+            // 
+            this.cbCameraType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cbCameraType.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.cbCameraType.FormattingEnabled = true;
+            this.cbCameraType.Items.AddRange(new object[] {
+            "AnaglyphArcRotateCamera",
+            "AnaglyphFreeCamera",
+            "ArcRotateCamera",
+            "DeviceOrientationCamera",
+            "FollowCamera",
+            "FreeCamera",
+            "GamepadCamera",
+            "TouchCamera",
+            "VirtualJoysticksCamera",
+            "WebVRFreeCamera",
+            "VRDeviceOrientationFreeCamera"});
+            this.cbCameraType.Location = new System.Drawing.Point(23, 74);
+            this.cbCameraType.Name = "cbCameraType";
+            this.cbCameraType.Size = new System.Drawing.Size(290, 21);
+            this.cbCameraType.TabIndex = 5;
+            // 
+            // chkNoExport
+            // 
+            this.chkNoExport.AutoSize = true;
+            this.chkNoExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkNoExport.Location = new System.Drawing.Point(21, 28);
+            this.chkNoExport.Name = "chkNoExport";
+            this.chkNoExport.Size = new System.Drawing.Size(87, 17);
+            this.chkNoExport.TabIndex = 4;
+            this.chkNoExport.Text = "Do not export";
+            this.chkNoExport.ThreeState = true;
+            this.chkNoExport.UseVisualStyleBackColor = true;
+            // 
+            // CameraPropertiesForm
+            // 
+            this.AcceptButton = this.butOK;
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.CancelButton = this.butCancel;
+            this.ClientSize = new System.Drawing.Size(343, 613);
+            this.Controls.Add(this.groupBox4);
+            this.Controls.Add(this.groupBox3);
+            this.Controls.Add(this.groupBox2);
+            this.Controls.Add(this.butCancel);
+            this.Controls.Add(this.butOK);
+            this.Controls.Add(this.groupBox1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "CameraPropertiesForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Babylon.js - Camera Properties";
+            this.Load += new System.EventHandler(this.CameraPropertiesForm_Load);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupInertia)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupSpeed)).EndInit();
+            this.groupBox3.ResumeLayout(false);
+            this.groupBox3.PerformLayout();
+            this.grpAutoAnimate.ResumeLayout(false);
+            this.grpAutoAnimate.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupTo)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupFrom)).EndInit();
+            this.groupBox4.ResumeLayout(false);
+            this.groupBox4.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.Button butOK;
+        private System.Windows.Forms.Button butCancel;
+        private System.Windows.Forms.CheckBox chkCollisions;
+        private System.Windows.Forms.CheckBox chkGravity;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.NumericUpDown nupSpeed;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.NumericUpDown nupInertia;
+        private System.Windows.Forms.Label label3;
+        private Vector3Control ellipsoidControl;
+        private System.Windows.Forms.GroupBox groupBox3;
+        private System.Windows.Forms.GroupBox grpAutoAnimate;
+        private System.Windows.Forms.CheckBox chkLoop;
+        private System.Windows.Forms.NumericUpDown nupTo;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.NumericUpDown nupFrom;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.CheckBox chkAutoAnimate;
+        private System.Windows.Forms.GroupBox groupBox4;
+        private System.Windows.Forms.CheckBox chkNoExport;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.ComboBox cbCameraType;
+    }
 }

+ 71 - 71
Exporters/3ds Max/Max2Babylon/Forms/CameraPropertiesForm.cs

@@ -1,71 +1,71 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using Autodesk.Max;
-
-namespace Max2Babylon
-{
-    public partial class CameraPropertiesForm : Form
-    {
-        private readonly List<IINode> cameras = new List<IINode>();
-
-        public CameraPropertiesForm()
-        {
-            InitializeComponent();
-        }
-
-        private void CameraPropertiesForm_Load(object sender, EventArgs e)
-        {
-            for (var index = 0; index < Loader.Core.SelNodeCount; index++)
-            {
-                var node = Loader.Core.GetSelNode(index);
-
-                if (node.ObjectRef != null && node.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Camera)
-                {
-                    cameras.Add(node);
-                }
-            }
-
-            Tools.PrepareCheckBox(chkNoExport, cameras, "babylonjs_noexport");
-            Tools.PrepareCheckBox(chkCollisions, cameras, "babylonjs_checkcollisions");
-            Tools.PrepareCheckBox(chkGravity, cameras, "babylonjs_applygravity");
-
-            Tools.PrepareNumericUpDown(nupSpeed, cameras, "babylonjs_speed", 1.0f);
-            Tools.PrepareNumericUpDown(nupInertia, cameras, "babylonjs_inertia", 0.9f);
-
-            Tools.PrepareVector3Control(ellipsoidControl, cameras[0], "babylonjs_ellipsoid", 0.5f, 1.0f, 0.5f);
-
-            Tools.PrepareComboBox(cbCameraType, cameras[0], "babylonjs_type", "FreeCamera");
-
-            Tools.PrepareCheckBox(chkAutoAnimate, cameras, "babylonjs_autoanimate");
-            Tools.PrepareCheckBox(chkLoop, cameras, "babylonjs_autoanimateloop");
-            Tools.PrepareNumericUpDown(nupFrom, cameras, "babylonjs_autoanimate_from");
-            Tools.PrepareNumericUpDown(nupTo, cameras, "babylonjs_autoanimate_to", 100.0f);
-        }
-
-        private void butOK_Click(object sender, EventArgs e)
-        {
-            Tools.UpdateCheckBox(chkNoExport, cameras, "babylonjs_noexport");
-            Tools.UpdateCheckBox(chkCollisions, cameras, "babylonjs_checkcollisions");
-            Tools.UpdateCheckBox(chkGravity, cameras, "babylonjs_applygravity");
-
-            Tools.UpdateNumericUpDown(nupSpeed, cameras, "babylonjs_speed");
-            Tools.UpdateNumericUpDown(nupInertia, cameras, "babylonjs_inertia");
-
-            Tools.UpdateVector3Control(ellipsoidControl, cameras, "babylonjs_ellipsoid");
-
-            Tools.UpdateComboBox(cbCameraType, cameras, "babylonjs_type");
-
-            Tools.UpdateCheckBox(chkAutoAnimate, cameras, "babylonjs_autoanimate");
-            Tools.UpdateCheckBox(chkLoop, cameras, "babylonjs_autoanimateloop");
-            Tools.UpdateNumericUpDown(nupFrom, cameras, "babylonjs_autoanimate_from");
-            Tools.UpdateNumericUpDown(nupTo, cameras, "babylonjs_autoanimate_to");
-        }
-
-        private void chkAutoAnimate_CheckedChanged(object sender, EventArgs e)
-        {
-            grpAutoAnimate.Enabled = chkAutoAnimate.Checked;
-        }
-
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using Autodesk.Max;
+
+namespace Max2Babylon
+{
+    public partial class CameraPropertiesForm : Form
+    {
+        private readonly List<IINode> cameras = new List<IINode>();
+
+        public CameraPropertiesForm()
+        {
+            InitializeComponent();
+        }
+
+        private void CameraPropertiesForm_Load(object sender, EventArgs e)
+        {
+            for (var index = 0; index < Loader.Core.SelNodeCount; index++)
+            {
+                var node = Loader.Core.GetSelNode(index);
+
+                if (node.ObjectRef != null && node.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Camera)
+                {
+                    cameras.Add(node);
+                }
+            }
+
+            Tools.PrepareCheckBox(chkNoExport, cameras, "babylonjs_noexport");
+            Tools.PrepareCheckBox(chkCollisions, cameras, "babylonjs_checkcollisions");
+            Tools.PrepareCheckBox(chkGravity, cameras, "babylonjs_applygravity");
+
+            Tools.PrepareNumericUpDown(nupSpeed, cameras, "babylonjs_speed", 1.0f);
+            Tools.PrepareNumericUpDown(nupInertia, cameras, "babylonjs_inertia", 0.9f);
+
+            Tools.PrepareVector3Control(ellipsoidControl, cameras[0], "babylonjs_ellipsoid", 0.5f, 1.0f, 0.5f);
+
+            Tools.PrepareComboBox(cbCameraType, cameras[0], "babylonjs_type", "FreeCamera");
+
+            Tools.PrepareCheckBox(chkAutoAnimate, cameras, "babylonjs_autoanimate");
+            Tools.PrepareCheckBox(chkLoop, cameras, "babylonjs_autoanimateloop");
+            Tools.PrepareNumericUpDown(nupFrom, cameras, "babylonjs_autoanimate_from");
+            Tools.PrepareNumericUpDown(nupTo, cameras, "babylonjs_autoanimate_to", 100.0f);
+        }
+
+        private void butOK_Click(object sender, EventArgs e)
+        {
+            Tools.UpdateCheckBox(chkNoExport, cameras, "babylonjs_noexport");
+            Tools.UpdateCheckBox(chkCollisions, cameras, "babylonjs_checkcollisions");
+            Tools.UpdateCheckBox(chkGravity, cameras, "babylonjs_applygravity");
+
+            Tools.UpdateNumericUpDown(nupSpeed, cameras, "babylonjs_speed");
+            Tools.UpdateNumericUpDown(nupInertia, cameras, "babylonjs_inertia");
+
+            Tools.UpdateVector3Control(ellipsoidControl, cameras, "babylonjs_ellipsoid");
+
+            Tools.UpdateComboBox(cbCameraType, cameras, "babylonjs_type");
+
+            Tools.UpdateCheckBox(chkAutoAnimate, cameras, "babylonjs_autoanimate");
+            Tools.UpdateCheckBox(chkLoop, cameras, "babylonjs_autoanimateloop");
+            Tools.UpdateNumericUpDown(nupFrom, cameras, "babylonjs_autoanimate_from");
+            Tools.UpdateNumericUpDown(nupTo, cameras, "babylonjs_autoanimate_to");
+        }
+
+        private void chkAutoAnimate_CheckedChanged(object sender, EventArgs e)
+        {
+            grpAutoAnimate.Enabled = chkAutoAnimate.Checked;
+        }
+
+    }
+}

+ 119 - 119
Exporters/3ds Max/Max2Babylon/Forms/CameraPropertiesForm.resx

@@ -1,120 +1,120 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
 </root>

+ 319 - 319
Exporters/3ds Max/Max2Babylon/Forms/ExporterForm.Designer.cs

@@ -1,320 +1,320 @@
-namespace Max2Babylon
-{
-    partial class ExporterForm
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExporterForm));
-            this.butExport = new System.Windows.Forms.Button();
-            this.label1 = new System.Windows.Forms.Label();
-            this.txtFilename = new System.Windows.Forms.TextBox();
-            this.butBrowse = new System.Windows.Forms.Button();
-            this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
-            this.progressBar = new System.Windows.Forms.ProgressBar();
-            this.treeView = new System.Windows.Forms.TreeView();
-            this.butCancel = new System.Windows.Forms.Button();
-            this.pictureBox2 = new System.Windows.Forms.PictureBox();
-            this.chkManifest = new System.Windows.Forms.CheckBox();
-            this.label2 = new System.Windows.Forms.Label();
-            this.chkCopyTextures = new System.Windows.Forms.CheckBox();
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
-            this.chkBinary = new System.Windows.Forms.CheckBox();
-            this.chkOnlySelected = new System.Windows.Forms.CheckBox();
-            this.chkAutoSave = new System.Windows.Forms.CheckBox();
-            this.chkHidden = new System.Windows.Forms.CheckBox();
-            this.butExportAndRun = new System.Windows.Forms.Button();
-            this.butClose = new System.Windows.Forms.Button();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
-            this.groupBox1.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // butExport
-            // 
-            this.butExport.Anchor = System.Windows.Forms.AnchorStyles.Top;
-            this.butExport.Enabled = false;
-            this.butExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butExport.Location = new System.Drawing.Point(211, 153);
-            this.butExport.Name = "butExport";
-            this.butExport.Size = new System.Drawing.Size(197, 27);
-            this.butExport.TabIndex = 0;
-            this.butExport.Text = "Export";
-            this.butExport.UseVisualStyleBackColor = true;
-            this.butExport.Click += new System.EventHandler(this.butExport_Click);
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(6, 17);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(52, 13);
-            this.label1.TabIndex = 2;
-            this.label1.Text = "Filename:";
-            // 
-            // txtFilename
-            // 
-            this.txtFilename.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.txtFilename.Location = new System.Drawing.Point(18, 34);
-            this.txtFilename.Name = "txtFilename";
-            this.txtFilename.Size = new System.Drawing.Size(420, 20);
-            this.txtFilename.TabIndex = 3;
-            this.txtFilename.TextChanged += new System.EventHandler(this.txtFilename_TextChanged);
-            // 
-            // butBrowse
-            // 
-            this.butBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.butBrowse.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butBrowse.Location = new System.Drawing.Point(444, 32);
-            this.butBrowse.Name = "butBrowse";
-            this.butBrowse.Size = new System.Drawing.Size(43, 23);
-            this.butBrowse.TabIndex = 4;
-            this.butBrowse.Text = "...";
-            this.butBrowse.UseVisualStyleBackColor = true;
-            this.butBrowse.Click += new System.EventHandler(this.butBrowse_Click);
-            // 
-            // saveFileDialog
-            // 
-            this.saveFileDialog.DefaultExt = "babylon";
-            this.saveFileDialog.Filter = "Babylon files|*.babylon";
-            this.saveFileDialog.RestoreDirectory = true;
-            // 
-            // progressBar
-            // 
-            this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.progressBar.Location = new System.Drawing.Point(12, 516);
-            this.progressBar.Name = "progressBar";
-            this.progressBar.Size = new System.Drawing.Size(627, 23);
-            this.progressBar.TabIndex = 5;
-            // 
-            // treeView
-            // 
-            this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.treeView.Location = new System.Drawing.Point(12, 186);
-            this.treeView.Name = "treeView";
-            this.treeView.Size = new System.Drawing.Size(799, 324);
-            this.treeView.TabIndex = 6;
-            // 
-            // butCancel
-            // 
-            this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.butCancel.Enabled = false;
-            this.butCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butCancel.Location = new System.Drawing.Point(645, 516);
-            this.butCancel.Name = "butCancel";
-            this.butCancel.Size = new System.Drawing.Size(80, 23);
-            this.butCancel.TabIndex = 7;
-            this.butCancel.Text = "Cancel";
-            this.butCancel.UseVisualStyleBackColor = true;
-            this.butCancel.Click += new System.EventHandler(this.butCancel_Click);
-            // 
-            // pictureBox2
-            // 
-            this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
-            this.pictureBox2.Location = new System.Drawing.Point(511, 12);
-            this.pictureBox2.Name = "pictureBox2";
-            this.pictureBox2.Size = new System.Drawing.Size(300, 130);
-            this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
-            this.pictureBox2.TabIndex = 9;
-            this.pictureBox2.TabStop = false;
-            // 
-            // chkManifest
-            // 
-            this.chkManifest.AutoSize = true;
-            this.chkManifest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkManifest.Location = new System.Drawing.Point(18, 104);
-            this.chkManifest.Name = "chkManifest";
-            this.chkManifest.Size = new System.Drawing.Size(112, 17);
-            this.chkManifest.TabIndex = 2;
-            this.chkManifest.Text = "Generate .manifest";
-            this.chkManifest.UseVisualStyleBackColor = true;
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(6, 62);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(46, 13);
-            this.label2.TabIndex = 11;
-            this.label2.Text = "Options:";
-            // 
-            // chkCopyTextures
-            // 
-            this.chkCopyTextures.AutoSize = true;
-            this.chkCopyTextures.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkCopyTextures.Location = new System.Drawing.Point(18, 81);
-            this.chkCopyTextures.Name = "chkCopyTextures";
-            this.chkCopyTextures.Size = new System.Drawing.Size(132, 17);
-            this.chkCopyTextures.TabIndex = 12;
-            this.chkCopyTextures.Text = "Copy textures to output";
-            this.chkCopyTextures.UseVisualStyleBackColor = true;
-            // 
-            // groupBox1
-            // 
-            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.groupBox1.Controls.Add(this.chkBinary);
-            this.groupBox1.Controls.Add(this.chkOnlySelected);
-            this.groupBox1.Controls.Add(this.chkAutoSave);
-            this.groupBox1.Controls.Add(this.chkHidden);
-            this.groupBox1.Controls.Add(this.label1);
-            this.groupBox1.Controls.Add(this.chkCopyTextures);
-            this.groupBox1.Controls.Add(this.txtFilename);
-            this.groupBox1.Controls.Add(this.chkManifest);
-            this.groupBox1.Controls.Add(this.butBrowse);
-            this.groupBox1.Controls.Add(this.label2);
-            this.groupBox1.Location = new System.Drawing.Point(12, 6);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(493, 136);
-            this.groupBox1.TabIndex = 13;
-            this.groupBox1.TabStop = false;
-            // 
-            // chkBinary
-            // 
-            this.chkBinary.AutoSize = true;
-            this.chkBinary.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkBinary.Location = new System.Drawing.Point(320, 104);
-            this.chkBinary.Name = "chkBinary";
-            this.chkBinary.Size = new System.Drawing.Size(135, 17);
-            this.chkBinary.TabIndex = 16;
-            this.chkBinary.Text = "Generate binary version";
-            this.chkBinary.UseVisualStyleBackColor = true;
-            // 
-            // chkOnlySelected
-            // 
-            this.chkOnlySelected.AutoSize = true;
-            this.chkOnlySelected.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkOnlySelected.Location = new System.Drawing.Point(320, 81);
-            this.chkOnlySelected.Name = "chkOnlySelected";
-            this.chkOnlySelected.Size = new System.Drawing.Size(118, 17);
-            this.chkOnlySelected.TabIndex = 15;
-            this.chkOnlySelected.Text = "Export only selected";
-            this.chkOnlySelected.UseVisualStyleBackColor = true;
-            // 
-            // chkAutoSave
-            // 
-            this.chkAutoSave.AutoSize = true;
-            this.chkAutoSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkAutoSave.Location = new System.Drawing.Point(166, 104);
-            this.chkAutoSave.Name = "chkAutoSave";
-            this.chkAutoSave.Size = new System.Drawing.Size(130, 17);
-            this.chkAutoSave.TabIndex = 14;
-            this.chkAutoSave.Text = "Auto save 3ds Max file";
-            this.chkAutoSave.UseVisualStyleBackColor = true;
-            // 
-            // chkHidden
-            // 
-            this.chkHidden.AutoSize = true;
-            this.chkHidden.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkHidden.Location = new System.Drawing.Point(166, 81);
-            this.chkHidden.Name = "chkHidden";
-            this.chkHidden.Size = new System.Drawing.Size(125, 17);
-            this.chkHidden.TabIndex = 13;
-            this.chkHidden.Text = "Export hidden objects";
-            this.chkHidden.UseVisualStyleBackColor = true;
-            // 
-            // butExportAndRun
-            // 
-            this.butExportAndRun.Anchor = System.Windows.Forms.AnchorStyles.Top;
-            this.butExportAndRun.Enabled = false;
-            this.butExportAndRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butExportAndRun.Location = new System.Drawing.Point(414, 153);
-            this.butExportAndRun.Name = "butExportAndRun";
-            this.butExportAndRun.Size = new System.Drawing.Size(197, 27);
-            this.butExportAndRun.TabIndex = 14;
-            this.butExportAndRun.Text = "Export && Run";
-            this.butExportAndRun.UseVisualStyleBackColor = true;
-            this.butExportAndRun.Click += new System.EventHandler(this.butExportAndRun_Click);
-            // 
-            // butClose
-            // 
-            this.butClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.butClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butClose.Location = new System.Drawing.Point(731, 516);
-            this.butClose.Name = "butClose";
-            this.butClose.Size = new System.Drawing.Size(80, 23);
-            this.butClose.TabIndex = 7;
-            this.butClose.Text = "Close";
-            this.butClose.UseVisualStyleBackColor = true;
-            this.butClose.Click += new System.EventHandler(this.butClose_Click);
-            // 
-            // ExporterForm
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(823, 551);
-            this.Controls.Add(this.butExportAndRun);
-            this.Controls.Add(this.groupBox1);
-            this.Controls.Add(this.pictureBox2);
-            this.Controls.Add(this.butClose);
-            this.Controls.Add(this.butCancel);
-            this.Controls.Add(this.treeView);
-            this.Controls.Add(this.progressBar);
-            this.Controls.Add(this.butExport);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
-            this.MinimumSize = new System.Drawing.Size(750, 400);
-            this.Name = "ExporterForm";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "Babylon.js - Export scene to .babylon file";
-            this.Activated += new System.EventHandler(this.ExporterForm_Activated);
-            this.Deactivate += new System.EventHandler(this.ExporterForm_Deactivate);
-            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ExporterForm_FormClosed);
-            this.Load += new System.EventHandler(this.ExporterForm_Load);
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
-            this.groupBox1.ResumeLayout(false);
-            this.groupBox1.PerformLayout();
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.Button butExport;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.TextBox txtFilename;
-        private System.Windows.Forms.Button butBrowse;
-        private System.Windows.Forms.SaveFileDialog saveFileDialog;
-        private System.Windows.Forms.ProgressBar progressBar;
-        private System.Windows.Forms.TreeView treeView;
-        private System.Windows.Forms.Button butCancel;
-        private System.Windows.Forms.PictureBox pictureBox2;
-        private System.Windows.Forms.CheckBox chkManifest;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.CheckBox chkCopyTextures;
-        private System.Windows.Forms.GroupBox groupBox1;
-        private System.Windows.Forms.CheckBox chkHidden;
-        private System.Windows.Forms.CheckBox chkAutoSave;
-        private System.Windows.Forms.Button butExportAndRun;
-        private System.Windows.Forms.CheckBox chkOnlySelected;
-        private System.Windows.Forms.Button butClose;
-        private System.Windows.Forms.CheckBox chkBinary;
-    }
+namespace Max2Babylon
+{
+    partial class ExporterForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExporterForm));
+            this.butExport = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.txtFilename = new System.Windows.Forms.TextBox();
+            this.butBrowse = new System.Windows.Forms.Button();
+            this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
+            this.progressBar = new System.Windows.Forms.ProgressBar();
+            this.treeView = new System.Windows.Forms.TreeView();
+            this.butCancel = new System.Windows.Forms.Button();
+            this.pictureBox2 = new System.Windows.Forms.PictureBox();
+            this.chkManifest = new System.Windows.Forms.CheckBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.chkCopyTextures = new System.Windows.Forms.CheckBox();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.chkBinary = new System.Windows.Forms.CheckBox();
+            this.chkOnlySelected = new System.Windows.Forms.CheckBox();
+            this.chkAutoSave = new System.Windows.Forms.CheckBox();
+            this.chkHidden = new System.Windows.Forms.CheckBox();
+            this.butExportAndRun = new System.Windows.Forms.Button();
+            this.butClose = new System.Windows.Forms.Button();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+            this.groupBox1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // butExport
+            // 
+            this.butExport.Anchor = System.Windows.Forms.AnchorStyles.Top;
+            this.butExport.Enabled = false;
+            this.butExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butExport.Location = new System.Drawing.Point(211, 153);
+            this.butExport.Name = "butExport";
+            this.butExport.Size = new System.Drawing.Size(197, 27);
+            this.butExport.TabIndex = 0;
+            this.butExport.Text = "Export";
+            this.butExport.UseVisualStyleBackColor = true;
+            this.butExport.Click += new System.EventHandler(this.butExport_Click);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(6, 17);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(52, 13);
+            this.label1.TabIndex = 2;
+            this.label1.Text = "Filename:";
+            // 
+            // txtFilename
+            // 
+            this.txtFilename.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtFilename.Location = new System.Drawing.Point(18, 34);
+            this.txtFilename.Name = "txtFilename";
+            this.txtFilename.Size = new System.Drawing.Size(420, 20);
+            this.txtFilename.TabIndex = 3;
+            this.txtFilename.TextChanged += new System.EventHandler(this.txtFilename_TextChanged);
+            // 
+            // butBrowse
+            // 
+            this.butBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.butBrowse.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butBrowse.Location = new System.Drawing.Point(444, 32);
+            this.butBrowse.Name = "butBrowse";
+            this.butBrowse.Size = new System.Drawing.Size(43, 23);
+            this.butBrowse.TabIndex = 4;
+            this.butBrowse.Text = "...";
+            this.butBrowse.UseVisualStyleBackColor = true;
+            this.butBrowse.Click += new System.EventHandler(this.butBrowse_Click);
+            // 
+            // saveFileDialog
+            // 
+            this.saveFileDialog.DefaultExt = "babylon";
+            this.saveFileDialog.Filter = "Babylon files|*.babylon";
+            this.saveFileDialog.RestoreDirectory = true;
+            // 
+            // progressBar
+            // 
+            this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.progressBar.Location = new System.Drawing.Point(12, 516);
+            this.progressBar.Name = "progressBar";
+            this.progressBar.Size = new System.Drawing.Size(627, 23);
+            this.progressBar.TabIndex = 5;
+            // 
+            // treeView
+            // 
+            this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.treeView.Location = new System.Drawing.Point(12, 186);
+            this.treeView.Name = "treeView";
+            this.treeView.Size = new System.Drawing.Size(799, 324);
+            this.treeView.TabIndex = 6;
+            // 
+            // butCancel
+            // 
+            this.butCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.butCancel.Enabled = false;
+            this.butCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butCancel.Location = new System.Drawing.Point(645, 516);
+            this.butCancel.Name = "butCancel";
+            this.butCancel.Size = new System.Drawing.Size(80, 23);
+            this.butCancel.TabIndex = 7;
+            this.butCancel.Text = "Cancel";
+            this.butCancel.UseVisualStyleBackColor = true;
+            this.butCancel.Click += new System.EventHandler(this.butCancel_Click);
+            // 
+            // pictureBox2
+            // 
+            this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
+            this.pictureBox2.Location = new System.Drawing.Point(511, 12);
+            this.pictureBox2.Name = "pictureBox2";
+            this.pictureBox2.Size = new System.Drawing.Size(300, 130);
+            this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+            this.pictureBox2.TabIndex = 9;
+            this.pictureBox2.TabStop = false;
+            // 
+            // chkManifest
+            // 
+            this.chkManifest.AutoSize = true;
+            this.chkManifest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkManifest.Location = new System.Drawing.Point(18, 104);
+            this.chkManifest.Name = "chkManifest";
+            this.chkManifest.Size = new System.Drawing.Size(112, 17);
+            this.chkManifest.TabIndex = 2;
+            this.chkManifest.Text = "Generate .manifest";
+            this.chkManifest.UseVisualStyleBackColor = true;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(6, 62);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(46, 13);
+            this.label2.TabIndex = 11;
+            this.label2.Text = "Options:";
+            // 
+            // chkCopyTextures
+            // 
+            this.chkCopyTextures.AutoSize = true;
+            this.chkCopyTextures.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkCopyTextures.Location = new System.Drawing.Point(18, 81);
+            this.chkCopyTextures.Name = "chkCopyTextures";
+            this.chkCopyTextures.Size = new System.Drawing.Size(132, 17);
+            this.chkCopyTextures.TabIndex = 12;
+            this.chkCopyTextures.Text = "Copy textures to output";
+            this.chkCopyTextures.UseVisualStyleBackColor = true;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.groupBox1.Controls.Add(this.chkBinary);
+            this.groupBox1.Controls.Add(this.chkOnlySelected);
+            this.groupBox1.Controls.Add(this.chkAutoSave);
+            this.groupBox1.Controls.Add(this.chkHidden);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.chkCopyTextures);
+            this.groupBox1.Controls.Add(this.txtFilename);
+            this.groupBox1.Controls.Add(this.chkManifest);
+            this.groupBox1.Controls.Add(this.butBrowse);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Location = new System.Drawing.Point(12, 6);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(493, 136);
+            this.groupBox1.TabIndex = 13;
+            this.groupBox1.TabStop = false;
+            // 
+            // chkBinary
+            // 
+            this.chkBinary.AutoSize = true;
+            this.chkBinary.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkBinary.Location = new System.Drawing.Point(320, 104);
+            this.chkBinary.Name = "chkBinary";
+            this.chkBinary.Size = new System.Drawing.Size(135, 17);
+            this.chkBinary.TabIndex = 16;
+            this.chkBinary.Text = "Generate binary version";
+            this.chkBinary.UseVisualStyleBackColor = true;
+            // 
+            // chkOnlySelected
+            // 
+            this.chkOnlySelected.AutoSize = true;
+            this.chkOnlySelected.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkOnlySelected.Location = new System.Drawing.Point(320, 81);
+            this.chkOnlySelected.Name = "chkOnlySelected";
+            this.chkOnlySelected.Size = new System.Drawing.Size(118, 17);
+            this.chkOnlySelected.TabIndex = 15;
+            this.chkOnlySelected.Text = "Export only selected";
+            this.chkOnlySelected.UseVisualStyleBackColor = true;
+            // 
+            // chkAutoSave
+            // 
+            this.chkAutoSave.AutoSize = true;
+            this.chkAutoSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkAutoSave.Location = new System.Drawing.Point(166, 104);
+            this.chkAutoSave.Name = "chkAutoSave";
+            this.chkAutoSave.Size = new System.Drawing.Size(130, 17);
+            this.chkAutoSave.TabIndex = 14;
+            this.chkAutoSave.Text = "Auto save 3ds Max file";
+            this.chkAutoSave.UseVisualStyleBackColor = true;
+            // 
+            // chkHidden
+            // 
+            this.chkHidden.AutoSize = true;
+            this.chkHidden.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkHidden.Location = new System.Drawing.Point(166, 81);
+            this.chkHidden.Name = "chkHidden";
+            this.chkHidden.Size = new System.Drawing.Size(125, 17);
+            this.chkHidden.TabIndex = 13;
+            this.chkHidden.Text = "Export hidden objects";
+            this.chkHidden.UseVisualStyleBackColor = true;
+            // 
+            // butExportAndRun
+            // 
+            this.butExportAndRun.Anchor = System.Windows.Forms.AnchorStyles.Top;
+            this.butExportAndRun.Enabled = false;
+            this.butExportAndRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butExportAndRun.Location = new System.Drawing.Point(414, 153);
+            this.butExportAndRun.Name = "butExportAndRun";
+            this.butExportAndRun.Size = new System.Drawing.Size(197, 27);
+            this.butExportAndRun.TabIndex = 14;
+            this.butExportAndRun.Text = "Export && Run";
+            this.butExportAndRun.UseVisualStyleBackColor = true;
+            this.butExportAndRun.Click += new System.EventHandler(this.butExportAndRun_Click);
+            // 
+            // butClose
+            // 
+            this.butClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.butClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butClose.Location = new System.Drawing.Point(731, 516);
+            this.butClose.Name = "butClose";
+            this.butClose.Size = new System.Drawing.Size(80, 23);
+            this.butClose.TabIndex = 7;
+            this.butClose.Text = "Close";
+            this.butClose.UseVisualStyleBackColor = true;
+            this.butClose.Click += new System.EventHandler(this.butClose_Click);
+            // 
+            // ExporterForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(823, 551);
+            this.Controls.Add(this.butExportAndRun);
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.pictureBox2);
+            this.Controls.Add(this.butClose);
+            this.Controls.Add(this.butCancel);
+            this.Controls.Add(this.treeView);
+            this.Controls.Add(this.progressBar);
+            this.Controls.Add(this.butExport);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
+            this.MinimumSize = new System.Drawing.Size(750, 400);
+            this.Name = "ExporterForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Babylon.js - Export scene to .babylon file";
+            this.Activated += new System.EventHandler(this.ExporterForm_Activated);
+            this.Deactivate += new System.EventHandler(this.ExporterForm_Deactivate);
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ExporterForm_FormClosed);
+            this.Load += new System.EventHandler(this.ExporterForm_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button butExport;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox txtFilename;
+        private System.Windows.Forms.Button butBrowse;
+        private System.Windows.Forms.SaveFileDialog saveFileDialog;
+        private System.Windows.Forms.ProgressBar progressBar;
+        private System.Windows.Forms.TreeView treeView;
+        private System.Windows.Forms.Button butCancel;
+        private System.Windows.Forms.PictureBox pictureBox2;
+        private System.Windows.Forms.CheckBox chkManifest;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.CheckBox chkCopyTextures;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.CheckBox chkHidden;
+        private System.Windows.Forms.CheckBox chkAutoSave;
+        private System.Windows.Forms.Button butExportAndRun;
+        private System.Windows.Forms.CheckBox chkOnlySelected;
+        private System.Windows.Forms.Button butClose;
+        private System.Windows.Forms.CheckBox chkBinary;
+    }
 }

+ 229 - 229
Exporters/3ds Max/Max2Babylon/Forms/ExporterForm.cs

@@ -1,229 +1,229 @@
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-using Color = System.Drawing.Color;
-
-namespace Max2Babylon
-{
-    public partial class ExporterForm : Form
-    {
-        private readonly BabylonExportActionItem babylonExportAction;
-        private BabylonExporter exporter;
-
-        TreeNode currentNode;
-        int currentRank;
-
-        public ExporterForm(BabylonExportActionItem babylonExportAction)
-        {
-            InitializeComponent();
-
-            this.babylonExportAction = babylonExportAction;
-        }
-
-        private void ExporterForm_Load(object sender, EventArgs e)
-        {
-            txtFilename.Text = Loader.Core.RootNode.GetLocalData();
-            Tools.PrepareCheckBox(chkManifest, Loader.Core.RootNode, "babylonjs_generatemanifest");
-            Tools.PrepareCheckBox(chkCopyTextures, Loader.Core.RootNode, "babylonjs_copytextures", 1);
-            Tools.PrepareCheckBox(chkHidden, Loader.Core.RootNode, "babylonjs_exporthidden");
-            Tools.PrepareCheckBox(chkAutoSave, Loader.Core.RootNode, "babylonjs_autosave", 1);
-            Tools.PrepareCheckBox(chkOnlySelected, Loader.Core.RootNode, "babylonjs_onlySelected");
-            Tools.PrepareCheckBox(chkBinary, Loader.Core.RootNode, "babylonjs_binary"); 
-        }
-
-        private void butBrowse_Click(object sender, EventArgs e)
-        {
-            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
-            {
-                txtFilename.Text = saveFileDialog.FileName;
-            }
-        }
-
-        private async void butExport_Click(object sender, EventArgs e)
-        {
-            await DoExport();
-        }
-
-        private async Task<bool> DoExport()
-        {
-            Tools.UpdateCheckBox(chkManifest, Loader.Core.RootNode, "babylonjs_generatemanifest");
-            Tools.UpdateCheckBox(chkCopyTextures, Loader.Core.RootNode, "babylonjs_copytextures");
-            Tools.UpdateCheckBox(chkHidden, Loader.Core.RootNode, "babylonjs_exporthidden");
-            Tools.UpdateCheckBox(chkAutoSave, Loader.Core.RootNode, "babylonjs_autosave");
-            Tools.UpdateCheckBox(chkOnlySelected, Loader.Core.RootNode, "babylonjs_onlySelected");
-            Tools.UpdateCheckBox(chkBinary, Loader.Core.RootNode, "babylonjs_binary");
-
-            Loader.Core.RootNode.SetLocalData(txtFilename.Text);
-
-            exporter = new BabylonExporter();
-
-            treeView.Nodes.Clear();
-
-            exporter.OnImportProgressChanged += progress =>
-            {
-                progressBar.Value = progress;
-                Application.DoEvents();
-            };
-
-            exporter.OnWarning += (warning, rank) =>
-            {
-                try
-                {
-                    currentNode = CreateTreeNode(rank, warning, Color.DarkOrange);
-                    currentNode.EnsureVisible();
-                }
-                catch
-                {
-                }
-                Application.DoEvents();
-            };
-
-            exporter.OnError += (error, rank) =>
-            {
-                try
-                {
-                    currentNode = CreateTreeNode(rank, error, Color.Red);
-                    currentNode.EnsureVisible();
-                }
-                catch
-                {
-                }
-                Application.DoEvents();
-            };
-
-            exporter.OnMessage += (message, color, rank, emphasis) =>
-            {
-                try
-                {
-                    currentNode = CreateTreeNode(rank, message, color);
-
-                    if (emphasis)
-                    {
-                        currentNode.EnsureVisible();
-                    }
-                }
-                catch
-                {
-                }
-                Application.DoEvents();
-            };
-
-            butExport.Enabled = false;
-            butExportAndRun.Enabled = false;
-            butCancel.Enabled = true;
-
-            bool success = true;
-            try
-            {
-                exporter.AutoSave3dsMaxFile = chkAutoSave.Checked;
-                exporter.ExportHiddenObjects = chkHidden.Checked;
-                exporter.CopyTexturesToOutput = chkCopyTextures.Checked;
-                await exporter.ExportAsync(txtFilename.Text, chkManifest.Checked, chkOnlySelected.Checked, chkBinary.Checked, this);
-            }
-            catch (OperationCanceledException)
-            {
-                progressBar.Value = 0;
-                success = false;
-            }
-            catch (Exception ex)
-            {
-                currentNode = CreateTreeNode(0, "Exportation cancelled: " + ex.Message, Color.Red);
-
-                currentNode.EnsureVisible();
-                progressBar.Value = 0;
-                success = false;
-            }
-
-            butCancel.Enabled = false;
-            butExport.Enabled = true;
-            butExportAndRun.Enabled = WebServer.IsSupported;
-
-            BringToFront();
-
-            return success;
-        }
-
-        private TreeNode CreateTreeNode(int rank, string text, Color color)
-        {
-            TreeNode newNode = null;
-
-            Invoke(new Action(() =>
-            {
-                newNode = new TreeNode(text) {ForeColor = color};
-                if (rank == 0)
-                {
-                    treeView.Nodes.Add(newNode);
-                }
-                else if (rank == currentRank + 1)
-                {
-                    currentNode.Nodes.Add(newNode);
-                }
-                else
-                {
-                    var parentNode = currentNode;
-                    while (currentRank != rank - 1)
-                    {
-                        parentNode = parentNode.Parent;
-                        currentRank--;
-                    }
-                    parentNode.Nodes.Add(newNode);
-                }
-
-                currentRank = rank;
-            }));
-
-            return newNode;
-        }
-
-        private void ExporterForm_FormClosed(object sender, FormClosedEventArgs e)
-        {
-            if (exporter != null)
-            {
-                exporter.IsCancelled = true;                
-            }
-            babylonExportAction.Close();
-        }
-
-        private void txtFilename_TextChanged(object sender, EventArgs e)
-        {
-            butExport.Enabled = !string.IsNullOrEmpty(txtFilename.Text.Trim());
-            butExportAndRun.Enabled = butExport.Enabled && WebServer.IsSupported;
-        }
-
-        private void butCancel_Click(object sender, EventArgs e)
-        {
-            exporter.IsCancelled = true;
-        }
-
-        private void ExporterForm_Activated(object sender, EventArgs e)
-        {
-            Loader.Global.DisableAccelerators();
-        }
-
-        private void ExporterForm_Deactivate(object sender, EventArgs e)
-        {
-            Loader.Global.EnableAccelerators();
-        }
-
-        private async void butExportAndRun_Click(object sender, EventArgs e)
-        {
-            if (await DoExport())
-            {
-                WebServer.SceneFilename = Path.GetFileName(txtFilename.Text);
-                WebServer.SceneFolder = Path.GetDirectoryName(txtFilename.Text);
-
-                Process.Start("http://localhost:" + WebServer.Port);
-
-                WindowState = FormWindowState.Minimized;
-            }
-        }
-
-        private void butClose_Click(object sender, EventArgs e)
-        {
-            Close();
-        }
-    }
-}
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+using Color = System.Drawing.Color;
+
+namespace Max2Babylon
+{
+    public partial class ExporterForm : Form
+    {
+        private readonly BabylonExportActionItem babylonExportAction;
+        private BabylonExporter exporter;
+
+        TreeNode currentNode;
+        int currentRank;
+
+        public ExporterForm(BabylonExportActionItem babylonExportAction)
+        {
+            InitializeComponent();
+
+            this.babylonExportAction = babylonExportAction;
+        }
+
+        private void ExporterForm_Load(object sender, EventArgs e)
+        {
+            txtFilename.Text = Loader.Core.RootNode.GetLocalData();
+            Tools.PrepareCheckBox(chkManifest, Loader.Core.RootNode, "babylonjs_generatemanifest");
+            Tools.PrepareCheckBox(chkCopyTextures, Loader.Core.RootNode, "babylonjs_copytextures", 1);
+            Tools.PrepareCheckBox(chkHidden, Loader.Core.RootNode, "babylonjs_exporthidden");
+            Tools.PrepareCheckBox(chkAutoSave, Loader.Core.RootNode, "babylonjs_autosave", 1);
+            Tools.PrepareCheckBox(chkOnlySelected, Loader.Core.RootNode, "babylonjs_onlySelected");
+            Tools.PrepareCheckBox(chkBinary, Loader.Core.RootNode, "babylonjs_binary"); 
+        }
+
+        private void butBrowse_Click(object sender, EventArgs e)
+        {
+            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
+            {
+                txtFilename.Text = saveFileDialog.FileName;
+            }
+        }
+
+        private async void butExport_Click(object sender, EventArgs e)
+        {
+            await DoExport();
+        }
+
+        private async Task<bool> DoExport()
+        {
+            Tools.UpdateCheckBox(chkManifest, Loader.Core.RootNode, "babylonjs_generatemanifest");
+            Tools.UpdateCheckBox(chkCopyTextures, Loader.Core.RootNode, "babylonjs_copytextures");
+            Tools.UpdateCheckBox(chkHidden, Loader.Core.RootNode, "babylonjs_exporthidden");
+            Tools.UpdateCheckBox(chkAutoSave, Loader.Core.RootNode, "babylonjs_autosave");
+            Tools.UpdateCheckBox(chkOnlySelected, Loader.Core.RootNode, "babylonjs_onlySelected");
+            Tools.UpdateCheckBox(chkBinary, Loader.Core.RootNode, "babylonjs_binary");
+
+            Loader.Core.RootNode.SetLocalData(txtFilename.Text);
+
+            exporter = new BabylonExporter();
+
+            treeView.Nodes.Clear();
+
+            exporter.OnImportProgressChanged += progress =>
+            {
+                progressBar.Value = progress;
+                Application.DoEvents();
+            };
+
+            exporter.OnWarning += (warning, rank) =>
+            {
+                try
+                {
+                    currentNode = CreateTreeNode(rank, warning, Color.DarkOrange);
+                    currentNode.EnsureVisible();
+                }
+                catch
+                {
+                }
+                Application.DoEvents();
+            };
+
+            exporter.OnError += (error, rank) =>
+            {
+                try
+                {
+                    currentNode = CreateTreeNode(rank, error, Color.Red);
+                    currentNode.EnsureVisible();
+                }
+                catch
+                {
+                }
+                Application.DoEvents();
+            };
+
+            exporter.OnMessage += (message, color, rank, emphasis) =>
+            {
+                try
+                {
+                    currentNode = CreateTreeNode(rank, message, color);
+
+                    if (emphasis)
+                    {
+                        currentNode.EnsureVisible();
+                    }
+                }
+                catch
+                {
+                }
+                Application.DoEvents();
+            };
+
+            butExport.Enabled = false;
+            butExportAndRun.Enabled = false;
+            butCancel.Enabled = true;
+
+            bool success = true;
+            try
+            {
+                exporter.AutoSave3dsMaxFile = chkAutoSave.Checked;
+                exporter.ExportHiddenObjects = chkHidden.Checked;
+                exporter.CopyTexturesToOutput = chkCopyTextures.Checked;
+                await exporter.ExportAsync(txtFilename.Text, chkManifest.Checked, chkOnlySelected.Checked, chkBinary.Checked, this);
+            }
+            catch (OperationCanceledException)
+            {
+                progressBar.Value = 0;
+                success = false;
+            }
+            catch (Exception ex)
+            {
+                currentNode = CreateTreeNode(0, "Exportation cancelled: " + ex.Message, Color.Red);
+
+                currentNode.EnsureVisible();
+                progressBar.Value = 0;
+                success = false;
+            }
+
+            butCancel.Enabled = false;
+            butExport.Enabled = true;
+            butExportAndRun.Enabled = WebServer.IsSupported;
+
+            BringToFront();
+
+            return success;
+        }
+
+        private TreeNode CreateTreeNode(int rank, string text, Color color)
+        {
+            TreeNode newNode = null;
+
+            Invoke(new Action(() =>
+            {
+                newNode = new TreeNode(text) {ForeColor = color};
+                if (rank == 0)
+                {
+                    treeView.Nodes.Add(newNode);
+                }
+                else if (rank == currentRank + 1)
+                {
+                    currentNode.Nodes.Add(newNode);
+                }
+                else
+                {
+                    var parentNode = currentNode;
+                    while (currentRank != rank - 1)
+                    {
+                        parentNode = parentNode.Parent;
+                        currentRank--;
+                    }
+                    parentNode.Nodes.Add(newNode);
+                }
+
+                currentRank = rank;
+            }));
+
+            return newNode;
+        }
+
+        private void ExporterForm_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            if (exporter != null)
+            {
+                exporter.IsCancelled = true;                
+            }
+            babylonExportAction.Close();
+        }
+
+        private void txtFilename_TextChanged(object sender, EventArgs e)
+        {
+            butExport.Enabled = !string.IsNullOrEmpty(txtFilename.Text.Trim());
+            butExportAndRun.Enabled = butExport.Enabled && WebServer.IsSupported;
+        }
+
+        private void butCancel_Click(object sender, EventArgs e)
+        {
+            exporter.IsCancelled = true;
+        }
+
+        private void ExporterForm_Activated(object sender, EventArgs e)
+        {
+            Loader.Global.DisableAccelerators();
+        }
+
+        private void ExporterForm_Deactivate(object sender, EventArgs e)
+        {
+            Loader.Global.EnableAccelerators();
+        }
+
+        private async void butExportAndRun_Click(object sender, EventArgs e)
+        {
+            if (await DoExport())
+            {
+                WebServer.SceneFilename = Path.GetFileName(txtFilename.Text);
+                WebServer.SceneFolder = Path.GetDirectoryName(txtFilename.Text);
+
+                Process.Start("http://localhost:" + WebServer.Port);
+
+                WindowState = FormWindowState.Minimized;
+            }
+        }
+
+        private void butClose_Click(object sender, EventArgs e)
+        {
+            Close();
+        }
+    }
+}

+ 320 - 320
Exporters/3ds Max/Max2Babylon/Forms/ExporterForm.resx

@@ -1,321 +1,321 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="pictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        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
-        QmCC
-</value>
-  </data>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="pictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        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
+        QmCC
+</value>
+  </data>
 </root>

+ 419 - 405
Exporters/3ds Max/Max2Babylon/Forms/LightPropertiesForm.Designer.cs

@@ -1,406 +1,420 @@
-namespace Max2Babylon
-{
-    partial class LightPropertiesForm
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.butOK = new System.Windows.Forms.Button();
-            this.butCancel = new System.Windows.Forms.Button();
-            this.groupBox3 = new System.Windows.Forms.GroupBox();
-            this.grpAutoAnimate = new System.Windows.Forms.GroupBox();
-            this.chkLoop = new System.Windows.Forms.CheckBox();
-            this.nupTo = new System.Windows.Forms.NumericUpDown();
-            this.label4 = new System.Windows.Forms.Label();
-            this.nupFrom = new System.Windows.Forms.NumericUpDown();
-            this.label5 = new System.Windows.Forms.Label();
-            this.chkAutoAnimate = new System.Windows.Forms.CheckBox();
-            this.groupBox4 = new System.Windows.Forms.GroupBox();
-            this.chkNoExport = new System.Windows.Forms.CheckBox();
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
-            this.grpBlurInfo = new System.Windows.Forms.GroupBox();
-            this.nupBlurBoxOffset = new System.Windows.Forms.NumericUpDown();
-            this.label3 = new System.Windows.Forms.Label();
-            this.label6 = new System.Windows.Forms.Label();
-            this.nupBlurScale = new System.Windows.Forms.NumericUpDown();
-            this.cbCameraType = new System.Windows.Forms.ComboBox();
-            this.label2 = new System.Windows.Forms.Label();
-            this.nupBias = new System.Windows.Forms.NumericUpDown();
-            this.label1 = new System.Windows.Forms.Label();
-            this.groupBox3.SuspendLayout();
-            this.grpAutoAnimate.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupTo)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupFrom)).BeginInit();
-            this.groupBox4.SuspendLayout();
-            this.groupBox1.SuspendLayout();
-            this.grpBlurInfo.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupBlurBoxOffset)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupBlurScale)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupBias)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // butOK
-            // 
-            this.butOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
-            this.butOK.DialogResult = System.Windows.Forms.DialogResult.OK;
-            this.butOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butOK.Location = new System.Drawing.Point(93, 454);
-            this.butOK.Name = "butOK";
-            this.butOK.Size = new System.Drawing.Size(75, 23);
-            this.butOK.TabIndex = 1;
-            this.butOK.Text = "OK";
-            this.butOK.UseVisualStyleBackColor = true;
-            this.butOK.Click += new System.EventHandler(this.butOK_Click);
-            // 
-            // butCancel
-            // 
-            this.butCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
-            this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.butCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butCancel.Location = new System.Drawing.Point(174, 454);
-            this.butCancel.Name = "butCancel";
-            this.butCancel.Size = new System.Drawing.Size(75, 23);
-            this.butCancel.TabIndex = 2;
-            this.butCancel.Text = "Cancel";
-            this.butCancel.UseVisualStyleBackColor = true;
-            // 
-            // groupBox3
-            // 
-            this.groupBox3.Controls.Add(this.grpAutoAnimate);
-            this.groupBox3.Controls.Add(this.chkAutoAnimate);
-            this.groupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox3.Location = new System.Drawing.Point(12, 284);
-            this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(319, 156);
-            this.groupBox3.TabIndex = 5;
-            this.groupBox3.TabStop = false;
-            this.groupBox3.Text = "Animations";
-            // 
-            // grpAutoAnimate
-            // 
-            this.grpAutoAnimate.Controls.Add(this.chkLoop);
-            this.grpAutoAnimate.Controls.Add(this.nupTo);
-            this.grpAutoAnimate.Controls.Add(this.label4);
-            this.grpAutoAnimate.Controls.Add(this.nupFrom);
-            this.grpAutoAnimate.Controls.Add(this.label5);
-            this.grpAutoAnimate.Enabled = false;
-            this.grpAutoAnimate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.grpAutoAnimate.Location = new System.Drawing.Point(21, 51);
-            this.grpAutoAnimate.Name = "grpAutoAnimate";
-            this.grpAutoAnimate.Size = new System.Drawing.Size(292, 99);
-            this.grpAutoAnimate.TabIndex = 3;
-            this.grpAutoAnimate.TabStop = false;
-            // 
-            // chkLoop
-            // 
-            this.chkLoop.AutoSize = true;
-            this.chkLoop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkLoop.Location = new System.Drawing.Point(9, 66);
-            this.chkLoop.Name = "chkLoop";
-            this.chkLoop.Size = new System.Drawing.Size(47, 17);
-            this.chkLoop.TabIndex = 5;
-            this.chkLoop.Text = "Loop";
-            this.chkLoop.ThreeState = true;
-            this.chkLoop.UseVisualStyleBackColor = true;
-            // 
-            // nupTo
-            // 
-            this.nupTo.Location = new System.Drawing.Point(47, 40);
-            this.nupTo.Maximum = new decimal(new int[] {
-            1000,
-            0,
-            0,
-            0});
-            this.nupTo.Name = "nupTo";
-            this.nupTo.Size = new System.Drawing.Size(120, 20);
-            this.nupTo.TabIndex = 3;
-            // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(6, 42);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(23, 13);
-            this.label4.TabIndex = 4;
-            this.label4.Text = "To:";
-            // 
-            // nupFrom
-            // 
-            this.nupFrom.Location = new System.Drawing.Point(47, 14);
-            this.nupFrom.Maximum = new decimal(new int[] {
-            1000,
-            0,
-            0,
-            0});
-            this.nupFrom.Name = "nupFrom";
-            this.nupFrom.Size = new System.Drawing.Size(120, 20);
-            this.nupFrom.TabIndex = 1;
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(6, 16);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(33, 13);
-            this.label5.TabIndex = 2;
-            this.label5.Text = "From:";
-            // 
-            // chkAutoAnimate
-            // 
-            this.chkAutoAnimate.AutoSize = true;
-            this.chkAutoAnimate.Location = new System.Drawing.Point(21, 28);
-            this.chkAutoAnimate.Name = "chkAutoAnimate";
-            this.chkAutoAnimate.Size = new System.Drawing.Size(88, 17);
-            this.chkAutoAnimate.TabIndex = 0;
-            this.chkAutoAnimate.Text = "Auto animate";
-            this.chkAutoAnimate.ThreeState = true;
-            this.chkAutoAnimate.UseVisualStyleBackColor = true;
-            this.chkAutoAnimate.CheckedChanged += new System.EventHandler(this.chkAutoAnimate_CheckedChanged);
-            // 
-            // groupBox4
-            // 
-            this.groupBox4.Controls.Add(this.chkNoExport);
-            this.groupBox4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox4.Location = new System.Drawing.Point(12, 12);
-            this.groupBox4.Name = "groupBox4";
-            this.groupBox4.Size = new System.Drawing.Size(319, 59);
-            this.groupBox4.TabIndex = 7;
-            this.groupBox4.TabStop = false;
-            this.groupBox4.Text = "Misc.";
-            // 
-            // chkNoExport
-            // 
-            this.chkNoExport.AutoSize = true;
-            this.chkNoExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkNoExport.Location = new System.Drawing.Point(21, 28);
-            this.chkNoExport.Name = "chkNoExport";
-            this.chkNoExport.Size = new System.Drawing.Size(87, 17);
-            this.chkNoExport.TabIndex = 4;
-            this.chkNoExport.Text = "Do not export";
-            this.chkNoExport.ThreeState = true;
-            this.chkNoExport.UseVisualStyleBackColor = true;
-            // 
-            // groupBox1
-            // 
-            this.groupBox1.Controls.Add(this.grpBlurInfo);
-            this.groupBox1.Controls.Add(this.nupBias);
-            this.groupBox1.Controls.Add(this.label6);
-            this.groupBox1.Controls.Add(this.label1);
-            this.groupBox1.Controls.Add(this.cbCameraType);
-            this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox1.Location = new System.Drawing.Point(12, 77);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(319, 201);
-            this.groupBox1.TabIndex = 6;
-            this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "Shadows";
-            // 
-            // grpBlurInfo
-            // 
-            this.grpBlurInfo.Controls.Add(this.nupBlurBoxOffset);
-            this.grpBlurInfo.Controls.Add(this.label3);
-            this.grpBlurInfo.Controls.Add(this.nupBlurScale);
-            this.grpBlurInfo.Controls.Add(this.label2);
-            this.grpBlurInfo.Enabled = false;
-            this.grpBlurInfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.grpBlurInfo.Location = new System.Drawing.Point(21, 108);
-            this.grpBlurInfo.Name = "grpBlurInfo";
-            this.grpBlurInfo.Size = new System.Drawing.Size(292, 87);
-            this.grpBlurInfo.TabIndex = 13;
-            this.grpBlurInfo.TabStop = false;
-            this.grpBlurInfo.Text = "Blur info";
-            // 
-            // nupBlurBoxOffset
-            // 
-            this.nupBlurBoxOffset.Location = new System.Drawing.Point(89, 50);
-            this.nupBlurBoxOffset.Maximum = new decimal(new int[] {
-            3,
-            0,
-            0,
-            0});
-            this.nupBlurBoxOffset.Minimum = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
-            this.nupBlurBoxOffset.Name = "nupBlurBoxOffset";
-            this.nupBlurBoxOffset.Size = new System.Drawing.Size(120, 20);
-            this.nupBlurBoxOffset.TabIndex = 13;
-            this.nupBlurBoxOffset.Value = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(6, 52);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(77, 13);
-            this.label3.TabIndex = 14;
-            this.label3.Text = "Blur box offset:";
-            // 
-            // label6
-            // 
-            this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(21, 55);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(34, 13);
-            this.label6.TabIndex = 8;
-            this.label6.Text = "Type:";
-            // 
-            // nupBlurScale
-            // 
-            this.nupBlurScale.Location = new System.Drawing.Point(89, 24);
-            this.nupBlurScale.Maximum = new decimal(new int[] {
-            10,
-            0,
-            0,
-            0});
-            this.nupBlurScale.Minimum = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
-            this.nupBlurScale.Name = "nupBlurScale";
-            this.nupBlurScale.Size = new System.Drawing.Size(120, 20);
-            this.nupBlurScale.TabIndex = 11;
-            this.nupBlurScale.Value = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
-            // 
-            // cbCameraType
-            // 
-            this.cbCameraType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cbCameraType.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.cbCameraType.FormattingEnabled = true;
-            this.cbCameraType.Items.AddRange(new object[] {
-            "Hard shadows",
-            "Poisson Sampling",
-            "Variance",
-            "Blurred Variance"});
-            this.cbCameraType.Location = new System.Drawing.Point(24, 71);
-            this.cbCameraType.Name = "cbCameraType";
-            this.cbCameraType.Size = new System.Drawing.Size(289, 21);
-            this.cbCameraType.TabIndex = 7;
-            this.cbCameraType.SelectedIndexChanged += new System.EventHandler(this.cbCameraType_SelectedIndexChanged);
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(6, 26);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(56, 13);
-            this.label2.TabIndex = 12;
-            this.label2.Text = "Blur scale:";
-            // 
-            // nupBias
-            // 
-            this.nupBias.DecimalPlaces = 5;
-            this.nupBias.Location = new System.Drawing.Point(57, 26);
-            this.nupBias.Maximum = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
-            this.nupBias.Name = "nupBias";
-            this.nupBias.Size = new System.Drawing.Size(120, 20);
-            this.nupBias.TabIndex = 9;
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(21, 28);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(30, 13);
-            this.label1.TabIndex = 10;
-            this.label1.Text = "Bias:";
-            // 
-            // LightPropertiesForm
-            // 
-            this.AcceptButton = this.butOK;
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.CancelButton = this.butCancel;
-            this.ClientSize = new System.Drawing.Size(343, 489);
-            this.Controls.Add(this.groupBox1);
-            this.Controls.Add(this.groupBox4);
-            this.Controls.Add(this.groupBox3);
-            this.Controls.Add(this.butCancel);
-            this.Controls.Add(this.butOK);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
-            this.Name = "LightPropertiesForm";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "Babylon.js - Light Properties";
-            this.Load += new System.EventHandler(this.LightPropertiesForm_Load);
-            this.groupBox3.ResumeLayout(false);
-            this.groupBox3.PerformLayout();
-            this.grpAutoAnimate.ResumeLayout(false);
-            this.grpAutoAnimate.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupTo)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupFrom)).EndInit();
-            this.groupBox4.ResumeLayout(false);
-            this.groupBox4.PerformLayout();
-            this.groupBox1.ResumeLayout(false);
-            this.groupBox1.PerformLayout();
-            this.grpBlurInfo.ResumeLayout(false);
-            this.grpBlurInfo.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupBlurBoxOffset)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupBlurScale)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupBias)).EndInit();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.Button butOK;
-        private System.Windows.Forms.Button butCancel;
-        private System.Windows.Forms.GroupBox groupBox3;
-        private System.Windows.Forms.GroupBox grpAutoAnimate;
-        private System.Windows.Forms.CheckBox chkLoop;
-        private System.Windows.Forms.NumericUpDown nupTo;
-        private System.Windows.Forms.Label label4;
-        private System.Windows.Forms.NumericUpDown nupFrom;
-        private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.CheckBox chkAutoAnimate;
-        private System.Windows.Forms.GroupBox groupBox4;
-        private System.Windows.Forms.CheckBox chkNoExport;
-        private System.Windows.Forms.GroupBox groupBox1;
-        private System.Windows.Forms.Label label6;
-        private System.Windows.Forms.ComboBox cbCameraType;
-        private System.Windows.Forms.NumericUpDown nupBlurScale;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.NumericUpDown nupBias;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.GroupBox grpBlurInfo;
-        private System.Windows.Forms.NumericUpDown nupBlurBoxOffset;
-        private System.Windows.Forms.Label label3;
-    }
+namespace Max2Babylon
+{
+    partial class LightPropertiesForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.butOK = new System.Windows.Forms.Button();
+            this.butCancel = new System.Windows.Forms.Button();
+            this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.grpAutoAnimate = new System.Windows.Forms.GroupBox();
+            this.chkLoop = new System.Windows.Forms.CheckBox();
+            this.nupTo = new System.Windows.Forms.NumericUpDown();
+            this.label4 = new System.Windows.Forms.Label();
+            this.nupFrom = new System.Windows.Forms.NumericUpDown();
+            this.label5 = new System.Windows.Forms.Label();
+            this.chkAutoAnimate = new System.Windows.Forms.CheckBox();
+            this.groupBox4 = new System.Windows.Forms.GroupBox();
+            this.chkNoExport = new System.Windows.Forms.CheckBox();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.ckForceBackFaces = new System.Windows.Forms.CheckBox();
+            this.grpBlurInfo = new System.Windows.Forms.GroupBox();
+            this.nupBlurBoxOffset = new System.Windows.Forms.NumericUpDown();
+            this.label3 = new System.Windows.Forms.Label();
+            this.nupBlurScale = new System.Windows.Forms.NumericUpDown();
+            this.label2 = new System.Windows.Forms.Label();
+            this.nupBias = new System.Windows.Forms.NumericUpDown();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.cbCameraType = new System.Windows.Forms.ComboBox();
+            this.groupBox3.SuspendLayout();
+            this.grpAutoAnimate.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupTo)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupFrom)).BeginInit();
+            this.groupBox4.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            this.grpBlurInfo.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupBlurBoxOffset)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupBlurScale)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupBias)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // butOK
+            // 
+            this.butOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.butOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.butOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butOK.Location = new System.Drawing.Point(93, 484);
+            this.butOK.Name = "butOK";
+            this.butOK.Size = new System.Drawing.Size(75, 23);
+            this.butOK.TabIndex = 1;
+            this.butOK.Text = "OK";
+            this.butOK.UseVisualStyleBackColor = true;
+            this.butOK.Click += new System.EventHandler(this.butOK_Click);
+            // 
+            // butCancel
+            // 
+            this.butCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.butCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butCancel.Location = new System.Drawing.Point(174, 484);
+            this.butCancel.Name = "butCancel";
+            this.butCancel.Size = new System.Drawing.Size(75, 23);
+            this.butCancel.TabIndex = 2;
+            this.butCancel.Text = "Cancel";
+            this.butCancel.UseVisualStyleBackColor = true;
+            // 
+            // groupBox3
+            // 
+            this.groupBox3.Controls.Add(this.grpAutoAnimate);
+            this.groupBox3.Controls.Add(this.chkAutoAnimate);
+            this.groupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox3.Location = new System.Drawing.Point(12, 319);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(319, 156);
+            this.groupBox3.TabIndex = 5;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "Animations";
+            // 
+            // grpAutoAnimate
+            // 
+            this.grpAutoAnimate.Controls.Add(this.chkLoop);
+            this.grpAutoAnimate.Controls.Add(this.nupTo);
+            this.grpAutoAnimate.Controls.Add(this.label4);
+            this.grpAutoAnimate.Controls.Add(this.nupFrom);
+            this.grpAutoAnimate.Controls.Add(this.label5);
+            this.grpAutoAnimate.Enabled = false;
+            this.grpAutoAnimate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.grpAutoAnimate.Location = new System.Drawing.Point(21, 51);
+            this.grpAutoAnimate.Name = "grpAutoAnimate";
+            this.grpAutoAnimate.Size = new System.Drawing.Size(292, 99);
+            this.grpAutoAnimate.TabIndex = 3;
+            this.grpAutoAnimate.TabStop = false;
+            // 
+            // chkLoop
+            // 
+            this.chkLoop.AutoSize = true;
+            this.chkLoop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkLoop.Location = new System.Drawing.Point(9, 66);
+            this.chkLoop.Name = "chkLoop";
+            this.chkLoop.Size = new System.Drawing.Size(47, 17);
+            this.chkLoop.TabIndex = 5;
+            this.chkLoop.Text = "Loop";
+            this.chkLoop.ThreeState = true;
+            this.chkLoop.UseVisualStyleBackColor = true;
+            // 
+            // nupTo
+            // 
+            this.nupTo.Location = new System.Drawing.Point(47, 40);
+            this.nupTo.Maximum = new decimal(new int[] {
+            100000,
+            0,
+            0,
+            0});
+            this.nupTo.Name = "nupTo";
+            this.nupTo.Size = new System.Drawing.Size(120, 20);
+            this.nupTo.TabIndex = 3;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(6, 42);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(23, 13);
+            this.label4.TabIndex = 4;
+            this.label4.Text = "To:";
+            // 
+            // nupFrom
+            // 
+            this.nupFrom.Location = new System.Drawing.Point(47, 14);
+            this.nupFrom.Maximum = new decimal(new int[] {
+            100000,
+            0,
+            0,
+            0});
+            this.nupFrom.Name = "nupFrom";
+            this.nupFrom.Size = new System.Drawing.Size(120, 20);
+            this.nupFrom.TabIndex = 1;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(6, 16);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(33, 13);
+            this.label5.TabIndex = 2;
+            this.label5.Text = "From:";
+            // 
+            // chkAutoAnimate
+            // 
+            this.chkAutoAnimate.AutoSize = true;
+            this.chkAutoAnimate.Location = new System.Drawing.Point(21, 28);
+            this.chkAutoAnimate.Name = "chkAutoAnimate";
+            this.chkAutoAnimate.Size = new System.Drawing.Size(88, 17);
+            this.chkAutoAnimate.TabIndex = 0;
+            this.chkAutoAnimate.Text = "Auto animate";
+            this.chkAutoAnimate.ThreeState = true;
+            this.chkAutoAnimate.UseVisualStyleBackColor = true;
+            this.chkAutoAnimate.CheckedChanged += new System.EventHandler(this.chkAutoAnimate_CheckedChanged);
+            // 
+            // groupBox4
+            // 
+            this.groupBox4.Controls.Add(this.chkNoExport);
+            this.groupBox4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox4.Location = new System.Drawing.Point(12, 12);
+            this.groupBox4.Name = "groupBox4";
+            this.groupBox4.Size = new System.Drawing.Size(319, 59);
+            this.groupBox4.TabIndex = 7;
+            this.groupBox4.TabStop = false;
+            this.groupBox4.Text = "Misc.";
+            // 
+            // chkNoExport
+            // 
+            this.chkNoExport.AutoSize = true;
+            this.chkNoExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkNoExport.Location = new System.Drawing.Point(21, 28);
+            this.chkNoExport.Name = "chkNoExport";
+            this.chkNoExport.Size = new System.Drawing.Size(87, 17);
+            this.chkNoExport.TabIndex = 4;
+            this.chkNoExport.Text = "Do not export";
+            this.chkNoExport.ThreeState = true;
+            this.chkNoExport.UseVisualStyleBackColor = true;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.ckForceBackFaces);
+            this.groupBox1.Controls.Add(this.grpBlurInfo);
+            this.groupBox1.Controls.Add(this.nupBias);
+            this.groupBox1.Controls.Add(this.label6);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.cbCameraType);
+            this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox1.Location = new System.Drawing.Point(12, 77);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(319, 236);
+            this.groupBox1.TabIndex = 6;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Shadows";
+            // 
+            // ckForceBackFaces
+            // 
+            this.ckForceBackFaces.AutoSize = true;
+            this.ckForceBackFaces.Location = new System.Drawing.Point(24, 61);
+            this.ckForceBackFaces.Name = "ckForceBackFaces";
+            this.ckForceBackFaces.Size = new System.Drawing.Size(135, 17);
+            this.ckForceBackFaces.TabIndex = 14;
+            this.ckForceBackFaces.Text = "Force Back Faces only";
+            this.ckForceBackFaces.ThreeState = true;
+            this.ckForceBackFaces.UseVisualStyleBackColor = true;
+            // 
+            // grpBlurInfo
+            // 
+            this.grpBlurInfo.Controls.Add(this.nupBlurBoxOffset);
+            this.grpBlurInfo.Controls.Add(this.label3);
+            this.grpBlurInfo.Controls.Add(this.nupBlurScale);
+            this.grpBlurInfo.Controls.Add(this.label2);
+            this.grpBlurInfo.Enabled = false;
+            this.grpBlurInfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.grpBlurInfo.Location = new System.Drawing.Point(18, 144);
+            this.grpBlurInfo.Name = "grpBlurInfo";
+            this.grpBlurInfo.Size = new System.Drawing.Size(292, 87);
+            this.grpBlurInfo.TabIndex = 13;
+            this.grpBlurInfo.TabStop = false;
+            this.grpBlurInfo.Text = "Blur info";
+            // 
+            // nupBlurBoxOffset
+            // 
+            this.nupBlurBoxOffset.Location = new System.Drawing.Point(89, 50);
+            this.nupBlurBoxOffset.Maximum = new decimal(new int[] {
+            3,
+            0,
+            0,
+            0});
+            this.nupBlurBoxOffset.Minimum = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            this.nupBlurBoxOffset.Name = "nupBlurBoxOffset";
+            this.nupBlurBoxOffset.Size = new System.Drawing.Size(120, 20);
+            this.nupBlurBoxOffset.TabIndex = 13;
+            this.nupBlurBoxOffset.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(6, 52);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(77, 13);
+            this.label3.TabIndex = 14;
+            this.label3.Text = "Blur box offset:";
+            // 
+            // nupBlurScale
+            // 
+            this.nupBlurScale.Location = new System.Drawing.Point(89, 24);
+            this.nupBlurScale.Maximum = new decimal(new int[] {
+            10,
+            0,
+            0,
+            0});
+            this.nupBlurScale.Minimum = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            this.nupBlurScale.Name = "nupBlurScale";
+            this.nupBlurScale.Size = new System.Drawing.Size(120, 20);
+            this.nupBlurScale.TabIndex = 11;
+            this.nupBlurScale.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(6, 26);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(56, 13);
+            this.label2.TabIndex = 12;
+            this.label2.Text = "Blur scale:";
+            // 
+            // nupBias
+            // 
+            this.nupBias.DecimalPlaces = 5;
+            this.nupBias.Location = new System.Drawing.Point(57, 26);
+            this.nupBias.Maximum = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            this.nupBias.Name = "nupBias";
+            this.nupBias.Size = new System.Drawing.Size(120, 20);
+            this.nupBias.TabIndex = 9;
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(18, 92);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(34, 13);
+            this.label6.TabIndex = 8;
+            this.label6.Text = "Type:";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(21, 28);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(30, 13);
+            this.label1.TabIndex = 10;
+            this.label1.Text = "Bias:";
+            // 
+            // cbCameraType
+            // 
+            this.cbCameraType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cbCameraType.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.cbCameraType.FormattingEnabled = true;
+            this.cbCameraType.Items.AddRange(new object[] {
+            "Hard shadows",
+            "Poisson Sampling",
+            "Variance",
+            "Blurred Variance"});
+            this.cbCameraType.Location = new System.Drawing.Point(21, 108);
+            this.cbCameraType.Name = "cbCameraType";
+            this.cbCameraType.Size = new System.Drawing.Size(289, 21);
+            this.cbCameraType.TabIndex = 7;
+            this.cbCameraType.SelectedIndexChanged += new System.EventHandler(this.cbCameraType_SelectedIndexChanged);
+            // 
+            // LightPropertiesForm
+            // 
+            this.AcceptButton = this.butOK;
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.CancelButton = this.butCancel;
+            this.ClientSize = new System.Drawing.Size(343, 519);
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.groupBox4);
+            this.Controls.Add(this.groupBox3);
+            this.Controls.Add(this.butCancel);
+            this.Controls.Add(this.butOK);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "LightPropertiesForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Babylon.js - Light Properties";
+            this.Load += new System.EventHandler(this.LightPropertiesForm_Load);
+            this.groupBox3.ResumeLayout(false);
+            this.groupBox3.PerformLayout();
+            this.grpAutoAnimate.ResumeLayout(false);
+            this.grpAutoAnimate.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupTo)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupFrom)).EndInit();
+            this.groupBox4.ResumeLayout(false);
+            this.groupBox4.PerformLayout();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.grpBlurInfo.ResumeLayout(false);
+            this.grpBlurInfo.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupBlurBoxOffset)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupBlurScale)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupBias)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button butOK;
+        private System.Windows.Forms.Button butCancel;
+        private System.Windows.Forms.GroupBox groupBox3;
+        private System.Windows.Forms.GroupBox grpAutoAnimate;
+        private System.Windows.Forms.CheckBox chkLoop;
+        private System.Windows.Forms.NumericUpDown nupTo;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.NumericUpDown nupFrom;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.CheckBox chkAutoAnimate;
+        private System.Windows.Forms.GroupBox groupBox4;
+        private System.Windows.Forms.CheckBox chkNoExport;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.ComboBox cbCameraType;
+        private System.Windows.Forms.NumericUpDown nupBlurScale;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.NumericUpDown nupBias;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.GroupBox grpBlurInfo;
+        private System.Windows.Forms.NumericUpDown nupBlurBoxOffset;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.CheckBox ckForceBackFaces;
+    }
 }

+ 67 - 65
Exporters/3ds Max/Max2Babylon/Forms/LightPropertiesForm.cs

@@ -1,65 +1,67 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using Autodesk.Max;
-
-namespace Max2Babylon
-{
-    public partial class LightPropertiesForm : Form
-    {
-        private readonly List<IINode> lights = new List<IINode>();
-
-        public LightPropertiesForm()
-        {
-            InitializeComponent();
-        }
-
-        private void LightPropertiesForm_Load(object sender, EventArgs e)
-        {
-            for (var index = 0; index < Loader.Core.SelNodeCount; index++)
-            {
-                var node = Loader.Core.GetSelNode(index);
-
-                if (node.ObjectRef != null && node.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Light)
-                {
-                    lights.Add(node);
-                }
-            }
-
-            Tools.PrepareCheckBox(chkNoExport, lights, "babylonjs_noexport");
-            Tools.PrepareCheckBox(chkAutoAnimate, lights, "babylonjs_autoanimate");
-            Tools.PrepareCheckBox(chkLoop, lights, "babylonjs_autoanimateloop");
-            Tools.PrepareNumericUpDown(nupFrom, lights, "babylonjs_autoanimate_from");
-            Tools.PrepareNumericUpDown(nupTo, lights, "babylonjs_autoanimate_to", 100.0f);
-
-            Tools.PrepareNumericUpDown(nupBias, lights, "babylonjs_shadows_bias", 0.00005f);
-            Tools.PrepareNumericUpDown(nupBlurScale, lights, "babylonjs_shadows_blurScale", 2);
-            Tools.PrepareNumericUpDown(nupBlurBoxOffset, lights, "babylonjs_shadows_blurBoxOffset", 1);
-            Tools.PrepareComboBox(cbCameraType, lights[0], "babylonjs_shadows_type", "Blurred Variance");
-        }
-
-        private void butOK_Click(object sender, EventArgs e)
-        {
-            Tools.UpdateCheckBox(chkNoExport, lights, "babylonjs_noexport");
-            Tools.UpdateCheckBox(chkAutoAnimate, lights, "babylonjs_autoanimate");
-            Tools.UpdateCheckBox(chkLoop, lights, "babylonjs_autoanimateloop");
-            Tools.UpdateNumericUpDown(nupFrom, lights, "babylonjs_autoanimate_from");
-            Tools.UpdateNumericUpDown(nupTo, lights, "babylonjs_autoanimate_to");
-
-            Tools.UpdateNumericUpDown(nupBias, lights, "babylonjs_shadows_bias");
-            Tools.UpdateNumericUpDown(nupBlurScale, lights, "babylonjs_shadows_blurScale");
-            Tools.UpdateNumericUpDown(nupBlurBoxOffset, lights, "babylonjs_shadows_blurBoxOffset");
-            Tools.UpdateComboBox(cbCameraType, lights, "babylonjs_shadows_type");
-        }
-
-        private void chkAutoAnimate_CheckedChanged(object sender, EventArgs e)
-        {
-            grpAutoAnimate.Enabled = chkAutoAnimate.Checked;
-        }
-
-        private void cbCameraType_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            grpBlurInfo.Enabled = (cbCameraType.SelectedIndex == 3);
-        }
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using Autodesk.Max;
+
+namespace Max2Babylon
+{
+    public partial class LightPropertiesForm : Form
+    {
+        private readonly List<IINode> lights = new List<IINode>();
+
+        public LightPropertiesForm()
+        {
+            InitializeComponent();
+        }
+
+        private void LightPropertiesForm_Load(object sender, EventArgs e)
+        {
+            for (var index = 0; index < Loader.Core.SelNodeCount; index++)
+            {
+                var node = Loader.Core.GetSelNode(index);
+
+                if (node.ObjectRef != null && node.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Light)
+                {
+                    lights.Add(node);
+                }
+            }
+
+            Tools.PrepareCheckBox(chkNoExport, lights, "babylonjs_noexport");
+            Tools.PrepareCheckBox(chkAutoAnimate, lights, "babylonjs_autoanimate");
+            Tools.PrepareCheckBox(chkLoop, lights, "babylonjs_autoanimateloop");
+            Tools.PrepareCheckBox(ckForceBackFaces, lights, "babylonjs_forcebackfaces");
+            Tools.PrepareNumericUpDown(nupFrom, lights, "babylonjs_autoanimate_from");
+            Tools.PrepareNumericUpDown(nupTo, lights, "babylonjs_autoanimate_to", 100.0f);
+
+            Tools.PrepareNumericUpDown(nupBias, lights, "babylonjs_shadows_bias", 0.00005f);
+            Tools.PrepareNumericUpDown(nupBlurScale, lights, "babylonjs_shadows_blurScale", 2);
+            Tools.PrepareNumericUpDown(nupBlurBoxOffset, lights, "babylonjs_shadows_blurBoxOffset", 1);
+            Tools.PrepareComboBox(cbCameraType, lights[0], "babylonjs_shadows_type", "Blurred Variance");
+        }
+
+        private void butOK_Click(object sender, EventArgs e)
+        {
+            Tools.UpdateCheckBox(chkNoExport, lights, "babylonjs_noexport");
+            Tools.UpdateCheckBox(chkAutoAnimate, lights, "babylonjs_autoanimate");
+            Tools.UpdateCheckBox(chkLoop, lights, "babylonjs_autoanimateloop");
+            Tools.UpdateCheckBox(ckForceBackFaces, lights, "babylonjs_forcebackfaces");
+            Tools.UpdateNumericUpDown(nupFrom, lights, "babylonjs_autoanimate_from");
+            Tools.UpdateNumericUpDown(nupTo, lights, "babylonjs_autoanimate_to");
+
+            Tools.UpdateNumericUpDown(nupBias, lights, "babylonjs_shadows_bias");
+            Tools.UpdateNumericUpDown(nupBlurScale, lights, "babylonjs_shadows_blurScale");
+            Tools.UpdateNumericUpDown(nupBlurBoxOffset, lights, "babylonjs_shadows_blurBoxOffset");
+            Tools.UpdateComboBox(cbCameraType, lights, "babylonjs_shadows_type");
+        }
+
+        private void chkAutoAnimate_CheckedChanged(object sender, EventArgs e)
+        {
+            grpAutoAnimate.Enabled = chkAutoAnimate.Checked;
+        }
+
+        private void cbCameraType_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            grpBlurInfo.Enabled = (cbCameraType.SelectedIndex == 3);
+        }
+    }
+}

+ 119 - 119
Exporters/3ds Max/Max2Babylon/Forms/LightPropertiesForm.resx

@@ -1,120 +1,120 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
 </root>

文件差異過大導致無法顯示
+ 943 - 943
Exporters/3ds Max/Max2Babylon/Forms/ObjectPropertiesForm.Designer.cs


+ 122 - 122
Exporters/3ds Max/Max2Babylon/Forms/ObjectPropertiesForm.cs

@@ -1,122 +1,122 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using Autodesk.Max;
-
-namespace Max2Babylon
-{
-    public partial class ObjectPropertiesForm : Form
-    {
-        private readonly List<IINode> objects = new List<IINode>();
-
-        public ObjectPropertiesForm()
-        {
-            InitializeComponent();
-        }
-
-        private void butOK_Click(object sender, EventArgs e)
-        {
-            Tools.UpdateCheckBox(chkNoExport, objects, "babylonjs_noexport");
-            Tools.UpdateCheckBox(chkCollisions, objects, "babylonjs_checkcollisions");
-            Tools.UpdateCheckBox(chkPickable, objects, "babylonjs_checkpickable");
-            Tools.UpdateCheckBox(chkOptimize, objects, "babylonjs_optimizevertices");
-            Tools.UpdateCheckBox(chkShowBoundingBox, objects, "babylonjs_showboundingbox");
-            Tools.UpdateCheckBox(chkShowSubMeshesBoundingBox, objects, "babylonjs_showsubmeshesboundingbox");
-
-            Tools.UpdateCheckBox(chkAutoAnimate, objects, "babylonjs_autoanimate");
-            Tools.UpdateCheckBox(chkLoop, objects, "babylonjs_autoanimateloop");
-            Tools.UpdateNumericUpDown(nupFrom, objects, "babylonjs_autoanimate_from");
-            Tools.UpdateNumericUpDown(nupTo, objects, "babylonjs_autoanimate_to");
-
-            Tools.UpdateNumericUpDown(nupAlphaIndex, objects, "babylonjs_alphaindex");
-            Tools.UpdateNumericUpDown(nupMass, objects, "babylonjs_mass");
-            Tools.UpdateNumericUpDown(nupFriction, objects, "babylonjs_friction");
-            Tools.UpdateNumericUpDown(nupRestitution, objects, "babylonjs_restitution");
-            Tools.UpdateComboBox(cbImpostor, objects, "babylonjs_impostor");
-
-            Tools.UpdateCheckBox(chkAutoPlay, objects, "babylonjs_sound_autoplay");
-            Tools.UpdateCheckBox(chkLoop, objects, "babylonjs_sound_loop");
-            Tools.UpdateNumericUpDown(nupVolume, objects, "babylonjs_sound_volume");
-            Tools.UpdateNumericUpDown(nupPlaybackRate, objects, "babylonjs_sound_playbackrate");
-
-            Tools.UpdateComboBox(cbDistanceModel, objects, "babylonjs_sound_distancemodel");
-            Tools.UpdateNumericUpDown(nupMaxDistance, objects, "babylonjs_sound_maxdistance");
-            Tools.UpdateNumericUpDown(nupRolloff, objects, "babylonjs_sound_rolloff");
-            Tools.UpdateNumericUpDown(nupRefDistance, objects, "babylonjs_sound_refdistance");
-
-            Tools.UpdateCheckBox(chkDirectional, objects, "babylonjs_sound_directional");
-            Tools.UpdateNumericUpDown(nupConeInnerAngle, objects, "babylonjs_sound_coneinnerangle");
-            Tools.UpdateNumericUpDown(nupConeOuterAngle, objects, "babylonjs_sound_coneouterangle");
-            Tools.UpdateNumericUpDown(nupConeOuterGain, objects, "babylonjs_sound_coneoutergain");
-
-            Tools.UpdateTextBox(txtSound, objects, "babylonjs_sound_filename");
-        }
-
-        private void ObjectPropertiesForm_Load(object sender, EventArgs e)
-        {
-            for (var index = 0; index < Loader.Core.SelNodeCount; index++)
-            {
-                var node = Loader.Core.GetSelNode(index);
-
-                if (node.ObjectRef != null && node.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Geomobject)
-                {
-                    objects.Add(node);
-                }
-            }
-
-            Tools.PrepareCheckBox(chkNoExport, objects, "babylonjs_noexport");
-            Tools.PrepareCheckBox(chkCollisions, objects, "babylonjs_checkcollisions");
-            Tools.PrepareCheckBox(chkPickable, objects, "babylonjs_checkpickable");
-            Tools.PrepareCheckBox(chkOptimize, objects, "babylonjs_optimizevertices");
-            Tools.PrepareCheckBox(chkShowBoundingBox, objects, "babylonjs_showboundingbox");
-            Tools.PrepareCheckBox(chkShowSubMeshesBoundingBox, objects, "babylonjs_showsubmeshesboundingbox");
-
-            Tools.PrepareCheckBox(chkAutoAnimate, objects, "babylonjs_autoanimate", 1);
-            Tools.PrepareCheckBox(chkLoop, objects, "babylonjs_autoanimateloop", 1);
-            Tools.PrepareNumericUpDown(nupFrom, objects, "babylonjs_autoanimate_from");
-            Tools.PrepareNumericUpDown(nupTo, objects, "babylonjs_autoanimate_to", 100.0f);
-            Tools.PrepareNumericUpDown(nupAlphaIndex, objects, "babylonjs_alphaindex", 1000);
-
-            Tools.PrepareNumericUpDown(nupMass, objects, "babylonjs_mass");
-            Tools.PrepareNumericUpDown(nupFriction, objects, "babylonjs_friction", 0.2f);
-            Tools.PrepareNumericUpDown(nupRestitution, objects, "babylonjs_restitution", 0.2f);
-
-            Tools.PrepareComboBox(cbImpostor, objects[0], "babylonjs_impostor", "None");
-
-            Tools.PrepareCheckBox(chkAutoPlay, objects, "babylonjs_sound_autoplay", 1);
-            Tools.PrepareCheckBox(chkLoop, objects, "babylonjs_sound_loop", 1);
-            Tools.PrepareNumericUpDown(nupVolume, objects, "babylonjs_sound_volume", 1.0f);
-            Tools.PrepareNumericUpDown(nupPlaybackRate, objects, "babylonjs_sound_playbackrate", 1.0f);
-
-            Tools.PrepareComboBox(cbDistanceModel, objects[0], "babylonjs_sound_distancemodel", "linear");
-            Tools.PrepareNumericUpDown(nupMaxDistance, objects, "babylonjs_sound_maxdistance", 100.0f);
-            Tools.PrepareNumericUpDown(nupRolloff, objects, "babylonjs_sound_rolloff", 1.0f);
-            Tools.PrepareNumericUpDown(nupRefDistance, objects, "babylonjs_sound_refdistance", 1.0f);
-
-            Tools.PrepareCheckBox(chkDirectional, objects, "babylonjs_sound_directional", 0);
-            Tools.PrepareNumericUpDown(nupConeInnerAngle, objects, "babylonjs_sound_coneinnerangle", 360.00f);
-            Tools.PrepareNumericUpDown(nupConeOuterAngle, objects, "babylonjs_sound_coneouterangle", 360.00f);
-            Tools.PrepareNumericUpDown(nupConeOuterGain, objects, "babylonjs_sound_coneoutergain", 1.0f);
-
-            Tools.PrepareTextBox(txtSound, objects[0], "babylonjs_sound_filename");
-        }
-
-        private void chkAutoAnimate_CheckedChanged(object sender, EventArgs e)
-        {
-            grpAutoAnimate.Enabled = chkAutoAnimate.Checked;
-        }
-
-        private void chkDirectional_CheckedChanged(object sender, EventArgs e)
-        {
-            grpDirectional.Enabled = chkDirectional.Checked;
-        }
-
-        private void cmdFileBrowse_Click(object sender, EventArgs e)
-        {
-            if (ofdOpenSound.ShowDialog() == DialogResult.OK)
-            {
-                txtSound.Text = ofdOpenSound.FileName;
-            }
-        }
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using Autodesk.Max;
+
+namespace Max2Babylon
+{
+    public partial class ObjectPropertiesForm : Form
+    {
+        private readonly List<IINode> objects = new List<IINode>();
+
+        public ObjectPropertiesForm()
+        {
+            InitializeComponent();
+        }
+
+        private void butOK_Click(object sender, EventArgs e)
+        {
+            Tools.UpdateCheckBox(chkNoExport, objects, "babylonjs_noexport");
+            Tools.UpdateCheckBox(chkCollisions, objects, "babylonjs_checkcollisions");
+            Tools.UpdateCheckBox(chkPickable, objects, "babylonjs_checkpickable");
+            Tools.UpdateCheckBox(chkOptimize, objects, "babylonjs_optimizevertices");
+            Tools.UpdateCheckBox(chkShowBoundingBox, objects, "babylonjs_showboundingbox");
+            Tools.UpdateCheckBox(chkShowSubMeshesBoundingBox, objects, "babylonjs_showsubmeshesboundingbox");
+
+            Tools.UpdateCheckBox(chkAutoAnimate, objects, "babylonjs_autoanimate");
+            Tools.UpdateCheckBox(chkLoop, objects, "babylonjs_autoanimateloop");
+            Tools.UpdateNumericUpDown(nupFrom, objects, "babylonjs_autoanimate_from");
+            Tools.UpdateNumericUpDown(nupTo, objects, "babylonjs_autoanimate_to");
+
+            Tools.UpdateNumericUpDown(nupAlphaIndex, objects, "babylonjs_alphaindex");
+            Tools.UpdateNumericUpDown(nupMass, objects, "babylonjs_mass");
+            Tools.UpdateNumericUpDown(nupFriction, objects, "babylonjs_friction");
+            Tools.UpdateNumericUpDown(nupRestitution, objects, "babylonjs_restitution");
+            Tools.UpdateComboBox(cbImpostor, objects, "babylonjs_impostor");
+
+            Tools.UpdateCheckBox(chkAutoPlay, objects, "babylonjs_sound_autoplay");
+            Tools.UpdateCheckBox(chkLoop, objects, "babylonjs_sound_loop");
+            Tools.UpdateNumericUpDown(nupVolume, objects, "babylonjs_sound_volume");
+            Tools.UpdateNumericUpDown(nupPlaybackRate, objects, "babylonjs_sound_playbackrate");
+
+            Tools.UpdateComboBox(cbDistanceModel, objects, "babylonjs_sound_distancemodel");
+            Tools.UpdateNumericUpDown(nupMaxDistance, objects, "babylonjs_sound_maxdistance");
+            Tools.UpdateNumericUpDown(nupRolloff, objects, "babylonjs_sound_rolloff");
+            Tools.UpdateNumericUpDown(nupRefDistance, objects, "babylonjs_sound_refdistance");
+
+            Tools.UpdateCheckBox(chkDirectional, objects, "babylonjs_sound_directional");
+            Tools.UpdateNumericUpDown(nupConeInnerAngle, objects, "babylonjs_sound_coneinnerangle");
+            Tools.UpdateNumericUpDown(nupConeOuterAngle, objects, "babylonjs_sound_coneouterangle");
+            Tools.UpdateNumericUpDown(nupConeOuterGain, objects, "babylonjs_sound_coneoutergain");
+
+            Tools.UpdateTextBox(txtSound, objects, "babylonjs_sound_filename");
+        }
+
+        private void ObjectPropertiesForm_Load(object sender, EventArgs e)
+        {
+            for (var index = 0; index < Loader.Core.SelNodeCount; index++)
+            {
+                var node = Loader.Core.GetSelNode(index);
+
+                if (node.ObjectRef != null && node.ObjectRef.Eval(0).Obj.SuperClassID == SClass_ID.Geomobject)
+                {
+                    objects.Add(node);
+                }
+            }
+
+            Tools.PrepareCheckBox(chkNoExport, objects, "babylonjs_noexport");
+            Tools.PrepareCheckBox(chkCollisions, objects, "babylonjs_checkcollisions");
+            Tools.PrepareCheckBox(chkPickable, objects, "babylonjs_checkpickable");
+            Tools.PrepareCheckBox(chkOptimize, objects, "babylonjs_optimizevertices");
+            Tools.PrepareCheckBox(chkShowBoundingBox, objects, "babylonjs_showboundingbox");
+            Tools.PrepareCheckBox(chkShowSubMeshesBoundingBox, objects, "babylonjs_showsubmeshesboundingbox");
+
+            Tools.PrepareCheckBox(chkAutoAnimate, objects, "babylonjs_autoanimate", 1);
+            Tools.PrepareCheckBox(chkLoop, objects, "babylonjs_autoanimateloop", 1);
+            Tools.PrepareNumericUpDown(nupFrom, objects, "babylonjs_autoanimate_from");
+            Tools.PrepareNumericUpDown(nupTo, objects, "babylonjs_autoanimate_to", 100.0f);
+            Tools.PrepareNumericUpDown(nupAlphaIndex, objects, "babylonjs_alphaindex", 1000);
+
+            Tools.PrepareNumericUpDown(nupMass, objects, "babylonjs_mass");
+            Tools.PrepareNumericUpDown(nupFriction, objects, "babylonjs_friction", 0.2f);
+            Tools.PrepareNumericUpDown(nupRestitution, objects, "babylonjs_restitution", 0.2f);
+
+            Tools.PrepareComboBox(cbImpostor, objects[0], "babylonjs_impostor", "None");
+
+            Tools.PrepareCheckBox(chkAutoPlay, objects, "babylonjs_sound_autoplay", 1);
+            Tools.PrepareCheckBox(chkLoop, objects, "babylonjs_sound_loop", 1);
+            Tools.PrepareNumericUpDown(nupVolume, objects, "babylonjs_sound_volume", 1.0f);
+            Tools.PrepareNumericUpDown(nupPlaybackRate, objects, "babylonjs_sound_playbackrate", 1.0f);
+
+            Tools.PrepareComboBox(cbDistanceModel, objects[0], "babylonjs_sound_distancemodel", "linear");
+            Tools.PrepareNumericUpDown(nupMaxDistance, objects, "babylonjs_sound_maxdistance", 100.0f);
+            Tools.PrepareNumericUpDown(nupRolloff, objects, "babylonjs_sound_rolloff", 1.0f);
+            Tools.PrepareNumericUpDown(nupRefDistance, objects, "babylonjs_sound_refdistance", 1.0f);
+
+            Tools.PrepareCheckBox(chkDirectional, objects, "babylonjs_sound_directional", 0);
+            Tools.PrepareNumericUpDown(nupConeInnerAngle, objects, "babylonjs_sound_coneinnerangle", 360.00f);
+            Tools.PrepareNumericUpDown(nupConeOuterAngle, objects, "babylonjs_sound_coneouterangle", 360.00f);
+            Tools.PrepareNumericUpDown(nupConeOuterGain, objects, "babylonjs_sound_coneoutergain", 1.0f);
+
+            Tools.PrepareTextBox(txtSound, objects[0], "babylonjs_sound_filename");
+        }
+
+        private void chkAutoAnimate_CheckedChanged(object sender, EventArgs e)
+        {
+            grpAutoAnimate.Enabled = chkAutoAnimate.Checked;
+        }
+
+        private void chkDirectional_CheckedChanged(object sender, EventArgs e)
+        {
+            grpDirectional.Enabled = chkDirectional.Checked;
+        }
+
+        private void cmdFileBrowse_Click(object sender, EventArgs e)
+        {
+            if (ofdOpenSound.ShowDialog() == DialogResult.OK)
+            {
+                txtSound.Text = ofdOpenSound.FileName;
+            }
+        }
+    }
+}

+ 122 - 122
Exporters/3ds Max/Max2Babylon/Forms/ObjectPropertiesForm.resx

@@ -1,123 +1,123 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="ofdOpenSound.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="ofdOpenSound.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 286 - 272
Exporters/3ds Max/Max2Babylon/Forms/ScenePropertiesForm.Designer.cs

@@ -1,273 +1,287 @@
-namespace Max2Babylon
-{
-    partial class ScenePropertiesForm
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
-            this.gravityControl = new Max2Babylon.Vector3Control();
-            this.label3 = new System.Windows.Forms.Label();
-            this.butCancel = new System.Windows.Forms.Button();
-            this.butOK = new System.Windows.Forms.Button();
-            this.groupBox2 = new System.Windows.Forms.GroupBox();
-            this.chkQuaternions = new System.Windows.Forms.CheckBox();
-            this.groupBox3 = new System.Windows.Forms.GroupBox();
-            this.cmdBrowse = new System.Windows.Forms.Button();
-            this.txtSound = new System.Windows.Forms.TextBox();
-            this.chkLoop = new System.Windows.Forms.CheckBox();
-            this.chkAutoPlay = new System.Windows.Forms.CheckBox();
-            this.ofdOpenSound = new System.Windows.Forms.OpenFileDialog();
-            this.nupVolume = new System.Windows.Forms.NumericUpDown();
-            this.lblVolume = new System.Windows.Forms.Label();
-            this.groupBox1.SuspendLayout();
-            this.groupBox2.SuspendLayout();
-            this.groupBox3.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupVolume)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // groupBox1
-            // 
-            this.groupBox1.Controls.Add(this.gravityControl);
-            this.groupBox1.Controls.Add(this.label3);
-            this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox1.Location = new System.Drawing.Point(12, 12);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(319, 87);
-            this.groupBox1.TabIndex = 0;
-            this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "Collisions";
-            // 
-            // gravityControl
-            // 
-            this.gravityControl.Location = new System.Drawing.Point(21, 44);
-            this.gravityControl.Name = "gravityControl";
-            this.gravityControl.Size = new System.Drawing.Size(294, 28);
-            this.gravityControl.TabIndex = 5;
-            this.gravityControl.X = 0F;
-            this.gravityControl.Y = 0F;
-            this.gravityControl.Z = 0F;
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(18, 28);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(43, 13);
-            this.label3.TabIndex = 4;
-            this.label3.Text = "Gravity:";
-            // 
-            // butCancel
-            // 
-            this.butCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
-            this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.butCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butCancel.Location = new System.Drawing.Point(174, 351);
-            this.butCancel.Name = "butCancel";
-            this.butCancel.Size = new System.Drawing.Size(75, 23);
-            this.butCancel.TabIndex = 4;
-            this.butCancel.Text = "Cancel";
-            this.butCancel.UseVisualStyleBackColor = true;
-            // 
-            // butOK
-            // 
-            this.butOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
-            this.butOK.DialogResult = System.Windows.Forms.DialogResult.OK;
-            this.butOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butOK.Location = new System.Drawing.Point(93, 351);
-            this.butOK.Name = "butOK";
-            this.butOK.Size = new System.Drawing.Size(75, 23);
-            this.butOK.TabIndex = 3;
-            this.butOK.Text = "OK";
-            this.butOK.UseVisualStyleBackColor = true;
-            this.butOK.Click += new System.EventHandler(this.butOK_Click);
-            // 
-            // groupBox2
-            // 
-            this.groupBox2.Controls.Add(this.chkQuaternions);
-            this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox2.Location = new System.Drawing.Point(12, 105);
-            this.groupBox2.Name = "groupBox2";
-            this.groupBox2.Size = new System.Drawing.Size(319, 87);
-            this.groupBox2.TabIndex = 5;
-            this.groupBox2.TabStop = false;
-            this.groupBox2.Text = "Advanced";
-            // 
-            // chkQuaternions
-            // 
-            this.chkQuaternions.AutoSize = true;
-            this.chkQuaternions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkQuaternions.Location = new System.Drawing.Point(21, 28);
-            this.chkQuaternions.Name = "chkQuaternions";
-            this.chkQuaternions.Size = new System.Drawing.Size(221, 17);
-            this.chkQuaternions.TabIndex = 2;
-            this.chkQuaternions.Text = "Export quaternions instead of Euler angles";
-            this.chkQuaternions.UseVisualStyleBackColor = true;
-            // 
-            // groupBox3
-            // 
-            this.groupBox3.Controls.Add(this.nupVolume);
-            this.groupBox3.Controls.Add(this.lblVolume);
-            this.groupBox3.Controls.Add(this.cmdBrowse);
-            this.groupBox3.Controls.Add(this.txtSound);
-            this.groupBox3.Controls.Add(this.chkLoop);
-            this.groupBox3.Controls.Add(this.chkAutoPlay);
-            this.groupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.groupBox3.Location = new System.Drawing.Point(12, 198);
-            this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(319, 136);
-            this.groupBox3.TabIndex = 6;
-            this.groupBox3.TabStop = false;
-            this.groupBox3.Text = "Sound";
-            // 
-            // cmdBrowse
-            // 
-            this.cmdBrowse.Anchor = System.Windows.Forms.AnchorStyles.Right;
-            this.cmdBrowse.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.cmdBrowse.Location = new System.Drawing.Point(276, 28);
-            this.cmdBrowse.Name = "cmdBrowse";
-            this.cmdBrowse.Size = new System.Drawing.Size(37, 23);
-            this.cmdBrowse.TabIndex = 6;
-            this.cmdBrowse.Text = "...";
-            this.cmdBrowse.UseVisualStyleBackColor = true;
-            this.cmdBrowse.Click += new System.EventHandler(this.cmdBrowse_Click);
-            // 
-            // txtSound
-            // 
-            this.txtSound.Location = new System.Drawing.Point(21, 28);
-            this.txtSound.Name = "txtSound";
-            this.txtSound.Size = new System.Drawing.Size(249, 20);
-            this.txtSound.TabIndex = 5;
-            // 
-            // chkLoop
-            // 
-            this.chkLoop.AutoSize = true;
-            this.chkLoop.Checked = true;
-            this.chkLoop.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.chkLoop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkLoop.Location = new System.Drawing.Point(21, 77);
-            this.chkLoop.Name = "chkLoop";
-            this.chkLoop.Size = new System.Drawing.Size(47, 17);
-            this.chkLoop.TabIndex = 4;
-            this.chkLoop.Text = "Loop";
-            this.chkLoop.UseVisualStyleBackColor = true;
-            // 
-            // chkAutoPlay
-            // 
-            this.chkAutoPlay.AutoSize = true;
-            this.chkAutoPlay.Checked = true;
-            this.chkAutoPlay.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.chkAutoPlay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkAutoPlay.Location = new System.Drawing.Point(21, 54);
-            this.chkAutoPlay.Name = "chkAutoPlay";
-            this.chkAutoPlay.Size = new System.Drawing.Size(67, 17);
-            this.chkAutoPlay.TabIndex = 3;
-            this.chkAutoPlay.Text = "Auto play";
-            this.chkAutoPlay.UseVisualStyleBackColor = true;
-            // 
-            // ofdOpenSound
-            // 
-            this.ofdOpenSound.Filter = "Sound files|*.wav;*.mp3";
-            // 
-            // nupVolume
-            // 
-            this.nupVolume.DecimalPlaces = 2;
-            this.nupVolume.Increment = new decimal(new int[] {
-            1,
-            0,
-            0,
-            65536});
-            this.nupVolume.Location = new System.Drawing.Point(150, 108);
-            this.nupVolume.Maximum = new decimal(new int[] {
-            10,
-            0,
-            0,
-            0});
-            this.nupVolume.Name = "nupVolume";
-            this.nupVolume.Size = new System.Drawing.Size(120, 20);
-            this.nupVolume.TabIndex = 10;
-            this.nupVolume.Value = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
-            // 
-            // lblVolume
-            // 
-            this.lblVolume.AutoSize = true;
-            this.lblVolume.Location = new System.Drawing.Point(18, 110);
-            this.lblVolume.Name = "lblVolume";
-            this.lblVolume.Size = new System.Drawing.Size(45, 13);
-            this.lblVolume.TabIndex = 9;
-            this.lblVolume.Text = "Volume:";
-            // 
-            // ScenePropertiesForm
-            // 
-            this.AcceptButton = this.butOK;
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.CancelButton = this.butCancel;
-            this.ClientSize = new System.Drawing.Size(343, 386);
-            this.Controls.Add(this.groupBox3);
-            this.Controls.Add(this.groupBox2);
-            this.Controls.Add(this.butCancel);
-            this.Controls.Add(this.butOK);
-            this.Controls.Add(this.groupBox1);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
-            this.Name = "ScenePropertiesForm";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "Babylon.js - Scene Properties";
-            this.Load += new System.EventHandler(this.ScenePropertiesForm_Load);
-            this.groupBox1.ResumeLayout(false);
-            this.groupBox1.PerformLayout();
-            this.groupBox2.ResumeLayout(false);
-            this.groupBox2.PerformLayout();
-            this.groupBox3.ResumeLayout(false);
-            this.groupBox3.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.nupVolume)).EndInit();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.GroupBox groupBox1;
-        private Vector3Control gravityControl;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Button butCancel;
-        private System.Windows.Forms.Button butOK;
-        private System.Windows.Forms.GroupBox groupBox2;
-        private System.Windows.Forms.CheckBox chkQuaternions;
-        private System.Windows.Forms.GroupBox groupBox3;
-        private System.Windows.Forms.CheckBox chkLoop;
-        private System.Windows.Forms.CheckBox chkAutoPlay;
-        private System.Windows.Forms.Button cmdBrowse;
-        private System.Windows.Forms.TextBox txtSound;
-        private System.Windows.Forms.OpenFileDialog ofdOpenSound;
-        private System.Windows.Forms.NumericUpDown nupVolume;
-        private System.Windows.Forms.Label lblVolume;
-    }
+namespace Max2Babylon
+{
+    partial class ScenePropertiesForm
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.gravityControl = new Max2Babylon.Vector3Control();
+            this.label3 = new System.Windows.Forms.Label();
+            this.butCancel = new System.Windows.Forms.Button();
+            this.butOK = new System.Windows.Forms.Button();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.chkAnimations = new System.Windows.Forms.CheckBox();
+            this.chkQuaternions = new System.Windows.Forms.CheckBox();
+            this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.nupVolume = new System.Windows.Forms.NumericUpDown();
+            this.lblVolume = new System.Windows.Forms.Label();
+            this.cmdBrowse = new System.Windows.Forms.Button();
+            this.txtSound = new System.Windows.Forms.TextBox();
+            this.chkLoop = new System.Windows.Forms.CheckBox();
+            this.chkAutoPlay = new System.Windows.Forms.CheckBox();
+            this.ofdOpenSound = new System.Windows.Forms.OpenFileDialog();
+            this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            this.groupBox3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupVolume)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.gravityControl);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox1.Location = new System.Drawing.Point(12, 12);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(319, 87);
+            this.groupBox1.TabIndex = 0;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Collisions";
+            // 
+            // gravityControl
+            // 
+            this.gravityControl.Location = new System.Drawing.Point(21, 44);
+            this.gravityControl.Name = "gravityControl";
+            this.gravityControl.Size = new System.Drawing.Size(294, 28);
+            this.gravityControl.TabIndex = 5;
+            this.gravityControl.X = 0F;
+            this.gravityControl.Y = 0F;
+            this.gravityControl.Z = 0F;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(18, 28);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(43, 13);
+            this.label3.TabIndex = 4;
+            this.label3.Text = "Gravity:";
+            // 
+            // butCancel
+            // 
+            this.butCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.butCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butCancel.Location = new System.Drawing.Point(174, 351);
+            this.butCancel.Name = "butCancel";
+            this.butCancel.Size = new System.Drawing.Size(75, 23);
+            this.butCancel.TabIndex = 4;
+            this.butCancel.Text = "Cancel";
+            this.butCancel.UseVisualStyleBackColor = true;
+            // 
+            // butOK
+            // 
+            this.butOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+            this.butOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.butOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.butOK.Location = new System.Drawing.Point(93, 351);
+            this.butOK.Name = "butOK";
+            this.butOK.Size = new System.Drawing.Size(75, 23);
+            this.butOK.TabIndex = 3;
+            this.butOK.Text = "OK";
+            this.butOK.UseVisualStyleBackColor = true;
+            this.butOK.Click += new System.EventHandler(this.butOK_Click);
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.chkAnimations);
+            this.groupBox2.Controls.Add(this.chkQuaternions);
+            this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox2.Location = new System.Drawing.Point(12, 105);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(319, 87);
+            this.groupBox2.TabIndex = 5;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "Advanced";
+            // 
+            // chkAnimations
+            // 
+            this.chkAnimations.AutoSize = true;
+            this.chkAnimations.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkAnimations.Location = new System.Drawing.Point(21, 51);
+            this.chkAnimations.Name = "chkAnimations";
+            this.chkAnimations.Size = new System.Drawing.Size(149, 17);
+            this.chkAnimations.TabIndex = 3;
+            this.chkAnimations.Text = "Do not optimize animations";
+            this.chkAnimations.UseVisualStyleBackColor = true;
+            // 
+            // chkQuaternions
+            // 
+            this.chkQuaternions.AutoSize = true;
+            this.chkQuaternions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkQuaternions.Location = new System.Drawing.Point(21, 28);
+            this.chkQuaternions.Name = "chkQuaternions";
+            this.chkQuaternions.Size = new System.Drawing.Size(221, 17);
+            this.chkQuaternions.TabIndex = 2;
+            this.chkQuaternions.Text = "Export quaternions instead of Euler angles";
+            this.chkQuaternions.UseVisualStyleBackColor = true;
+            // 
+            // groupBox3
+            // 
+            this.groupBox3.Controls.Add(this.nupVolume);
+            this.groupBox3.Controls.Add(this.lblVolume);
+            this.groupBox3.Controls.Add(this.cmdBrowse);
+            this.groupBox3.Controls.Add(this.txtSound);
+            this.groupBox3.Controls.Add(this.chkLoop);
+            this.groupBox3.Controls.Add(this.chkAutoPlay);
+            this.groupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.groupBox3.Location = new System.Drawing.Point(12, 198);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(319, 136);
+            this.groupBox3.TabIndex = 6;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "Sound";
+            // 
+            // nupVolume
+            // 
+            this.nupVolume.DecimalPlaces = 2;
+            this.nupVolume.Increment = new decimal(new int[] {
+            1,
+            0,
+            0,
+            65536});
+            this.nupVolume.Location = new System.Drawing.Point(150, 108);
+            this.nupVolume.Maximum = new decimal(new int[] {
+            10,
+            0,
+            0,
+            0});
+            this.nupVolume.Name = "nupVolume";
+            this.nupVolume.Size = new System.Drawing.Size(120, 20);
+            this.nupVolume.TabIndex = 10;
+            this.nupVolume.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // lblVolume
+            // 
+            this.lblVolume.AutoSize = true;
+            this.lblVolume.Location = new System.Drawing.Point(18, 110);
+            this.lblVolume.Name = "lblVolume";
+            this.lblVolume.Size = new System.Drawing.Size(45, 13);
+            this.lblVolume.TabIndex = 9;
+            this.lblVolume.Text = "Volume:";
+            // 
+            // cmdBrowse
+            // 
+            this.cmdBrowse.Anchor = System.Windows.Forms.AnchorStyles.Right;
+            this.cmdBrowse.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.cmdBrowse.Location = new System.Drawing.Point(276, 28);
+            this.cmdBrowse.Name = "cmdBrowse";
+            this.cmdBrowse.Size = new System.Drawing.Size(37, 23);
+            this.cmdBrowse.TabIndex = 6;
+            this.cmdBrowse.Text = "...";
+            this.cmdBrowse.UseVisualStyleBackColor = true;
+            this.cmdBrowse.Click += new System.EventHandler(this.cmdBrowse_Click);
+            // 
+            // txtSound
+            // 
+            this.txtSound.Location = new System.Drawing.Point(21, 28);
+            this.txtSound.Name = "txtSound";
+            this.txtSound.Size = new System.Drawing.Size(249, 20);
+            this.txtSound.TabIndex = 5;
+            // 
+            // chkLoop
+            // 
+            this.chkLoop.AutoSize = true;
+            this.chkLoop.Checked = true;
+            this.chkLoop.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.chkLoop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkLoop.Location = new System.Drawing.Point(21, 77);
+            this.chkLoop.Name = "chkLoop";
+            this.chkLoop.Size = new System.Drawing.Size(47, 17);
+            this.chkLoop.TabIndex = 4;
+            this.chkLoop.Text = "Loop";
+            this.chkLoop.UseVisualStyleBackColor = true;
+            // 
+            // chkAutoPlay
+            // 
+            this.chkAutoPlay.AutoSize = true;
+            this.chkAutoPlay.Checked = true;
+            this.chkAutoPlay.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.chkAutoPlay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.chkAutoPlay.Location = new System.Drawing.Point(21, 54);
+            this.chkAutoPlay.Name = "chkAutoPlay";
+            this.chkAutoPlay.Size = new System.Drawing.Size(67, 17);
+            this.chkAutoPlay.TabIndex = 3;
+            this.chkAutoPlay.Text = "Auto play";
+            this.chkAutoPlay.UseVisualStyleBackColor = true;
+            // 
+            // ofdOpenSound
+            // 
+            this.ofdOpenSound.Filter = "Sound files|*.wav;*.mp3";
+            // 
+            // ScenePropertiesForm
+            // 
+            this.AcceptButton = this.butOK;
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.CancelButton = this.butCancel;
+            this.ClientSize = new System.Drawing.Size(343, 386);
+            this.Controls.Add(this.groupBox3);
+            this.Controls.Add(this.groupBox2);
+            this.Controls.Add(this.butCancel);
+            this.Controls.Add(this.butOK);
+            this.Controls.Add(this.groupBox1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "ScenePropertiesForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Babylon.js - Scene Properties";
+            this.Load += new System.EventHandler(this.ScenePropertiesForm_Load);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
+            this.groupBox3.ResumeLayout(false);
+            this.groupBox3.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nupVolume)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        private Vector3Control gravityControl;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Button butCancel;
+        private System.Windows.Forms.Button butOK;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.CheckBox chkQuaternions;
+        private System.Windows.Forms.GroupBox groupBox3;
+        private System.Windows.Forms.CheckBox chkLoop;
+        private System.Windows.Forms.CheckBox chkAutoPlay;
+        private System.Windows.Forms.Button cmdBrowse;
+        private System.Windows.Forms.TextBox txtSound;
+        private System.Windows.Forms.OpenFileDialog ofdOpenSound;
+        private System.Windows.Forms.NumericUpDown nupVolume;
+        private System.Windows.Forms.Label lblVolume;
+        private System.Windows.Forms.CheckBox chkAnimations;
+    }
 }

+ 49 - 47
Exporters/3ds Max/Max2Babylon/Forms/ScenePropertiesForm.cs

@@ -1,47 +1,49 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using Autodesk.Max;
-
-namespace Max2Babylon
-{
-    public partial class ScenePropertiesForm : Form
-    {
-        public ScenePropertiesForm()
-        {
-            InitializeComponent();
-        }
-
-        private void butOK_Click(object sender, EventArgs e)
-        {
-            Tools.UpdateVector3Control(gravityControl, Loader.Core.RootNode, "babylonjs_gravity");
-            Tools.UpdateCheckBox(chkQuaternions, Loader.Core.RootNode, "babylonjs_exportquaternions");
-
-            Tools.UpdateCheckBox(chkAutoPlay, Loader.Core.RootNode, "babylonjs_sound_autoplay");
-            Tools.UpdateCheckBox(chkLoop, Loader.Core.RootNode, "babylonjs_sound_loop");
-            Tools.UpdateNumericUpDown(nupVolume, new List<IINode> { Loader.Core.RootNode }, "babylonjs_sound_volume");
-
-            Tools.UpdateTextBox(txtSound, new List<IINode> { Loader.Core.RootNode }, "babylonjs_sound_filename");
-        }
-
-        private void ScenePropertiesForm_Load(object sender, EventArgs e)
-        {
-            Tools.PrepareVector3Control(gravityControl, Loader.Core.RootNode, "babylonjs_gravity", 0, -0.9f);
-            Tools.PrepareCheckBox(chkQuaternions, Loader.Core.RootNode, "babylonjs_exportquaternions", 1);
-
-            Tools.PrepareCheckBox(chkAutoPlay, Loader.Core.RootNode, "babylonjs_sound_autoplay", 1);
-            Tools.PrepareCheckBox(chkLoop, Loader.Core.RootNode, "babylonjs_sound_loop", 1);
-            Tools.PrepareNumericUpDown(nupVolume, new List<IINode>{Loader.Core.RootNode}, "babylonjs_sound_volume", 1.0f);
-
-            Tools.PrepareTextBox(txtSound, Loader.Core.RootNode, "babylonjs_sound_filename");
-        }
-
-        private void cmdBrowse_Click(object sender, EventArgs e)
-        {
-            if (ofdOpenSound.ShowDialog() == DialogResult.OK)
-            {
-                txtSound.Text = ofdOpenSound.FileName;
-            }
-        }
-    }
-}
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using Autodesk.Max;
+
+namespace Max2Babylon
+{
+    public partial class ScenePropertiesForm : Form
+    {
+        public ScenePropertiesForm()
+        {
+            InitializeComponent();
+        }
+
+        private void butOK_Click(object sender, EventArgs e)
+        {
+            Tools.UpdateVector3Control(gravityControl, Loader.Core.RootNode, "babylonjs_gravity");
+            Tools.UpdateCheckBox(chkQuaternions, Loader.Core.RootNode, "babylonjs_exportquaternions");
+            Tools.UpdateCheckBox(chkAnimations, Loader.Core.RootNode, "babylonjs_exportnonoptimizedanimations");
+
+            Tools.UpdateCheckBox(chkAutoPlay, Loader.Core.RootNode, "babylonjs_sound_autoplay");
+            Tools.UpdateCheckBox(chkLoop, Loader.Core.RootNode, "babylonjs_sound_loop");
+            Tools.UpdateNumericUpDown(nupVolume, new List<IINode> { Loader.Core.RootNode }, "babylonjs_sound_volume");
+
+            Tools.UpdateTextBox(txtSound, new List<IINode> { Loader.Core.RootNode }, "babylonjs_sound_filename");
+        }
+
+        private void ScenePropertiesForm_Load(object sender, EventArgs e)
+        {
+            Tools.PrepareVector3Control(gravityControl, Loader.Core.RootNode, "babylonjs_gravity", 0, -0.9f);
+            Tools.PrepareCheckBox(chkQuaternions, Loader.Core.RootNode, "babylonjs_exportquaternions", 1);
+            Tools.PrepareCheckBox(chkAnimations, Loader.Core.RootNode, "babylonjs_exportnonoptimizedanimations", 0);
+
+            Tools.PrepareCheckBox(chkAutoPlay, Loader.Core.RootNode, "babylonjs_sound_autoplay", 1);
+            Tools.PrepareCheckBox(chkLoop, Loader.Core.RootNode, "babylonjs_sound_loop", 1);
+            Tools.PrepareNumericUpDown(nupVolume, new List<IINode>{Loader.Core.RootNode}, "babylonjs_sound_volume", 1.0f);
+
+            Tools.PrepareTextBox(txtSound, Loader.Core.RootNode, "babylonjs_sound_filename");
+        }
+
+        private void cmdBrowse_Click(object sender, EventArgs e)
+        {
+            if (ofdOpenSound.ShowDialog() == DialogResult.OK)
+            {
+                txtSound.Text = ofdOpenSound.FileName;
+            }
+        }
+    }
+}

+ 122 - 122
Exporters/3ds Max/Max2Babylon/Forms/ScenePropertiesForm.resx

@@ -1,123 +1,123 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="ofdOpenSound.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="ofdOpenSound.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 152 - 152
Exporters/3ds Max/Max2Babylon/Forms/Vector3Control.Designer.cs

@@ -1,152 +1,152 @@
-namespace Max2Babylon
-{
-    partial class Vector3Control
-    {
-        /// <summary> 
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary> 
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Component Designer generated code
-
-        /// <summary> 
-        /// Required method for Designer support - do not modify 
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.label1 = new System.Windows.Forms.Label();
-            this.nupX = new System.Windows.Forms.NumericUpDown();
-            this.nupY = new System.Windows.Forms.NumericUpDown();
-            this.label2 = new System.Windows.Forms.Label();
-            this.nupZ = new System.Windows.Forms.NumericUpDown();
-            this.label3 = new System.Windows.Forms.Label();
-            ((System.ComponentModel.ISupportInitialize)(this.nupX)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupY)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupZ)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(4, 6);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(20, 13);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "X: ";
-            // 
-            // nupX
-            // 
-            this.nupX.DecimalPlaces = 2;
-            this.nupX.Location = new System.Drawing.Point(30, 4);
-            this.nupX.Maximum = new decimal(new int[] {
-            1000000,
-            0,
-            0,
-            0});
-            this.nupX.Minimum = new decimal(new int[] {
-            1000000,
-            0,
-            0,
-            -2147483648});
-            this.nupX.Name = "nupX";
-            this.nupX.Size = new System.Drawing.Size(57, 20);
-            this.nupX.TabIndex = 1;
-            // 
-            // nupY
-            // 
-            this.nupY.DecimalPlaces = 2;
-            this.nupY.Location = new System.Drawing.Point(123, 4);
-            this.nupY.Maximum = new decimal(new int[] {
-            1000000,
-            0,
-            0,
-            0});
-            this.nupY.Minimum = new decimal(new int[] {
-            1000000,
-            0,
-            0,
-            -2147483648});
-            this.nupY.Name = "nupY";
-            this.nupY.Size = new System.Drawing.Size(57, 20);
-            this.nupY.TabIndex = 3;
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(97, 6);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(17, 13);
-            this.label2.TabIndex = 2;
-            this.label2.Text = "Y:";
-            // 
-            // nupZ
-            // 
-            this.nupZ.DecimalPlaces = 2;
-            this.nupZ.Location = new System.Drawing.Point(216, 4);
-            this.nupZ.Maximum = new decimal(new int[] {
-            1000000,
-            0,
-            0,
-            0});
-            this.nupZ.Minimum = new decimal(new int[] {
-            1000000,
-            0,
-            0,
-            -2147483648});
-            this.nupZ.Name = "nupZ";
-            this.nupZ.Size = new System.Drawing.Size(57, 20);
-            this.nupZ.TabIndex = 5;
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(190, 6);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(17, 13);
-            this.label3.TabIndex = 4;
-            this.label3.Text = "Z:";
-            // 
-            // Vector3Control
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Controls.Add(this.nupZ);
-            this.Controls.Add(this.label3);
-            this.Controls.Add(this.nupY);
-            this.Controls.Add(this.label2);
-            this.Controls.Add(this.nupX);
-            this.Controls.Add(this.label1);
-            this.Name = "Vector3Control";
-            this.Size = new System.Drawing.Size(294, 28);
-            ((System.ComponentModel.ISupportInitialize)(this.nupX)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupY)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.nupZ)).EndInit();
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.NumericUpDown nupX;
-        private System.Windows.Forms.NumericUpDown nupY;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.NumericUpDown nupZ;
-        private System.Windows.Forms.Label label3;
-    }
-}
+namespace Max2Babylon
+{
+    partial class Vector3Control
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.nupX = new System.Windows.Forms.NumericUpDown();
+            this.nupY = new System.Windows.Forms.NumericUpDown();
+            this.label2 = new System.Windows.Forms.Label();
+            this.nupZ = new System.Windows.Forms.NumericUpDown();
+            this.label3 = new System.Windows.Forms.Label();
+            ((System.ComponentModel.ISupportInitialize)(this.nupX)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupY)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupZ)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(4, 6);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(20, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "X: ";
+            // 
+            // nupX
+            // 
+            this.nupX.DecimalPlaces = 2;
+            this.nupX.Location = new System.Drawing.Point(30, 4);
+            this.nupX.Maximum = new decimal(new int[] {
+            1000000,
+            0,
+            0,
+            0});
+            this.nupX.Minimum = new decimal(new int[] {
+            1000000,
+            0,
+            0,
+            -2147483648});
+            this.nupX.Name = "nupX";
+            this.nupX.Size = new System.Drawing.Size(57, 20);
+            this.nupX.TabIndex = 1;
+            // 
+            // nupY
+            // 
+            this.nupY.DecimalPlaces = 2;
+            this.nupY.Location = new System.Drawing.Point(123, 4);
+            this.nupY.Maximum = new decimal(new int[] {
+            1000000,
+            0,
+            0,
+            0});
+            this.nupY.Minimum = new decimal(new int[] {
+            1000000,
+            0,
+            0,
+            -2147483648});
+            this.nupY.Name = "nupY";
+            this.nupY.Size = new System.Drawing.Size(57, 20);
+            this.nupY.TabIndex = 3;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(97, 6);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(17, 13);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "Y:";
+            // 
+            // nupZ
+            // 
+            this.nupZ.DecimalPlaces = 2;
+            this.nupZ.Location = new System.Drawing.Point(216, 4);
+            this.nupZ.Maximum = new decimal(new int[] {
+            1000000,
+            0,
+            0,
+            0});
+            this.nupZ.Minimum = new decimal(new int[] {
+            1000000,
+            0,
+            0,
+            -2147483648});
+            this.nupZ.Name = "nupZ";
+            this.nupZ.Size = new System.Drawing.Size(57, 20);
+            this.nupZ.TabIndex = 5;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(190, 6);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(17, 13);
+            this.label3.TabIndex = 4;
+            this.label3.Text = "Z:";
+            // 
+            // Vector3Control
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.nupZ);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.nupY);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.nupX);
+            this.Controls.Add(this.label1);
+            this.Name = "Vector3Control";
+            this.Size = new System.Drawing.Size(294, 28);
+            ((System.ComponentModel.ISupportInitialize)(this.nupX)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupY)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nupZ)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.NumericUpDown nupX;
+        private System.Windows.Forms.NumericUpDown nupY;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.NumericUpDown nupZ;
+        private System.Windows.Forms.Label label3;
+    }
+}

+ 30 - 30
Exporters/3ds Max/Max2Babylon/Forms/Vector3Control.cs

@@ -1,30 +1,30 @@
-using System.Windows.Forms;
-
-namespace Max2Babylon
-{
-    public partial class Vector3Control : UserControl
-    {
-        public Vector3Control()
-        {
-            InitializeComponent();
-        }
-
-        public float X
-        {
-            get { return (float)nupX.Value; }
-            set { nupX.Value = (decimal)value; }
-        }
-
-        public float Y
-        {
-            get { return (float)nupY.Value; }
-            set { nupY.Value = (decimal)value; }
-        }
-
-        public float Z
-        {
-            get { return (float)nupZ.Value; }
-            set { nupZ.Value = (decimal)value; }
-        }
-    }
-}
+using System.Windows.Forms;
+
+namespace Max2Babylon
+{
+    public partial class Vector3Control : UserControl
+    {
+        public Vector3Control()
+        {
+            InitializeComponent();
+        }
+
+        public float X
+        {
+            get { return (float)nupX.Value; }
+            set { nupX.Value = (decimal)value; }
+        }
+
+        public float Y
+        {
+            get { return (float)nupY.Value; }
+            set { nupY.Value = (decimal)value; }
+        }
+
+        public float Z
+        {
+            get { return (float)nupZ.Value; }
+            set { nupZ.Value = (decimal)value; }
+        }
+    }
+}

+ 119 - 119
Exporters/3ds Max/Max2Babylon/Forms/Vector3Control.resx

@@ -1,120 +1,120 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
 </root>

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

@@ -1,128 +1,128 @@
-using Autodesk.Max;
-using Autodesk.Max.IQuadMenuContext;
-using Autodesk.Max.Plugins;
-
-namespace Max2Babylon
-{
-    class GlobalUtility : GUP
-    {
-        IIMenu menu;
-        IIMenuItem menuItem;
-        IIMenuItem menuItemBabylon;
-        uint idActionTable;
-        IActionTable actionTable;
-        IActionCallback actionCallback;
-
-        public override void Stop()
-        {
-            try
-            {
-                if (actionTable != null)
-                {
-                    Loader.Global.COREInterface.ActionManager.DeactivateActionTable(actionCallback, idActionTable);
-                }
-
-                // Clean up menu
-                if (menu != null)
-                {
-                    Loader.Global.COREInterface.MenuManager.UnRegisterMenu(menu);
-                    Loader.Global.ReleaseIMenu(menu);
-                    Loader.Global.ReleaseIMenuItem(menuItemBabylon);
-                    Loader.Global.ReleaseIMenuItem(menuItem);
-
-                    menu = null;
-                    menuItem = null;
-                }
-            }
-            catch
-            {
-                // Fails silently
-            }
-        }
-
-        public override uint Start
-        {
-            get
-            {
-                IIActionManager actionManager = Loader.Core.ActionManager;
-                IIMenuManager menuManager = Loader.Core.MenuManager;
-
-                // Set up global actions
-                idActionTable = (uint)actionManager.NumActionTables;
-
-                string actionTableName = "Babylon Actions";
-                actionTable = Loader.Global.ActionTable.Create(idActionTable, 0, ref actionTableName);
-                actionTable.AppendOperation(new BabylonExportActionItem());
-                actionTable.AppendOperation(new BabylonPropertiesActionItem());
-               // actionTable.AppendOperation(new BabylonActionsBuilderActionItem());
-                actionCallback = new BabylonActionCallback();
-
-                actionManager.RegisterActionTable(actionTable);
-                actionManager.ActivateActionTable(actionCallback as ActionCallback, idActionTable);
-
-                // Set up menu
-                menu = menuManager.FindMenu("Babylon");
-
-                if (menu != null)
-                {
-                    menuManager.UnRegisterMenu(menu);
-                    Loader.Global.ReleaseIMenu(menu);
-                    menu = null;
-                }
-
-                // Main menu
-                menu = Loader.Global.IMenu;
-                menu.Title = "Babylon";
-                menuManager.RegisterMenu(menu, 0);
-
-                // Launch option
-                menuItemBabylon = Loader.Global.IMenuItem;
-                menuItemBabylon.Title = "&File Exporter";
-                menuItemBabylon.ActionItem = actionTable[0];
-
-                menu.AddItem(menuItemBabylon, -1);
-
-                menuItem = Loader.Global.IMenuItem;
-                menuItem.SubMenu = menu;
-
-                menuManager.MainMenuBar.AddItem(menuItem, -1);
-
-                // Quad
-                var rootQuadMenu = menuManager.GetViewportRightClickMenu(RightClickContext.NonePressed);
-                var quadMenu = rootQuadMenu.GetMenu(0);
-
-                menu = menuManager.FindMenu("Babylon...");
-
-                if (menu != null)
-                {
-                    menuManager.UnRegisterMenu(menu);
-                    Loader.Global.ReleaseIMenu(menu);
-                    menu = null;
-                }
-
-                menu = Loader.Global.IMenu;
-                menu.Title = "Babylon...";
-                menuManager.RegisterMenu(menu, 0);
-
-                menuItemBabylon = Loader.Global.IMenuItem;
-                menuItemBabylon.Title = "Babylon Properties";
-                menuItemBabylon.ActionItem = actionTable[1];
-                //menu.AddItem(menuItemBabylon, -1);
-
-                //menuItemBabylon = Loader.Global.IMenuItem;
-                //menuItemBabylon.Title = "Babylon Actions Builder";
-                //menuItemBabylon.ActionItem = actionTable[2];
-                menu.AddItem(menuItemBabylon, -1);
-
-                menuItem = Loader.Global.IMenuItem;
-                menuItem.SubMenu = menu;
-
-                quadMenu.AddItem(menuItem, -1);
-
-                Loader.Global.COREInterface.MenuManager.UpdateMenuBar();
-
-                return 0;
-            }
-        }
-    }
-}
+using Autodesk.Max;
+using Autodesk.Max.IQuadMenuContext;
+using Autodesk.Max.Plugins;
+
+namespace Max2Babylon
+{
+    class GlobalUtility : GUP
+    {
+        IIMenu menu;
+        IIMenuItem menuItem;
+        IIMenuItem menuItemBabylon;
+        uint idActionTable;
+        IActionTable actionTable;
+        IActionCallback actionCallback;
+
+        public override void Stop()
+        {
+            try
+            {
+                if (actionTable != null)
+                {
+                    Loader.Global.COREInterface.ActionManager.DeactivateActionTable(actionCallback, idActionTable);
+                }
+
+                // Clean up menu
+                if (menu != null)
+                {
+                    Loader.Global.COREInterface.MenuManager.UnRegisterMenu(menu);
+                    Loader.Global.ReleaseIMenu(menu);
+                    Loader.Global.ReleaseIMenuItem(menuItemBabylon);
+                    Loader.Global.ReleaseIMenuItem(menuItem);
+
+                    menu = null;
+                    menuItem = null;
+                }
+            }
+            catch
+            {
+                // Fails silently
+            }
+        }
+
+        public override uint Start
+        {
+            get
+            {
+                IIActionManager actionManager = Loader.Core.ActionManager;
+                IIMenuManager menuManager = Loader.Core.MenuManager;
+
+                // Set up global actions
+                idActionTable = (uint)actionManager.NumActionTables;
+
+                string actionTableName = "Babylon Actions";
+                actionTable = Loader.Global.ActionTable.Create(idActionTable, 0, ref actionTableName);
+                actionTable.AppendOperation(new BabylonExportActionItem());
+                actionTable.AppendOperation(new BabylonPropertiesActionItem());
+                actionTable.AppendOperation(new BabylonActionsBuilderActionItem());
+                actionCallback = new BabylonActionCallback();
+
+                actionManager.RegisterActionTable(actionTable);
+                actionManager.ActivateActionTable(actionCallback as ActionCallback, idActionTable);
+
+                // Set up menu
+                menu = menuManager.FindMenu("Babylon");
+
+                if (menu != null)
+                {
+                    menuManager.UnRegisterMenu(menu);
+                    Loader.Global.ReleaseIMenu(menu);
+                    menu = null;
+                }
+
+                // Main menu
+                menu = Loader.Global.IMenu;
+                menu.Title = "Babylon";
+                menuManager.RegisterMenu(menu, 0);
+
+                // Launch option
+                menuItemBabylon = Loader.Global.IMenuItem;
+                menuItemBabylon.Title = "&File Exporter";
+                menuItemBabylon.ActionItem = actionTable[0];
+
+                menu.AddItem(menuItemBabylon, -1);
+
+                menuItem = Loader.Global.IMenuItem;
+                menuItem.SubMenu = menu;
+
+                menuManager.MainMenuBar.AddItem(menuItem, -1);
+
+                // Quad
+                var rootQuadMenu = menuManager.GetViewportRightClickMenu(RightClickContext.NonePressed);
+                var quadMenu = rootQuadMenu.GetMenu(0);
+
+                menu = menuManager.FindMenu("Babylon...");
+
+                if (menu != null)
+                {
+                    menuManager.UnRegisterMenu(menu);
+                    Loader.Global.ReleaseIMenu(menu);
+                    menu = null;
+                }
+
+                menu = Loader.Global.IMenu;
+                menu.Title = "Babylon...";
+                menuManager.RegisterMenu(menu, 0);
+
+                menuItemBabylon = Loader.Global.IMenuItem;
+                menuItemBabylon.Title = "Babylon Properties";
+                menuItemBabylon.ActionItem = actionTable[1];
+                menu.AddItem(menuItemBabylon, -1);
+
+                menuItemBabylon = Loader.Global.IMenuItem;
+                menuItemBabylon.Title = "Babylon Actions Builder";
+                menuItemBabylon.ActionItem = actionTable[2];
+                menu.AddItem(menuItemBabylon, -1);
+
+                menuItem = Loader.Global.IMenuItem;
+                menuItem.SubMenu = menu;
+
+                quadMenu.AddItem(menuItem, -1);
+
+                Loader.Global.COREInterface.MenuManager.UpdateMenuBar();
+
+                return 0;
+            }
+        }
+    }
+}

+ 19 - 19
Exporters/3ds Max/Max2Babylon/JsonTextWriterOptimized.cs

@@ -1,19 +1,19 @@
-using System;
-using System.IO;
-using Newtonsoft.Json;
-
-namespace Max2Babylon
-{
-    class JsonTextWriterOptimized : JsonTextWriter
-    {
-        public JsonTextWriterOptimized(TextWriter textWriter)
-            : base(textWriter)
-        {
-        }
-        public override void WriteValue(float value)
-        {
-            value = (float)Math.Round(value, 4);
-            base.WriteValue(value);
-        }
-    }
-}
+using System;
+using System.IO;
+using Newtonsoft.Json;
+
+namespace Max2Babylon
+{
+    class JsonTextWriterOptimized : JsonTextWriter
+    {
+        public JsonTextWriterOptimized(TextWriter textWriter)
+            : base(textWriter)
+        {
+        }
+        public override void WriteValue(float value)
+        {
+            value = (float)Math.Round(value, 4);
+            base.WriteValue(value);
+        }
+    }
+}

+ 29 - 29
Exporters/3ds Max/Max2Babylon/Loader.cs

@@ -1,29 +1,29 @@
-using System;
-using System.ComponentModel;
-using Autodesk.Max;
-using Autodesk.Max.Plugins;
-
-namespace Max2Babylon
-{
-    public class Loader
-    {
-        public static IGlobal Global;
-        public static IInterface14 Core;
-        public static IClass_ID Class_ID;
-
-        public static void AssemblyMain()
-        {
-            Global = GlobalInterface.Instance;
-            Core = Global.COREInterface14;
-            Class_ID = Global.Class_ID.Create(0x8217f123, 0xef980456);
-            Core.AddClass(new Descriptor());
-        }
-
-        public static void AssemblyShutdown()
-        {
-
-        }
-
-     
-    }
-}
+using System;
+using System.ComponentModel;
+using Autodesk.Max;
+using Autodesk.Max.Plugins;
+
+namespace Max2Babylon
+{
+    public class Loader
+    {
+        public static IGlobal Global;
+        public static IInterface14 Core;
+        public static IClass_ID Class_ID;
+
+        public static void AssemblyMain()
+        {
+            Global = GlobalInterface.Instance;
+            Core = Global.COREInterface14;
+            Class_ID = Global.Class_ID.Create(0x8217f123, 0xef980456);
+            Core.AddClass(new Descriptor());
+        }
+
+        public static void AssemblyShutdown()
+        {
+
+        }
+
+     
+    }
+}

二進制
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);

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

@@ -3,7 +3,7 @@
 
 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. 
 
@@ -26,13 +26,14 @@ To export you can use the [Babylon] menu in the main menu bar.
  - Animations: Position, Fov
 - *Lights*
  - Omni / spot / directional / Ambient(Hemispheric)
- - Shadows maps for directional lights (Variance shadow maps can be actived by checking [ABsoulte Map Bias] in light properties)
+ - Shadows maps for directional lights (Variance shadow maps can be actived by checking [Absolute Map Bias] in light properties)
  - Inclusion / exclusion lists
  - Position / direction
  - Intensity
  - Diffuse
  - Specular
- - Animations: Position, Direction, intensity 
+ - Animations: Position, Direction, intensity, diffuse
+ - Range 
 - *Meshes*
  - Visibility
  - Renderable

文件差異過大導致無法顯示
+ 589 - 264
Exporters/Blender/io_export_babylon.py


+ 0 - 122
Exporters/Blender/io_scene_map/__init__.py

@@ -1,122 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Quake MAP format",
-    "author": "Campbell Barton",
-    "blender": (2, 57, 0),
-    "location": "File > Export",
-    "description": "Export MAP brushes, nurbs surfaces, "
-                   "lamps and empties as map nodes",
-    "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/Import-Export/Quake_MAP",
-    "tracker_url": "",
-    "support": 'OFFICIAL',
-    "category": "Import-Export"}
-
-# To support reload properly, try to access a package var, if it's there, reload everything
-if "bpy" in locals():
-    import imp
-    if "export_map" in locals():
-        imp.reload(export_map)
-
-
-import bpy
-from bpy.props import StringProperty, FloatProperty, BoolProperty
-from bpy_extras.io_utils import ExportHelper
-
-
-class ExportMAP(bpy.types.Operator, ExportHelper):
-    """Export selection to a quake map"""
-    bl_idname = "export_scene.quake_map"
-    bl_label = "Export MAP"
-    bl_options = {'PRESET'}
-
-    filename_ext = ".map"
-    filter_glob = StringProperty(default="*.map", options={'HIDDEN'})
-
-    face_thickness = FloatProperty(
-            name="Face Thickness",
-            description=("Thickness given to geometry which can't be "
-                         "converted into a brush"),
-            min=0.0001, max=10.0,
-            default=0.1,
-            )
-    global_scale = FloatProperty(
-            name="Scale",
-            description="Scale everything by this value",
-            min=0.01, max=1000.0,
-            default=100.0,
-            )
-    grid_snap = BoolProperty(
-            name="Grid Snap",
-            description="Round to whole numbers",
-            default=False,
-            )
-    texture_null = StringProperty(
-            name="Tex Null",
-            description="Texture used when none is assigned",
-            default="NULL",
-            )
-    texture_opts = StringProperty(
-            name="Tex Opts",
-            description="Brush texture options",
-            default='0 0 0 1 1 0 0 0',
-            )
-
-    def execute(self, context):
-        # import math
-        # from mathutils import Matrix
-        if not self.filepath:
-            raise Exception("filepath not set")
-
-        '''
-        global_matrix = Matrix()
-        global_matrix[0][0] = global_matrix[1][1] = global_matrix[2][2] = self.global_scale
-        global_matrix = global_matrix * axis_conversion(to_forward=self.axis_forward, to_up=self.axis_up).to_4x4()
-
-        keywords = self.as_keywords(ignore=("axis_forward", "axis_up", "global_scale", "check_existing", "filter_glob"))
-        keywords["global_matrix"] = global_matrix
-        '''
-
-        keywords = self.as_keywords(ignore=("check_existing", "filter_glob"))
-
-        from . import export_map
-        return export_map.save(self, context, **keywords)
-
-
-def menu_func(self, context):
-    self.layout.operator(ExportMAP.bl_idname, text="Quake MAP (.map)")
-
-
-def register():
-    bpy.utils.register_module(__name__)
-
-    bpy.types.INFO_MT_file_export.append(menu_func)
-
-
-def unregister():
-    bpy.utils.unregister_module(__name__)
-
-    bpy.types.INFO_MT_file_export.remove(menu_func)
-
-if __name__ == "__main__":
-    register()

+ 0 - 508
Exporters/Blender/io_scene_map/export_map.py

@@ -1,508 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8-80 compliant>
-
-import bpy
-import os
-
-# TODO, make options
-PREF_SCALE = 100
-PREF_FACE_THICK = 0.1
-PREF_GRID_SNAP = False
-# Quake 1/2?
-# Quake 3+?
-PREF_DEF_TEX_OPTS = '0 0 0 1 1 0 0 0'  # not user settable yet
-
-PREF_NULL_TEX = 'NULL'  # not user settable yet
-PREF_INVIS_TEX = 'common/caulk'
-
-
-def face_uv_get(face):
-    """ Workaround 2.5x change.
-    """
-    me = face.id_data
-    uv_faces = me.uv_textures.active
-    if uv_faces:
-        return uv_faces.data[face.index]
-    else:
-        return None
-
-
-def face_material_get(face):
-    me = face.id_data
-    try:
-        return me.materials[face.material_index]
-    except:
-        return None
-
-
-def write_cube2brush(file, faces):
-    """
-    Takes 6 faces and writes a brush,
-    these faces can be from 1 mesh, 1 cube within a mesh of larger cubes
-    Faces could even come from different meshes or be contrived.
-    """
-    # comment only
-    # file.write('// brush "%s", "%s"\n' % (ob.name, ob.data.name))
-    file.write('// brush from cube\n{\n')
-
-    if PREF_GRID_SNAP:
-        format_vec = '( %d %d %d ) '
-    else:
-        format_vec = '( %.8f %.8f %.8f ) '
-
-    for f in faces:
-        # from 4 verts this gets them in reversed order and only 3 of them
-        # 0,1,2,3 -> 2,1,0
-        me = f.id_data  # XXX25
-        for v in f.vertices[:][2::-1]:
-            file.write(format_vec % me.vertices[v].co[:])
-
-        material = face_material_get(f)
-
-        if material and material.game_settings.invisible:
-            file.write(PREF_INVIS_TEX)
-        else:
-            uf = face_uv_get(f)
-
-            image = uf.image if uf else None
-
-            if image:
-                file.write(os.path.splitext(
-                        bpy.path.basename(image.filepath))[0])
-            else:
-                file.write(PREF_NULL_TEX)
-
-        # Texture stuff ignored for now
-        file.write(" %s\n" % PREF_DEF_TEX_OPTS)
-    file.write('}\n')
-
-
-def round_vec(v):
-    if PREF_GRID_SNAP:
-        return v.to_tuple(0)
-    else:
-        return v[:]
-
-
-def write_face2brush(file, face):
-    """
-    takes a face and writes it as a brush
-    each face is a cube/brush
-    """
-
-    if PREF_GRID_SNAP:
-        format_vec = '( %d %d %d ) '
-    else:
-        format_vec = '( %.8f %.8f %.8f ) '
-
-    image_text = PREF_NULL_TEX
-
-    material = face_material_get(face)
-
-    if material and material.game_settings.invisible:
-        image_text = PREF_INVIS_TEX
-    else:
-        uf = face_uv_get(face)
-
-        image = uf.image if uf else None
-
-        if image:
-            image_text = os.path.splitext(bpy.path.basename(image.filepath))[0]
-
-    # reuse face vertices
-    _v = face.id_data.vertices  # XXX25
-    f_vertices = [_v[vi] for vi in face.vertices]
-    del _v  # XXX25
-
-    # original verts as tuples for writing
-    orig_vco = [v.co[:] for v in f_vertices]
-
-    # new verts that give the face a thickness
-    dist = PREF_SCALE * PREF_FACE_THICK
-    new_vco = [round_vec(v.co - (v.normal * dist)) for v in f_vertices]
-    #new_vco = [round_vec(v.co - (face.no * dist)) for v in face]
-
-    file.write('// brush from face\n{\n')
-    # front
-    for co in orig_vco[2::-1]:
-        file.write(format_vec % co)
-    file.write(image_text)
-    # Texture stuff ignored for now
-    file.write(" %s\n" % PREF_DEF_TEX_OPTS)
-
-    for co in new_vco[:3]:
-        file.write(format_vec % co)
-    if uf and uf.use_twoside:
-        file.write(image_text)
-    else:
-        file.write(PREF_INVIS_TEX)
-
-    # Texture stuff ignored for now
-    file.write(" %s\n" % PREF_DEF_TEX_OPTS)
-
-    # sides.
-    if len(orig_vco) == 3:  # Tri, it seemms tri brushes are supported.
-        index_pairs = ((0, 1), (1, 2), (2, 0))
-    else:
-        index_pairs = ((0, 1), (1, 2), (2, 3), (3, 0))
-
-    for i1, i2 in index_pairs:
-        for co in orig_vco[i1], orig_vco[i2], new_vco[i2]:
-            file.write(format_vec % co)
-        file.write(PREF_INVIS_TEX)
-        file.write(" %s\n" % PREF_DEF_TEX_OPTS)
-
-    file.write('}\n')
-
-
-def is_cube_facegroup(faces):
-    """
-    Returns a bool, true if the faces make up a cube
-    """
-    # cube must have 6 faces
-    if len(faces) != 6:
-        # print('1')
-        return False
-
-    # Check for quads and that there are 6 unique verts
-    verts = {}
-    for f in faces:
-        f_v = f.vertices[:]
-        if len(f_v) != 4:
-            return False
-
-        for v in f_v:
-            verts[v] = 0
-
-    if len(verts) != 8:
-        return False
-
-    # Now check that each vert has 3 face users
-    for f in faces:
-        f_v = f.vertices[:]
-        for v in f_v:
-            verts[v] += 1
-
-    for v in verts.values():
-        if v != 3:  # vert has 3 users?
-            return False
-
-    # Could we check for 12 unique edges??, probably not needed.
-    return True
-
-
-def is_tricyl_facegroup(faces):
-    """
-    is the face group a tri cylinder
-    Returns a bool, true if the faces make an extruded tri solid
-    """
-
-    # cube must have 5 faces
-    if len(faces) != 5:
-        #  print('1')
-        return False
-
-    # Check for quads and that there are 6 unique verts
-    verts = {}
-    tottri = 0
-    for f in faces:
-        if len(f.vertices) == 3:
-            tottri += 1
-
-        for vi in f.vertices:
-            verts[vi] = 0
-
-    if len(verts) != 6 or tottri != 2:
-        return False
-
-    # Now check that each vert has 3 face users
-    for f in faces:
-        for vi in f.vertices:
-            verts[vi] += 1
-
-    for v in verts.values():
-        if v != 3:  # vert has 3 users?
-            return False
-
-    # Could we check for 12 unique edges??, probably not needed.
-    return True
-
-
-def write_node_map(file, ob):
-    """
-    Writes the properties of an object (empty in this case)
-    as a MAP node as long as it has the property name - classname
-    returns True/False based on weather a node was written
-    """
-    props = [(p.name, p.value) for p in ob.game.properties]
-
-    IS_MAP_NODE = False
-    for name, value in props:
-        if name == "classname":
-            IS_MAP_NODE = True
-            break
-
-    if not IS_MAP_NODE:
-        return False
-
-    # Write a node
-    file.write('{\n')
-    for name_value in props:
-        file.write('"%s" "%s"\n' % name_value)
-    if PREF_GRID_SNAP:
-        file.write('"origin" "%d %d %d"\n' %
-                   tuple([round(axis * PREF_SCALE)
-                          for axis in ob.matrix_world.to_translation()]))
-    else:
-        file.write('"origin" "%.6f %.6f %.6f"\n' %
-                   tuple([axis * PREF_SCALE
-                          for axis in ob.matrix_world.to_translation()]))
-
-    file.write('}\n')
-    return True
-
-
-def export_map(context, filepath):
-    """
-    pup_block = [\
-    ('Scale:', PREF_SCALE, 1, 1000,
-            'Scale the blender scene by this value.'),\
-    ('Face Width:', PREF_FACE_THICK, 0.01, 10,
-            'Thickness of faces exported as brushes.'),\
-    ('Grid Snap', PREF_GRID_SNAP,
-            'snaps floating point values to whole numbers.'),\
-    'Null Texture',\
-    ('', PREF_NULL_TEX, 1, 128,
-            'Export textureless faces with this texture'),\
-    'Unseen Texture',\
-    ('', PREF_INVIS_TEX, 1, 128,
-            'Export invisible faces with this texture'),\
-    ]
-
-    if not Draw.PupBlock('map export', pup_block):
-        return
-    """
-    import time
-    from mathutils import Matrix
-    from bpy_extras import mesh_utils
-
-    t = time.time()
-    print("Map Exporter 0.0")
-    file = open(filepath, 'w')
-
-    scene = context.scene
-    objects = context.selected_objects
-
-    obs_mesh = []
-    obs_lamp = []
-    obs_surf = []
-    obs_empty = []
-
-    SCALE_MAT = Matrix()
-    SCALE_MAT[0][0] = SCALE_MAT[1][1] = SCALE_MAT[2][2] = PREF_SCALE
-
-    TOTBRUSH = TOTLAMP = TOTNODE = 0
-
-    for ob in objects:
-        type = ob.type
-        if type == 'MESH':
-            obs_mesh.append(ob)
-        elif type == 'SURFACE':
-            obs_surf.append(ob)
-        elif type == 'LAMP':
-            obs_lamp.append(ob)
-        elif type == 'EMPTY':
-            obs_empty.append(ob)
-
-    if obs_mesh or obs_surf:
-        # brushes and surf's must be under worldspan
-        file.write('\n// entity 0\n')
-        file.write('{\n')
-        file.write('"classname" "worldspawn"\n')
-
-    print("\twriting cubes from meshes")
-    for ob in obs_mesh:
-        dummy_mesh = ob.to_mesh(scene, True, 'PREVIEW')
-
-        #print len(mesh_split2connected(dummy_mesh))
-
-        # Is the object 1 cube? - object-is-a-brush
-        # 1 to tx the normals also
-        dummy_mesh.transform(ob.matrix_world * SCALE_MAT)
-
-        if PREF_GRID_SNAP:
-            for v in dummy_mesh.vertices:
-                v.co[:] = v.co.to_tuple(0)
-
-        # High quality normals
-        #XXX25: BPyMesh.meshCalcNormals(dummy_mesh)
-
-        # We need tessfaces
-        dummy_mesh.update(calc_tessface=True)
-
-        # Split mesh into connected regions
-        for face_group in mesh_utils.mesh_linked_tessfaces(dummy_mesh):
-            if is_cube_facegroup(face_group):
-                write_cube2brush(file, face_group)
-                TOTBRUSH += 1
-            elif is_tricyl_facegroup(face_group):
-                write_cube2brush(file, face_group)
-                TOTBRUSH += 1
-            else:
-                for f in face_group:
-                    write_face2brush(file, f)
-                    TOTBRUSH += 1
-
-            #print 'warning, not exporting "%s" it is not a cube' % ob.name
-        bpy.data.meshes.remove(dummy_mesh)
-
-    valid_dims = 3, 5, 7, 9, 11, 13, 15
-    for ob in obs_surf:
-        '''
-        Surf, patches
-        '''
-        data = ob.data
-        surf_name = data.name
-        mat = ob.matrix_world * SCALE_MAT
-
-        # This is what a valid patch looks like
-
-        """
-// brush 0
-{
-patchDef2
-{
-NULL
-( 3 3 0 0 0 )
-(
-( ( -64 -64 0 0 0 ) ( -64 0 0 0 -2 ) ( -64 64 0 0 -4 ) )
-( ( 0 -64 0 2 0 ) ( 0 0 0 2 -2 ) ( 0 64 0 2 -4 ) )
-( ( 64 -64 0 4 0 ) ( 64 0 0 4 -2 ) ( 80 88 0 4 -4 ) )
-)
-}
-}
-        """
-        for i, nurb in enumerate(data.splines):
-            u = nurb.point_count_u
-            v = nurb.point_count_v
-            if u in valid_dims and v in valid_dims:
-
-                file.write('// brush %d surf_name\n' % i)
-                file.write('{\n')
-                file.write('patchDef2\n')
-                file.write('{\n')
-                file.write('NULL\n')
-                file.write('( %d %d 0 0 0 )\n' % (u, v))
-                file.write('(\n')
-
-                u_iter = 0
-                for p in nurb.points:
-
-                    if u_iter == 0:
-                        file.write('(')
-
-                    u_iter += 1
-
-                    # add nmapping 0 0 ?
-                    if PREF_GRID_SNAP:
-                        file.write(" ( %d %d %d 0 0 )" %
-                                   round_vec(mat * p.co.xyz))
-                    else:
-                        file.write(' ( %.6f %.6f %.6f 0 0 )' %
-                                   (mat * p.co.xyz)[:])
-
-                    # Move to next line
-                    if u_iter == u:
-                        file.write(' )\n')
-                        u_iter = 0
-
-                file.write(')\n')
-                file.write('}\n')
-                file.write('}\n')
-                # Debugging
-                # for p in nurb: print 'patch', p
-
-            else:
-                print("Warning: not exporting patch",
-                      surf_name, u, v, 'Unsupported')
-
-    if obs_mesh or obs_surf:
-        file.write('}\n')  # end worldspan
-
-    print("\twriting lamps")
-    for ob in obs_lamp:
-        print("\t\t%s" % ob.name)
-        lamp = ob.data
-        file.write('{\n')
-        file.write('"classname" "light"\n')
-        file.write('"light" "%.6f"\n' % (lamp.distance * PREF_SCALE))
-        if PREF_GRID_SNAP:
-            file.write('"origin" "%d %d %d"\n' %
-                       tuple([round(axis * PREF_SCALE)
-                              for axis in ob.matrix_world.to_translation()]))
-        else:
-            file.write('"origin" "%.6f %.6f %.6f"\n' %
-                       tuple([axis * PREF_SCALE
-                              for axis in ob.matrix_world.to_translation()]))
-
-        file.write('"_color" "%.6f %.6f %.6f"\n' % tuple(lamp.color))
-        file.write('"style" "0"\n')
-        file.write('}\n')
-        TOTLAMP += 1
-
-    print("\twriting empty objects as nodes")
-    for ob in obs_empty:
-        if write_node_map(file, ob):
-            print("\t\t%s" % ob.name)
-            TOTNODE += 1
-        else:
-            print("\t\tignoring %s" % ob.name)
-
-    file.close()
-
-    print("Exported Map in %.4fsec" % (time.time() - t))
-    print("Brushes: %d  Nodes: %d  Lamps %d\n" % (TOTBRUSH, TOTNODE, TOTLAMP))
-
-
-def save(operator,
-         context,
-         filepath=None,
-         global_scale=100.0,
-         face_thickness=0.1,
-         texture_null="NULL",
-         texture_opts='0 0 0 1 1 0 0 0',
-         grid_snap=False,
-         ):
-
-    global PREF_SCALE
-    global PREF_FACE_THICK
-    global PREF_NULL_TEX
-    global PREF_DEF_TEX_OPTS
-    global PREF_GRID_SNAP
-
-    PREF_SCALE = global_scale
-    PREF_FACE_THICK = face_thickness
-    PREF_NULL_TEX = texture_null
-    PREF_DEF_TEX_OPTS = texture_opts
-    PREF_GRID_SNAP = grid_snap
-
-    export_map(context, filepath)
-
-    return {'FINISHED'}

+ 8 - 4
Exporters/Blender/readme.md

@@ -14,7 +14,7 @@ For a discussion of Tower of Babel exporter, along with the difference this expo
  * Check collisions
  * Gravity
  * Ellipsoid
- * Animations
+ * Actions exported as AnimationRanges
  * 3D Camera Rigs
  * All kind of Babylon.js cameras can be chosen from a custom dropdown list
 * **Lights**
@@ -28,9 +28,10 @@ For a discussion of Tower of Babel exporter, along with the difference this expo
  * Diffuse color
  * Specular color
  * Shadow maps, all types (For directional lights)
- * Animations
+ * Actions exported as AnimationRanges
 * **Materials**
  * Name
+ * Name space
  * Ambient color
  * Diffuse color
  * Specular color
@@ -46,6 +47,7 @@ For a discussion of Tower of Babel exporter, along with the difference this expo
  * Bump texture
  * Procedural Texture Baking
  * Cycles Render Baking
+ * Check Ready Only Once
 * **Multi-materials**
  * Name
  * Child materials
@@ -71,11 +73,13 @@ For a discussion of Tower of Babel exporter, along with the difference this expo
  * Texture coordinates (2 channels)
  * Vertex colors
  * Visibility
+ * Load disabled
  * Check collisions
  * Billboard
  * Receive and cast shadows
- * Bones (armatures) and bones' animations
- * Animations
+ * Bones (armatures) and bones' actions
+ 	* Variable Max Bone Influencers / vertex
+ * Actions exported as AnimationRanges
 
 
 

+ 64 - 59
Exporters/FBX/BabylonFbxNative/BabylonMesh.cpp

@@ -440,77 +440,82 @@ BabylonMesh::BabylonMesh(BabylonNode* node) :
 	}
 	pivotMatrix = ConvertToBabylonCoordinateSystem( GetGeometryTransformation(fbxNode));
 
-	auto animStack = fbxNode->GetScene()->GetCurrentAnimationStack();
-	FbxString animStackName = animStack->GetName();
-	//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
-	auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
-	auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
-	auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
-	auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
-	auto animLengthInFrame = endFrame - startFrame + 1;
-	_visibility = static_cast<float>(node->fbxNode()->Visibility.Get());
-	auto posAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"position", L"position", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto rotAnim = std::make_shared<BabylonAnimation<babylon_vector4>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"rotationQuaternion", L"rotationQuaternion", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto scaleAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"scaling", L"scaling", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto visibilityAnim = std::make_shared<BabylonAnimation<float>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"visibility", L"visibility", true, 0, static_cast<int>(animLengthInFrame), true);
 	auto mesh = fbxNode->GetMesh();
-	_isVisible = fbxNode->Show.Get();
-	
-	auto rotCurveNode = fbxNode->LclRotation.GetCurveNode();
-	auto translateCurveNode = fbxNode->LclTranslation.GetCurveNode();
-	auto scalingCurveNode = fbxNode->LclScaling.GetCurveNode();
-	auto visibilityCurveNode = fbxNode->Visibility.GetCurveNode();
-	if (rotCurveNode || translateCurveNode || scalingCurveNode) {
-		for (auto ix = 0; ix < animLengthInFrame; ix++) {
-			FbxTime currTime;
-			currTime.SetFrame(startFrame + ix, animTimeMode);
-
-			babylon_animation_key<babylon_vector3> poskey;
-			babylon_animation_key<babylon_vector4> rotkey;
-			babylon_animation_key<babylon_vector3> scalekey;
-			poskey.frame = ix;
-			rotkey.frame = ix;
-			scalekey.frame = ix;
-			auto currTransform = node->GetLocal(currTime);
-			poskey.values = currTransform.translation();
-			rotkey.values = currTransform.rotationQuaternion();
-			scalekey.values = currTransform.scaling();
-			posAnim->appendKey(poskey);
-			rotAnim->appendKey(rotkey);
-			scaleAnim->appendKey(scalekey);
+	auto animStack = fbxNode->GetScene()->GetCurrentAnimationStack();
 
+	if (animStack) {
+		FbxString animStackName = animStack->GetName();
+		//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
+		auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
+		auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
+		auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
+		auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
+		auto animLengthInFrame = endFrame - startFrame + 1;
+		_visibility = static_cast<float>(node->fbxNode()->Visibility.Get());
+		auto posAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"position", L"position", true, 0, static_cast<int>(animLengthInFrame), true);
+		auto rotAnim = std::make_shared<BabylonAnimation<babylon_vector4>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"rotationQuaternion", L"rotationQuaternion", true, 0, static_cast<int>(animLengthInFrame), true);
+		auto scaleAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"scaling", L"scaling", true, 0, static_cast<int>(animLengthInFrame), true);
+		auto visibilityAnim = std::make_shared<BabylonAnimation<float>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"visibility", L"visibility", true, 0, static_cast<int>(animLengthInFrame), true);
+
+		_isVisible = fbxNode->Show.Get();
+
+		auto rotCurveNode = fbxNode->LclRotation.GetCurveNode();
+		auto translateCurveNode = fbxNode->LclTranslation.GetCurveNode();
+		auto scalingCurveNode = fbxNode->LclScaling.GetCurveNode();
+		auto visibilityCurveNode = fbxNode->Visibility.GetCurveNode();
+		if (rotCurveNode || translateCurveNode || scalingCurveNode) {
+			for (auto ix = 0; ix < animLengthInFrame; ix++) {
+				FbxTime currTime;
+				currTime.SetFrame(startFrame + ix, animTimeMode);
+
+				babylon_animation_key<babylon_vector3> poskey;
+				babylon_animation_key<babylon_vector4> rotkey;
+				babylon_animation_key<babylon_vector3> scalekey;
+				poskey.frame = ix;
+				rotkey.frame = ix;
+				scalekey.frame = ix;
+				auto currTransform = node->GetLocal(currTime);
+				poskey.values = currTransform.translation();
+				rotkey.values = currTransform.rotationQuaternion();
+				scalekey.values = currTransform.scaling();
+				posAnim->appendKey(poskey);
+				rotAnim->appendKey(rotkey);
+				scaleAnim->appendKey(scalekey);
 
+
+			}
 		}
-	}
-	if (visibilityCurveNode) {
-		for (auto ix = 0; ix < animLengthInFrame; ix++) {
-			FbxTime currTime;
-			currTime.SetFrame(startFrame + ix, animTimeMode);
+		if (visibilityCurveNode) {
+			for (auto ix = 0; ix < animLengthInFrame; ix++) {
+				FbxTime currTime;
+				currTime.SetFrame(startFrame + ix, animTimeMode);
 
-			babylon_animation_key<float> visibilityKey;
+				babylon_animation_key<float> visibilityKey;
 
-			visibilityKey.frame = ix;
+				visibilityKey.frame = ix;
 
-			visibilityKey.values = static_cast<float>(node->fbxNode()->Visibility.EvaluateValue(currTime));
+				visibilityKey.values = static_cast<float>(node->fbxNode()->Visibility.EvaluateValue(currTime));
 
-			visibilityAnim->appendKey(visibilityKey);
+				visibilityAnim->appendKey(visibilityKey);
 
 
+			}
+		}
+
+		if (!posAnim->isConstant()){
+			animations.push_back(posAnim);
+		}
+		if (!rotAnim->isConstant()){
+			animations.push_back(rotAnim);
+		}
+		if (!scaleAnim->isConstant()){
+			animations.push_back(scaleAnim);
+		}
+		if (!visibilityAnim->isConstant()) {
+			animations.push_back(visibilityAnim);
 		}
 	}
-	
-	if (!posAnim->isConstant()){
-		animations.push_back(posAnim);
-	}
-	if (!rotAnim->isConstant()){
-		animations.push_back(rotAnim);
-	}
-	if (!scaleAnim->isConstant()){
-		animations.push_back(scaleAnim);
-	}
-	if (!visibilityAnim->isConstant()) {
-		animations.push_back(visibilityAnim);
-	}
+
 	if (!mesh) {
 		return;
 	}

+ 2 - 0
Exporters/FBX/readme.md

@@ -11,6 +11,8 @@ FBX Exporter produces a babylon scene file from an FBX asset
 
 ##Prerequisites
 To use this tool, you need to download the Visual C++ 2015 redistribuable package : http://www.microsoft.com/en-us/download/details.aspx?id=48145
+
+To build from source you need to install the Autodesk FBX SDK 2016.1 and copy the lib folder from the SDK install location to 3rdParty\Fbx2016.1\
 ##Usage
 FbxExporter.exe "fbx file" "outdir" [/fps:60|30|24] [/skipemptynodes]
 - fbx file : path to the source FBX asset

+ 1 - 1
Exporters/Unity 5/Unity3D2Babylon/ExporterWindow.cs

@@ -40,7 +40,7 @@ namespace Unity3D2Babylon
 
         void Initialize()
         {
-            title = "Babylon.js";
+            titleContent.text = "Babylon.js";
         }
 
         void OnGUI()

+ 103 - 20
Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.Meshes.cs

@@ -6,22 +6,113 @@ namespace Unity3D2Babylon
 {
     partial class SceneBuilder
     {
-        private void ConvertUnityEmptyObjectToBabylon(GameObject gameObject)
+        private BabylonAbstractMesh ConvertUnityMeshToInstance(GameObject gameObject)
         {
-            BabylonMesh babylonMesh = new BabylonMesh { name = gameObject.name, id = GetID(gameObject) };
+            BabylonAbstractMesh babylonMesh = new BabylonAbstractMesh();
 
-            var transform = gameObject.transform;
+            Transform transform = gameObject.transform;
+            babylonMesh.name = gameObject.name;
+            babylonMesh.position = new float[3];
+            babylonMesh.position[0] = transform.position.x;
+            babylonMesh.position[1] = transform.position.y;
+            babylonMesh.position[2] = transform.position.z;
 
-            babylonMesh.parentId = GetParentID(transform);
+            babylonMesh.rotation = new float[3];
+            babylonMesh.rotation[0] = transform.rotation.eulerAngles.x * (float)Math.PI / 180;
+            babylonMesh.rotation[1] = transform.rotation.eulerAngles.y * (float)Math.PI / 180;
+            babylonMesh.rotation[2] = transform.rotation.eulerAngles.z * (float)Math.PI / 180;
+
+            babylonMesh.scaling = new float[3];
+            babylonMesh.scaling[0] = transform.localScale.x;
+            babylonMesh.scaling[1] = transform.localScale.y;
+            babylonMesh.scaling[2] = transform.localScale.z;
+            return babylonMesh;
+        }
 
-            babylonMesh.position = transform.localPosition.ToFloat();
+        private void ConvertTransform(BabylonMesh babylonMesh, Transform transform, GameObject gameObject, BabylonAbstractMesh[] instances = null)
+        {
+            Action SetTransformFromGameobject = () =>
+            {
+                babylonMesh.position = transform.localPosition.ToFloat();
 
-            babylonMesh.rotation = new float[3];
-            babylonMesh.rotation[0] = transform.localRotation.eulerAngles.x * (float)Math.PI / 180;
-            babylonMesh.rotation[1] = transform.localRotation.eulerAngles.y * (float)Math.PI / 180;
-            babylonMesh.rotation[2] = transform.localRotation.eulerAngles.z * (float)Math.PI / 180;
+                babylonMesh.rotation = new float[3];
+                babylonMesh.rotation[0] = transform.localRotation.eulerAngles.x * (float)Math.PI / 180;
+                babylonMesh.rotation[1] = transform.localRotation.eulerAngles.y * (float)Math.PI / 180;
+                babylonMesh.rotation[2] = transform.localRotation.eulerAngles.z * (float)Math.PI / 180;
+
+                babylonMesh.scaling = transform.localScale.ToFloat();
+            };
 
-            babylonMesh.scaling = transform.localScale.ToFloat();
+            Action SetTransformFromFirstInstance = () =>
+            {
+                BabylonAbstractMesh first = instances[0];
+
+                babylonMesh.position = new float[3];
+                babylonMesh.position[0] = first.position[0];
+                babylonMesh.position[1] = first.position[1];
+                babylonMesh.position[2] = first.position[2];
+
+                babylonMesh.rotation = new float[3];
+                babylonMesh.rotation[0] = first.rotation[0];
+                babylonMesh.rotation[1] = first.rotation[1];
+                babylonMesh.rotation[2] = first.rotation[2];
+
+                babylonMesh.scaling = new float[3];
+                babylonMesh.scaling[0] = first.scaling[0];
+                babylonMesh.scaling[1] = first.scaling[1];
+                babylonMesh.scaling[2] = first.scaling[2];
+            };
+
+            //Check if this is a prefab
+            if (instances != null)
+            {
+                /*
+                    Unity3D prefabs don't have transforms (position, rotation, scale) because they are just a template and are not drawn on screen          
+                    but Babylon.js meshes must have a transform because they are drawn on the screen
+                    so what we do is take the first instance
+                    copy its transform (position, rotation, scale) into the prefab mesh
+                    then remove that first instance
+                */
+
+                babylonMesh.instances = new BabylonAbstractMesh[instances.Length - 1];
+
+                //Effectively remove first instance from list of all instances
+                for (int i = 0; i < instances.Length - 1; i++)
+                {
+                    babylonMesh.instances[i] = instances[i + 1];
+                }
+
+                //If this is the root object then copy values directly from first instance
+                if (GetParentID(transform) == null)
+                {
+                    SetTransformFromFirstInstance();
+                }
+                else
+                {
+                    GameObject parent = gameObject.transform.parent.gameObject;
+                    if ((parent.GetComponent<Light>() == null) && (parent.GetComponent<Camera>() == null))
+                    {
+                        SetTransformFromGameobject();
+                    } else
+                    {
+                        SetTransformFromFirstInstance();
+                    }
+                }
+            }
+            else
+            {
+                SetTransformFromGameobject();
+            }
+        }
+
+        private void ConvertUnityEmptyObjectToBabylon(GameObject gameObject, BabylonAbstractMesh[] instances = null)
+        {
+            BabylonMesh babylonMesh = new BabylonMesh { name = gameObject.name, id = GetID(gameObject) };
+
+            var transform = gameObject.transform;
+
+            babylonMesh.parentId = GetParentID(transform);
+            ConvertTransform(babylonMesh, transform, gameObject, instances);
 
             babylonScene.MeshesList.Add(babylonMesh);
 
@@ -34,7 +125,7 @@ namespace Unity3D2Babylon
             }
         }
 
-        private void ConvertUnityMeshToBabylon(Mesh mesh, Transform transform, GameObject gameObject, float progress)
+        private void ConvertUnityMeshToBabylon(Mesh mesh, Transform transform, GameObject gameObject, float progress, BabylonAbstractMesh[] instances = null)
         {
             BabylonMesh babylonMesh = new BabylonMesh();
             var renderer = gameObject.GetComponent<Renderer>();
@@ -46,15 +137,7 @@ namespace Unity3D2Babylon
             babylonMesh.receiveShadows = renderer.receiveShadows;
 
             babylonMesh.parentId = GetParentID(transform);
-
-            babylonMesh.position = transform.localPosition.ToFloat();
-
-            babylonMesh.rotation = new float[3];
-            babylonMesh.rotation[0] = transform.localRotation.eulerAngles.x * (float)Math.PI / 180;
-            babylonMesh.rotation[1] = transform.localRotation.eulerAngles.y * (float)Math.PI / 180;
-            babylonMesh.rotation[2] = transform.localRotation.eulerAngles.z * (float)Math.PI / 180;
-
-            babylonMesh.scaling = transform.localScale.ToFloat();
+            ConvertTransform(babylonMesh, transform, gameObject, instances);
 
             babylonMesh.positions = new float[mesh.vertexCount * 3];
 

+ 69 - 9
Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.cs

@@ -7,6 +7,7 @@ using UnityEngine;
 using Object = UnityEngine.Object;
 using JsonFx.Serialization;
 using JsonFx.Serialization.Resolvers;
+using UnityEditor;
 
 namespace Unity3D2Babylon
 {
@@ -108,10 +109,52 @@ namespace Unity3D2Babylon
             var itemsCount = gameObjects.Length;
 
             var index = 0;
+
+            //Dictionary to store prefabs and their instances
+            Dictionary<GameObject, List<BabylonAbstractMesh>> dicPrefabs = new Dictionary<GameObject, List<BabylonAbstractMesh>>();
+
             foreach (var gameObject in gameObjects)
             {
                 var progress = ((float)index / itemsCount);
                 index++;
+
+                /* 
+                    The order of processing is important here.
+                    We will only check if this is a mesh prefab if it is not a light or camera
+                */
+
+                // Light
+                var light = gameObject.GetComponent<Light>();
+                if (light != null)
+                {
+                    ConvertUnityLightToBabylon(light, progress);
+                    continue;
+                }
+
+                // Camera
+                var camera = gameObject.GetComponent<Camera>();
+                if (camera != null)
+                {
+                    ConvertUnityCameraToBabylon(camera, progress);
+                    continue;
+                }
+
+                // Check if this is a prefab instance
+                GameObject gobjPrefab = (GameObject)PrefabUtility.GetPrefabParent(gameObject);
+                if (gobjPrefab != null)
+                {
+                    //Add prefab to dictionary if it doesn't already exist
+                    if (!dicPrefabs.ContainsKey(gobjPrefab))
+                    {
+                        dicPrefabs[gobjPrefab] = new List<BabylonAbstractMesh>();
+                    }
+
+                    List<BabylonAbstractMesh> lstInstances = dicPrefabs[gobjPrefab];
+                    BabylonAbstractMesh instance = ConvertUnityMeshToInstance(gameObject);
+                    lstInstances.Add(instance);
+                    continue;
+                }
+
                 // Static meshes
                 var meshFilter = gameObject.GetComponent<MeshFilter>();
                 if (meshFilter != null)
@@ -128,24 +171,41 @@ namespace Unity3D2Babylon
                     continue;
                 }
 
-                // Light
-                var light = gameObject.GetComponent<Light>();
-                if (light != null)
+                // Empty
+                ConvertUnityEmptyObjectToBabylon(gameObject);
+            }
+
+            index = 0;
+            itemsCount = dicPrefabs.Count;
+
+            //Convert prefabs
+            foreach (KeyValuePair<GameObject, List<BabylonAbstractMesh>> pair in dicPrefabs)
+            {
+                var progress = ((float)index / itemsCount);
+                index++;
+
+                List<BabylonAbstractMesh> lstValue = pair.Value;
+                GameObject prefab = pair.Key;
+                BabylonAbstractMesh[] lstInstance = lstValue.ToArray();
+
+                // Static meshes
+                var meshFilter = prefab.GetComponent<MeshFilter>();
+                if (meshFilter != null)
                 {
-                    ConvertUnityLightToBabylon(light, progress);
+                    ConvertUnityMeshToBabylon(meshFilter.sharedMesh, meshFilter.transform, prefab, progress, lstInstance);
                     continue;
                 }
 
-                // Camera
-                var camera = gameObject.GetComponent<Camera>();
-                if (camera != null)
+                // Skinned meshes
+                var skinnedMesh = prefab.GetComponent<SkinnedMeshRenderer>();
+                if (skinnedMesh != null)
                 {
-                    ConvertUnityCameraToBabylon(camera, progress);
+                    ConvertUnityMeshToBabylon(skinnedMesh.sharedMesh, skinnedMesh.transform, prefab, progress, lstInstance);
                     continue;
                 }
 
                 // Empty
-                ConvertUnityEmptyObjectToBabylon(gameObject);
+                ConvertUnityEmptyObjectToBabylon(prefab, lstInstance);
             }
 
             // Materials

+ 1 - 0
Tools/ActionsBuilder/Sources/actionsbuilder.actionNode.js

@@ -84,3 +84,4 @@ var ActionsBuilder;
     })();
     ActionsBuilder.Action = Action;
 })(ActionsBuilder || (ActionsBuilder = {}));
+//# sourceMappingURL=actionsbuilder.actionNode.js.map

+ 1 - 0
Tools/ActionsBuilder/Sources/actionsbuilder.contextMenu.js

@@ -116,3 +116,4 @@ var ActionsBuilder;
     })();
     ActionsBuilder.ContextMenu = ContextMenu;
 })(ActionsBuilder || (ActionsBuilder = {}));
+//# sourceMappingURL=actionsbuilder.contextMenu.js.map

+ 1 - 0
Tools/ActionsBuilder/Sources/actionsbuilder.js

@@ -349,3 +349,4 @@ var ActionsBuilder;
     Elements.FLOW_CONTROLS.push({ name: "StateCondition", text: "state condition", properties: [{ targetType: "MeshProperties", text: "target", value: "" }, { text: "value", value: "" }], description: "A condition checking if the target object's state is equal to the given state. See \"set state\" action to set a state to an object." });
     Elements.FLOW_CONTROLS.push({ name: "Hub", text: "hub", properties: [], description: "The hub is internally used by the Combine Action. It allows to add children to the Combine Action" });
 })(ActionsBuilder || (ActionsBuilder = {}));
+//# sourceMappingURL=actionsbuilder.js.map

+ 6 - 1
Tools/ActionsBuilder/Sources/actionsbuilder.list.js

@@ -78,6 +78,9 @@ var ActionsBuilder;
                 if (this._viewer.root.type === ActionsBuilder.Type.OBJECT && excludedTriggers.indexOf(i) !== -1) {
                     continue;
                 }
+                else if (this._viewer.root.type === ActionsBuilder.Type.SCENE && excludedTriggers.indexOf(i) === -1) {
+                    continue;
+                }
                 var trigger = this._createListElement(this.triggersList, yPosition, element.text, ActionsBuilder.Type.TRIGGER, textColor, true, element);
                 trigger.rect.attr("fill", Raphael.rgb(133, 154, 185));
                 yPosition += List.ELEMENT_HEIGHT;
@@ -223,7 +226,8 @@ var ActionsBuilder;
                         alert("Please add a trigger before.");
                         return;
                     }
-                    if (element.type === ActionsBuilder.Type.FLOW_CONTROL && (dragResult.action === _this._viewer.root || (dragResult.action.type === ActionsBuilder.Type.FLOW_CONTROL && dragResult.action.parent.hub === null))) {
+                    //if (element.type === Type.FLOW_CONTROL && (dragResult.action === this._viewer.root || (dragResult.action.type === Type.FLOW_CONTROL && dragResult.action.parent.hub === null))) {
+                    if (element.type === ActionsBuilder.Type.FLOW_CONTROL && dragResult.action === _this._viewer.root) {
                         return;
                     }
                     if (element.type === ActionsBuilder.Type.FLOW_CONTROL && dragResult.action.combineArray !== null) {
@@ -249,3 +253,4 @@ var ActionsBuilder;
     })();
     ActionsBuilder.List = List;
 })(ActionsBuilder || (ActionsBuilder = {}));
+//# sourceMappingURL=actionsbuilder.list.js.map

+ 4 - 0
Tools/ActionsBuilder/Sources/actionsbuilder.main.js

@@ -9,6 +9,7 @@ this.createJSON = function () {
     var structure = viewer.utils.createJSON(viewer.root);
     var asText = JSON.stringify(structure);
     actionsBuilderJsonInput.value = asText;
+    console.log(asText);
 };
 this.loadFromJSON = function () {
     var json = actionsBuilderJsonInput.value;
@@ -95,4 +96,7 @@ this.run = function () {
     list.setColorTheme("rgb(64, 64, 64)");
     list.createListsElements();
     list.onResize();
+    // 3ds Max fix
+    viewer.onResize();
 };
+//# sourceMappingURL=actionsbuilder.main.js.map

+ 95 - 20
Tools/ActionsBuilder/Sources/actionsbuilder.max.js

@@ -282,6 +282,9 @@ var ActionsBuilder;
                 if (this._viewer.root.type === ActionsBuilder.Type.OBJECT && excludedTriggers.indexOf(i) !== -1) {
                     continue;
                 }
+                else if (this._viewer.root.type === ActionsBuilder.Type.SCENE && excludedTriggers.indexOf(i) === -1) {
+                    continue;
+                }
                 var trigger = this._createListElement(this.triggersList, yPosition, element.text, ActionsBuilder.Type.TRIGGER, textColor, true, element);
                 trigger.rect.attr("fill", Raphael.rgb(133, 154, 185));
                 yPosition += List.ELEMENT_HEIGHT;
@@ -427,7 +430,8 @@ var ActionsBuilder;
                         alert("Please add a trigger before.");
                         return;
                     }
-                    if (element.type === ActionsBuilder.Type.FLOW_CONTROL && (dragResult.action === _this._viewer.root || (dragResult.action.type === ActionsBuilder.Type.FLOW_CONTROL && dragResult.action.parent.hub === null))) {
+                    //if (element.type === Type.FLOW_CONTROL && (dragResult.action === this._viewer.root || (dragResult.action.type === Type.FLOW_CONTROL && dragResult.action.parent.hub === null))) {
+                    if (element.type === ActionsBuilder.Type.FLOW_CONTROL && dragResult.action === _this._viewer.root) {
                         return;
                     }
                     if (element.type === ActionsBuilder.Type.FLOW_CONTROL && dragResult.action.combineArray !== null) {
@@ -464,6 +468,7 @@ this.createJSON = function () {
     var structure = viewer.utils.createJSON(viewer.root);
     var asText = JSON.stringify(structure);
     actionsBuilderJsonInput.value = asText;
+    console.log(asText);
 };
 this.loadFromJSON = function () {
     var json = actionsBuilderJsonInput.value;
@@ -550,6 +555,8 @@ this.run = function () {
     list.setColorTheme("rgb(64, 64, 64)");
     list.createListsElements();
     list.onResize();
+    // 3ds Max fix
+    viewer.onResize();
 };
 var ActionsBuilder;
 (function (ActionsBuilder) {
@@ -601,6 +608,9 @@ var ActionsBuilder;
             var targetParameterNameSelect = null;
             var propertyPathSelect = null;
             var propertyPathOptionalSelect = null;
+            var booleanSelect = null;
+            var propertyInput = null;
+            var propertyPathIndice = -1;
             if (properties.length === 0) {
                 return;
             }
@@ -633,6 +643,7 @@ var ActionsBuilder;
                     targetParameterNameSelect.onchange = this._parameterTargetNameChanged(targetParameterSelect, targetParameterNameSelect, i);
                 }
                 else if (properties[i].text === "propertyPath") {
+                    propertyPathIndice = i;
                     // Create property path select
                     propertyPathSelect = document.createElement("select");
                     propertyPathSelect.className = "ParametersElementSelectClass";
@@ -642,7 +653,7 @@ var ActionsBuilder;
                     propertyPathOptionalSelect.className = "ParametersElementSelectClass";
                     this.parametersContainer.appendChild(propertyPathOptionalSelect);
                     // Events and configure
-                    (this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, i))(null);
+                    (this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, null, null, i))(null);
                     var property = this._action.propertiesResults[i].value.split(".");
                     if (property.length > 0) {
                         if (property.length === 1) {
@@ -664,7 +675,7 @@ var ActionsBuilder;
                         }
                     }
                     targetParameterSelect.onchange = this._parameterTargetChanged(targetParameterSelect, targetParameterNameSelect, propertyPathSelect, propertyPathOptionalSelect, i - 1);
-                    propertyPathSelect.onchange = this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, i);
+                    propertyPathSelect.onchange = this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, null, null, i);
                     propertyPathOptionalSelect.onchange = this._additionalPropertyPathSelectChanged(propertyPathSelect, propertyPathOptionalSelect, i);
                 }
                 else if (properties[i].text === "operator") {
@@ -686,22 +697,40 @@ var ActionsBuilder;
                     soundSelect.onchange = this._soundSelectChanged(soundSelect, i);
                 }
                 else {
-                    if (propertiesResults[i].value === "true" || propertiesResults[i].value === "false") {
-                        var booleanSelect = document.createElement("select");
-                        booleanSelect.className = "ParametersElementSelectClass";
-                        this.parametersContainer.appendChild(booleanSelect);
-                        // Configure event
-                        (this._booleanSelectChanged(booleanSelect, i))(null);
-                        booleanSelect.value = propertiesResults[i].value;
-                        booleanSelect.onchange = this._booleanSelectChanged(booleanSelect, i);
+                    var isBoolean = propertiesResults[i].value === "true" || propertiesResults[i].value === "false";
+                    var object = this._getObjectFromType(targetParameterSelect.value);
+                    if (object !== null) {
+                        var property = this._action.propertiesResults[i - 1].value.split(".");
+                        for (var j = 0; j < property.length && object !== undefined; j++) {
+                            object = object[property[j]];
+                            if (j === property.length - 1) {
+                                isBoolean = isBoolean || typeof object === "boolean";
+                            }
+                        }
+                    }
+                    booleanSelect = document.createElement("select");
+                    booleanSelect.className = "ParametersElementSelectClass";
+                    this.parametersContainer.appendChild(booleanSelect);
+                    // Configure event
+                    (this._booleanSelectChanged(booleanSelect, i))(null);
+                    booleanSelect.value = propertiesResults[i].value;
+                    booleanSelect.onchange = this._booleanSelectChanged(booleanSelect, i);
+                    propertyInput = document.createElement("input");
+                    propertyInput.value = propertiesResults[i].value;
+                    propertyInput.className = "ParametersElementInputClass";
+                    this.parametersContainer.appendChild(propertyInput);
+                    // Configure event
+                    propertyInput.onkeyup = this._propertyInputChanged(propertyInput, i);
+                    if (propertyPathIndice !== -1 && properties[i].text === "value") {
+                        propertyPathSelect.onchange = this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, booleanSelect, propertyInput, propertyPathIndice);
+                    }
+                    if (isBoolean) {
+                        this._viewer.utils.setElementVisible(booleanSelect, true);
+                        this._viewer.utils.setElementVisible(propertyInput, false);
                     }
                     else {
-                        var propertyInput = document.createElement("input");
-                        propertyInput.value = propertiesResults[i].value;
-                        propertyInput.className = "ParametersElementInputClass";
-                        this.parametersContainer.appendChild(propertyInput);
-                        // Configure event
-                        propertyInput.onkeyup = this._propertyInputChanged(propertyInput, i);
+                        this._viewer.utils.setElementVisible(booleanSelect, false);
+                        this._viewer.utils.setElementVisible(propertyInput, true);
                     }
                 }
             }
@@ -795,7 +824,7 @@ var ActionsBuilder;
         * @param additionalPropertyPathSelect: the additional propertyPath select element
         * @param indice: the properties indice in action.properties
         */
-        Parameters.prototype._propertyPathSelectChanged = function (targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect, indice) {
+        Parameters.prototype._propertyPathSelectChanged = function (targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect, booleanSelect, propertyInput, indice) {
             var _this = this;
             return function (event) {
                 if (propertyPathSelect.options.length === 0) {
@@ -812,6 +841,27 @@ var ActionsBuilder;
                 else {
                     // Set property
                     _this._action.propertiesResults[indice].value = propertyPathSelect.value;
+                    if (booleanSelect !== null && propertyInput !== null) {
+                        var object = _this._getObjectFromType(targetParameterSelect.value);
+                        var isBoolean = false;
+                        if (object !== null) {
+                            var property = _this._action.propertiesResults[indice].value.split(".");
+                            for (var j = 0; j < property.length; j++) {
+                                object = object[property[j]];
+                                if (j === property.length - 1) {
+                                    isBoolean = isBoolean || typeof object === "boolean";
+                                }
+                            }
+                        }
+                        if (isBoolean) {
+                            _this._viewer.utils.setElementVisible(booleanSelect, true);
+                            _this._viewer.utils.setElementVisible(propertyInput, false);
+                        }
+                        else {
+                            _this._viewer.utils.setElementVisible(booleanSelect, false);
+                            _this._viewer.utils.setElementVisible(propertyInput, true);
+                        }
+                    }
                 }
                 // Configure addition property
                 _this._fillAdditionalPropertyPath(targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect);
@@ -897,10 +947,17 @@ var ActionsBuilder;
                         option.value = options[i].targetType;
                         targetParameterSelect.options.add(option);
                     }
+                    targetParameterSelect.value = _this._action.propertiesResults[indice].targetType;
                 }
                 else {
                     _this._action.propertiesResults[indice].targetType = targetParameterSelect.value;
-                    _this._action.propertiesResults[indice].value = "";
+                    var names = _this._getListFromType(targetParameterSelect.value);
+                    if (names !== null && names.length > 0) {
+                        _this._action.propertiesResults[indice].value = names[0];
+                    }
+                    else {
+                        _this._action.propertiesResults[indice].value = "";
+                    }
                     if (propertyPathSelect !== null) {
                         _this._action.propertiesResults[indice + 1].value = ""; // propertyPath
                     }
@@ -915,11 +972,12 @@ var ActionsBuilder;
                         targetParameterNameSelect.options.add(option);
                     }
                 }
+                targetParameterNameSelect.value = _this._action.propertiesResults[indice].value;
                 // Clear property path
                 if (propertyPathSelect !== null) {
                     propertyPathSelect.options.length = 0;
                     additionalPropertyPathSelect.options.length = 0;
-                    _this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect, indice + 1)(null);
+                    _this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect, null, null, indice + 1)(null);
                 }
                 _this._sortList(targetParameterNameSelect);
                 _this._sortList(targetParameterSelect);
@@ -970,21 +1028,37 @@ var ActionsBuilder;
             }
             return null;
         };
+        Parameters.prototype._getListFromType = function (type) {
+            if (type === "MeshProperties" || type === "Mesh") {
+                return ActionsBuilder.SceneElements.MESHES;
+            }
+            if (type === "LightProperties" || type === "Light") {
+                return ActionsBuilder.SceneElements.LIGHTS;
+            }
+            if (type === "CameraProperties" || type === "Camera") {
+                return ActionsBuilder.SceneElements.CAMERAS;
+            }
+            return null;
+        };
         /*
         * Returns the object in function of the given type
         * @param type: the target type
         */
         Parameters.prototype._getObjectFromType = function (type) {
             if (type === "MeshProperties" || type === "Mesh") {
+                this._currentObject = ActionsBuilder.SceneElements.MESH;
                 return ActionsBuilder.SceneElements.MESH;
             }
             if (type === "LightProperties" || type === "Light") {
+                this._currentObject = ActionsBuilder.SceneElements.LIGHT;
                 return ActionsBuilder.SceneElements.LIGHT;
             }
             if (type === "CameraProperties" || type === "Camera") {
+                this._currentObject = ActionsBuilder.SceneElements.CAMERA;
                 return ActionsBuilder.SceneElements.CAMERA;
             }
             if (type === "SceneProperties" || type === "Scene") {
+                this._currentObject = ActionsBuilder.SceneElements.SCENE;
                 return ActionsBuilder.SceneElements.SCENE;
             }
             return null;
@@ -1941,6 +2015,7 @@ var ActionsBuilder;
             this.utils = new ActionsBuilder.Utils(this);
             // Finish
             this.parameters.parametersHelpElement.textContent = Viewer._DEFAULT_INFO_MESSAGE;
+            this.onResize(null);
         }
         Object.defineProperty(Viewer, "NODE_WIDTH", {
             get: function () {

+ 87 - 19
Tools/ActionsBuilder/Sources/actionsbuilder.parameters.js

@@ -48,6 +48,9 @@ var ActionsBuilder;
             var targetParameterNameSelect = null;
             var propertyPathSelect = null;
             var propertyPathOptionalSelect = null;
+            var booleanSelect = null;
+            var propertyInput = null;
+            var propertyPathIndice = -1;
             if (properties.length === 0) {
                 return;
             }
@@ -80,6 +83,7 @@ var ActionsBuilder;
                     targetParameterNameSelect.onchange = this._parameterTargetNameChanged(targetParameterSelect, targetParameterNameSelect, i);
                 }
                 else if (properties[i].text === "propertyPath") {
+                    propertyPathIndice = i;
                     // Create property path select
                     propertyPathSelect = document.createElement("select");
                     propertyPathSelect.className = "ParametersElementSelectClass";
@@ -89,7 +93,7 @@ var ActionsBuilder;
                     propertyPathOptionalSelect.className = "ParametersElementSelectClass";
                     this.parametersContainer.appendChild(propertyPathOptionalSelect);
                     // Events and configure
-                    (this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, i))(null);
+                    (this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, null, null, i))(null);
                     var property = this._action.propertiesResults[i].value.split(".");
                     if (property.length > 0) {
                         if (property.length === 1) {
@@ -111,7 +115,7 @@ var ActionsBuilder;
                         }
                     }
                     targetParameterSelect.onchange = this._parameterTargetChanged(targetParameterSelect, targetParameterNameSelect, propertyPathSelect, propertyPathOptionalSelect, i - 1);
-                    propertyPathSelect.onchange = this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, i);
+                    propertyPathSelect.onchange = this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, null, null, i);
                     propertyPathOptionalSelect.onchange = this._additionalPropertyPathSelectChanged(propertyPathSelect, propertyPathOptionalSelect, i);
                 }
                 else if (properties[i].text === "operator") {
@@ -133,22 +137,40 @@ var ActionsBuilder;
                     soundSelect.onchange = this._soundSelectChanged(soundSelect, i);
                 }
                 else {
-                    if (propertiesResults[i].value === "true" || propertiesResults[i].value === "false") {
-                        var booleanSelect = document.createElement("select");
-                        booleanSelect.className = "ParametersElementSelectClass";
-                        this.parametersContainer.appendChild(booleanSelect);
-                        // Configure event
-                        (this._booleanSelectChanged(booleanSelect, i))(null);
-                        booleanSelect.value = propertiesResults[i].value;
-                        booleanSelect.onchange = this._booleanSelectChanged(booleanSelect, i);
+                    var isBoolean = propertiesResults[i].value === "true" || propertiesResults[i].value === "false";
+                    var object = this._getObjectFromType(targetParameterSelect.value);
+                    if (object !== null) {
+                        var property = this._action.propertiesResults[i - 1].value.split(".");
+                        for (var j = 0; j < property.length && object !== undefined; j++) {
+                            object = object[property[j]];
+                            if (j === property.length - 1) {
+                                isBoolean = isBoolean || typeof object === "boolean";
+                            }
+                        }
+                    }
+                    booleanSelect = document.createElement("select");
+                    booleanSelect.className = "ParametersElementSelectClass";
+                    this.parametersContainer.appendChild(booleanSelect);
+                    // Configure event
+                    (this._booleanSelectChanged(booleanSelect, i))(null);
+                    booleanSelect.value = propertiesResults[i].value;
+                    booleanSelect.onchange = this._booleanSelectChanged(booleanSelect, i);
+                    propertyInput = document.createElement("input");
+                    propertyInput.value = propertiesResults[i].value;
+                    propertyInput.className = "ParametersElementInputClass";
+                    this.parametersContainer.appendChild(propertyInput);
+                    // Configure event
+                    propertyInput.onkeyup = this._propertyInputChanged(propertyInput, i);
+                    if (propertyPathIndice !== -1 && properties[i].text === "value") {
+                        propertyPathSelect.onchange = this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, propertyPathOptionalSelect, booleanSelect, propertyInput, propertyPathIndice);
+                    }
+                    if (isBoolean) {
+                        this._viewer.utils.setElementVisible(booleanSelect, true);
+                        this._viewer.utils.setElementVisible(propertyInput, false);
                     }
                     else {
-                        var propertyInput = document.createElement("input");
-                        propertyInput.value = propertiesResults[i].value;
-                        propertyInput.className = "ParametersElementInputClass";
-                        this.parametersContainer.appendChild(propertyInput);
-                        // Configure event
-                        propertyInput.onkeyup = this._propertyInputChanged(propertyInput, i);
+                        this._viewer.utils.setElementVisible(booleanSelect, false);
+                        this._viewer.utils.setElementVisible(propertyInput, true);
                     }
                 }
             }
@@ -242,7 +264,7 @@ var ActionsBuilder;
         * @param additionalPropertyPathSelect: the additional propertyPath select element
         * @param indice: the properties indice in action.properties
         */
-        Parameters.prototype._propertyPathSelectChanged = function (targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect, indice) {
+        Parameters.prototype._propertyPathSelectChanged = function (targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect, booleanSelect, propertyInput, indice) {
             var _this = this;
             return function (event) {
                 if (propertyPathSelect.options.length === 0) {
@@ -259,6 +281,27 @@ var ActionsBuilder;
                 else {
                     // Set property
                     _this._action.propertiesResults[indice].value = propertyPathSelect.value;
+                    if (booleanSelect !== null && propertyInput !== null) {
+                        var object = _this._getObjectFromType(targetParameterSelect.value);
+                        var isBoolean = false;
+                        if (object !== null) {
+                            var property = _this._action.propertiesResults[indice].value.split(".");
+                            for (var j = 0; j < property.length; j++) {
+                                object = object[property[j]];
+                                if (j === property.length - 1) {
+                                    isBoolean = isBoolean || typeof object === "boolean";
+                                }
+                            }
+                        }
+                        if (isBoolean) {
+                            _this._viewer.utils.setElementVisible(booleanSelect, true);
+                            _this._viewer.utils.setElementVisible(propertyInput, false);
+                        }
+                        else {
+                            _this._viewer.utils.setElementVisible(booleanSelect, false);
+                            _this._viewer.utils.setElementVisible(propertyInput, true);
+                        }
+                    }
                 }
                 // Configure addition property
                 _this._fillAdditionalPropertyPath(targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect);
@@ -344,10 +387,17 @@ var ActionsBuilder;
                         option.value = options[i].targetType;
                         targetParameterSelect.options.add(option);
                     }
+                    targetParameterSelect.value = _this._action.propertiesResults[indice].targetType;
                 }
                 else {
                     _this._action.propertiesResults[indice].targetType = targetParameterSelect.value;
-                    _this._action.propertiesResults[indice].value = "";
+                    var names = _this._getListFromType(targetParameterSelect.value);
+                    if (names !== null && names.length > 0) {
+                        _this._action.propertiesResults[indice].value = names[0];
+                    }
+                    else {
+                        _this._action.propertiesResults[indice].value = "";
+                    }
                     if (propertyPathSelect !== null) {
                         _this._action.propertiesResults[indice + 1].value = ""; // propertyPath
                     }
@@ -362,11 +412,12 @@ var ActionsBuilder;
                         targetParameterNameSelect.options.add(option);
                     }
                 }
+                targetParameterNameSelect.value = _this._action.propertiesResults[indice].value;
                 // Clear property path
                 if (propertyPathSelect !== null) {
                     propertyPathSelect.options.length = 0;
                     additionalPropertyPathSelect.options.length = 0;
-                    _this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect, indice + 1)(null);
+                    _this._propertyPathSelectChanged(targetParameterSelect, propertyPathSelect, additionalPropertyPathSelect, null, null, indice + 1)(null);
                 }
                 _this._sortList(targetParameterNameSelect);
                 _this._sortList(targetParameterSelect);
@@ -417,21 +468,37 @@ var ActionsBuilder;
             }
             return null;
         };
+        Parameters.prototype._getListFromType = function (type) {
+            if (type === "MeshProperties" || type === "Mesh") {
+                return ActionsBuilder.SceneElements.MESHES;
+            }
+            if (type === "LightProperties" || type === "Light") {
+                return ActionsBuilder.SceneElements.LIGHTS;
+            }
+            if (type === "CameraProperties" || type === "Camera") {
+                return ActionsBuilder.SceneElements.CAMERAS;
+            }
+            return null;
+        };
         /*
         * Returns the object in function of the given type
         * @param type: the target type
         */
         Parameters.prototype._getObjectFromType = function (type) {
             if (type === "MeshProperties" || type === "Mesh") {
+                this._currentObject = ActionsBuilder.SceneElements.MESH;
                 return ActionsBuilder.SceneElements.MESH;
             }
             if (type === "LightProperties" || type === "Light") {
+                this._currentObject = ActionsBuilder.SceneElements.LIGHT;
                 return ActionsBuilder.SceneElements.LIGHT;
             }
             if (type === "CameraProperties" || type === "Camera") {
+                this._currentObject = ActionsBuilder.SceneElements.CAMERA;
                 return ActionsBuilder.SceneElements.CAMERA;
             }
             if (type === "SceneProperties" || type === "Scene") {
+                this._currentObject = ActionsBuilder.SceneElements.SCENE;
                 return ActionsBuilder.SceneElements.SCENE;
             }
             return null;
@@ -481,3 +548,4 @@ var ActionsBuilder;
     })();
     ActionsBuilder.Parameters = Parameters;
 })(ActionsBuilder || (ActionsBuilder = {}));
+//# sourceMappingURL=actionsbuilder.parameters.js.map

+ 1 - 0
Tools/ActionsBuilder/Sources/actionsbuilder.toolbar.js

@@ -83,3 +83,4 @@ var ActionsBuilder;
     })();
     ActionsBuilder.Toolbar = Toolbar;
 })(ActionsBuilder || (ActionsBuilder = {}));
+//# sourceMappingURL=actionsbuilder.toolbar.js.map

+ 1 - 0
Tools/ActionsBuilder/Sources/actionsbuilder.utils.js

@@ -431,3 +431,4 @@ var ActionsBuilder;
     })();
     ActionsBuilder.Utils = Utils;
 })(ActionsBuilder || (ActionsBuilder = {}));
+//# sourceMappingURL=actionsbuilder.utils.js.map

+ 2 - 0
Tools/ActionsBuilder/Sources/actionsbuilder.viewer.js

@@ -36,6 +36,7 @@ var ActionsBuilder;
             this.utils = new ActionsBuilder.Utils(this);
             // Finish
             this.parameters.parametersHelpElement.textContent = Viewer._DEFAULT_INFO_MESSAGE;
+            this.onResize(null);
         }
         Object.defineProperty(Viewer, "NODE_WIDTH", {
             get: function () {
@@ -644,3 +645,4 @@ var ActionsBuilder;
     })();
     ActionsBuilder.Viewer = Viewer;
 })(ActionsBuilder || (ActionsBuilder = {}));
+//# sourceMappingURL=actionsbuilder.viewer.js.map

+ 0 - 0
Tools/ActionsBuilder/Sources/babylon.max.js


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