فهرست منبع

Merge pull request #1 from BabylonJS/master

update my repo
Wingnutt 8 سال پیش
والد
کامیت
d82ae0f038
100فایلهای تغییر یافته به همراه2055 افزوده شده و 1036 حذف شده
  1. 38 1
      .gitignore
  2. 59 0
      .vscode/launch.json
  3. 38 0
      .vscode/settings.json
  4. 29 0
      .vscode/tasks.json
  5. 571 0
      Babylon.csproj
  6. 34 0
      Babylon.sln
  7. 0 0
      Exporters/3ds Max/ActionsBuilder/README.md
  8. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.actionNode.js
  9. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.contextMenu.js
  10. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.js
  11. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.list.js
  12. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.main.js
  13. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.max.js
  14. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.parameters.js
  15. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.toolbar.js
  16. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.utils.js
  17. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.viewer.js
  18. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/babylon.max.js
  19. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts.css
  20. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.eot
  21. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.otf
  22. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.svg
  23. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.ttf
  24. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.woff
  25. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.eot
  26. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.otf
  27. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.svg
  28. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.ttf
  29. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.woff
  30. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.eot
  31. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.otf
  32. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.svg
  33. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.ttf
  34. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.woff
  35. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.eot
  36. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.otf
  37. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.svg
  38. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.ttf
  39. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.woff
  40. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans_NOTICE.txt
  41. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/index-debug.html
  42. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/index.css
  43. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/index.html
  44. 0 0
      Exporters/3ds Max/ActionsBuilder/Sources/raphael.js
  45. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.actionNode.ts
  46. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.contextMenu.ts
  47. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.list.ts
  48. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.main.ts
  49. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.parameters.ts
  50. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.toolbar.ts
  51. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.ts
  52. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.utils.ts
  53. 0 0
      Exporters/3ds Max/ActionsBuilder/actionsbuilder.viewer.ts
  54. 0 0
      Exporters/3ds Max/ActionsBuilder/gulpfile.js
  55. 0 0
      Exporters/3ds Max/ActionsBuilder/package.json
  56. 0 0
      Exporters/3ds Max/ActionsBuilder/raphaeljs.d.ts
  57. 6 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonCamera.cs
  58. 37 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonHDRCubeTexture.cs
  59. 6 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonLight.cs
  60. 4 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonMaterial.cs
  61. 6 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonMesh.cs
  62. 17 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonPBRMaterial.cs
  63. 6 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonParticleSystem.cs
  64. 11 1
      Exporters/3ds Max/BabylonExport.Entities/BabylonScene.cs
  65. 99 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonShaderMaterial.cs
  66. 11 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonStandardMaterial.cs
  67. 4 1
      Exporters/3ds Max/BabylonExport.Entities/BabylonTexture.cs
  68. 35 0
      Exporters/3ds Max/BabylonExport.Entities/BabylonUniversalCamera.cs
  69. BIN
      Exporters/Blender/Blender2Babylon-5.0.zip
  70. BIN
      Exporters/Blender/Blender2Babylon-5.1.zip
  71. 0 89
      Exporters/Blender/src/__init__.py
  72. 90 0
      Exporters/Blender/src/babylon-js/__init__.py
  73. 0 0
      Exporters/Blender/src/babylon-js/animation.py
  74. 0 0
      Exporters/Blender/src/babylon-js/armature.py
  75. 0 0
      Exporters/Blender/src/babylon-js/camera.py
  76. 70 0
      Exporters/Blender/src/babylon-js/exporter_settings_panel.py
  77. 0 0
      Exporters/Blender/src/babylon-js/f_curve_animatable.py
  78. 297 0
      Exporters/Blender/src/babylon-js/json_exporter.py
  79. 0 0
      Exporters/Blender/src/babylon-js/light_shadow.py
  80. 0 0
      Exporters/Blender/src/babylon-js/logger.py
  81. 577 0
      Exporters/Blender/src/babylon-js/material.py
  82. 0 0
      Exporters/Blender/src/babylon-js/mesh.py
  83. 0 0
      Exporters/Blender/src/babylon-js/package_level.py
  84. 0 0
      Exporters/Blender/src/babylon-js/sound.py
  85. 0 0
      Exporters/Blender/src/babylon-js/world.py
  86. 0 70
      Exporters/Blender/src/exporter_settings_panel.py
  87. 0 297
      Exporters/Blender/src/json_exporter.py
  88. 0 577
      Exporters/Blender/src/material.py
  89. 10 0
      Exporters/Blender/zip_media.xml
  90. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/BabylonExport.Entities.dll
  91. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/ExportationOptions.cs
  92. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/ExporterWindow.cs
  93. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/Ionic.Zip.dll
  94. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/JsonFx.Json.dll
  95. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/JsonFx.dll
  96. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/SceneBuilder.Animations.cs
  97. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/SceneBuilder.Cameras.cs
  98. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/SceneBuilder.Lights.cs
  99. 0 0
      Exporters/Unity 5/Deprecated/Unity3D2Babylon/SceneBuilder.Materials.cs
  100. 0 0
      Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.Meshes.cs

+ 38 - 1
.gitignore

@@ -14,6 +14,17 @@ TestResults
 *.sln.docstates
 *.map
 
+# javascript files
+src/**/*.js
+src/**/*.d.ts
+loaders/src/**/*.js
+materialsLibrary/src/**/*.js
+proceduralTexturesLibrary/src/**/*.js
+postProcessLibrary/src/**/*.js
+canvas2D/src/**/*.js
+inspector/src/**/*.js
+serializers/src/**/*.js
+
 # Build results
 [Dd]ebug/
 [Rr]elease/
@@ -104,6 +115,19 @@ ClientBin
 *.dbmdl
 Generated_Code #added for RIA/Silverlight projects
 
+# OS or Editor folders
+*.DS_Store
+._*
+Thumbs.db
+.cache
+.tmproj
+nbproject
+*.sublime-project
+*.sublime-workspace
+.directory
+build
+.history
+
 # Backup & report files from converting an old project file to a newer
 # Visual Studio version. Backup files are not needed, because we have git ;-)
 _UpgradeReport_Files/
@@ -121,10 +145,23 @@ UpgradeLog*.XML
 
 # Do not ignore loaders/obj
 !loaders/*
+**/node_modules
 node_modules
 
 # for JetBrains IDE
 .idea
 
 # for VSCode
-.vscode
+.vs
+.tempChromeProfileForDebug
+.temp
+*.js.map
+*.js.fx
+*.d.ts
+!dist/**/*.d.ts
+!lib.d.ts
+
+# local dev
+localDev/src/*
+/dist/preview release/babylon.custom.js
+/dist/preview release/babylon.custom.max.js

+ 59 - 0
.vscode/launch.json

@@ -0,0 +1,59 @@
+{
+    "version": "0.1.0",
+    "configurations": [
+        {
+            "name": "Launch playground (Chrome)",
+            "type": "chrome",
+            "request": "launch",
+            "url": "http://localhost:1338/Playground/index-local.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug"
+        },
+        {
+            "name": "Launch Materials Library (Chrome)",
+            "type": "chrome",
+            "request": "launch",
+            "url": "http://localhost:1338/materialsLibrary/index.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug"
+        },
+        {
+            "name": "Launch Post Processes Library (Chrome)",
+            "type": "chrome",
+            "request": "launch",
+            "url": "http://localhost:1338/postProcessLibrary/index.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug"
+        },
+        {
+            "name": "Launch Procedural Textures Library (Chrome)",
+            "type": "chrome",
+            "request": "launch",
+            "url": "http://localhost:1338/proceduralTexturesLibrary/index.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug"
+        },
+        {
+            "name": "Launch Inspector (Chrome)",
+            "type": "chrome",
+            "request": "launch",
+            "url": "http://localhost:1338/inspector/index.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug"
+        },
+        {
+            "name": "Launch Local Dev (Chrome)",
+            "type": "chrome",
+            "request": "launch",
+            "url": "http://localhost:1338/localDev/index.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug"
+        }
+    ]
+}

+ 38 - 0
.vscode/settings.json

@@ -0,0 +1,38 @@
+// Place your settings in this file to overwrite default and user settings.
+{
+    // Configure glob patterns for excluding files and folders.
+    "files.exclude": {
+        "**/.git": true,
+        "**/.svn": true,
+        "**/.hg": true,
+        "**/.DS_Store": true,
+        "**/.vs": true,        
+        "**/.tempChromeProfileForDebug": true,
+        "**/node_modules": true,
+        "**/temp": true,
+        "**/.temp": true,
+        "**/*.d.ts": true,
+        "**/*.js.map": true,
+        "**/*.js.fx": true,
+        "**/*.js": { 
+            "when":"$(basename).ts"
+        }
+    },
+    "files.associations": {
+        "*.fx": "glsl"
+    },
+    "search.exclude": {
+        "**/node_modules": true,
+        "**/bower_components": true,
+        "**/.vs": true,
+        "**/.tempChromeProfileForDebug": true,
+        "**/.temp": true,
+        "**/dist": true,
+        "**/*.map": true,
+        "**/*.js": { 
+             "when":"$(basename).ts"
+         },
+        "**/*.d.ts": true
+    },
+    "typescript.check.workspaceVersion": false
+}

+ 29 - 0
.vscode/tasks.json

@@ -0,0 +1,29 @@
+{
+    // See https://go.microsoft.com/fwlink/?LinkId=733558
+    // for the documentation about the tasks.json format
+    "version": "0.1.0",
+    "command": "gulp",
+    "isShellCommand": true,
+    "args": [],
+    "showOutput": "always",
+    "options": {
+        "cwd": "${workspaceRoot}/Tools/Gulp"
+    },
+    "tasks": [
+        { 
+            "taskName": "run",
+            // Hijack Test Command for easy shortcut
+            "isTestCommand": true,
+            "problemMatcher": [
+                "$tsc"
+            ]
+        },
+        { 
+            "taskName": "typescript-all",
+            "isBuildCommand": true,
+            "problemMatcher": [
+                "$tsc"
+            ]
+        }
+    ]
+}

+ 571 - 0
Babylon.csproj

@@ -0,0 +1,571 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>
+    </ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}</ProjectGuid>
+    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>BabylonExport</RootNamespace>
+    <AssemblyName>Babylon</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <UseIISExpress>true</UseIISExpress>
+    <IISExpressSSLPort />
+    <IISExpressAnonymousAuthentication />
+    <IISExpressWindowsAuthentication />
+    <IISExpressUseClassicPipelineMode />
+    <SccProjectName>SAK</SccProjectName>
+    <SccLocalPath>SAK</SccLocalPath>
+    <SccAuxPath>SAK</SccAuxPath>
+    <SccProvider>SAK</SccProvider>
+    <TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>
+    <UseGlobalApplicationHostFile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Web.DynamicData" />
+    <Reference Include="System.Web.Entity" />
+    <Reference Include="System.Web.ApplicationServices" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Web" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Web.Services" />
+    <Reference Include="System.EnterpriseServices" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Playground\babylon.d.txt" />
+    <Content Include="Playground\debug.html" />
+    <Content Include="Playground\index-local.html" />
+    <Content Include="Playground\sounds\gunshot.wav" />
+    <Content Include="Playground\sounds\violons11.wav" />
+    <Content Include="Playground\textures\albedo.png" />
+    <Content Include="Playground\textures\reflectivity.png" />
+    <Content Include="Playground\textures\room.hdr" />
+    <Content Include="Playground\package.json" />
+    <Content Include="src\Shaders\glowBlurPostProcess.fragment.fx" />
+    <Content Include="src\Shaders\glowMapGeneration.fragment.fx" />
+    <Content Include="src\Shaders\glowMapGeneration.vertex.fx" />
+    <Content Include="src\Shaders\glowMapMerge.fragment.fx" />
+    <Content Include="src\Shaders\glowMapMerge.vertex.fx" />
+    <None Include="Web.Debug.config">
+      <DependentUpon>Web.config</DependentUpon>
+    </None>
+    <None Include="Web.Release.config">
+      <DependentUpon>Web.config</DependentUpon>
+    </None>
+    <Content Include="Playground\frame.css" />
+    <Content Include="Playground\frame.js" />
+    <Content Include="Playground\scripts\pbr.js" />
+    <Content Include="Playground\scripts\refraction and reflection.js" />
+    <Content Include="Playground\frame.html" />
+    <Content Include="Playground\textures\mask.png" />
+    <Content Include="Playground\hand.minified-1.2.js" />
+    <Content Include="Playground\textures\equirectangular.jpg" />
+    <Content Include="Playground\textures\sphereMap.png" />
+    <Content Include="Playground\textures\waterbump.png" />
+    <TypeScriptCompile Include="src\Actions\babylon.action.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.actionManager.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.condition.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.directActions.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.interpolateValueAction.ts" />
+    <TypeScriptCompile Include="src\Animations\babylon.easing.ts" />
+    <TypeScriptCompile Include="src\Audio\babylon.analyser.ts" />
+    <TypeScriptCompile Include="src\Audio\babylon.audioEngine.ts" />
+    <TypeScriptCompile Include="src\Audio\babylon.sound.ts" />
+    <TypeScriptCompile Include="src\Audio\babylon.soundtrack.ts" />
+    <TypeScriptCompile Include="src\Bones\babylon.bone.ts" />
+    <TypeScriptCompile Include="src\Bones\babylon.skeleton.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.arcRotateCameraInputsManager.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.cameraInputsManager.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.followCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.freeCameraInputsManager.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.gamepadCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.stereoscopicCameras.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.targetCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.universalCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.touchCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.deviceOrientationCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.virtualJoysticksCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.arcrotatecamera.input.gamepad.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.arcrotatecamera.input.keyboard.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.arcrotatecamera.input.mousewheel.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.arcrotatecamera.input.pointers.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.freecamera.input.deviceorientation.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.freecamera.input.gamepad.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.freecamera.input.keyboard.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.freecamera.input.mouse.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.freecamera.input.touch.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.freecamera.input.virtualjoystick.ts" />
+    <TypeScriptCompile Include="src\Cameras\Inputs\babylon.arcrotatecamera.input.vrdeviceorientation.ts" />
+    <TypeScriptCompile Include="src\Cameras\VR\babylon.vrCameraMetrics.ts" />
+    <TypeScriptCompile Include="src\Cameras\VR\babylon.vrDeviceOrientationCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\VR\babylon.webVRCamera.ts" />
+    <TypeScriptCompile Include="src\Collisions\babylon.collisionCoordinator.ts" />
+    <TypeScriptCompile Include="src\Collisions\babylon.collisionWorker.ts" />
+    <TypeScriptCompile Include="src\Culling\babylon.ray.ts" />
+    <TypeScriptCompile Include="src\Debug\babylon.axesViewer.ts" />
+    <TypeScriptCompile Include="src\Debug\babylon.boneAxesViewer.ts" />
+    <TypeScriptCompile Include="src\Debug\babylon.skeletonViewer.ts" />
+    <TypeScriptCompile Include="src\Debug\babylon.debugLayer.ts" />
+    <TypeScriptCompile Include="src\Layer\babylon.highlightlayer.ts" />
+    <TypeScriptCompile Include="src\Loading\babylon.sceneLoader.ts" />
+    <TypeScriptCompile Include="src\Loading\Plugins\babylon.babylonFileLoader.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.colorCurves.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.effect.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.fresnelParameters.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.material.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.materialHelper.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.multiMaterial.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.pbrMaterial.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.shaderMaterial.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.standardMaterial.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.baseTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.colorGradingTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.cubeTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.dynamicTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.fontTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.mapTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.refractionTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.mirrorTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.rawTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.renderTargetTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.texture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.videoTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.hdrCubeTexture.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.buffer.ts" />
+    <TypeScriptCompile Include="src\Physics\babylon.physicsImpostor.ts" />
+    <TypeScriptCompile Include="src\Physics\babylon.physicsJoint.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.standardRenderingPipeline.ts" />
+    <TypeScriptCompile Include="src\States\babylon.alphaCullingState.ts" />
+    <TypeScriptCompile Include="src\States\babylon.depthCullingState.ts" />
+    <TypeScriptCompile Include="src\States\babylon.stencilState.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.decorators.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.dynamicFloatArray.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.earcut.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.observable.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.rectPackingMap.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.stringDictionary.ts" />
+    <TypeScriptCompile Include="src\Tools\HDR\babylon.tools.cubemapToSphericalPolynomial.ts" />
+    <TypeScriptCompile Include="src\Tools\HDR\babylon.tools.hdr.ts" />
+    <TypeScriptCompile Include="src\Tools\HDR\babylon.tools.panoramaToCubemap.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\Procedurals\babylon.customProceduralTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\Procedurals\babylon.proceduralTexture.ts" />
+    <TypeScriptCompile Include="src\Math\babylon.math.SIMD.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.abstractMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.geometry.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.groundMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.instancedMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.linesMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.meshBuilder.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.meshLODLevel.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.meshSimplification.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.polygonMesh.ts" />
+    <TypeScriptCompile Include="src\Particles\babylon.solidParticle.ts" />
+    <TypeScriptCompile Include="src\Particles\babylon.solidParticleSystem.ts" />
+    <TypeScriptCompile Include="src\Physics\Plugins\babylon.oimoJSPlugin.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.colorCorrectionPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.displayPassPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.filterPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.convolutionPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.fxaaPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.hdrRenderingPipeline.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.lensRenderingPipeline.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.ssaoRenderingPipeline.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.stereoscopicInterlacePostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.tonemapPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.volumetricLightScatteringPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.vrDistortionCorrectionPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.refractionPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\RenderPipeline\babylon.postProcessRenderEffect.ts" />
+    <TypeScriptCompile Include="src\PostProcess\RenderPipeline\babylon.postProcessRenderPass.ts" />
+    <Content Include="Playground\splitbox.css" />
+    <Content Include="Playground\splitbox.js" />
+    <Content Include="Playground\textures\amiga.jpg" />
+    <Content Include="Playground\textures\grass.dds" />
+    <Content Include="Playground\textures\specmap.png" />
+    <Content Include="Playground\textures\specularglossymap.png" />
+    <Content Include="Playground\xtag.min.js" />
+    <Content Include="src\Shaders\anaglyph.fragment.fx" />
+    <Content Include="src\Shaders\chromaticAberration.fragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\colorCurves.fx" />
+    <Content Include="src\Shaders\ShadersInclude\colorCurvesDefinition.fx" />
+    <Content Include="src\Shaders\ShadersInclude\colorGrading.fx" />
+    <Content Include="src\Shaders\ShadersInclude\colorGradingDefinition.fx" />
+    <Content Include="src\Shaders\standard.fragment.fx" />
+    <Content Include="src\Shaders\legacypbr.fragment.fx" />
+    <Content Include="src\Shaders\legacypbr.vertex.fx" />
+    <Content Include="src\Shaders\line.fragment.fx" />
+    <Content Include="src\Shaders\line.vertex.fx" />
+    <Content Include="src\Shaders\colorCorrection.fragment.fx" />
+    <Content Include="src\Shaders\depthBoxBlur.fragment.fx" />
+    <Content Include="src\Shaders\depthOfField.fragment.fx" />
+    <Content Include="src\Shaders\hdr.fragment.fx" />
+    <Content Include="src\Shaders\lensHighlights.fragment.fx" />
+    <Content Include="src\Shaders\pbr.fragment.fx" />
+    <Content Include="src\Shaders\pbr.vertex.fx" />
+    <Content Include="src\Shaders\procedural.vertex.fx" />
+    <Content Include="src\Shaders\outline.fragment.fx" />
+    <Content Include="src\Shaders\color.fragment.fx" />
+    <Content Include="src\Shaders\outline.vertex.fx" />
+    <Content Include="src\Shaders\color.vertex.fx" />
+    <Content Include="src\Shaders\displayPass.fragment.fx" />
+    <Content Include="src\Shaders\filter.fragment.fx" />
+    <Content Include="src\Shaders\convolution.fragment.fx" />
+    <Content Include="src\Shaders\blackAndWhite.fragment.fx" />
+    <Content Include="src\Shaders\fxaa.fragment.fx" />
+    <Content Include="src\Shaders\lensFlare.fragment.fx" />
+    <Content Include="src\Shaders\lensFlare.vertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\bumpFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\clipPlaneFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\clipPlaneVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\clipPlaneFragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\clipPlaneVertexDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\harmonicsFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\helperFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\lightFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\pbrFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\pbrLightFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\pbrLightFunctionsCall.fx" />
+    <Content Include="src\Shaders\ShadersInclude\pbrShadowFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\reflectionFunction.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fresnelFunction.fx" />
+    <Content Include="src\Shaders\ShadersInclude\pointCloudVertexDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\pointCloudVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\logDepthDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\logDepthFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\logDepthVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\lightsFragmentFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\lightFragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\bumpFragmentFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\shadowsVertexDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\shadowsVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\shadowsFragmentFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fogVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fogVertexDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fogFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fogFragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\instancesVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\instancesDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\bonesVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\bonesDeclaration.fx" />
+    <Content Include="src\Shaders\stereoscopicInterlace.fragment.fx" />
+    <Content Include="src\Shaders\tonemap.fragment.fx" />
+    <Content Include="src\Shaders\vrDistortionCorrection.fragment.fx" />
+    <Content Include="src\Shaders\pass.fragment.fx" />
+    <Content Include="src\Shaders\refraction.fragment.fx" />
+    <TypeScriptCompile Include="src\PostProcess\RenderPipeline\babylon.postProcessRenderPipeline.ts" />
+    <TypeScriptCompile Include="src\PostProcess\RenderPipeline\babylon.postProcessRenderPipelineManager.ts" />
+    <TypeScriptCompile Include="src\Probes\babylon.reflectionProbe.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.boundingBoxRenderer.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.depthRenderer.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.edgesRenderer.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.outlineRenderer.ts" />
+    <Content Include="src\Shaders\depth.fragment.fx" />
+    <Content Include="src\Shaders\shadowMap.vertex.fx" />
+    <Content Include="src\Shaders\ssao.fragment.fx" />
+    <Content Include="src\Shaders\ssaoCombine.fragment.fx" />
+    <Content Include="src\Shaders\volumetricLightScattering.fragment.fx" />
+    <Content Include="src\Shaders\volumetricLightScatteringPass.fragment.fx" />
+    <TypeScriptCompile Include="src\Tools\babylon.assetsManager.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.filesInput.ts" />
+    <Content Include="Playground\scripts\hdr rendering pipeline.js" />
+    <Content Include="Playground\bootstrap\css\bootstrap-responsive.css" />
+    <Content Include="Playground\bootstrap\css\bootstrap-responsive.min.css" />
+    <Content Include="Playground\bootstrap\css\bootstrap.css" />
+    <Content Include="Playground\bootstrap\css\bootstrap.min.css" />
+    <Content Include="Playground\bootstrap\img\glyphicons-halflings-white.png" />
+    <Content Include="Playground\bootstrap\img\glyphicons-halflings.png" />
+    <Content Include="Playground\bootstrap\js\bootstrap.js" />
+    <Content Include="Playground\bootstrap\js\bootstrap.min.js" />
+    <Content Include="Playground\fileSaver.js" />
+    <Content Include="Playground\index.css" />
+    <Content Include="Playground\index.html" />
+    <Content Include="Playground\scenes\0.jpg" />
+    <Content Include="Playground\scenes\Dude\0.jpg" />
+    <Content Include="Playground\scenes\Dude\1.jpg" />
+    <Content Include="Playground\scenes\Dude\2.jpg" />
+    <Content Include="Playground\scenes\Dude\3.jpg" />
+    <Content Include="Playground\scripts\Easing functions.js" />
+    <Content Include="Playground\scripts\proceduralTexture.js" />
+    <Content Include="Playground\scripts\ssao rendering pipeline.js" />
+    <Content Include="Playground\scripts\volumetric light scattering.js" />
+    <Content Include="Playground\index.js" />
+    <Content Include="Playground\jszip.min.js" />
+    <Content Include="Playground\scripts\drag and drop.js" />
+    <Content Include="Playground\scripts\actions.js" />
+    <Content Include="Playground\scripts\Environment.js" />
+    <Content Include="Playground\scripts\cameras.js" />
+    <Content Include="Playground\scripts\collisions.js" />
+    <Content Include="Playground\scripts\height Map.js" />
+    <Content Include="Playground\scripts\import meshes.js" />
+    <Content Include="Playground\scripts\Intersections.js" />
+    <Content Include="Playground\scripts\fresnel.js" />
+    <Content Include="Playground\scripts\lights.js" />
+    <Content Include="Playground\scripts\particles.js" />
+    <Content Include="Playground\scripts\rotation and scaling.js" />
+    <Content Include="Playground\scripts\basic elements.js" />
+    <Content Include="Playground\scripts\basic scene.js" />
+    <Content Include="Playground\scripts\materials.js" />
+    <Content Include="Playground\scripts\animations.js" />
+    <Content Include="Playground\scripts\scripts.txt" />
+    <Content Include="Playground\scripts\shadows.js" />
+    <Content Include="Playground\scripts\sprites.js" />
+    <Content Include="Playground\textures\babylonjs.mp4" />
+    <Content Include="Playground\textures\bloc.jpg" />
+    <Content Include="Playground\textures\cloud.png" />
+    <Content Include="Playground\textures\crate.png" />
+    <Content Include="Playground\textures\customProceduralTextures\land\custom.fragment.fx" />
+    <Content Include="Playground\textures\customProceduralTextures\land\textures\dirt.jpg" />
+    <Content Include="Playground\textures\customProceduralTextures\land\textures\grass.png" />
+    <Content Include="Playground\textures\earth.jpg" />
+    <Content Include="Playground\textures\flare.png" />
+    <Content Include="Playground\textures\grass.jpg" />
+    <Content Include="Playground\textures\ground.jpg" />
+    <Content Include="Playground\textures\heightMap.png" />
+    <Content Include="Playground\textures\impact.png" />
+    <Content Include="Playground\textures\normalMap.jpg" />
+    <Content Include="Playground\textures\orient.jpg" />
+    <Content Include="Playground\textures\palm.png" />
+    <Content Include="Playground\textures\player.png" />
+    <Content Include="Playground\textures\skybox_nx.jpg" />
+    <Content Include="Playground\textures\skybox_ny.jpg" />
+    <Content Include="Playground\textures\skybox_nz.jpg" />
+    <Content Include="Playground\textures\skybox_px.jpg" />
+    <Content Include="Playground\textures\skybox_py.jpg" />
+    <Content Include="Playground\textures\skybox_pz.jpg" />
+    <Content Include="Playground\textures\sun.png" />
+    <Content Include="Playground\textures\tree.png" />
+    <Content Include="Playground\textures\misc.jpg" />
+    <Content Include="Playground\textures\TropicalSunnyDay_ny.jpg" />
+    <Content Include="Playground\textures\TropicalSunnyDay_nx.jpg" />
+    <Content Include="Playground\textures\TropicalSunnyDay_nz.jpg" />
+    <Content Include="Playground\textures\TropicalSunnyDay_px.jpg" />
+    <Content Include="Playground\textures\TropicalSunnyDay_py.jpg" />
+    <Content Include="Playground\textures\TropicalSunnyDay_pz.jpg" />
+    <Content Include="Playground\textures\worldHeightMap.jpg" />
+    <Content Include="Playground\textures\xStrip.jpg" />
+    <Content Include="Playground\textures\yStrip.jpg" />
+    <Content Include="Playground\textures\zStrip.jpg" />
+    <Content Include="Playground\zipContent\index.html" />
+    <Content Include="src\Shaders\blur.fragment.fx" />
+    <Content Include="src\Shaders\postprocess.vertex.fx" />
+    <Content Include="src\Shaders\shadowMap.fragment.fx" />
+    <Content Include="src\Shaders\depth.vertex.fx" />
+    <Content Include="src\Shaders\layer.fragment.fx" />
+    <Content Include="src\Shaders\layer.vertex.fx" />
+    <Content Include="src\Shaders\particles.fragment.fx" />
+    <Content Include="src\Shaders\particles.vertex.fx" />
+    <Content Include="src\Shaders\sprites.fragment.fx" />
+    <Content Include="src\Shaders\sprites.vertex.fx" />
+    <Content Include="Playground\scripts\picking.js" />
+    <Content Include="Web.config">
+      <SubType>Designer</SubType>
+    </Content>
+    <TypeScriptCompile Include="src\Tools\babylon.gamepads.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.database.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.loadingScreen.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.sceneOptimizer.ts" />
+    <TypeScriptCompile Include="src\Tools\HDR\babylon.tools.pmremGenerator.ts" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="src\Shaders\default.fragment.fx" />
+    <Content Include="src\Shaders\default.vertex.fx" />
+    <Content Include="Playground\textures\babylonjs.webm" />
+    <Content Include="Playground\scenes\skull.babylon" />
+    <Content Include="Playground\textures\customProceduralTextures\land\config.json" />
+    <Content Include="Playground\scenes\SSAOcat.babylon" />
+    <Content Include="Playground\scenes\Rabbit.babylon" />
+    <Content Include="Playground\scenes\Dude\dude.babylon" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Properties\" />
+  </ItemGroup>
+  <ItemGroup>
+    <TypeScriptCompile Include="src\Animations\babylon.animatable.ts" />
+    <TypeScriptCompile Include="src\Animations\babylon.animation.ts" />
+    <TypeScriptCompile Include="src\babylon.engine.ts" />
+    <TypeScriptCompile Include="src\babylon.mixins.ts" />
+    <TypeScriptCompile Include="src\babylon.scene.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.arcRotateCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.camera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.freeCamera.ts" />
+    <TypeScriptCompile Include="src\Collisions\babylon.collider.ts" />
+    <TypeScriptCompile Include="src\Collisions\babylon.pickingInfo.ts" />
+    <TypeScriptCompile Include="src\Culling\babylon.boundingBox.ts" />
+    <TypeScriptCompile Include="src\Culling\babylon.boundingInfo.ts" />
+    <TypeScriptCompile Include="src\Culling\babylon.boundingSphere.ts" />
+    <TypeScriptCompile Include="src\Culling\Octrees\babylon.octree.ts" />
+    <TypeScriptCompile Include="src\Culling\Octrees\babylon.octreeBlock.ts" />
+    <TypeScriptCompile Include="src\Layer\babylon.layer.ts" />
+    <TypeScriptCompile Include="src\LensFlare\babylon.lensFlare.ts" />
+    <TypeScriptCompile Include="src\LensFlare\babylon.lensFlareSystem.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.directionalLight.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.hemisphericLight.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.light.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.pointLight.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.spotLight.ts" />
+    <TypeScriptCompile Include="src\Lights\Shadows\babylon.shadowGenerator.ts" />
+    <TypeScriptCompile Include="src\Math\babylon.math.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.csg.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.mesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.mesh.vertexData.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.subMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.vertexBuffer.ts" />
+    <TypeScriptCompile Include="src\babylon.node.ts" />
+    <TypeScriptCompile Include="src\Particles\babylon.particle.ts" />
+    <TypeScriptCompile Include="src\Particles\babylon.particleSystem.ts" />
+    <TypeScriptCompile Include="src\Physics\babylon.physicsEngine.ts" />
+    <TypeScriptCompile Include="src\Physics\Plugins\babylon.cannonJSPlugin.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.anaglyphPostProcess.ts">
+      <SubType>Code</SubType>
+    </TypeScriptCompile>
+    <TypeScriptCompile Include="src\PostProcess\babylon.blackAndWhitePostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.blurPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.passPostProcess.ts">
+      <SubType>Code</SubType>
+    </TypeScriptCompile>
+    <TypeScriptCompile Include="src\PostProcess\babylon.postProcess.ts">
+      <SubType>Code</SubType>
+    </TypeScriptCompile>
+    <TypeScriptCompile Include="src\PostProcess\babylon.postProcessManager.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.renderingGroup.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.renderingManager.ts" />
+    <TypeScriptCompile Include="src\Sprites\babylon.sprite.ts" />
+    <TypeScriptCompile Include="src\Sprites\babylon.spriteManager.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.andOrNotEvaluator.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.sceneSerializer.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.smartArray.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.tags.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.tools.dds.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.tools.tga.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.tools.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.virtualJoystick.ts" />
+  </ItemGroup>
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
+    <TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
+    <TypeScriptModuleKind>none</TypeScriptModuleKind>
+    <TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
+    <TypeScriptTarget>ES5</TypeScriptTarget>
+    <TypeScriptCompileOnSaveEnabled>False</TypeScriptCompileOnSaveEnabled>
+    <TypeScriptRemoveComments>False</TypeScriptRemoveComments>
+    <TypeScriptOutFile />
+    <TypeScriptOutDir />
+    <TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
+    <TypeScriptSourceMap>True</TypeScriptSourceMap>
+    <TypeScriptMapRoot />
+    <TypeScriptSourceRoot />
+    <TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
+    <TypeScriptTarget>ES5</TypeScriptTarget>
+  </PropertyGroup>
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
+  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+        <WebProjectProperties>
+          <UseIIS>True</UseIIS>
+          <AutoAssignPort>True</AutoAssignPort>
+          <DevelopmentServerPort>0</DevelopmentServerPort>
+          <DevelopmentServerVPath>/</DevelopmentServerVPath>
+          <IISUrl>http://localhost:51793/</IISUrl>
+          <NTLMAuthentication>False</NTLMAuthentication>
+          <UseCustomServer>False</UseCustomServer>
+          <CustomServerUrl>
+          </CustomServerUrl>
+          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+        </WebProjectProperties>
+      </FlavorProperties>
+      <UserProperties node__modules_2grunt-contrib-uglify_2package_1json__JSONSchema="http://json.schemastore.org/package" />
+    </VisualStudio>
+  </ProjectExtensions>
+  <PropertyGroup>
+    <PreBuildEvent>
+    </PreBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 34 - 0
Babylon.sln

@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.25914.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Babylon", "Babylon.csproj", "{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Debug|x64.ActiveCfg = Debug|x64
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Debug|x64.Build.0 = Debug|x64
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Debug|x86.ActiveCfg = Debug|x86
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Debug|x86.Build.0 = Debug|x86
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Release|x64.ActiveCfg = Release|x64
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Release|x64.Build.0 = Release|x64
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Release|x86.ActiveCfg = Release|x86
+		{BA85B096-DDB8-4324-BB47-5F4EC2C5DB6A}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

Tools/ActionsBuilder/README.md → Exporters/3ds Max/ActionsBuilder/README.md


Tools/ActionsBuilder/Sources/actionsbuilder.actionNode.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.actionNode.js


Tools/ActionsBuilder/Sources/actionsbuilder.contextMenu.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.contextMenu.js


Tools/ActionsBuilder/Sources/actionsbuilder.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.js


Tools/ActionsBuilder/Sources/actionsbuilder.list.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.list.js


Tools/ActionsBuilder/Sources/actionsbuilder.main.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.main.js


Tools/ActionsBuilder/Sources/actionsbuilder.max.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.max.js


Tools/ActionsBuilder/Sources/actionsbuilder.parameters.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.parameters.js


Tools/ActionsBuilder/Sources/actionsbuilder.toolbar.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.toolbar.js


Tools/ActionsBuilder/Sources/actionsbuilder.utils.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.utils.js


Tools/ActionsBuilder/Sources/actionsbuilder.viewer.js → Exporters/3ds Max/ActionsBuilder/Sources/actionsbuilder.viewer.js


Tools/ActionsBuilder/Sources/babylon.max.js → Exporters/3ds Max/ActionsBuilder/Sources/babylon.max.js


Tools/ActionsBuilder/Sources/fonts.css → Exporters/3ds Max/ActionsBuilder/Sources/fonts.css


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.eot → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.eot


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.otf → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.otf


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.svg → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.svg


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.ttf → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.ttf


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.woff → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300Light.woff


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.eot → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.eot


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.otf → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.otf


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.svg → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.svg


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.ttf → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.ttf


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.woff → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-300LightItalic.woff


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.eot → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.eot


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.otf → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.otf


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.svg → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.svg


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.ttf → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.ttf


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.woff → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-500Medium.woff


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.eot → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.eot


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.otf → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.otf


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.svg → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.svg


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.ttf → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.ttf


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.woff → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans-600SemiBold.woff


Tools/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans_NOTICE.txt → Exporters/3ds Max/ActionsBuilder/Sources/fonts/SinkinSans/SinkinSans_NOTICE.txt


Tools/ActionsBuilder/Sources/index-debug.html → Exporters/3ds Max/ActionsBuilder/Sources/index-debug.html


Tools/ActionsBuilder/Sources/index.css → Exporters/3ds Max/ActionsBuilder/Sources/index.css


Tools/ActionsBuilder/Sources/index.html → Exporters/3ds Max/ActionsBuilder/Sources/index.html


Tools/ActionsBuilder/Sources/raphael.js → Exporters/3ds Max/ActionsBuilder/Sources/raphael.js


Tools/ActionsBuilder/actionsbuilder.actionNode.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.actionNode.ts


Tools/ActionsBuilder/actionsbuilder.contextMenu.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.contextMenu.ts


Tools/ActionsBuilder/actionsbuilder.list.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.list.ts


Tools/ActionsBuilder/actionsbuilder.main.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.main.ts


Tools/ActionsBuilder/actionsbuilder.parameters.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.parameters.ts


Tools/ActionsBuilder/actionsbuilder.toolbar.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.toolbar.ts


Tools/ActionsBuilder/actionsbuilder.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.ts


Tools/ActionsBuilder/actionsbuilder.utils.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.utils.ts


Tools/ActionsBuilder/actionsbuilder.viewer.ts → Exporters/3ds Max/ActionsBuilder/actionsbuilder.viewer.ts


Tools/ActionsBuilder/gulpfile.js → Exporters/3ds Max/ActionsBuilder/gulpfile.js


Tools/ActionsBuilder/package.json → Exporters/3ds Max/ActionsBuilder/package.json


Tools/ActionsBuilder/raphaeljs.d.ts → Exporters/3ds Max/ActionsBuilder/raphaeljs.d.ts


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

@@ -68,6 +68,12 @@ namespace BabylonExport.Entities
         [DataMember]
         public BabylonAnimation[] animations { get; set; }
 
+        [DataMember]
+        public object metadata { get; set; }
+
+        [DataMember]
+        public string tags { get; set; }
+
         public BabylonCamera()
         {
             position = new[] { 0f, 0f, 0f };

+ 37 - 0
Exporters/3ds Max/BabylonExport.Entities/BabylonHDRCubeTexture.cs

@@ -0,0 +1,37 @@
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonHDRCubeTexture : BabylonTexture
+    {
+        [DataMember]
+        public string customType { get; private set; }
+
+        [DataMember]
+        public int size { get; set; }
+
+        [DataMember]
+        public bool useInGammaSpace { get; set; }
+
+        [DataMember]
+        public bool generateHarmonics { get; set; }
+
+        [DataMember]
+        public bool usePMREMGenerator { get; set; }
+
+        [DataMember]
+        public bool isBABYLONPreprocessed { get; set; }
+
+        public BabylonHDRCubeTexture()
+        {
+            this.customType = "BABYLON.HDRCubeTexture";
+            this.size = 0;
+            this.isCube = true;
+            this.useInGammaSpace = false;
+            this.generateHarmonics = true;
+            this.usePMREMGenerator = false;
+            this.isBABYLONPreprocessed = false;
+        }
+    }
+}

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

@@ -65,6 +65,12 @@ namespace BabylonExport.Entities
         [DataMember]
         public BabylonAnimation[] animations { get; set; }
 
+        [DataMember]
+        public object metadata { get; set; }
+
+        [DataMember]
+        public string tags { get; set; }
+
         public BabylonLight()
         {
             diffuse = new[] {1.0f, 1.0f, 1.0f};

+ 4 - 0
Exporters/3ds Max/BabylonExport.Entities/BabylonMaterial.cs

@@ -19,12 +19,16 @@ namespace BabylonExport.Entities
         [DataMember]
         public float alpha { get; set; }
 
+        [DataMember]
+        public int alphaMode { get; set; }
 
         public BabylonMaterial()
         {
             backFaceCulling = true;
 
             alpha = 1.0f;
+
+            alphaMode = 2;
         }
     }
 }

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

@@ -110,6 +110,12 @@ namespace BabylonExport.Entities
         [DataMember]
         public float physicsRestitution { get; set; }
 
+        [DataMember]
+        public object metadata { get; set; }
+
+        [DataMember]
+        public string tags { get; set; }
+
         public BabylonMesh()
         {
             isEnabled = true;

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

@@ -116,6 +116,15 @@ namespace BabylonExport.Entities
         public float[] emissive { get; set; }
 
         [DataMember]
+        public float roughness { get; set; }
+
+        [DataMember]
+        public bool useRoughnessFromMetallicTextureAlpha { get; set; }
+
+        [DataMember]
+        public bool useRoughnessFromMetallicTextureGreen { get; set; }
+
+        [DataMember]
         public bool useAlphaFromAlbedoTexture { get; set; }
 
         [DataMember]
@@ -142,6 +151,9 @@ namespace BabylonExport.Entities
         [DataMember]
         public BabylonFresnelParameters opacityFresnelParameters { get; set; }
 
+        [DataMember]
+        public bool disableLighting { get; set; }
+
         public BabylonPBRMaterial() : base()
         {
             customType = "BABYLON.PBRMaterial";
@@ -152,6 +164,11 @@ namespace BabylonExport.Entities
             specularIntensity = 1.0f;
             cameraExposure = 1.0f;
             cameraContrast = 1.0f;
+            useEmissiveAsIllumination = false;
+
+            roughness = 1.0f;
+            useRoughnessFromMetallicTextureAlpha = false;
+            useRoughnessFromMetallicTextureGreen = false;
 
             overloadedShadowIntensity = 1.0f;
             overloadedShadeIntensity = 1.0f;

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

@@ -6,6 +6,12 @@ namespace BabylonExport.Entities
     public class BabylonParticleSystem
     {
         [DataMember]
+        public string name { get; set; }
+
+        [DataMember]
+        public bool preventAutoStart { get; set; }
+
+        [DataMember]
         public string emitterId { get; set; }
 
         [DataMember]

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

@@ -37,7 +37,10 @@ namespace BabylonExport.Entities
 
         [DataMember]
         public float[] gravity { get; set; }
-        
+
+        [DataMember]
+        public string physicsEngine { get; set; }
+
         [DataMember]
         public bool physicsEnabled { get; set; }
 
@@ -80,6 +83,12 @@ namespace BabylonExport.Entities
         [DataMember]
         public BabylonActions actions { get; set; }
 
+        [DataMember]
+        public object metadata { get; set; }
+
+        [DataMember]
+        public bool workerCollisions { get; set; }
+
         public BabylonVector3 MaxVector { get; set; }
         public BabylonVector3 MinVector { get; set; }
 
@@ -114,6 +123,7 @@ namespace BabylonExport.Entities
             clearColor = new[] { 0.2f, 0.2f, 0.3f };
             ambientColor = new[] { 0f, 0f, 0f };
             gravity = new[] { 0f, 0f, -0.9f };
+            physicsEngine = "cannon";
 
             MaxVector = new BabylonVector3 { X = float.MinValue, Y = float.MinValue, Z = float.MinValue };
             MinVector = new BabylonVector3 { X = float.MaxValue, Y = float.MaxValue, Z = float.MaxValue };

+ 99 - 0
Exporters/3ds Max/BabylonExport.Entities/BabylonShaderMaterial.cs

@@ -0,0 +1,99 @@
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonShaderMaterial : BabylonMaterial
+    {
+        [DataMember]
+        public string customType { get; private set; }
+
+        [DataMember]
+        public object shaderPath;
+
+        [DataMember]
+        public BabylonShaderOptions options;
+
+        [DataMember]
+        public Dictionary<string, object> textures;
+
+        [DataMember]
+        public Dictionary<string, object[]> textureArrays;
+
+        [DataMember]
+        public Dictionary<string, object> floats;
+
+        [DataMember]
+        public Dictionary<string, object[]> floatArrays;
+
+        [DataMember]
+        public Dictionary<string, object> colors3;
+
+        [DataMember]
+        public Dictionary<string, object> colors4;
+
+        [DataMember]
+        public Dictionary<string, object> vectors2;
+
+        [DataMember]
+        public Dictionary<string, object> vectors3;
+
+        [DataMember]
+        public Dictionary<string, object> vectors4;
+
+        [DataMember]
+        public Dictionary<string, object> matrices;
+
+        [DataMember]
+        public Dictionary<string, object> matrices2x2;
+
+        [DataMember]
+        public Dictionary<string, object> matrices3x3;
+
+        [DataMember]
+        public Dictionary<string, object[]> vectors3Arrays;
+
+        public BabylonShaderMaterial()
+        {
+            this.customType = "BABYLON.ShaderMaterial";
+            this.shaderPath = null;
+            this.options = new BabylonShaderOptions();
+            this.textures = new Dictionary<string, object>();
+            this.textureArrays = new Dictionary<string, object[]>();
+            this.floats = new Dictionary<string, object>();
+            this.floatArrays = new Dictionary<string, object[]>();
+            this.colors3 = new Dictionary<string, object>();
+            this.colors4 = new Dictionary<string, object>();
+            this.vectors2 = new Dictionary<string, object>();
+            this.vectors3 = new Dictionary<string, object>();
+            this.vectors4 = new Dictionary<string, object>();
+            this.matrices = new Dictionary<string, object>();
+            this.matrices2x2 = new Dictionary<string, object>();
+            this.matrices3x3 = new Dictionary<string, object>();
+            this.vectors3Arrays = new Dictionary<string, object[]>();
+        }
+    }
+
+    [DataContract]
+    public class BabylonShaderOptions
+    {
+        [DataMember]
+        public string[] attributes;
+
+        [DataMember]
+        public string[] uniforms;
+
+        [DataMember]
+        public bool needAlphaBlending;
+
+        [DataMember]
+        public bool needAlphaTesting;
+
+        [DataMember]
+        public string[] samplers;
+
+        [DataMember]
+        public string[] defines;
+    }
+}

+ 11 - 0
Exporters/3ds Max/BabylonExport.Entities/BabylonStandardMaterial.cs

@@ -59,6 +59,15 @@ namespace BabylonExport.Entities
         [DataMember]
         public bool useSpecularOverAlpha { get; set; }
 
+        [DataMember]
+        public bool disableLighting { get; set; }
+
+        [DataMember]
+        public bool useEmissiveAsIllumination { get; set; }
+
+        [DataMember]
+        public bool linkEmissiveWithDiffuse { get; set; }
+
         public BabylonStandardMaterial() : base()
         {
             ambient = new[] {1.0f, 1.0f, 1.0f};
@@ -67,6 +76,8 @@ namespace BabylonExport.Entities
             emissive = new[] { 0f, 0f, 0f };
             specularPower = 64;
             useSpecularOverAlpha = true;
+            useEmissiveAsIllumination = false;
+            linkEmissiveWithDiffuse = false;
         }
     }
 }

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

@@ -67,7 +67,10 @@ namespace BabylonExport.Entities
 
         [DataMember]
         public BabylonAnimation[] animations { get; set; }
-        
+
+        [DataMember]
+        public string[] extensions { get; set; }
+
         public BabylonTexture()
         {
             level = 1.0f;

+ 35 - 0
Exporters/3ds Max/BabylonExport.Entities/BabylonUniversalCamera.cs

@@ -0,0 +1,35 @@
+using System.Runtime.Serialization;
+namespace BabylonExport.Entities
+{
+    [DataContract]
+    public class BabylonUniversalCamera : BabylonCamera
+    {
+        [DataMember]
+        public int mode { get; set; }
+
+        [DataMember]
+        public float? orthoLeft { get; set; }
+
+        [DataMember]
+        public float? orthoRight { get; set; }
+
+        [DataMember]
+        public float? orthoBottom { get; set; }
+
+        [DataMember]
+        public float? orthoTop { get; set; }
+
+        [DataMember]
+        public bool isStereoscopicSideBySide;
+
+        public BabylonUniversalCamera()
+        {
+            this.mode = 0;
+            this.orthoLeft = null;
+            this.orthoRight = null;
+            this.orthoBottom = null;
+            this.orthoTop = null;
+            this.type = "BABYLON.UniversalCamera";
+        }
+    }
+}

BIN
Exporters/Blender/Blender2Babylon-5.0.zip


BIN
Exporters/Blender/Blender2Babylon-5.1.zip


+ 0 - 89
Exporters/Blender/src/__init__.py

@@ -1,89 +0,0 @@
-bl_info = {
-    'name': 'Babylon.js',
-    'author': 'David Catuhe, Jeff Palmer',
-    'version': (5, 0, 7),
-    'blender': (2, 76, 0),
-    'location': 'File > Export > Babylon.js (.babylon)',
-    'description': 'Export Babylon.js scenes (.babylon)',
-    'wiki_url': 'https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/Blender',
-    'tracker_url': '',
-    'category': 'Babylon.JS'}
-
-# allow module to be changed during a session (dev purposes)
-if "bpy" in locals():
-    print('Reloading TOB exporter')
-    import imp
-    imp.reload(animation)
-    imp.reload(armature)
-    imp.reload(camera)
-    imp.reload(exporter_settings_panel)
-    imp.reload(f_curve_animatable)
-    imp.reload(json_exporter)
-    imp.reload(light_shadow)
-    imp.reload(logger)
-    imp.reload(material)
-    imp.reload(mesh)
-    imp.reload(package_level)
-    imp.reload(sound)
-    imp.reload(world)
-else:
-    from . import animation
-    from . import armature
-    from . import camera
-    from . import exporter_settings_panel
-    from . import f_curve_animatable
-    from . import json_exporter
-    from . import light_shadow
-    from . import logger
-    from . import material
-    from . import mesh
-    from . import package_level
-    from . import sound
-    from . import world
-
-import bpy
-from bpy_extras.io_utils import ExportHelper, ImportHelper
-#===============================================================================
-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)
-
-# Registration the calling of the INFO_MT_file_export file selector
-def menu_func(self, context):
-    from .package_level import get_title
-    # the info for get_title is in this file, but getting it the same way as others
-    self.layout.operator(JsonMain.bl_idname, get_title())
-
-if __name__ == '__main__':
-    unregister()
-    register()
-#===============================================================================
-class JsonMain(bpy.types.Operator, ExportHelper):
-    bl_idname = 'bjs.main'
-    bl_label = 'Export Babylon.js scene' # used on the label of the actual 'save' button
-    filename_ext = '.babylon'            # used as the extension on file selector
-
-    filepath = bpy.props.StringProperty(subtype = 'FILE_PATH') # assigned once the file selector returns
-    
-    def execute(self, context):
-        from .json_exporter import JsonExporter
-        from .package_level import get_title, verify_min_blender_version
-        
-        if not verify_min_blender_version():
-            self.report({'ERROR'}, 'version of Blender too old.')
-            return {'FINISHED'}
-            
-        exporter = JsonExporter()
-        exporter.execute(context, self.filepath)
-        
-        if (exporter.fatalError):
-            self.report({'ERROR'}, exporter.fatalError)
-
-        elif (exporter.nWarnings > 0):
-            self.report({'WARNING'}, 'Processing completed, but ' + str(exporter.nWarnings) + ' WARNINGS were raised,  see log file.')
-            
-        return {'FINISHED'}

+ 90 - 0
Exporters/Blender/src/babylon-js/__init__.py

@@ -0,0 +1,90 @@
+bl_info = {
+    'name': 'Babylon.js',
+    'author': 'David Catuhe, Jeff Palmer',
+    'version': (5, 1, 2),
+    'blender': (2, 76, 0),
+    'location': 'File > Export > Babylon.js (.babylon)',
+    'description': 'Export Babylon.js scenes (.babylon)',
+    'wiki_url': 'https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/Blender',
+    'tracker_url': '',
+    'category': 'Babylon.JS'}
+
+# allow module to be changed during a session (dev purposes)
+if "bpy" in locals():
+    print('Reloading TOB exporter')
+    import imp
+    imp.reload(animation)
+    imp.reload(armature)
+    imp.reload(camera)
+    imp.reload(exporter_settings_panel)
+    imp.reload(f_curve_animatable)
+    imp.reload(json_exporter)
+    imp.reload(light_shadow)
+    imp.reload(logger)
+    imp.reload(material)
+    imp.reload(mesh)
+    imp.reload(package_level)
+    imp.reload(sound)
+    imp.reload(world)
+else:
+    from . import animation
+    from . import armature
+    from . import camera
+    from . import exporter_settings_panel
+    from . import f_curve_animatable
+    from . import json_exporter
+    from . import light_shadow
+    from . import logger
+    from . import material
+    from . import mesh
+    from . import package_level
+    from . import sound
+    from . import world
+
+import bpy
+from bpy_extras.io_utils import ExportHelper, ImportHelper
+#===============================================================================
+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)
+
+# Registration the calling of the INFO_MT_file_export file selector
+def menu_func(self, context):
+    from .package_level import get_title
+    # the info for get_title is in this file, but getting it the same way as others
+    self.layout.operator(JsonMain.bl_idname, get_title())
+
+if __name__ == '__main__':
+    unregister()
+    register()
+#===============================================================================
+class JsonMain(bpy.types.Operator, ExportHelper):
+    bl_idname = 'bjs.main'
+    bl_label = 'Export Babylon.js scene' # used on the label of the actual 'save' button
+    filename_ext = '.babylon'            # used as the extension on file selector
+
+    filepath = bpy.props.StringProperty(subtype = 'FILE_PATH') # assigned once the file selector returns
+    filter_glob = bpy.props.StringProperty(name='.babylon',default='*.babylon', options={'HIDDEN'})
+    
+    def execute(self, context):
+        from .json_exporter import JsonExporter
+        from .package_level import get_title, verify_min_blender_version
+        
+        if not verify_min_blender_version():
+            self.report({'ERROR'}, 'version of Blender too old.')
+            return {'FINISHED'}
+            
+        exporter = JsonExporter()
+        exporter.execute(context, self.filepath)
+        
+        if (exporter.fatalError):
+            self.report({'ERROR'}, exporter.fatalError)
+
+        elif (exporter.nWarnings > 0):
+            self.report({'WARNING'}, 'Processing completed, but ' + str(exporter.nWarnings) + ' WARNINGS were raised,  see log file.')
+            
+        return {'FINISHED'}

Exporters/Blender/src/animation.py → Exporters/Blender/src/babylon-js/animation.py


Exporters/Blender/src/armature.py → Exporters/Blender/src/babylon-js/armature.py


Exporters/Blender/src/camera.py → Exporters/Blender/src/babylon-js/camera.py


+ 70 - 0
Exporters/Blender/src/babylon-js/exporter_settings_panel.py

@@ -0,0 +1,70 @@
+from .package_level import *
+
+import bpy
+# Panel displayed in Scene Tab of properties, so settings can be saved in a .blend file
+class ExporterSettingsPanel(bpy.types.Panel):
+    bl_label = get_title()
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = 'scene'
+
+    bpy.types.Scene.export_onlySelectedLayer = bpy.props.BoolProperty(
+        name='Export only selected layers',
+        description='Export only selected layers',
+        default = False,
+        )
+    bpy.types.Scene.export_flatshadeScene = bpy.props.BoolProperty(
+        name='Flat shade entire scene',
+        description='Use face normals on all meshes.  Increases vertices.',
+        default = False,
+        )
+    bpy.types.Scene.attachedSound = bpy.props.StringProperty(
+        name='Sound',
+        description='',
+        default = ''
+        )
+    bpy.types.Scene.loopSound = bpy.props.BoolProperty(
+        name='Loop sound',
+        description='',
+        default = True
+        )
+    bpy.types.Scene.autoPlaySound = bpy.props.BoolProperty(
+        name='Auto play sound',
+        description='',
+        default = True
+        )
+    bpy.types.Scene.inlineTextures = bpy.props.BoolProperty(
+        name='inline',
+        description='turn textures into encoded strings, for direct inclusion into source code',
+        default = False
+    )
+    bpy.types.Scene.textureDir = bpy.props.StringProperty(
+        name='Sub-directory',
+        description='The path below the output directory to write texture files (any separators OS dependent)',
+        default = ''
+        )
+    bpy.types.Scene.ignoreIKBones = bpy.props.BoolProperty(
+        name='Ignore IK Bones',
+        description="Do not export bones with either '.ik' or 'ik.'(not case sensitive) in the name",
+        default = False,
+        )
+
+    def draw(self, context):
+        layout = self.layout
+
+        scene = context.scene
+        layout.prop(scene, 'export_onlySelectedLayer')
+        layout.prop(scene, 'export_flatshadeScene')
+        layout.prop(scene, 'ignoreIKBones')
+
+        box = layout.box()
+        box.label(text='Texture Location:')
+        box.prop(scene, 'inlineTextures')
+        row = box.row()
+        row.enabled = not scene.inlineTextures
+        row.prop(scene, 'textureDir')
+
+        box = layout.box()
+        box.prop(scene, 'attachedSound')
+        box.prop(scene, 'autoPlaySound')
+        box.prop(scene, 'loopSound')

Exporters/Blender/src/f_curve_animatable.py → Exporters/Blender/src/babylon-js/f_curve_animatable.py


+ 297 - 0
Exporters/Blender/src/babylon-js/json_exporter.py

@@ -0,0 +1,297 @@
+from .animation import *
+from .armature import *
+from .camera import *
+from .exporter_settings_panel import *
+from .light_shadow import *
+from .logger import *
+from .material import *
+from .mesh import *
+from .package_level import *
+from .sound import *
+from .world import *
+
+import bpy
+from io import open
+from os import path, makedirs
+#===============================================================================
+class JsonExporter:
+    nameSpace   = None  # assigned in execute
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def execute(self, context, filepath):
+        scene = context.scene
+        self.scene = scene # reference for passing
+        self.fatalError = None
+        try:
+            self.filepathMinusExtension = filepath.rpartition('.')[0]
+            JsonExporter.nameSpace = getNameSpace(self.filepathMinusExtension)
+
+            log = Logger(self.filepathMinusExtension + '.log')
+
+            if bpy.ops.object.mode_set.poll():
+                bpy.ops.object.mode_set(mode = 'OBJECT')
+
+            # assign texture location, purely temporary if inlining
+            self.textureDir = path.dirname(filepath)
+            if not scene.inlineTextures:
+                self.textureDir = path.join(self.textureDir, scene.textureDir)
+                if not path.isdir(self.textureDir):
+                    makedirs(self.textureDir)
+                    Logger.warn('Texture sub-directory did not already exist, created: ' + self.textureDir)
+
+            Logger.log('========= Conversion from Blender to Babylon.js =========', 0)
+            Logger.log('Scene settings used:', 1)
+            Logger.log('selected layers only:  ' + format_bool(scene.export_onlySelectedLayer), 2)
+            Logger.log('flat shading entire scene:  ' + format_bool(scene.export_flatshadeScene), 2)
+            Logger.log('inline textures:  ' + format_bool(scene.inlineTextures), 2)
+            if not scene.inlineTextures:
+                Logger.log('texture directory:  ' + self.textureDir, 2)
+                
+            self.world = World(scene)
+
+            bpy.ops.screen.animation_cancel()
+            currentFrame = bpy.context.scene.frame_current
+
+            # Active camera
+            if scene.camera != None:
+                self.activeCamera = scene.camera.name
+            else:
+                Logger.warn('No active camera has been assigned, or is not in a currently selected Blender layer')
+
+            self.cameras = []
+            self.lights = []
+            self.shadowGenerators = []
+            self.skeletons = []
+            skeletonId = 0
+            self.meshesAndNodes = []
+            self.materials = []
+            self.multiMaterials = []
+            self.sounds = []
+
+            # Scene level sound
+            if scene.attachedSound != '':
+                self.sounds.append(Sound(scene.attachedSound, scene.autoPlaySound, scene.loopSound))
+
+            # separate loop doing all skeletons, so available in Mesh to make skipping IK bones possible
+            for object in [object for object in scene.objects]:
+                scene.frame_set(currentFrame)
+                if object.type == 'ARMATURE':  #skeleton.pose.bones
+                    if object.is_visible(scene):
+                        self.skeletons.append(Skeleton(object, scene, skeletonId, scene.ignoreIKBones))
+                        skeletonId += 1
+                    else:
+                        Logger.warn('The following armature not visible in scene thus ignored: ' + object.name)
+
+            # exclude lamps in this pass, so ShadowGenerator constructor can be passed meshesAnNodes
+            for object in [object for object in scene.objects]:
+                scene.frame_set(currentFrame)
+                if object.type == 'CAMERA':
+                    if object.is_visible(scene): # no isInSelectedLayer() required, is_visible() handles this for them
+                        self.cameras.append(Camera(object))
+                    else:
+                        Logger.warn('The following camera not visible in scene thus ignored: ' + object.name)
+
+                elif object.type == 'MESH':
+                    forcedParent = None
+                    nameID = ''
+                    nextStartFace = 0
+
+                    while True and self.isInSelectedLayer(object, scene):
+                        mesh = Mesh(object, scene, nextStartFace, forcedParent, nameID, self)
+                        if mesh.hasUnappliedTransforms and hasattr(mesh, 'skeletonWeights'):
+                            self.fatalError = 'Mesh: ' + mesh.name + ' has unapplied transformations.  This will never work for a mesh with an armature.  Export cancelled'
+                            Logger.log(self.fatalError)
+                            return
+
+                        if hasattr(mesh, 'instances'):
+                            self.meshesAndNodes.append(mesh)
+                        else:
+                            break
+
+                        if object.data.attachedSound != '':
+                            self.sounds.append(Sound(object.data.attachedSound, object.data.autoPlaySound, object.data.loopSound, object))
+
+                        nextStartFace = mesh.offsetFace
+                        if nextStartFace == 0:
+                            break
+
+                        if forcedParent is None:
+                            nameID = 0
+                            forcedParent = object
+                            Logger.warn('The following mesh has exceeded the maximum # of vertex elements & will be broken into multiple Babylon meshes: ' + object.name)
+
+                        nameID = nameID + 1
+
+                elif object.type == 'EMPTY':
+                    self.meshesAndNodes.append(Node(object))
+
+                elif object.type != 'LAMP' and object.type != 'ARMATURE':
+                    Logger.warn('The following object (type - ' +  object.type + ') is not currently exportable thus ignored: ' + object.name)
+
+            # Lamp / shadow Generator pass; meshesAnNodes complete & forceParents included
+            for object in [object for object in scene.objects]:
+                if object.type == 'LAMP':
+                    if object.is_visible(scene): # no isInSelectedLayer() required, is_visible() handles this for them
+                        bulb = Light(object, self.meshesAndNodes)
+                        self.lights.append(bulb)
+                        if object.data.shadowMap != 'NONE':
+                            if bulb.light_type == DIRECTIONAL_LIGHT or bulb.light_type == SPOT_LIGHT:
+                                self.shadowGenerators.append(ShadowGenerator(object, self.meshesAndNodes, scene))
+                            else:
+                                Logger.warn('Only directional (sun) and spot types of lamp are valid for shadows thus ignored: ' + object.name)
+                    else:
+                        Logger.warn('The following lamp not visible in scene thus ignored: ' + object.name)
+
+            bpy.context.scene.frame_set(currentFrame)
+
+            # output file
+            self.to_scene_file()
+
+        except:# catch *all* exceptions
+            log.log_error_stack()
+            raise
+
+        finally:
+            log.close()
+
+        self.nWarnings = log.nWarnings
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def to_scene_file(self):
+        Logger.log('========= Writing of scene file started =========', 0)
+        # Open file
+        file_handler = open(self.filepathMinusExtension + '.babylon', 'w', encoding='utf8')
+        file_handler.write('{')
+        file_handler.write('"producer":{"name":"Blender","version":"' + bpy.app.version_string + '","exporter_version":"' + format_exporter_version() + '","file":"' + JsonExporter.nameSpace + '.babylon"},\n')
+        self.world.to_scene_file(file_handler)
+
+        # Materials
+        file_handler.write(',\n"materials":[')
+        first = True
+        for material in self.materials:
+            if first != True:
+                file_handler.write(',\n')
+
+            first = False
+            material.to_scene_file(file_handler)
+        file_handler.write(']')
+
+        # Multi-materials
+        file_handler.write(',\n"multiMaterials":[')
+        first = True
+        for multimaterial in self.multiMaterials:
+            if first != True:
+                file_handler.write(',')
+
+            first = False
+            multimaterial.to_scene_file(file_handler)
+        file_handler.write(']')
+
+        # Armatures/Bones
+        file_handler.write(',\n"skeletons":[')
+        first = True
+        for skeleton in self.skeletons:
+            if first != True:
+                file_handler.write(',')
+
+            first = False
+            skeleton.to_scene_file(file_handler)
+        file_handler.write(']')
+
+        # Meshes
+        file_handler.write(',\n"meshes":[')
+        first = True
+        for mesh in self.meshesAndNodes:
+            if first != True:
+                file_handler.write(',')
+
+            first = False
+            mesh.to_scene_file(file_handler)
+        file_handler.write(']')
+
+        # Cameras
+        file_handler.write(',\n"cameras":[')
+        first = True
+        for camera in self.cameras:
+            if hasattr(camera, 'fatalProblem'): continue
+            if first != True:
+                file_handler.write(',')
+
+            first = False
+            camera.update_for_target_attributes(self.meshesAndNodes)
+            camera.to_scene_file(file_handler)
+        file_handler.write(']')
+
+        # Active camera
+        if hasattr(self, 'activeCamera'):
+            write_string(file_handler, 'activeCamera', self.activeCamera)
+
+        # Lights
+        file_handler.write(',\n"lights":[')
+        first = True
+        for light in self.lights:
+            if first != True:
+                file_handler.write(',')
+
+            first = False
+            light.to_scene_file(file_handler)
+        file_handler.write(']')
+
+        # Shadow generators
+        file_handler.write(',\n"shadowGenerators":[')
+        first = True
+        for shadowGen in self.shadowGenerators:
+            if first != True:
+                file_handler.write(',')
+
+            first = False
+            shadowGen.to_scene_file(file_handler)
+        file_handler.write(']')
+
+        # Sounds
+        if len(self.sounds) > 0:
+            file_handler.write('\n,"sounds":[')
+            first = True
+            for sound in self.sounds:
+                if first != True:
+                    file_handler.write(',')
+
+                first = False
+                sound.to_scene_file(file_handler)
+
+            file_handler.write(']')
+
+        # Closing
+        file_handler.write('\n}')
+        file_handler.close()
+        Logger.log('========= Writing of scene file completed =========', 0)
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def getMaterial(self, baseMaterialId):
+        fullName = JsonExporter.nameSpace + '.' + baseMaterialId
+        for material in self.materials:
+            if material.name == fullName:
+                return material
+
+        return None
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def getSourceMeshInstance(self, dataName):
+        for mesh in self.meshesAndNodes:
+            # nodes have no 'dataName', cannot be instanced in any case
+            if hasattr(mesh, 'dataName') and mesh.dataName == dataName:
+                return mesh
+
+        return None
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def isInSelectedLayer(self, obj, scene):
+        if not scene.export_onlySelectedLayer:
+            return True
+
+        for l in range(0, len(scene.layers)):
+            if obj.layers[l] and scene.layers[l]:
+                return True
+        return False
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def get_skeleton(self, name):
+        for skeleton in self.skeletons:
+            if skeleton.name == name:
+                return skeleton
+        #really cannot happen, will cause exception in caller
+        return None

Exporters/Blender/src/light_shadow.py → Exporters/Blender/src/babylon-js/light_shadow.py


Exporters/Blender/src/logger.py → Exporters/Blender/src/babylon-js/logger.py


+ 577 - 0
Exporters/Blender/src/babylon-js/material.py

@@ -0,0 +1,577 @@
+from .logger import *
+from .package_level import *
+
+import bpy
+from base64 import b64encode
+from mathutils import Color
+from os import path, remove
+from shutil import copy
+from sys import exc_info # for writing errors to log file
+
+# used in Texture constructor, defined in BABYLON.Texture
+CLAMP_ADDRESSMODE = 0
+WRAP_ADDRESSMODE = 1
+MIRROR_ADDRESSMODE = 2
+
+# used in Texture constructor, defined in BABYLON.Texture
+EXPLICIT_MODE = 0
+SPHERICAL_MODE = 1
+#PLANAR_MODE = 2
+CUBIC_MODE = 3
+#PROJECTION_MODE = 4
+#SKYBOX_MODE = 5
+
+DEFAULT_MATERIAL_NAMESPACE = 'Same as Filename'
+#===============================================================================
+class MultiMaterial:
+    def __init__(self, material_slots, idx, nameSpace):
+        self.name = nameSpace + '.' + 'Multimaterial#' + str(idx)
+        Logger.log('processing begun of multimaterial:  ' + self.name, 2)
+        self.material_slots = material_slots
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def to_scene_file(self, file_handler):
+        file_handler.write('{')
+        write_string(file_handler, 'name', self.name, True)
+        write_string(file_handler, 'id', self.name)
+
+        file_handler.write(',"materials":[')
+        first = True
+        for material in self.material_slots:
+            if first != True:
+                file_handler.write(',')
+            file_handler.write('"' + material.name +'"')
+            first = False
+        file_handler.write(']')
+        file_handler.write('}')
+#===============================================================================
+class Texture:
+    def __init__(self, slot, level, textureOrImage, mesh, exporter):
+        wasBaked = not hasattr(textureOrImage, 'uv_layer')
+        if wasBaked:
+            image = textureOrImage
+            texture = None
+
+            repeat = False
+            self.hasAlpha = False
+            self.coordinatesIndex = 0
+        else:
+            texture = textureOrImage
+            image = texture.texture.image
+
+            repeat = texture.texture.extension == 'REPEAT'
+            self.hasAlpha = texture.texture.use_alpha
+
+            usingMap = texture.uv_layer
+            if len(usingMap) == 0:
+                usingMap = mesh.data.uv_textures[0].name
+
+            Logger.log('Image texture found, type:  ' + slot + ', mapped using: "' + usingMap + '"', 4)
+            if mesh.data.uv_textures[0].name == usingMap:
+                self.coordinatesIndex = 0
+            elif mesh.data.uv_textures[1].name == usingMap:
+                self.coordinatesIndex = 1
+            else:
+                Logger.warn('Texture is not mapped as UV or UV2, assigned 1', 5)
+                self.coordinatesIndex = 0
+
+        # always write the file out, since base64 encoding is easiest from a file
+        try:
+            imageFilepath = path.normpath(bpy.path.abspath(image.filepath))
+            self.fileNoPath = path.basename(imageFilepath)
+
+            internalImage = image.packed_file or wasBaked
+
+            # when coming from either a packed image or a baked image, then save_render
+            if internalImage:
+                if exporter.scene.inlineTextures:
+                    textureFile = path.join(exporter.textureDir, self.fileNoPath + 'temp')
+                else:
+                    textureFile = path.join(exporter.textureDir, self.fileNoPath)
+
+                image.save_render(textureFile)
+
+            # when backed by an actual file, copy to target dir, unless inlining
+            else:
+                textureFile = bpy.path.abspath(image.filepath)
+                if not exporter.scene.inlineTextures:
+                    copy(textureFile, exporter.textureDir)
+        except:
+            ex = exc_info()
+            Logger.warn('Error encountered processing image file:  ' + ', Error:  '+ str(ex[1]))
+
+        if exporter.scene.inlineTextures:
+            # base64 is easiest from a file, so sometimes a temp file was made above;  need to delete those
+            with open(textureFile, "rb") as image_file:
+                asString = b64encode(image_file.read()).decode()
+            self.encoded_URI = 'data:image/' + image.file_format + ';base64,' + asString
+
+            if internalImage:
+                remove(textureFile)
+
+        # capture texture attributes
+        self.slot = slot
+        self.level = level
+
+        if (texture and texture.mapping == 'CUBE'):
+            self.coordinatesMode = CUBIC_MODE
+        if (texture and texture.mapping == 'SPHERE'):
+            self.coordinatesMode = SPHERICAL_MODE
+        else:
+            self.coordinatesMode = EXPLICIT_MODE
+
+        self.uOffset = texture.offset.x if texture else 0.0
+        self.vOffset = texture.offset.y if texture else 0.0
+        self.uScale  = texture.scale.x  if texture else 1.0
+        self.vScale  = texture.scale.y  if texture else 1.0
+        self.uAng = 0
+        self.vAng = 0
+        self.wAng = 0
+
+        if (repeat):
+            if (texture.texture.use_mirror_x):
+                self.wrapU = MIRROR_ADDRESSMODE
+            else:
+                self.wrapU = WRAP_ADDRESSMODE
+
+            if (texture.texture.use_mirror_y):
+                self.wrapV = MIRROR_ADDRESSMODE
+            else:
+                self.wrapV = WRAP_ADDRESSMODE
+        else:
+            self.wrapU = CLAMP_ADDRESSMODE
+            self.wrapV = CLAMP_ADDRESSMODE
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def to_scene_file(self, file_handler):
+        file_handler.write(', \n"' + self.slot + '":{')
+        write_string(file_handler, 'name', self.fileNoPath, True)
+
+        write_float(file_handler, 'level', self.level)
+        write_float(file_handler, 'hasAlpha', self.hasAlpha)
+        write_int(file_handler, 'coordinatesMode', self.coordinatesMode)
+        write_float(file_handler, 'uOffset', self.uOffset)
+        write_float(file_handler, 'vOffset', self.vOffset)
+        write_float(file_handler, 'uScale', self.uScale)
+        write_float(file_handler, 'vScale', self.vScale)
+        write_float(file_handler, 'uAng', self.uAng)
+        write_float(file_handler, 'vAng', self.vAng)
+        write_float(file_handler, 'wAng', self.wAng)
+        write_int(file_handler, 'wrapU', self.wrapU)
+        write_int(file_handler, 'wrapV', self.wrapV)
+        write_int(file_handler, 'coordinatesIndex', self.coordinatesIndex)
+        if hasattr(self,'encoded_URI'):
+            write_string(file_handler, 'base64String', self.encoded_URI)
+        file_handler.write('}')
+#===============================================================================
+# need to evaluate the need to bake a mesh before even starting; class also stores specific types of bakes
+class BakingRecipe:
+    def __init__(self, mesh):
+        # transfer from Mesh custom properties
+        self.bakeSize    = mesh.data.bakeSize
+        self.bakeQuality = mesh.data.bakeQuality # for lossy compression formats
+        self.forceBaking = mesh.data.forceBaking # in mesh, but not currently exposed
+        self.usePNG      = mesh.data.usePNG      # in mesh, but not currently exposed
+
+        # initialize all members
+        self.needsBaking      = self.forceBaking
+        self.diffuseBaking    = self.forceBaking
+        self.ambientBaking    = False
+        self.opacityBaking    = False
+        self.reflectionBaking = False
+        self.emissiveBaking   = False
+        self.bumpBaking       = False
+        self.specularBaking   = False
+
+        # need to make sure a single render
+        self.cyclesRender     = False
+        blenderRender         = False
+
+        # accumulators set by Blender Game
+        self.backFaceCulling = True  # used only when baking
+        self.isBillboard = len(mesh.material_slots) == 1 and mesh.material_slots[0].material.game_settings.face_orientation == 'BILLBOARD'
+
+        # Cycles specific, need to get the node trees of each material
+        self.nodeTrees = []
+
+        for material_slot in mesh.material_slots:
+            # a material slot is not a reference to an actual material; need to look up
+            material = material_slot.material
+
+            self.backFaceCulling &= material.game_settings.use_backface_culling
+
+            # testing for Cycles renderer has to be different
+            if material.use_nodes == True:
+                self.needsBaking = True
+                self.cyclesRender = True
+                self.nodeTrees.append(material.node_tree)
+
+                for node in material.node_tree.nodes:
+                    id = node.bl_idname
+                    if id == 'ShaderNodeBsdfDiffuse':
+                        self.diffuseBaking = True
+
+                    if id == 'ShaderNodeAmbientOcclusion':
+                        self.ambientBaking = True
+
+                    # there is no opacity baking for Cycles AFAIK
+                    if id == '':
+                        self.opacityBaking = True
+
+                    if id == 'ShaderNodeEmission':
+                        self.emissiveBaking = True
+
+                    if id == 'ShaderNodeNormal' or id == 'ShaderNodeNormalMap':
+                        self.bumpBaking = True
+
+                    if id == '':
+                        self.specularBaking = True
+
+            else:
+                blenderRender = True
+                nDiffuseImages = 0
+                nReflectionImages = 0
+                nAmbientImages = 0
+                nOpacityImages = 0
+                nEmissiveImages = 0
+                nBumpImages = 0
+                nSpecularImages = 0
+
+                textures = [mtex for mtex in material.texture_slots if mtex and mtex.texture]
+                for mtex in textures:
+                    # ignore empty slots
+                    if mtex.texture.type == 'NONE':
+                        continue
+
+                    # for images, just need to make sure there is only 1 per type
+                    if mtex.texture.type == 'IMAGE' and not self.forceBaking:
+                        if mtex.use_map_diffuse or mtex.use_map_color_diffuse:
+                            if mtex.texture_coords == 'REFLECTION':
+                                nReflectionImages += 1
+                            else:
+                                nDiffuseImages += 1
+
+                        if mtex.use_map_ambient:
+                            nAmbientImages += 1
+
+                        if mtex.use_map_alpha:
+                            nOpacityImages += 1
+
+                        if mtex.use_map_emit:
+                            nEmissiveImages += 1
+
+                        if mtex.use_map_normal:
+                            nBumpImages += 1
+
+                        if mtex.use_map_color_spec:
+                            nSpecularImages += 1
+
+                    else:
+                        self.needsBaking = True
+
+                        if mtex.use_map_diffuse or mtex.use_map_color_diffuse:
+                            if mtex.texture_coords == 'REFLECTION':
+                                self.reflectionBaking = True
+                            else:
+                                self.diffuseBaking = True
+
+                        if mtex.use_map_ambient:
+                            self.ambientBaking = True
+
+                        if mtex.use_map_alpha and material.alpha > 0:
+                            self.opacityBaking = True
+
+                        if mtex.use_map_emit:
+                            self.emissiveBaking = True
+
+                        if mtex.use_map_normal:
+                            self.bumpBaking = True
+
+                        if mtex.use_map_color_spec:
+                            self.specularBaking = True
+
+                # 2nd pass 2 check for multiples of a given image type
+                if nDiffuseImages > 1:
+                    self.needsBaking = self.diffuseBaking = True
+                if nReflectionImages > 1:
+                    self.needsBaking = self.nReflectionImages = True
+                if nAmbientImages > 1:
+                    self.needsBaking = self.ambientBaking = True
+                if nOpacityImages > 1:
+                    self.needsBaking = self.opacityBaking = True
+                if nEmissiveImages > 1:
+                    self.needsBaking = self.emissiveBaking = True
+                if nBumpImages > 1:
+                    self.needsBaking = self.bumpBaking = True
+                if nSpecularImages > 1:
+                    self.needsBaking = self.specularBaking = True
+
+        self.multipleRenders = blenderRender and self.cyclesRender
+
+        # check for really old .blend file, eg. 2.49, to ensure that everything requires exists
+        if self.needsBaking and bpy.data.screens.find('UV Editing') == -1:
+            Logger.warn('Contains material requiring baking, but resources not available.  Probably .blend very old', 2)
+            self.needsBaking = False
+#===============================================================================
+# Not intended to be instanced directly
+class Material:
+    def __init__(self, checkReadyOnlyOnce, maxSimultaneousLights):
+        self.checkReadyOnlyOnce = checkReadyOnlyOnce
+        self.maxSimultaneousLights = maxSimultaneousLights
+        # first pass of textures, either appending image type or recording types of bakes to do
+        self.textures = []
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def to_scene_file(self, file_handler):
+        file_handler.write('{')
+        write_string(file_handler, 'name', self.name, True)
+        write_string(file_handler, 'id', self.name)
+        write_color(file_handler, 'ambient', self.ambient)
+        write_color(file_handler, 'diffuse', self.diffuse)
+        write_color(file_handler, 'specular', self.specular)
+        write_color(file_handler, 'emissive', self.emissive)
+        write_float(file_handler, 'specularPower', self.specularPower)
+        write_float(file_handler, 'alpha', self.alpha)
+        write_bool(file_handler, 'backFaceCulling', self.backFaceCulling)
+        write_bool(file_handler, 'checkReadyOnlyOnce', self.checkReadyOnlyOnce)
+        write_int(file_handler, 'maxSimultaneousLights', self.maxSimultaneousLights)
+        for texSlot in self.textures:
+            texSlot.to_scene_file(file_handler)
+
+        file_handler.write('}')
+#===============================================================================
+class StdMaterial(Material):
+    def __init__(self, material_slot, exporter, mesh):
+        super().__init__(mesh.data.checkReadyOnlyOnce, mesh.data.maxSimultaneousLights)
+        nameSpace = exporter.nameSpace if mesh.data.materialNameSpace == DEFAULT_MATERIAL_NAMESPACE or len(mesh.data.materialNameSpace) == 0 else mesh.data.materialNameSpace
+        self.name = nameSpace + '.' + material_slot.name
+
+        Logger.log('processing begun of Standard material:  ' +  material_slot.name, 2)
+
+        # a material slot is not a reference to an actual material; need to look up
+        material = material_slot.material
+
+        self.ambient = material.ambient * material.diffuse_color
+        self.diffuse = material.diffuse_intensity * material.diffuse_color
+        self.specular = material.specular_intensity * material.specular_color
+        self.emissive = material.emit * material.diffuse_color
+        self.specularPower = material.specular_hardness
+        self.alpha = material.alpha
+
+        self.backFaceCulling = material.game_settings.use_backface_culling
+
+        textures = [mtex for mtex in material.texture_slots if mtex and mtex.texture]
+        for mtex in textures:
+            # test should be un-neccessary, since should be a BakedMaterial; just for completeness
+            if (mtex.texture.type != 'IMAGE'):
+                continue
+            elif not mtex.texture.image:
+                Logger.warn('Material has un-assigned image texture:  "' + mtex.name + '" ignored', 3)
+                continue
+            elif len(mesh.data.uv_textures) == 0:
+                Logger.warn('Mesh has no UV maps, material:  "' + mtex.name + '" ignored', 3)
+                continue
+
+            if mtex.use_map_diffuse or mtex.use_map_color_diffuse:
+                if mtex.texture_coords == 'REFLECTION':
+                    Logger.log('Reflection texture found "' + mtex.name + '"', 3)
+                    self.textures.append(Texture('reflectionTexture', mtex.diffuse_color_factor, mtex, mesh, exporter))
+                else:
+                    Logger.log('Diffuse texture found "' + mtex.name + '"', 3)
+                    self.textures.append(Texture('diffuseTexture', mtex.diffuse_color_factor, mtex, mesh, exporter))
+
+            if mtex.use_map_ambient:
+                Logger.log('Ambient texture found "' + mtex.name + '"', 3)
+                self.textures.append(Texture('ambientTexture', mtex.ambient_factor, mtex, mesh, exporter))
+
+            if mtex.use_map_alpha:
+                if self.alpha > 0:
+                    Logger.log('Opacity texture found "' + mtex.name + '"', 3)
+                    self.textures.append(Texture('opacityTexture', mtex.alpha_factor, mtex, mesh, exporter))
+                else:
+                    Logger.warn('Opacity non-std way to indicate opacity, use material alpha to also use Opacity texture', 4)
+                    self.alpha = 1
+
+            if mtex.use_map_emit:
+                Logger.log('Emissive texture found "' + mtex.name + '"', 3)
+                self.textures.append(Texture('emissiveTexture', mtex.emit_factor, mtex, mesh, exporter))
+
+            if mtex.use_map_normal:
+                Logger.log('Bump texture found "' + mtex.name + '"', 3)
+                self.textures.append(Texture('bumpTexture', mtex.normal_factor, mtex, mesh, exporter))
+
+            if mtex.use_map_color_spec:
+                Logger.log('Specular texture found "' + mtex.name + '"', 3)
+                self.textures.append(Texture('specularTexture', mtex.specular_color_factor, mtex, mesh, exporter))
+#===============================================================================
+class BakedMaterial(Material):
+    def __init__(self, exporter, mesh, recipe):
+        super().__init__(mesh.data.checkReadyOnlyOnce, mesh.data.maxSimultaneousLights)
+        nameSpace = exporter.nameSpace if mesh.data.materialNameSpace == DEFAULT_MATERIAL_NAMESPACE or len(mesh.data.materialNameSpace) == 0 else mesh.data.materialNameSpace
+        self.name = nameSpace + '.' + mesh.name
+        Logger.log('processing begun of baked material:  ' +  mesh.name, 2)
+
+        # changes to cycles & smart_project occurred in 2.77; need to know what we are running
+        bVersion = blenderMajorMinorVersion()
+
+        # any baking already took in the values. Do not want to apply them again, but want shadows to show.
+        # These are the default values from StandardMaterials
+        self.ambient = Color((0, 0, 0))
+        self.diffuse = Color((0.8, 0.8, 0.8)) # needed for shadows, but not change anything else
+        self.specular = Color((1, 1, 1))
+        self.emissive = Color((0, 0, 0))
+        self.specularPower = 64
+        self.alpha = 1.0
+
+        self.backFaceCulling = recipe.backFaceCulling
+
+        # texture is baked from selected mesh(es), need to insure this mesh is only one selected
+        bpy.ops.object.select_all(action='DESELECT')
+        mesh.select = True
+
+        # store setting to restore
+        engine = exporter.scene.render.engine
+
+        # mode_set's only work when there is an active object
+        exporter.scene.objects.active = mesh
+
+         # UV unwrap operates on mesh in only edit mode, procedurals can also give error of 'no images to be found' when not done
+         # select all verticies of mesh, since smart_project works only with selected verticies
+        bpy.ops.object.mode_set(mode='EDIT')
+        bpy.ops.mesh.select_all(action='SELECT')
+
+        # you need UV on a mesh in order to bake image.  This is not reqd for procedural textures, so may not exist
+        # need to look if it might already be created, if so use the first one
+        uv = mesh.data.uv_textures[0] if len(mesh.data.uv_textures) > 0 else None
+
+        if uv == None or recipe.forceBaking:
+            mesh.data.uv_textures.new('BakingUV')
+            uv = mesh.data.uv_textures['BakingUV']
+            uv.active = True
+            uv.active_render = not recipe.forceBaking # want the other uv's for the source when combining
+
+            if bVersion <= 2.76:
+                bpy.ops.uv.smart_project(angle_limit = 66.0, island_margin = 0.0, user_area_weight = 1.0, use_aspect = True)
+            else:
+                bpy.ops.uv.smart_project(angle_limit = 66.0, island_margin = 0.0, user_area_weight = 1.0, use_aspect = True, stretch_to_bounds = True)
+
+            # syntax for using unwrap enstead of smart project
+#            bpy.ops.uv.unwrap(margin = 1.0) # defaulting on all
+            uvName = 'BakingUV'  # issues with cycles when not done this way
+        else:
+            uvName = uv.name
+
+        format = 'PNG' if recipe.usePNG else 'JPEG'
+
+        # create a temporary image & link it to the UV/Image Editor so bake_image works
+        image = bpy.data.images.new(name = mesh.name + '_BJS_BAKE', width = recipe.bakeSize, height = recipe.bakeSize, alpha = recipe.usePNG, float_buffer = False)
+        image.file_format = format
+        image.mapping = 'UV' # default value
+
+        image_settings = exporter.scene.render.image_settings
+        image_settings.file_format = format
+        image_settings.color_mode = 'RGBA' if recipe.usePNG else 'RGB'
+        image_settings.quality = recipe.bakeQuality # for lossy compression formats
+        image_settings.compression = recipe.bakeQuality  # Amount of time to determine best compression: 0 = no compression with fast file output, 100 = maximum lossless compression with slow file output
+
+        # now go thru all the textures that need to be baked
+        if recipe.diffuseBaking:
+            cycles_type = 'DIFFUSE_COLOR' if bVersion <= 2.76 else 'DIFFUSE'
+            self.bake('diffuseTexture', cycles_type, 'TEXTURE', image, mesh, uvName, exporter, recipe)
+
+        if recipe.ambientBaking:
+            self.bake('ambientTexture', 'AO', 'AO', image, mesh, uvName, exporter, recipe)
+
+        if recipe.opacityBaking:  # no eqivalent found for cycles
+            self.bake('opacityTexture', None, 'ALPHA', image, mesh, uvName, exporter, recipe)
+
+        if recipe.reflectionBaking:  # no eqivalent found for cycles
+            self.bake('reflectionTexture', None, 'MIRROR_COLOR', image, mesh, uvName, exporter, recipe)
+
+        if recipe.emissiveBaking:
+            self.bake('emissiveTexture', 'EMIT', 'EMIT', image, mesh, uvName, exporter, recipe)
+
+        if recipe.bumpBaking:
+            self.bake('bumpTexture', 'NORMAL', 'NORMALS', image, mesh, uvName, exporter, recipe)
+
+        if recipe.specularBaking:
+            cycles_type = 'SPECULAR' if bVersion <= 2.76 else 'GLOSSY'
+            self.bake('specularTexture', cycles_type, 'SPEC_COLOR', image, mesh, uvName, exporter, recipe)
+
+        # Toggle vertex selection & mode, if setting changed their value
+        bpy.ops.mesh.select_all(action='TOGGLE')  # still in edit mode toggle select back to previous
+        bpy.ops.object.mode_set(toggle=True)      # change back to Object
+
+        bpy.ops.object.select_all(action='TOGGLE') # change scene selection back, not seeming to work
+
+        exporter.scene.render.engine = engine
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def bake(self, bjs_type, cycles_type, internal_type, image, mesh, uvName, exporter, recipe):
+        extension = '.png' if recipe.usePNG else '.jpg'
+
+        if recipe.cyclesRender:
+            if cycles_type is None:
+                return
+            self.bakeCycles(cycles_type, image, uvName, recipe.nodeTrees, extension)
+        else:
+            self.bakeInternal(internal_type, image, uvName, extension)
+
+        self.textures.append(Texture(bjs_type, 1.0, image, mesh, exporter))
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def bakeInternal(self, bake_type, image, uvName, extension):
+        Logger.log('Internal baking texture, type: ' + bake_type + ', mapped using: ' + uvName, 3)
+        # need to use the legal name, since this will become the file name, chars like ':' not legal
+        legalName = legal_js_identifier(self.name)
+        image.filepath = legalName + '_' + bake_type + extension
+
+        scene = bpy.context.scene
+        scene.render.engine = 'BLENDER_RENDER'
+
+        scene.render.bake_type = bake_type
+
+        # assign the image to the UV Editor, which does not have to shown
+        bpy.data.screens['UV Editing'].areas[1].spaces[0].image = image
+
+        renderer = scene.render
+        renderer.use_bake_selected_to_active = False
+        renderer.use_bake_to_vertex_color = False
+        renderer.use_bake_clear = False
+        renderer.bake_quad_split = 'AUTO'
+        renderer.bake_margin = 5
+        renderer.use_file_extension = True
+
+        renderer.use_bake_normalize = True
+        renderer.use_bake_antialiasing = True
+
+        bpy.ops.object.bake_image()
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    def bakeCycles(self, bake_type, image, uvName, nodeTrees, extension):
+        Logger.log('Cycles baking texture, type: ' + bake_type + ', mapped using: ' + uvName, 3)
+        legalName = legal_js_identifier(self.name)
+        image.filepath = legalName + '_' + bake_type + extension
+
+        scene = bpy.context.scene
+        scene.render.engine = 'CYCLES'
+
+        # create an unlinked temporary node to bake to for each material
+        for tree in nodeTrees:
+            bakeNode = tree.nodes.new(type='ShaderNodeTexImage')
+            bakeNode.image = image
+            bakeNode.select = True
+            tree.nodes.active = bakeNode
+
+        bpy.ops.object.bake(type = bake_type, use_clear = True, margin = 5, use_selected_to_active = False)
+
+        for tree in nodeTrees:
+            tree.nodes.remove(tree.nodes.active)
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    @staticmethod
+    def meshBakingClean(mesh):
+        for uvMap in mesh.data.uv_textures:
+            if uvMap.name == 'BakingUV':
+                mesh.data.uv_textures.remove(uvMap)
+                break
+
+        # remove an image if it was baked
+        for image in bpy.data.images:
+            if image.name == mesh.name + '_BJS_BAKE':
+                image.user_clear() # cannot remove image unless 0 references
+                bpy.data.images.remove(image)
+                break

Exporters/Blender/src/mesh.py → Exporters/Blender/src/babylon-js/mesh.py


Exporters/Blender/src/package_level.py → Exporters/Blender/src/babylon-js/package_level.py


Exporters/Blender/src/sound.py → Exporters/Blender/src/babylon-js/sound.py


Exporters/Blender/src/world.py → Exporters/Blender/src/babylon-js/world.py


+ 0 - 70
Exporters/Blender/src/exporter_settings_panel.py

@@ -1,70 +0,0 @@
-from .package_level import *
-
-import bpy
-# Panel displayed in Scene Tab of properties, so settings can be saved in a .blend file
-class ExporterSettingsPanel(bpy.types.Panel):
-    bl_label = get_title()
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = 'scene'
-
-    bpy.types.Scene.export_onlySelectedLayer = bpy.props.BoolProperty(
-        name="Export only selected layers",
-        description="Export only selected layers",
-        default = False,
-        )
-    bpy.types.Scene.export_flatshadeScene = bpy.props.BoolProperty(
-        name="Flat shade entire scene",
-        description="Use face normals on all meshes.  Increases vertices.",
-        default = False,
-        )
-    bpy.types.Scene.attachedSound = bpy.props.StringProperty(
-        name='Sound',
-        description='',
-        default = ''
-        )
-    bpy.types.Scene.loopSound = bpy.props.BoolProperty(
-        name='Loop sound',
-        description='',
-        default = True
-        )
-    bpy.types.Scene.autoPlaySound = bpy.props.BoolProperty(
-        name='Auto play sound',
-        description='',
-        default = True
-        )
-    bpy.types.Scene.inlineTextures = bpy.props.BoolProperty(
-        name="inline",
-        description="turn textures into encoded strings, for direct inclusion into source code",
-        default = False,
-        )
-    bpy.types.Scene.textureDir = bpy.props.StringProperty(
-        name='sub-directory',
-        description='The path below the output directory to write texture files (any separators OS dependent)',
-        default = ''
-        )
-    bpy.types.Scene.ignoreIKBones = bpy.props.BoolProperty(
-        name="Ignore IK Bones",
-        description="Do not export bones with either '.ik' or 'ik.'(not case sensitive) in the name",
-        default = False,
-        )
-
-    def draw(self, context):
-        layout = self.layout
-
-        scene = context.scene
-        layout.prop(scene, "export_onlySelectedLayer")
-        layout.prop(scene, "export_flatshadeScene")
-        layout.prop(scene, "ignoreIKBones")
-
-        box = layout.box()
-        box.label(text='Texture Location:')
-        box.prop(scene, "inlineTextures")
-        row = box.row()
-        row.enabled = not scene.inlineTextures
-        row.prop(scene, "textureDir")
-
-        box = layout.box()
-        box.prop(scene, 'attachedSound')
-        box.prop(scene, 'autoPlaySound')
-        box.prop(scene, 'loopSound')

+ 0 - 297
Exporters/Blender/src/json_exporter.py

@@ -1,297 +0,0 @@
-from .animation import *
-from .armature import *
-from .camera import *
-from .exporter_settings_panel import *
-from .light_shadow import *
-from .logger import *
-from .material import *
-from .mesh import *
-from .package_level import *
-from .sound import *
-from .world import *
-
-import bpy
-from io import open
-from os import path, makedirs
-#===============================================================================
-class JsonExporter:
-    nameSpace   = None  # assigned in execute
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def execute(self, context, filepath):
-        scene = context.scene
-        self.scene = scene # reference for passing
-        self.fatalError = None
-        try:
-            self.filepathMinusExtension = filepath.rpartition('.')[0]
-            JsonExporter.nameSpace = getNameSpace(self.filepathMinusExtension)
-
-            log = Logger(self.filepathMinusExtension + '.log')
-
-            if bpy.ops.object.mode_set.poll():
-                bpy.ops.object.mode_set(mode = 'OBJECT')
-
-            # assign texture location, purely temporary if inlining
-            self.textureDir = path.dirname(filepath)
-            if not scene.inlineTextures:
-                self.textureDir = path.join(self.textureDir, scene.textureDir)
-                if not path.isdir(self.textureDir):
-                    makedirs(self.textureDir)
-                    Logger.warn("Texture sub-directory did not already exist, created: " + self.textureDir)
-
-            Logger.log('========= Conversion from Blender to Babylon.js =========', 0)
-            Logger.log('Scene settings used:', 1)
-            Logger.log('selected layers only:  ' + format_bool(scene.export_onlySelectedLayer), 2)
-            Logger.log('flat shading entire scene:  ' + format_bool(scene.export_flatshadeScene), 2)
-            Logger.log('inline textures:  ' + format_bool(scene.inlineTextures), 2)
-            if not scene.inlineTextures:
-                Logger.log('texture directory:  ' + self.textureDir, 2)
-
-            self.world = World(scene)
-
-            bpy.ops.screen.animation_cancel()
-            currentFrame = bpy.context.scene.frame_current
-
-            # Active camera
-            if scene.camera != None:
-                self.activeCamera = scene.camera.name
-            else:
-                Logger.warn('No active camera has been assigned, or is not in a currently selected Blender layer')
-
-            self.cameras = []
-            self.lights = []
-            self.shadowGenerators = []
-            self.skeletons = []
-            skeletonId = 0
-            self.meshesAndNodes = []
-            self.materials = []
-            self.multiMaterials = []
-            self.sounds = []
-
-            # Scene level sound
-            if scene.attachedSound != '':
-                self.sounds.append(Sound(scene.attachedSound, scene.autoPlaySound, scene.loopSound))
-
-            # separate loop doing all skeletons, so available in Mesh to make skipping IK bones possible
-            for object in [object for object in scene.objects]:
-                scene.frame_set(currentFrame)
-                if object.type == 'ARMATURE':  #skeleton.pose.bones
-                    if object.is_visible(scene):
-                        self.skeletons.append(Skeleton(object, scene, skeletonId, scene.ignoreIKBones))
-                        skeletonId += 1
-                    else:
-                        Logger.warn('The following armature not visible in scene thus ignored: ' + object.name)
-
-            # exclude lamps in this pass, so ShadowGenerator constructor can be passed meshesAnNodes
-            for object in [object for object in scene.objects]:
-                scene.frame_set(currentFrame)
-                if object.type == 'CAMERA':
-                    if object.is_visible(scene): # no isInSelectedLayer() required, is_visible() handles this for them
-                        self.cameras.append(Camera(object))
-                    else:
-                        Logger.warn('The following camera not visible in scene thus ignored: ' + object.name)
-
-                elif object.type == 'MESH':
-                    forcedParent = None
-                    nameID = ''
-                    nextStartFace = 0
-
-                    while True and self.isInSelectedLayer(object, scene):
-                        mesh = Mesh(object, scene, nextStartFace, forcedParent, nameID, self)
-                        if mesh.hasUnappliedTransforms and hasattr(mesh, 'skeletonWeights'):
-                            self.fatalError = 'Mesh: ' + mesh.name + ' has unapplied transformations.  This will never work for a mesh with an armature.  Export cancelled'
-                            Logger.log(self.fatalError)
-                            return
-
-                        if hasattr(mesh, 'instances'):
-                            self.meshesAndNodes.append(mesh)
-                        else:
-                            break
-
-                        if object.data.attachedSound != '':
-                            self.sounds.append(Sound(object.data.attachedSound, object.data.autoPlaySound, object.data.loopSound, object))
-
-                        nextStartFace = mesh.offsetFace
-                        if nextStartFace == 0:
-                            break
-
-                        if forcedParent is None:
-                            nameID = 0
-                            forcedParent = object
-                            Logger.warn('The following mesh has exceeded the maximum # of vertex elements & will be broken into multiple Babylon meshes: ' + object.name)
-
-                        nameID = nameID + 1
-
-                elif object.type == 'EMPTY':
-                    self.meshesAndNodes.append(Node(object))
-
-                elif object.type != 'LAMP' and object.type != 'ARMATURE':
-                    Logger.warn('The following object (type - ' +  object.type + ') is not currently exportable thus ignored: ' + object.name)
-
-            # Lamp / shadow Generator pass; meshesAnNodes complete & forceParents included
-            for object in [object for object in scene.objects]:
-                if object.type == 'LAMP':
-                    if object.is_visible(scene): # no isInSelectedLayer() required, is_visible() handles this for them
-                        bulb = Light(object, self.meshesAndNodes)
-                        self.lights.append(bulb)
-                        if object.data.shadowMap != 'NONE':
-                            if bulb.light_type == DIRECTIONAL_LIGHT or bulb.light_type == SPOT_LIGHT:
-                                self.shadowGenerators.append(ShadowGenerator(object, self.meshesAndNodes, scene))
-                            else:
-                                Logger.warn('Only directional (sun) and spot types of lamp are valid for shadows thus ignored: ' + object.name)
-                    else:
-                        Logger.warn('The following lamp not visible in scene thus ignored: ' + object.name)
-
-            bpy.context.scene.frame_set(currentFrame)
-
-            # output file
-            self.to_scene_file()
-
-        except:# catch *all* exceptions
-            log.log_error_stack()
-            raise
-
-        finally:
-            log.close()
-
-        self.nWarnings = log.nWarnings
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def to_scene_file(self):
-        Logger.log('========= Writing of scene file started =========', 0)
-        # Open file
-        file_handler = open(self.filepathMinusExtension + '.babylon', 'w', encoding='utf8')
-        file_handler.write('{')
-        file_handler.write('"producer":{"name":"Blender","version":"' + bpy.app.version_string + '","exporter_version":"' + format_exporter_version() + '","file":"' + JsonExporter.nameSpace + '.babylon"},\n')
-        self.world.to_scene_file(file_handler)
-
-        # Materials
-        file_handler.write(',\n"materials":[')
-        first = True
-        for material in self.materials:
-            if first != True:
-                file_handler.write(',\n')
-
-            first = False
-            material.to_scene_file(file_handler)
-        file_handler.write(']')
-
-        # Multi-materials
-        file_handler.write(',\n"multiMaterials":[')
-        first = True
-        for multimaterial in self.multiMaterials:
-            if first != True:
-                file_handler.write(',')
-
-            first = False
-            multimaterial.to_scene_file(file_handler)
-        file_handler.write(']')
-
-        # Armatures/Bones
-        file_handler.write(',\n"skeletons":[')
-        first = True
-        for skeleton in self.skeletons:
-            if first != True:
-                file_handler.write(',')
-
-            first = False
-            skeleton.to_scene_file(file_handler)
-        file_handler.write(']')
-
-        # Meshes
-        file_handler.write(',\n"meshes":[')
-        first = True
-        for mesh in self.meshesAndNodes:
-            if first != True:
-                file_handler.write(',')
-
-            first = False
-            mesh.to_scene_file(file_handler)
-        file_handler.write(']')
-
-        # Cameras
-        file_handler.write(',\n"cameras":[')
-        first = True
-        for camera in self.cameras:
-            if hasattr(camera, 'fatalProblem'): continue
-            if first != True:
-                file_handler.write(',')
-
-            first = False
-            camera.update_for_target_attributes(self.meshesAndNodes)
-            camera.to_scene_file(file_handler)
-        file_handler.write(']')
-
-        # Active camera
-        if hasattr(self, 'activeCamera'):
-            write_string(file_handler, 'activeCamera', self.activeCamera)
-
-        # Lights
-        file_handler.write(',\n"lights":[')
-        first = True
-        for light in self.lights:
-            if first != True:
-                file_handler.write(',')
-
-            first = False
-            light.to_scene_file(file_handler)
-        file_handler.write(']')
-
-        # Shadow generators
-        file_handler.write(',\n"shadowGenerators":[')
-        first = True
-        for shadowGen in self.shadowGenerators:
-            if first != True:
-                file_handler.write(',')
-
-            first = False
-            shadowGen.to_scene_file(file_handler)
-        file_handler.write(']')
-
-        # Sounds
-        if len(self.sounds) > 0:
-            file_handler.write('\n,"sounds":[')
-            first = True
-            for sound in self.sounds:
-                if first != True:
-                    file_handler.write(',')
-
-                first = False
-                sound.to_scene_file(file_handler)
-
-            file_handler.write(']')
-
-        # Closing
-        file_handler.write('\n}')
-        file_handler.close()
-        Logger.log('========= Writing of scene file completed =========', 0)
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def getMaterial(self, baseMaterialId):
-        fullName = JsonExporter.nameSpace + '.' + baseMaterialId
-        for material in self.materials:
-            if material.name == fullName:
-                return material
-
-        return None
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def getSourceMeshInstance(self, dataName):
-        for mesh in self.meshesAndNodes:
-            # nodes have no 'dataName', cannot be instanced in any case
-            if hasattr(mesh, 'dataName') and mesh.dataName == dataName:
-                return mesh
-
-        return None
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def isInSelectedLayer(self, obj, scene):
-        if not scene.export_onlySelectedLayer:
-            return True
-
-        for l in range(0, len(scene.layers)):
-            if obj.layers[l] and scene.layers[l]:
-                return True
-        return False
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def get_skeleton(self, name):
-        for skeleton in self.skeletons:
-            if skeleton.name == name:
-                return skeleton
-        #really cannot happen, will cause exception in caller
-        return None

+ 0 - 577
Exporters/Blender/src/material.py

@@ -1,577 +0,0 @@
-from .logger import *
-from .package_level import *
-
-import bpy
-from base64 import b64encode
-from mathutils import Color
-from os import path, remove
-from shutil import copy
-from sys import exc_info # for writing errors to log file
-
-# used in Texture constructor, defined in BABYLON.Texture
-CLAMP_ADDRESSMODE = 0
-WRAP_ADDRESSMODE = 1
-MIRROR_ADDRESSMODE = 2
-
-# used in Texture constructor, defined in BABYLON.Texture
-EXPLICIT_MODE = 0
-SPHERICAL_MODE = 1
-#PLANAR_MODE = 2
-CUBIC_MODE = 3
-#PROJECTION_MODE = 4
-#SKYBOX_MODE = 5
-
-DEFAULT_MATERIAL_NAMESPACE = 'Same as Filename'
-#===============================================================================
-class MultiMaterial:
-    def __init__(self, material_slots, idx, nameSpace):
-        self.name = nameSpace + '.' + 'Multimaterial#' + str(idx)
-        Logger.log('processing begun of multimaterial:  ' + self.name, 2)
-        self.material_slots = material_slots
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def to_scene_file(self, file_handler):
-        file_handler.write('{')
-        write_string(file_handler, 'name', self.name, True)
-        write_string(file_handler, 'id', self.name)
-
-        file_handler.write(',"materials":[')
-        first = True
-        for material in self.material_slots:
-            if first != True:
-                file_handler.write(',')
-            file_handler.write('"' + material.name +'"')
-            first = False
-        file_handler.write(']')
-        file_handler.write('}')
-#===============================================================================
-class Texture:
-    def __init__(self, slot, level, textureOrImage, mesh, exporter):
-        wasBaked = not hasattr(textureOrImage, 'uv_layer')
-        if wasBaked:
-            image = textureOrImage
-            texture = None
-
-            repeat = False
-            self.hasAlpha = False
-            self.coordinatesIndex = 0
-        else:
-            texture = textureOrImage
-            image = texture.texture.image
-
-            repeat = texture.texture.extension == 'REPEAT'
-            self.hasAlpha = texture.texture.use_alpha
-
-            usingMap = texture.uv_layer
-            if len(usingMap) == 0:
-                usingMap = mesh.data.uv_textures[0].name
-
-            Logger.log('Image texture found, type:  ' + slot + ', mapped using: "' + usingMap + '"', 4)
-            if mesh.data.uv_textures[0].name == usingMap:
-                self.coordinatesIndex = 0
-            elif mesh.data.uv_textures[1].name == usingMap:
-                self.coordinatesIndex = 1
-            else:
-                Logger.warn('Texture is not mapped as UV or UV2, assigned 1', 5)
-                self.coordinatesIndex = 0
-
-        # always write the file out, since base64 encoding is easiest from a file
-        try:
-            imageFilepath = path.normpath(bpy.path.abspath(image.filepath))
-            basename = path.basename(imageFilepath)
-
-            internalImage = image.packed_file or wasBaked
-
-            # when coming from either a packed image or a baked image, then save_render
-            if internalImage:
-                if exporter.scene.inlineTextures:
-                    textureFile = path.join(exporter.textureDir, basename + "temp")
-                else:
-                    textureFile = path.join(exporter.textureDir, basename)
-
-                image.save_render(textureFile)
-
-            # when backed by an actual file, copy to target dir, unless inlining
-            else:
-                textureFile = bpy.path.abspath(image.filepath)
-                if not exporter.scene.inlineTextures:
-                    copy(textureFile, exporter.textureDir)
-        except:
-            ex = exc_info()
-            Logger.warn('Error encountered processing image file:  ' + ', Error:  '+ str(ex[1]))
-
-        if exporter.scene.inlineTextures:
-            # base64 is easiest from a file, so sometimes a temp file was made above;  need to delete those
-            with open(textureFile, "rb") as image_file:
-                asString = b64encode(image_file.read()).decode()
-            self.encoded_URI = 'data:image/' + image.file_format + ';base64,' + asString
-
-            if internalImage:
-                remove(textureFile)
-
-        # capture texture attributes
-        self.slot = slot
-        self.name = basename
-        self.level = level
-
-        if (texture and texture.mapping == 'CUBE'):
-            self.coordinatesMode = CUBIC_MODE
-        if (texture and texture.mapping == 'SPHERE'):
-            self.coordinatesMode = SPHERICAL_MODE
-        else:
-            self.coordinatesMode = EXPLICIT_MODE
-
-        self.uOffset = texture.offset.x if texture else 0.0
-        self.vOffset = texture.offset.y if texture else 0.0
-        self.uScale  = texture.scale.x  if texture else 1.0
-        self.vScale  = texture.scale.y  if texture else 1.0
-        self.uAng = 0
-        self.vAng = 0
-        self.wAng = 0
-
-        if (repeat):
-            if (texture.texture.use_mirror_x):
-                self.wrapU = MIRROR_ADDRESSMODE
-            else:
-                self.wrapU = WRAP_ADDRESSMODE
-
-            if (texture.texture.use_mirror_y):
-                self.wrapV = MIRROR_ADDRESSMODE
-            else:
-                self.wrapV = WRAP_ADDRESSMODE
-        else:
-            self.wrapU = CLAMP_ADDRESSMODE
-            self.wrapV = CLAMP_ADDRESSMODE
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def to_scene_file(self, file_handler):
-        file_handler.write(', \n"' + self.slot + '":{')
-        write_string(file_handler, 'name', self.name, True)
-        write_float(file_handler, 'level', self.level)
-        write_float(file_handler, 'hasAlpha', self.hasAlpha)
-        write_int(file_handler, 'coordinatesMode', self.coordinatesMode)
-        write_float(file_handler, 'uOffset', self.uOffset)
-        write_float(file_handler, 'vOffset', self.vOffset)
-        write_float(file_handler, 'uScale', self.uScale)
-        write_float(file_handler, 'vScale', self.vScale)
-        write_float(file_handler, 'uAng', self.uAng)
-        write_float(file_handler, 'vAng', self.vAng)
-        write_float(file_handler, 'wAng', self.wAng)
-        write_int(file_handler, 'wrapU', self.wrapU)
-        write_int(file_handler, 'wrapV', self.wrapV)
-        write_int(file_handler, 'coordinatesIndex', self.coordinatesIndex)
-        if hasattr(self,'encoded_URI'):
-            write_string(file_handler, 'base64String', self.encoded_URI)
-        file_handler.write('}')
-#===============================================================================
-# need to evaluate the need to bake a mesh before even starting; class also stores specific types of bakes
-class BakingRecipe:
-    def __init__(self, mesh):
-        # transfer from Mesh custom properties
-        self.bakeSize    = mesh.data.bakeSize
-        self.bakeQuality = mesh.data.bakeQuality # for lossy compression formats
-        self.forceBaking = mesh.data.forceBaking # in mesh, but not currently exposed
-        self.usePNG      = mesh.data.usePNG      # in mesh, but not currently exposed
-
-        # initialize all members
-        self.needsBaking      = self.forceBaking
-        self.diffuseBaking    = self.forceBaking
-        self.ambientBaking    = False
-        self.opacityBaking    = False
-        self.reflectionBaking = False
-        self.emissiveBaking   = False
-        self.bumpBaking       = False
-        self.specularBaking   = False
-
-        # need to make sure a single render
-        self.cyclesRender     = False
-        blenderRender         = False
-
-        # accumulators set by Blender Game
-        self.backFaceCulling = True  # used only when baking
-        self.isBillboard = len(mesh.material_slots) == 1 and mesh.material_slots[0].material.game_settings.face_orientation == 'BILLBOARD'
-
-        # Cycles specific, need to get the node trees of each material
-        self.nodeTrees = []
-
-        for material_slot in mesh.material_slots:
-            # a material slot is not a reference to an actual material; need to look up
-            material = material_slot.material
-
-            self.backFaceCulling &= material.game_settings.use_backface_culling
-
-            # testing for Cycles renderer has to be different
-            if material.use_nodes == True:
-                self.needsBaking = True
-                self.cyclesRender = True
-                self.nodeTrees.append(material.node_tree)
-
-                for node in material.node_tree.nodes:
-                    id = node.bl_idname
-                    if id == 'ShaderNodeBsdfDiffuse':
-                        self.diffuseBaking = True
-
-                    if id == 'ShaderNodeAmbientOcclusion':
-                        self.ambientBaking = True
-
-                    # there is no opacity baking for Cycles AFAIK
-                    if id == '':
-                        self.opacityBaking = True
-
-                    if id == 'ShaderNodeEmission':
-                        self.emissiveBaking = True
-
-                    if id == 'ShaderNodeNormal' or id == 'ShaderNodeNormalMap':
-                        self.bumpBaking = True
-
-                    if id == '':
-                        self.specularBaking = True
-
-            else:
-                blenderRender = True
-                nDiffuseImages = 0
-                nReflectionImages = 0
-                nAmbientImages = 0
-                nOpacityImages = 0
-                nEmissiveImages = 0
-                nBumpImages = 0
-                nSpecularImages = 0
-
-                textures = [mtex for mtex in material.texture_slots if mtex and mtex.texture]
-                for mtex in textures:
-                    # ignore empty slots
-                    if mtex.texture.type == 'NONE':
-                        continue
-
-                    # for images, just need to make sure there is only 1 per type
-                    if mtex.texture.type == 'IMAGE' and not self.forceBaking:
-                        if mtex.use_map_diffuse or mtex.use_map_color_diffuse:
-                            if mtex.texture_coords == 'REFLECTION':
-                                nReflectionImages += 1
-                            else:
-                                nDiffuseImages += 1
-
-                        if mtex.use_map_ambient:
-                            nAmbientImages += 1
-
-                        if mtex.use_map_alpha:
-                            nOpacityImages += 1
-
-                        if mtex.use_map_emit:
-                            nEmissiveImages += 1
-
-                        if mtex.use_map_normal:
-                            nBumpImages += 1
-
-                        if mtex.use_map_color_spec:
-                            nSpecularImages += 1
-
-                    else:
-                        self.needsBaking = True
-
-                        if mtex.use_map_diffuse or mtex.use_map_color_diffuse:
-                            if mtex.texture_coords == 'REFLECTION':
-                                self.reflectionBaking = True
-                            else:
-                                self.diffuseBaking = True
-
-                        if mtex.use_map_ambient:
-                            self.ambientBaking = True
-
-                        if mtex.use_map_alpha and material.alpha > 0:
-                            self.opacityBaking = True
-
-                        if mtex.use_map_emit:
-                            self.emissiveBaking = True
-
-                        if mtex.use_map_normal:
-                            self.bumpBaking = True
-
-                        if mtex.use_map_color_spec:
-                            self.specularBaking = True
-
-                # 2nd pass 2 check for multiples of a given image type
-                if nDiffuseImages > 1:
-                    self.needsBaking = self.diffuseBaking = True
-                if nReflectionImages > 1:
-                    self.needsBaking = self.nReflectionImages = True
-                if nAmbientImages > 1:
-                    self.needsBaking = self.ambientBaking = True
-                if nOpacityImages > 1:
-                    self.needsBaking = self.opacityBaking = True
-                if nEmissiveImages > 1:
-                    self.needsBaking = self.emissiveBaking = True
-                if nBumpImages > 1:
-                    self.needsBaking = self.bumpBaking = True
-                if nSpecularImages > 1:
-                    self.needsBaking = self.specularBaking = True
-
-        self.multipleRenders = blenderRender and self.cyclesRender
-
-        # check for really old .blend file, eg. 2.49, to ensure that everything requires exists
-        if self.needsBaking and bpy.data.screens.find('UV Editing') == -1:
-            Logger.warn('Contains material requiring baking, but resources not available.  Probably .blend very old', 2)
-            self.needsBaking = False
-#===============================================================================
-# Not intended to be instanced directly
-class Material:
-    def __init__(self, checkReadyOnlyOnce, maxSimultaneousLights):
-        self.checkReadyOnlyOnce = checkReadyOnlyOnce
-        self.maxSimultaneousLights = maxSimultaneousLights
-        # first pass of textures, either appending image type or recording types of bakes to do
-        self.textures = []
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def to_scene_file(self, file_handler):
-        file_handler.write('{')
-        write_string(file_handler, 'name', self.name, True)
-        write_string(file_handler, 'id', self.name)
-        write_color(file_handler, 'ambient', self.ambient)
-        write_color(file_handler, 'diffuse', self.diffuse)
-        write_color(file_handler, 'specular', self.specular)
-        write_color(file_handler, 'emissive', self.emissive)
-        write_float(file_handler, 'specularPower', self.specularPower)
-        write_float(file_handler, 'alpha', self.alpha)
-        write_bool(file_handler, 'backFaceCulling', self.backFaceCulling)
-        write_bool(file_handler, 'checkReadyOnlyOnce', self.checkReadyOnlyOnce)
-        write_int(file_handler, 'maxSimultaneousLights', self.maxSimultaneousLights)
-        for texSlot in self.textures:
-            texSlot.to_scene_file(file_handler)
-
-        file_handler.write('}')
-#===============================================================================
-class StdMaterial(Material):
-    def __init__(self, material_slot, exporter, mesh):
-        super().__init__(mesh.data.checkReadyOnlyOnce, mesh.data.maxSimultaneousLights)
-        nameSpace = exporter.nameSpace if mesh.data.materialNameSpace == DEFAULT_MATERIAL_NAMESPACE or len(mesh.data.materialNameSpace) == 0 else mesh.data.materialNameSpace
-        self.name = nameSpace + '.' + material_slot.name
-
-        Logger.log('processing begun of Standard material:  ' +  material_slot.name, 2)
-
-        # a material slot is not a reference to an actual material; need to look up
-        material = material_slot.material
-
-        self.ambient = material.ambient * material.diffuse_color
-        self.diffuse = material.diffuse_intensity * material.diffuse_color
-        self.specular = material.specular_intensity * material.specular_color
-        self.emissive = material.emit * material.diffuse_color
-        self.specularPower = material.specular_hardness
-        self.alpha = material.alpha
-
-        self.backFaceCulling = material.game_settings.use_backface_culling
-
-        textures = [mtex for mtex in material.texture_slots if mtex and mtex.texture]
-        for mtex in textures:
-            # test should be un-neccessary, since should be a BakedMaterial; just for completeness
-            if (mtex.texture.type != 'IMAGE'):
-                continue
-            elif not mtex.texture.image:
-                Logger.warn('Material has un-assigned image texture:  "' + mtex.name + '" ignored', 3)
-                continue
-            elif len(mesh.data.uv_textures) == 0:
-                Logger.warn('Mesh has no UV maps, material:  "' + mtex.name + '" ignored', 3)
-                continue
-
-            if mtex.use_map_diffuse or mtex.use_map_color_diffuse:
-                if mtex.texture_coords == 'REFLECTION':
-                    Logger.log('Reflection texture found "' + mtex.name + '"', 3)
-                    self.textures.append(Texture('reflectionTexture', mtex.diffuse_color_factor, mtex, mesh, exporter))
-                else:
-                    Logger.log('Diffuse texture found "' + mtex.name + '"', 3)
-                    self.textures.append(Texture('diffuseTexture', mtex.diffuse_color_factor, mtex, mesh, exporter))
-
-            if mtex.use_map_ambient:
-                Logger.log('Ambient texture found "' + mtex.name + '"', 3)
-                self.textures.append(Texture('ambientTexture', mtex.ambient_factor, mtex, mesh, exporter))
-
-            if mtex.use_map_alpha:
-                if self.alpha > 0:
-                    Logger.log('Opacity texture found "' + mtex.name + '"', 3)
-                    self.textures.append(Texture('opacityTexture', mtex.alpha_factor, mtex, mesh, exporter))
-                else:
-                    Logger.warn('Opacity non-std way to indicate opacity, use material alpha to also use Opacity texture', 4)
-                    self.alpha = 1
-
-            if mtex.use_map_emit:
-                Logger.log('Emissive texture found "' + mtex.name + '"', 3)
-                self.textures.append(Texture('emissiveTexture', mtex.emit_factor, mtex, mesh, exporter))
-
-            if mtex.use_map_normal:
-                Logger.log('Bump texture found "' + mtex.name + '"', 3)
-                self.textures.append(Texture('bumpTexture', 1.0 / mtex.normal_factor, mtex, mesh, exporter))
-
-            if mtex.use_map_color_spec:
-                Logger.log('Specular texture found "' + mtex.name + '"', 3)
-                self.textures.append(Texture('specularTexture', mtex.specular_color_factor, mtex, mesh, exporter))
-#===============================================================================
-class BakedMaterial(Material):
-    def __init__(self, exporter, mesh, recipe):
-        super().__init__(mesh.data.checkReadyOnlyOnce, mesh.data.maxSimultaneousLights)
-        nameSpace = exporter.nameSpace if mesh.data.materialNameSpace == DEFAULT_MATERIAL_NAMESPACE or len(mesh.data.materialNameSpace) == 0 else mesh.data.materialNameSpace
-        self.name = nameSpace + '.' + mesh.name
-        Logger.log('processing begun of baked material:  ' +  mesh.name, 2)
-
-        # changes to cycles & smart_project occurred in 2.77; need to know what we are running
-        bVersion = blenderMajorMinorVersion()
-
-        # any baking already took in the values. Do not want to apply them again, but want shadows to show.
-        # These are the default values from StandardMaterials
-        self.ambient = Color((0, 0, 0))
-        self.diffuse = Color((0.8, 0.8, 0.8)) # needed for shadows, but not change anything else
-        self.specular = Color((1, 1, 1))
-        self.emissive = Color((0, 0, 0))
-        self.specularPower = 64
-        self.alpha = 1.0
-
-        self.backFaceCulling = recipe.backFaceCulling
-
-        # texture is baked from selected mesh(es), need to insure this mesh is only one selected
-        bpy.ops.object.select_all(action='DESELECT')
-        mesh.select = True
-
-        # store setting to restore
-        engine = exporter.scene.render.engine
-
-        # mode_set's only work when there is an active object
-        exporter.scene.objects.active = mesh
-
-         # UV unwrap operates on mesh in only edit mode, procedurals can also give error of 'no images to be found' when not done
-         # select all verticies of mesh, since smart_project works only with selected verticies
-        bpy.ops.object.mode_set(mode='EDIT')
-        bpy.ops.mesh.select_all(action='SELECT')
-
-        # you need UV on a mesh in order to bake image.  This is not reqd for procedural textures, so may not exist
-        # need to look if it might already be created, if so use the first one
-        uv = mesh.data.uv_textures[0] if len(mesh.data.uv_textures) > 0 else None
-
-        if uv == None or recipe.forceBaking:
-            mesh.data.uv_textures.new('BakingUV')
-            uv = mesh.data.uv_textures['BakingUV']
-            uv.active = True
-            uv.active_render = not recipe.forceBaking # want the other uv's for the source when combining
-
-            if bVersion <= 2.76:
-                bpy.ops.uv.smart_project(angle_limit = 66.0, island_margin = 0.0, user_area_weight = 1.0, use_aspect = True)
-            else:
-                bpy.ops.uv.smart_project(angle_limit = 66.0, island_margin = 0.0, user_area_weight = 1.0, use_aspect = True, stretch_to_bounds = True)
-
-            # syntax for using unwrap enstead of smart project
-#            bpy.ops.uv.unwrap(margin = 1.0) # defaulting on all
-            uvName = 'BakingUV'  # issues with cycles when not done this way
-        else:
-            uvName = uv.name
-
-        format = 'PNG' if recipe.usePNG else 'JPEG'
-
-        # create a temporary image & link it to the UV/Image Editor so bake_image works
-        image = bpy.data.images.new(name = mesh.name + '_BJS_BAKE', width = recipe.bakeSize, height = recipe.bakeSize, alpha = recipe.usePNG, float_buffer = False)
-        image.file_format = format
-        image.mapping = 'UV' # default value
-
-        image_settings = exporter.scene.render.image_settings
-        image_settings.file_format = format
-        image_settings.color_mode = 'RGBA' if recipe.usePNG else 'RGB'
-        image_settings.quality = recipe.bakeQuality # for lossy compression formats
-        image_settings.compression = recipe.bakeQuality  # Amount of time to determine best compression: 0 = no compression with fast file output, 100 = maximum lossless compression with slow file output
-
-        # now go thru all the textures that need to be baked
-        if recipe.diffuseBaking:
-            cycles_type = 'DIFFUSE_COLOR' if bVersion <= 2.76 else 'DIFFUSE'
-            self.bake('diffuseTexture', cycles_type, 'TEXTURE', image, mesh, uvName, exporter, recipe)
-
-        if recipe.ambientBaking:
-            self.bake('ambientTexture', 'AO', 'AO', image, mesh, uvName, exporter, recipe)
-
-        if recipe.opacityBaking:  # no eqivalent found for cycles
-            self.bake('opacityTexture', None, 'ALPHA', image, mesh, uvName, exporter, recipe)
-
-        if recipe.reflectionBaking:  # no eqivalent found for cycles
-            self.bake('reflectionTexture', None, 'MIRROR_COLOR', image, mesh, uvName, exporter, recipe)
-
-        if recipe.emissiveBaking:
-            self.bake('emissiveTexture', 'EMIT', 'EMIT', image, mesh, uvName, exporter, recipe)
-
-        if recipe.bumpBaking:
-            self.bake('bumpTexture', 'NORMAL', 'NORMALS', image, mesh, uvName, exporter, recipe)
-
-        if recipe.specularBaking:
-            cycles_type = 'SPECULAR' if bVersion <= 2.76 else 'GLOSSY'
-            self.bake('specularTexture', cycles_type, 'SPEC_COLOR', image, mesh, uvName, exporter, recipe)
-
-        # Toggle vertex selection & mode, if setting changed their value
-        bpy.ops.mesh.select_all(action='TOGGLE')  # still in edit mode toggle select back to previous
-        bpy.ops.object.mode_set(toggle=True)      # change back to Object
-
-        bpy.ops.object.select_all(action='TOGGLE') # change scene selection back, not seeming to work
-
-        exporter.scene.render.engine = engine
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def bake(self, bjs_type, cycles_type, internal_type, image, mesh, uvName, exporter, recipe):
-        extension = '.png' if recipe.usePNG else '.jpg'
-
-        if recipe.cyclesRender:
-            if cycles_type is None:
-                return
-            self.bakeCycles(cycles_type, image, uvName, recipe.nodeTrees, extension)
-        else:
-            self.bakeInternal(internal_type, image, uvName, extension)
-
-        self.textures.append(Texture(bjs_type, 1.0, image, mesh, exporter))
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def bakeInternal(self, bake_type, image, uvName, extension):
-        Logger.log('Internal baking texture, type: ' + bake_type + ', mapped using: ' + uvName, 3)
-        # need to use the legal name, since this will become the file name, chars like ':' not legal
-        legalName = legal_js_identifier(self.name)
-        image.filepath = legalName + '_' + bake_type + extension
-
-        scene = bpy.context.scene
-        scene.render.engine = 'BLENDER_RENDER'
-
-        scene.render.bake_type = bake_type
-
-        # assign the image to the UV Editor, which does not have to shown
-        bpy.data.screens['UV Editing'].areas[1].spaces[0].image = image
-
-        renderer = scene.render
-        renderer.use_bake_selected_to_active = False
-        renderer.use_bake_to_vertex_color = False
-        renderer.use_bake_clear = False
-        renderer.bake_quad_split = 'AUTO'
-        renderer.bake_margin = 5
-        renderer.use_file_extension = True
-
-        renderer.use_bake_normalize = True
-        renderer.use_bake_antialiasing = True
-
-        bpy.ops.object.bake_image()
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    def bakeCycles(self, bake_type, image, uvName, nodeTrees, extension):
-        Logger.log('Cycles baking texture, type: ' + bake_type + ', mapped using: ' + uvName, 3)
-        legalName = legal_js_identifier(self.name)
-        image.filepath = legalName + '_' + bake_type + extension
-
-        scene = bpy.context.scene
-        scene.render.engine = 'CYCLES'
-
-        # create an unlinked temporary node to bake to for each material
-        for tree in nodeTrees:
-            bakeNode = tree.nodes.new(type='ShaderNodeTexImage')
-            bakeNode.image = image
-            bakeNode.select = True
-            tree.nodes.active = bakeNode
-
-        bpy.ops.object.bake(type = bake_type, use_clear = True, margin = 5, use_selected_to_active = False)
-
-        for tree in nodeTrees:
-            tree.nodes.remove(tree.nodes.active)
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-    @staticmethod
-    def meshBakingClean(mesh):
-        for uvMap in mesh.data.uv_textures:
-            if uvMap.name == 'BakingUV':
-                mesh.data.uv_textures.remove(uvMap)
-                break
-
-        # remove an image if it was baked
-        for image in bpy.data.images:
-            if image.name == mesh.name + '_BJS_BAKE':
-                image.user_clear() # cannot remove image unless 0 references
-                bpy.data.images.remove(image)
-                break

+ 10 - 0
Exporters/Blender/zip_media.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="zipper">
+	<property name="version" value="5.1"/>
+	
+	<!-- this target assumes it is run from Babylon.js/Exporters/Blender directory.  -->
+    <target name="make-zip">
+    	<zip destfile="Blender2Babylon-${version}.zip" basedir="src" level="9"></zip>
+    </target>
+
+</project>

Exporters/Unity 5/Unity3D2Babylon/BabylonExport.Entities.dll → Exporters/Unity 5/Deprecated/Unity3D2Babylon/BabylonExport.Entities.dll


Exporters/Unity 5/Unity3D2Babylon/ExportationOptions.cs → Exporters/Unity 5/Deprecated/Unity3D2Babylon/ExportationOptions.cs


Exporters/Unity 5/Unity3D2Babylon/ExporterWindow.cs → Exporters/Unity 5/Deprecated/Unity3D2Babylon/ExporterWindow.cs


Exporters/Unity 5/Unity3D2Babylon/Ionic.Zip.dll → Exporters/Unity 5/Deprecated/Unity3D2Babylon/Ionic.Zip.dll


Exporters/Unity 5/Unity3D2Babylon/JsonFx.Json.dll → Exporters/Unity 5/Deprecated/Unity3D2Babylon/JsonFx.Json.dll


Exporters/Unity 5/Unity3D2Babylon/JsonFx.dll → Exporters/Unity 5/Deprecated/Unity3D2Babylon/JsonFx.dll


Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.Animations.cs → Exporters/Unity 5/Deprecated/Unity3D2Babylon/SceneBuilder.Animations.cs


Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.Cameras.cs → Exporters/Unity 5/Deprecated/Unity3D2Babylon/SceneBuilder.Cameras.cs


Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.Lights.cs → Exporters/Unity 5/Deprecated/Unity3D2Babylon/SceneBuilder.Lights.cs


Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.Materials.cs → Exporters/Unity 5/Deprecated/Unity3D2Babylon/SceneBuilder.Materials.cs


+ 0 - 0
Exporters/Unity 5/Unity3D2Babylon/SceneBuilder.Meshes.cs


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است