浏览代码

Max2Babylon: Support for Max2015

David Catuhe 11 年之前
父节点
当前提交
aaaaeaf791
共有 22 个文件被更改,包括 667 次插入224 次删除
  1. 二进制
      Exporters/3ds Max/Max2Babylon-0.5.7.zip
  2. 二进制
      Exporters/3ds Max/Max2Babylon-0.6.0.zip
  3. 234 0
      Exporters/3ds Max/Max2Babylon/2015/Max2Babylon2015.csproj
  4. 36 0
      Exporters/3ds Max/Max2Babylon/2015/Properties/AssemblyInfo.cs
  5. 63 0
      Exporters/3ds Max/Max2Babylon/2015/Properties/Resources.Designer.cs
  6. 120 0
      Exporters/3ds Max/Max2Babylon/2015/Properties/Resources.resx
  7. 二进制
      Exporters/3ds Max/Max2Babylon/2015/Refs/Autodesk.Max.dll
  8. 1 5
      Exporters/3ds Max/Max2Babylon/BabylonExportActionItem.cs
  9. 0 1
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Animation.cs
  10. 20 20
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Camera.cs
  11. 27 28
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Light.cs
  12. 13 14
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Material.cs
  13. 37 43
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Mesh.cs
  14. 9 10
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.ShadowGenerator.cs
  15. 0 2
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Skeleton.cs
  16. 0 2
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Texture.cs
  17. 23 22
      Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.cs
  18. 7 8
      Exporters/3ds Max/Max2Babylon/Forms/ExporterForm.Designer.cs
  19. 16 14
      Exporters/3ds Max/Max2Babylon/Forms/ExporterForm.cs
  20. 2 3
      Exporters/3ds Max/Max2Babylon/Forms/ScenePropertiesForm.cs
  21. 1 3
      Exporters/3ds Max/Max2Babylon/GlobalUtility.cs
  22. 58 49
      Exporters/3ds Max/Max2Babylon/Tools/Tools.cs

二进制
Exporters/3ds Max/Max2Babylon-0.5.7.zip


二进制
Exporters/3ds Max/Max2Babylon-0.6.0.zip


+ 234 - 0
Exporters/3ds Max/Max2Babylon/2015/Max2Babylon2015.csproj

@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{DD7C931A-8FAF-4318-BB74-71DC858CC400}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Max2Babylon</RootNamespace>
+    <AssemblyName>Max2Babylon</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+    <SccProjectName>SAK</SccProjectName>
+    <SccLocalPath>SAK</SccLocalPath>
+    <SccAuxPath>SAK</SccAuxPath>
+    <SccProvider>SAK</SccProvider>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>C:\Program Files\Autodesk\3ds Max 2015\bin\assemblies\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;MAX2015</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>C:\Program Files\Autodesk\3ds Max 2013\bin\assemblies\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Autodesk.Max, Version=17.0.630.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>Refs\2015\Autodesk.Max.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="SharpDX, Version=2.4.2.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\BabylonExport.Core\Refs\SharpDX.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\BabylonActionCallback.cs">
+      <Link>BabylonActionCallback.cs</Link>
+    </Compile>
+    <Compile Include="..\BabylonExportActionItem.cs">
+      <Link>BabylonExportActionItem.cs</Link>
+    </Compile>
+    <Compile Include="..\BabylonPropertiesActionItem.cs">
+      <Link>BabylonPropertiesActionItem.cs</Link>
+    </Compile>
+    <Compile Include="..\Descriptor.cs">
+      <Link>Descriptor.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.Animation.cs">
+      <Link>Exporter\BabylonExporter.Animation.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.Camera.cs">
+      <Link>Exporter\BabylonExporter.Camera.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.cs">
+      <Link>Exporter\BabylonExporter.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.Light.cs">
+      <Link>Exporter\BabylonExporter.Light.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.Material.cs">
+      <Link>Exporter\BabylonExporter.Material.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.Mesh.cs">
+      <Link>Exporter\BabylonExporter.Mesh.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.ShadowGenerator.cs">
+      <Link>Exporter\BabylonExporter.ShadowGenerator.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.Skeleton.cs">
+      <Link>Exporter\BabylonExporter.Skeleton.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\BabylonExporter.Texture.cs">
+      <Link>Exporter\BabylonExporter.Texture.cs</Link>
+    </Compile>
+    <Compile Include="..\Exporter\GlobalVertex.cs">
+      <Link>Exporter\GlobalVertex.cs</Link>
+    </Compile>
+    <Compile Include="..\Forms\CameraPropertiesForm.cs">
+      <Link>Forms\CameraPropertiesForm.cs</Link>
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="..\Forms\CameraPropertiesForm.Designer.cs">
+      <Link>Forms\CameraPropertiesForm.Designer.cs</Link>
+      <DependentUpon>CameraPropertiesForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="..\Forms\ExporterForm.cs">
+      <Link>Forms\ExporterForm.cs</Link>
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="..\Forms\ExporterForm.Designer.cs">
+      <Link>Forms\ExporterForm.Designer.cs</Link>
+      <DependentUpon>ExporterForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="..\Forms\LightPropertiesForm.cs">
+      <Link>Forms\LightPropertiesForm.cs</Link>
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="..\Forms\LightPropertiesForm.Designer.cs">
+      <Link>Forms\LightPropertiesForm.Designer.cs</Link>
+      <DependentUpon>LightPropertiesForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="..\Forms\ObjectPropertiesForm.cs">
+      <Link>Forms\ObjectPropertiesForm.cs</Link>
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="..\Forms\ObjectPropertiesForm.Designer.cs">
+      <Link>Forms\ObjectPropertiesForm.Designer.cs</Link>
+      <DependentUpon>ObjectPropertiesForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="..\Forms\ScenePropertiesForm.cs">
+      <Link>Forms\ScenePropertiesForm.cs</Link>
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="..\Forms\ScenePropertiesForm.Designer.cs">
+      <Link>Forms\ScenePropertiesForm.Designer.cs</Link>
+      <DependentUpon>ScenePropertiesForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="..\Forms\Vector3Control.cs">
+      <Link>Forms\Vector3Control.cs</Link>
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="..\Forms\Vector3Control.Designer.cs">
+      <Link>Forms\Vector3Control.Designer.cs</Link>
+      <DependentUpon>Vector3Control.cs</DependentUpon>
+    </Compile>
+    <Compile Include="..\GlobalUtility.cs">
+      <Link>GlobalUtility.cs</Link>
+    </Compile>
+    <Compile Include="..\JsonTextWriterOptimized.cs">
+      <Link>JsonTextWriterOptimized.cs</Link>
+    </Compile>
+    <Compile Include="..\Loader.cs">
+      <Link>Loader.cs</Link>
+    </Compile>
+    <Compile Include="..\Tools\Tools.cs">
+      <Link>Tools\Tools.cs</Link>
+    </Compile>
+    <Compile Include="..\Tools\VNormal.cs">
+      <Link>Tools\VNormal.cs</Link>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Refs\Autodesk.Max.dll" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="..\Forms\CameraPropertiesForm.resx">
+      <Link>Forms\CameraPropertiesForm.resx</Link>
+      <DependentUpon>CameraPropertiesForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="..\Forms\ExporterForm.resx">
+      <Link>Forms\ExporterForm.resx</Link>
+      <DependentUpon>ExporterForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="..\Forms\LightPropertiesForm.resx">
+      <Link>Forms\LightPropertiesForm.resx</Link>
+      <DependentUpon>LightPropertiesForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="..\Forms\ObjectPropertiesForm.resx">
+      <Link>Forms\ObjectPropertiesForm.resx</Link>
+      <DependentUpon>ObjectPropertiesForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="..\Forms\ScenePropertiesForm.resx">
+      <Link>Forms\ScenePropertiesForm.resx</Link>
+      <DependentUpon>ScenePropertiesForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="..\Forms\Vector3Control.resx">
+      <Link>Forms\Vector3Control.resx</Link>
+      <DependentUpon>Vector3Control.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\BabylonExport.Entities\BabylonExport.Entities.csproj">
+      <Project>{6150965a-658c-4263-89ad-4f980eb0675d}</Project>
+      <Name>BabylonExport.Entities</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
+  </Target>
+  <!-- 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>

+ 36 - 0
Exporters/3ds Max/Max2Babylon/2015/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Max2Babylon")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Max2Babylon")]
+[assembly: AssemblyCopyright("Copyright ©  2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2d621b1c-3661-49bd-8dd3-4c5de51fce94")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 63 - 0
Exporters/3ds Max/Max2Babylon/2015/Properties/Resources.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.34014
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Max2Babylon.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Max2Babylon.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 120 - 0
Exporters/3ds Max/Max2Babylon/2015/Properties/Resources.resx

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

二进制
Exporters/3ds Max/Max2Babylon/2015/Refs/Autodesk.Max.dll


+ 1 - 5
Exporters/3ds Max/Max2Babylon/BabylonExportActionItem.cs

@@ -1,8 +1,4 @@
-using System;
-using Autodesk.Max;
-using Autodesk.Max.IQuadMenuContext;
-using MaxSharp;
-using ActionItem = Autodesk.Max.Plugins.ActionItem;
+using ActionItem = Autodesk.Max.Plugins.ActionItem;
 
 namespace Max2Babylon
 {

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

@@ -2,7 +2,6 @@
 using System.Collections.Generic;
 using Autodesk.Max;
 using BabylonExport.Entities;
-using MaxSharp;
 
 namespace Max2Babylon
 {

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

@@ -1,19 +1,19 @@
 using System.Collections.Generic;
+using Autodesk.Max;
 using BabylonExport.Entities;
-using MaxSharp;
 
 namespace Max2Babylon
 {
     partial class BabylonExporter
     {
-        private void ExportCamera(Node cameraNode, BabylonScene babylonScene)
+        private void ExportCamera(IINode cameraNode, BabylonScene babylonScene)
         {
-            if (cameraNode._Node.GetBoolProperty("babylonjs_noexport"))
+            if (cameraNode.GetBoolProperty("babylonjs_noexport"))
             {
                 return;
             }
 
-            var maxCamera = (cameraNode.Object as Camera)._Camera;
+            var maxCamera = (cameraNode.ObjectRef as ICameraObject);
             var babylonCamera = new BabylonCamera();
 
             RaiseMessage(cameraNode.Name, 1);
@@ -21,12 +21,12 @@ namespace Max2Babylon
             babylonCamera.id = cameraNode.GetGuid().ToString();
             if (cameraNode.HasParent())
             {
-                babylonCamera.parentId = cameraNode.Parent.GetGuid().ToString();
+                babylonCamera.parentId = cameraNode.ParentNode.GetGuid().ToString();
             }
 
-            babylonCamera.fov = Tools.ConvertFov(maxCamera.GetFOV(0, Interval.Forever._IInterval));
-            babylonCamera.minZ = maxCamera.GetEnvRange(0, 0, Interval.Forever._IInterval);
-            babylonCamera.maxZ = maxCamera.GetEnvRange(0, 1, Interval.Forever._IInterval);
+            babylonCamera.fov = Tools.ConvertFov(maxCamera.GetFOV(0, Tools.Forever));
+            babylonCamera.minZ = maxCamera.GetEnvRange(0, 0, Tools.Forever);
+            babylonCamera.maxZ = maxCamera.GetEnvRange(0, 1, Tools.Forever);
 
             if (babylonCamera.minZ == 0.0f)
             {
@@ -34,13 +34,13 @@ namespace Max2Babylon
             }
 
             // Control
-            babylonCamera.speed = cameraNode._Node.GetFloatProperty("babylonjs_speed", 1.0f);
-            babylonCamera.inertia = cameraNode._Node.GetFloatProperty("babylonjs_inertia", 0.9f);
+            babylonCamera.speed = cameraNode.GetFloatProperty("babylonjs_speed", 1.0f);
+            babylonCamera.inertia = cameraNode.GetFloatProperty("babylonjs_inertia", 0.9f);
 
             // Collisions
-            babylonCamera.checkCollisions = cameraNode._Node.GetBoolProperty("babylonjs_checkcollisions");
-            babylonCamera.applyGravity = cameraNode._Node.GetBoolProperty("babylonjs_applygravity");
-            babylonCamera.ellipsoid = cameraNode._Node.GetVector3Property("babylonjs_ellipsoid");
+            babylonCamera.checkCollisions = cameraNode.GetBoolProperty("babylonjs_checkcollisions");
+            babylonCamera.applyGravity = cameraNode.GetBoolProperty("babylonjs_applygravity");
+            babylonCamera.ellipsoid = cameraNode.GetVector3Property("babylonjs_ellipsoid");
 
             // Position
             var wm = cameraNode.GetWorldMatrix(0, cameraNode.HasParent());
@@ -48,7 +48,7 @@ namespace Max2Babylon
             babylonCamera.position = position.ToArraySwitched();
 
             // Target
-            var target = cameraNode._Node.Target;
+            var target = cameraNode.Target;
             if (target != null)
             {
                 babylonCamera.lockedTargetId = target.GetGuid().ToString();
@@ -61,7 +61,7 @@ namespace Max2Babylon
 
             // Animations
             var animations = new List<BabylonAnimation>();
-            if (!ExportVector3Controller(cameraNode._Node.TMController.PositionController, "position", animations))
+            if (!ExportVector3Controller(cameraNode.TMController.PositionController, "position", animations))
             {
                 ExportVector3Animation("position", animations, key =>
                 {
@@ -70,16 +70,16 @@ namespace Max2Babylon
                 });
             }
 
-            ExportFloatAnimation("fov", animations, key => new[] {Tools.ConvertFov(maxCamera.GetFOV(key, Interval.Forever._IInterval))});
+            ExportFloatAnimation("fov", animations, key => new[] {Tools.ConvertFov(maxCamera.GetFOV(key, Tools.Forever))});
 
             babylonCamera.animations = animations.ToArray();
 
-            if (cameraNode._Node.GetBoolProperty("babylonjs_autoanimate"))
+            if (cameraNode.GetBoolProperty("babylonjs_autoanimate"))
             {
                 babylonCamera.autoAnimate = true;
-                babylonCamera.autoAnimateFrom = (int)cameraNode._Node.GetFloatProperty("babylonjs_autoanimate_from");
-                babylonCamera.autoAnimateTo = (int)cameraNode._Node.GetFloatProperty("babylonjs_autoanimate_to");
-                babylonCamera.autoAnimateLoop = cameraNode._Node.GetBoolProperty("babylonjs_autoanimateloop");
+                babylonCamera.autoAnimateFrom = (int)cameraNode.GetFloatProperty("babylonjs_autoanimate_from");
+                babylonCamera.autoAnimateTo = (int)cameraNode.GetFloatProperty("babylonjs_autoanimate_to");
+                babylonCamera.autoAnimateLoop = cameraNode.GetBoolProperty("babylonjs_autoanimateloop");
             }
 
             babylonScene.CamerasList.Add(babylonCamera);

+ 27 - 28
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Light.cs

@@ -2,29 +2,28 @@
 using System.Collections.Generic;
 using Autodesk.Max;
 using BabylonExport.Entities;
-using MaxSharp;
 
 namespace Max2Babylon
 {
     partial class BabylonExporter
     {
-        private void ExportLight(Node lightNode, BabylonScene babylonScene)
+        private void ExportLight(IINode lightNode, BabylonScene babylonScene)
         {
-            if (lightNode._Node.GetBoolProperty("babylonjs_noexport"))
+            if (lightNode.GetBoolProperty("babylonjs_noexport"))
             {
                 return;
             }
 
-            var maxLight = (lightNode.Object as Light);
+            var maxLight = (lightNode.ObjectRef as ILightObject);
             var babylonLight = new BabylonLight();
 
-            RaiseMessage(maxLight.Name, 1);
+            RaiseMessage(lightNode.Name, 1);
             babylonLight.name = lightNode.Name;
             babylonLight.id = lightNode.GetGuid().ToString();
 
             // Type
             var lightState = Loader.Global.LightState.Create();
-            maxLight._Light.EvalLightState(0, Interval.Forever._IInterval, lightState);
+            maxLight.EvalLightState(0, Tools.Forever, lightState);
             var directionScale = -1;
 
             switch (lightState.Type)
@@ -34,7 +33,7 @@ namespace Max2Babylon
                     break;
                 case LightType.SpotLgt:
                     babylonLight.type = 2;
-                    babylonLight.angle = (float)(maxLight.GetFallOffSize(0, Interval.Forever) * Math.PI / 180.0f);
+                    babylonLight.angle = (float)(maxLight.GetFallsize(0, Tools.Forever) * Math.PI / 180.0f);
                     babylonLight.exponent = 1;
                     break;
                 case LightType.DirectLgt:
@@ -66,10 +65,10 @@ namespace Max2Babylon
             babylonLight.position = position.ToArraySwitched();
 
             // Direction
-            var target = lightNode._Node.Target;
+            var target = lightNode.Target;
             if (target != null)
             {
-                var targetWm = target.GetObjTMBeforeWSM(0, Interval.Forever._IInterval);
+                var targetWm = target.GetObjTMBeforeWSM(0, Tools.Forever);
                 var targetPosition = targetWm.Trans;
 
                 var direction = targetPosition.Subtract(position);
@@ -82,19 +81,19 @@ namespace Max2Babylon
             }
 
             // Exclusion
-            var maxScene = Kernel.Scene;
-            var inclusion = maxLight._Light.ExclList.TestFlag(1); //NT_INCLUDE 
-            var checkExclusionList = maxLight._Light.ExclList.TestFlag(2); //NT_AFFECT_ILLUM
+            var maxScene = Loader.Core.RootNode;
+            var inclusion = maxLight.ExclList.TestFlag(1); //NT_INCLUDE 
+            var checkExclusionList = maxLight.ExclList.TestFlag(2); //NT_AFFECT_ILLUM
 
             if (checkExclusionList)
             {
                 var list = new List<string>();
 
-                foreach (var meshNode in maxScene.NodesListBySuperClass(SuperClassID.GeometricObject))
+                foreach (var meshNode in maxScene.NodesListBySuperClass(SClass_ID.Geomobject))
                 {
-                    if (meshNode._Node.CastShadows == 1)
+                    if (meshNode.CastShadows == 1)
                     {
-                        var inList = maxLight._Light.ExclList.FindNode(meshNode._Node) != -1;
+                        var inList = maxLight.ExclList.FindNode(meshNode) != -1;
 
                         if ((!inList && inclusion) || (inList && !inclusion))
                         {
@@ -107,20 +106,20 @@ namespace Max2Babylon
             }
 
             // Other fields
-            babylonLight.intensity = maxLight.GetIntensity(0, Interval.Forever);
+            babylonLight.intensity = maxLight.GetIntensity(0, Tools.Forever);
 
-            babylonLight.diffuse = lightState.AffectDiffuse ? maxLight.GetRGBColor(0, Interval.Forever).ToArray() : new float[] { 0, 0, 0 };
-            babylonLight.specular = lightState.AffectDiffuse ? maxLight.GetRGBColor(0, Interval.Forever).ToArray() : new float[] { 0, 0, 0 };
+            babylonLight.diffuse = lightState.AffectDiffuse ? maxLight.GetRGBColor(0, Tools.Forever).ToArray() : new float[] { 0, 0, 0 };
+            babylonLight.specular = lightState.AffectDiffuse ? maxLight.GetRGBColor(0, Tools.Forever).ToArray() : new float[] { 0, 0, 0 };
 
-            if (maxLight.UseAttenuation)
+            if (maxLight.UseAtten)
             {
-                babylonLight.range = maxLight.GetAttenuation(0, 1, Interval.Forever);
+                babylonLight.range = maxLight.GetAtten(0, 1, Tools.Forever);
             }
 
             // Animations
             var animations = new List<BabylonAnimation>();
 
-            if (!ExportVector3Controller(lightNode._Node.TMController.PositionController, "position", animations))
+            if (!ExportVector3Controller(lightNode.TMController.PositionController, "position", animations))
             {
                 ExportVector3Animation("position", animations, key =>
                 {
@@ -131,10 +130,10 @@ namespace Max2Babylon
 
             ExportVector3Animation("direction", animations, key =>
             {
-                var targetNode = lightNode._Node.Target;
+                var targetNode = lightNode.Target;
                 if (targetNode != null)
                 {
-                    var targetWm = target.GetObjTMBeforeWSM(0, Interval.Forever._IInterval);
+                    var targetWm = target.GetObjTMBeforeWSM(0, Tools.Forever);
                     var targetPosition = targetWm.Trans;
 
                     var direction = targetPosition.Subtract(position);
@@ -145,16 +144,16 @@ namespace Max2Babylon
                 return dir.ToArraySwitched();
             });
 
-            ExportFloatAnimation("intensity", animations, key => new[] { maxLight.GetIntensity(key, Interval.Forever) });
+            ExportFloatAnimation("intensity", animations, key => new[] { maxLight.GetIntensity(key, Tools.Forever) });
 
             babylonLight.animations = animations.ToArray();
 
-            if (lightNode._Node.GetBoolProperty("babylonjs_autoanimate"))
+            if (lightNode.GetBoolProperty("babylonjs_autoanimate"))
             {
                 babylonLight.autoAnimate = true;
-                babylonLight.autoAnimateFrom = (int)lightNode._Node.GetFloatProperty("babylonjs_autoanimate_from");
-                babylonLight.autoAnimateTo = (int)lightNode._Node.GetFloatProperty("babylonjs_autoanimate_to");
-                babylonLight.autoAnimateLoop = lightNode._Node.GetBoolProperty("babylonjs_autoanimateloop");
+                babylonLight.autoAnimateFrom = (int)lightNode.GetFloatProperty("babylonjs_autoanimate_from");
+                babylonLight.autoAnimateTo = (int)lightNode.GetFloatProperty("babylonjs_autoanimate_to");
+                babylonLight.autoAnimateLoop = lightNode.GetBoolProperty("babylonjs_autoanimateloop");
             }
 
             babylonScene.LightsList.Add(babylonLight);

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

@@ -2,22 +2,21 @@
 using System.Collections.Generic;
 using Autodesk.Max;
 using BabylonExport.Entities;
-using MaxSharp;
 
 namespace Max2Babylon
 {
     partial class BabylonExporter
     {
-        readonly List<Material> referencedMaterials = new List<Material>();
+        readonly List<IMtl> referencedMaterials = new List<IMtl>();
 
-        private void ExportMaterial(Material materialNode, BabylonScene babylonScene)
+        private void ExportMaterial(IMtl materialNode, BabylonScene babylonScene)
         {
-            var name = materialNode._Mtl.Name;
+            var name = materialNode.Name;
             var id = materialNode.GetGuid().ToString();
 
             RaiseMessage(name, 1);
 
-            if (materialNode.NumSubMaterials > 0)
+            if (materialNode.NumSubMtls > 0)
             {
                 var babylonMultimaterial = new BabylonMultiMaterial();
                 babylonMultimaterial.name = name;
@@ -25,9 +24,9 @@ namespace Max2Babylon
 
                 var guids = new List<string>();
 
-                for (var index = 0; index < materialNode.NumSubMaterials; index++)
+                for (var index = 0; index < materialNode.NumSubMtls; index++)
                 {
-                    var subMat = materialNode.GetSubMaterial(index) as Material;
+                    var subMat = materialNode.GetSubMtl(index);
 
                     if (subMat != null)
                     {
@@ -56,15 +55,15 @@ namespace Max2Babylon
             babylonMaterial.name = name;
             babylonMaterial.id = id;
 
-            babylonMaterial.ambient = materialNode.GetAmbient(0).ToArray();
-            babylonMaterial.diffuse = materialNode.GetDiffuse(0).ToArray();
-            babylonMaterial.specular = materialNode.GetSpecular(0).Scale(materialNode.GetShinyStrength(0));
-            babylonMaterial.specularPower = materialNode.GetShininess(0) * 256;
+            babylonMaterial.ambient = materialNode.GetAmbient(0, false).ToArray();
+            babylonMaterial.diffuse = materialNode.GetDiffuse(0, false).ToArray();
+            babylonMaterial.specular = materialNode.GetSpecular(0, false).Scale(materialNode.GetShinStr(0, false));
+            babylonMaterial.specularPower = materialNode.GetShininess(0, false) * 256;
 
-            babylonMaterial.emissive = materialNode.SelfIlluminationColorOn ? materialNode.GetSelfIllumColor(0).ToArray() : materialNode.GetDiffuse(0).Scale(materialNode.GetSelfIllumination(0));
-            babylonMaterial.alpha = 1.0f - materialNode.GetTransparency(0);
+            babylonMaterial.emissive = materialNode.GetSelfIllumColorOn(0, false) ? materialNode.GetSelfIllumColor(0, false).ToArray() : materialNode.GetDiffuse(0, false).Scale(materialNode.GetSelfIllum(0, false));
+            babylonMaterial.alpha = 1.0f - materialNode.GetXParency(0, false);
 
-            var stdMat = materialNode._Mtl.GetParamBlock(0).Owner as IStdMat2;
+            var stdMat = materialNode.GetParamBlock(0).Owner as IStdMat2;
 
             if (stdMat != null)
             {

+ 37 - 43
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Mesh.cs

@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using System.Linq;
 using Autodesk.Max;
 using BabylonExport.Entities;
-using MaxSharp;
 using System.Runtime.InteropServices;
 
 namespace Max2Babylon
@@ -11,14 +10,14 @@ namespace Max2Babylon
     partial class BabylonExporter
     {
         private int bonesCount;
-        private void ExportMesh(Node meshNode, BabylonScene babylonScene)
+        private void ExportMesh(IINode meshNode, BabylonScene babylonScene)
         {
-            if (meshNode._Node.GetBoolProperty("babylonjs_noexport"))
+            if (meshNode.GetBoolProperty("babylonjs_noexport"))
             {
                 return;
             }
 
-            if (!ExportHiddenObjects && !meshNode.Visible)
+            if (!ExportHiddenObjects && meshNode.IsHidden(NodeHideFlags.None, false))
             {
                 return;
             }
@@ -30,21 +29,21 @@ namespace Max2Babylon
             babylonMesh.id = meshNode.GetGuid().ToString();
             if (meshNode.HasParent())
             {
-                babylonMesh.parentId = meshNode.Parent.GetGuid().ToString();
+                babylonMesh.parentId = meshNode.ParentNode.GetGuid().ToString();
             }
 
             // Misc.
-            babylonMesh.isVisible = meshNode._Node.Renderable == 1;
-            babylonMesh.pickable = meshNode._Node.GetBoolProperty("babylonjs_checkpickable");
-            babylonMesh.receiveShadows = meshNode._Node.RcvShadows == 1;
-            babylonMesh.showBoundingBox = meshNode._Node.GetBoolProperty("babylonjs_showboundingbox");
-            babylonMesh.showSubMeshesBoundingBox = meshNode._Node.GetBoolProperty("babylonjs_showsubmeshesboundingbox");
+            babylonMesh.isVisible = meshNode.Renderable == 1;
+            babylonMesh.pickable = meshNode.GetBoolProperty("babylonjs_checkpickable");
+            babylonMesh.receiveShadows = meshNode.RcvShadows == 1;
+            babylonMesh.showBoundingBox = meshNode.GetBoolProperty("babylonjs_showboundingbox");
+            babylonMesh.showSubMeshesBoundingBox = meshNode.GetBoolProperty("babylonjs_showsubmeshesboundingbox");
 
             // Collisions
-            babylonMesh.checkCollisions = meshNode._Node.GetBoolProperty("babylonjs_checkcollisions");
+            babylonMesh.checkCollisions = meshNode.GetBoolProperty("babylonjs_checkcollisions");
 
             // Skin
-            var skin = GetSkinModifier(meshNode._Node);
+            var skin = GetSkinModifier(meshNode);
 
             if (skin != null)
             {
@@ -100,17 +99,16 @@ namespace Max2Babylon
             }
 
             // Pivot
-            var pivotMatrix = Matrix3.Identity._IMatrix3;
-            pivotMatrix.PreTranslate(meshNode._Node.ObjOffsetPos);
-            Loader.Global.PreRotateMatrix(pivotMatrix, meshNode._Node.ObjOffsetRot);
-            Loader.Global.ApplyScaling(pivotMatrix, meshNode._Node.ObjOffsetScale);
+            var pivotMatrix = Tools.Identity;
+            pivotMatrix.PreTranslate(meshNode.ObjOffsetPos);
+            Loader.Global.PreRotateMatrix(pivotMatrix, meshNode.ObjOffsetRot);
+            Loader.Global.ApplyScaling(pivotMatrix, meshNode.ObjOffsetScale);
             babylonMesh.pivotMatrix = pivotMatrix.ToArray();
 
             // Mesh
-            var objectState = meshNode._Node.EvalWorldState(0, false);
+            var objectState = meshNode.EvalWorldState(0, false);
             var triObject = objectState.Obj.GetMesh();
             var mesh = triObject != null ? triObject.Mesh : null;
-            var computedMesh = meshNode.GetMesh();
 
             RaiseMessage(meshNode.Name, 1);
 
@@ -134,7 +132,7 @@ namespace Max2Babylon
                 }
 
                 // Material
-                var mtl = meshNode.Material;
+                var mtl = meshNode.Mtl;
                 var multiMatsCount = 1;
 
                 if (mtl != null)
@@ -146,10 +144,10 @@ namespace Max2Babylon
                         referencedMaterials.Add(mtl);
                     }
 
-                    multiMatsCount = Math.Max(mtl.NumSubMaterials, 1);
+                    multiMatsCount = Math.Max(mtl.NumSubMtls, 1);
                 }
 
-                babylonMesh.visibility = meshNode._Node.GetVisibility(0, Interval.Forever._IInterval);
+                babylonMesh.visibility = meshNode.GetVisibility(0, Tools.Forever);
 
                 var vertices = new List<GlobalVertex>();
                 var indices = new List<int>();
@@ -158,34 +156,30 @@ namespace Max2Babylon
                 var hasUV = mesh.NumTVerts > 0;
                 var hasUV2 = mesh.GetNumMapVerts(2) > 0;
 
-                var optimizeVertices = meshNode._Node.GetBoolProperty("babylonjs_optimizevertices");
+                var optimizeVertices = meshNode.GetBoolProperty("babylonjs_optimizevertices");
 
                 // Skin
                 IISkinContextData skinContext = null;
 
                 if (skin != null)
                 {
-                    skinContext = skin.GetContextInterface(meshNode._Node);
+                    skinContext = skin.GetContextInterface(meshNode);
                 }
 
                 // Compute normals
-                VNormal[] vnorms = null;
+                VNormal[] vnorms = Tools.ComputeNormals(mesh, optimizeVertices);
                 List<GlobalVertex>[] verticesAlreadyExported = null;
 
-                if (!optimizeVertices)
-                {
-                    vnorms = Tools.ComputeNormals(mesh);
-                }
-                else
+                if (optimizeVertices)
                 {
                     verticesAlreadyExported = new List<GlobalVertex>[mesh.NumVerts];
                 }
 
                 for (var face = 0; face < mesh.NumFaces; face++)
                 {
-                    indices.Add(CreateGlobalVertex(mesh, computedMesh, face, vx1, vertices, hasUV, hasUV2, vnorms, verticesAlreadyExported, skinContext));
-                    indices.Add(CreateGlobalVertex(mesh, computedMesh, face, vx2, vertices, hasUV, hasUV2, vnorms, verticesAlreadyExported, skinContext));
-                    indices.Add(CreateGlobalVertex(mesh, computedMesh, face, vx3, vertices, hasUV, hasUV2, vnorms, verticesAlreadyExported, skinContext));
+                    indices.Add(CreateGlobalVertex(mesh, face, vx1, vertices, hasUV, hasUV2, vnorms, verticesAlreadyExported, skinContext));
+                    indices.Add(CreateGlobalVertex(mesh, face, vx2, vertices, hasUV, hasUV2, vnorms, verticesAlreadyExported, skinContext));
+                    indices.Add(CreateGlobalVertex(mesh, face, vx3, vertices, hasUV, hasUV2, vnorms, verticesAlreadyExported, skinContext));
                     matIDs.Add(mesh.Faces[face].MatID % multiMatsCount);
                     CheckCancelled();
                 }
@@ -304,7 +298,7 @@ namespace Max2Babylon
             // Animations
             var animations = new List<BabylonAnimation>();
 
-            if (!ExportVector3Controller(meshNode._Node.TMController.PositionController, "position", animations))
+            if (!ExportVector3Controller(meshNode.TMController.PositionController, "position", animations))
             {
                 ExportVector3Animation("position", animations, key =>
                 {
@@ -313,7 +307,7 @@ namespace Max2Babylon
                 });
             }
 
-            if (!ExportQuaternionController(meshNode._Node.TMController.RotationController, "rotationQuaternion", animations))
+            if (!ExportQuaternionController(meshNode.TMController.RotationController, "rotationQuaternion", animations))
             {
                 ExportQuaternionAnimation("rotationQuaternion", animations, key =>
                 {
@@ -326,7 +320,7 @@ namespace Max2Babylon
                 });
             }
 
-            if (!ExportVector3Controller(meshNode._Node.TMController.ScaleController, "scaling", animations))
+            if (!ExportVector3Controller(meshNode.TMController.ScaleController, "scaling", animations))
             {
                 ExportVector3Animation("scaling", animations, key =>
                 {
@@ -339,25 +333,25 @@ namespace Max2Babylon
                 });
             }
 
-            if (!ExportFloatController(meshNode._Node.VisController, "visibility", animations))
+            if (!ExportFloatController(meshNode.VisController, "visibility", animations))
             {
-                ExportFloatAnimation("visibility", animations, key => new[] { meshNode._Node.GetVisibility(key, Interval.Forever._IInterval) });
+                ExportFloatAnimation("visibility", animations, key => new[] { meshNode.GetVisibility(key, Tools.Forever) });
             }
 
             babylonMesh.animations = animations.ToArray();
 
-            if (meshNode._Node.GetBoolProperty("babylonjs_autoanimate"))
+            if (meshNode.GetBoolProperty("babylonjs_autoanimate"))
             {
                 babylonMesh.autoAnimate = true;
-                babylonMesh.autoAnimateFrom = (int)meshNode._Node.GetFloatProperty("babylonjs_autoanimate_from");
-                babylonMesh.autoAnimateTo = (int)meshNode._Node.GetFloatProperty("babylonjs_autoanimate_to");
-                babylonMesh.autoAnimateLoop = meshNode._Node.GetBoolProperty("babylonjs_autoanimateloop");
+                babylonMesh.autoAnimateFrom = (int)meshNode.GetFloatProperty("babylonjs_autoanimate_from");
+                babylonMesh.autoAnimateTo = (int)meshNode.GetFloatProperty("babylonjs_autoanimate_to");
+                babylonMesh.autoAnimateLoop = meshNode.GetBoolProperty("babylonjs_autoanimateloop");
             }
 
             babylonScene.MeshesList.Add(babylonMesh);
         }
 
-        int CreateGlobalVertex(IMesh mesh, Mesh computedMesh, int face, int facePart, List<GlobalVertex> vertices, bool hasUV, bool hasUV2, VNormal[] vnorms, List<GlobalVertex>[] verticesAlreadyExported, IISkinContextData skinContextData)
+        int CreateGlobalVertex(IMesh mesh, int face, int facePart, List<GlobalVertex> vertices, bool hasUV, bool hasUV2, VNormal[] vnorms, List<GlobalVertex>[] verticesAlreadyExported, IISkinContextData skinContextData)
         {
             var faceObject = mesh.Faces[face];
             var vertexIndex = (int)faceObject.V[facePart];
@@ -366,7 +360,7 @@ namespace Max2Babylon
             {
                 BaseIndex = vertexIndex,
                 Position = mesh.Verts[vertexIndex],
-                Normal = (vnorms != null) ? vnorms[vertexIndex].GetNormal(faceObject.SmGroup) : computedMesh.vnormals[vertexIndex]._IPoint3
+                Normal = vnorms[vertexIndex].GetNormal(verticesAlreadyExported != null ? 1 : faceObject.SmGroup)
             };
 
             if (hasUV)

+ 9 - 10
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.ShadowGenerator.cs

@@ -1,33 +1,32 @@
 using System.Collections.Generic;
+using Autodesk.Max;
 using BabylonExport.Entities;
-using MaxSharp;
 
 namespace Max2Babylon
 {
     partial class BabylonExporter
     {
-        private BabylonShadowGenerator ExportShadowGenerator(Node lightNode, BabylonScene babylonScene)
+        private BabylonShadowGenerator ExportShadowGenerator(IINode lightNode, BabylonScene babylonScene)
         {
-            var maxLight = (lightNode.Object as Light);
+            var maxLight = (lightNode.ObjectRef as ILightObject);
             var babylonShadowGenerator = new BabylonShadowGenerator();
 
             RaiseMessage("Exporting shadow map", 2);
 
             babylonShadowGenerator.lightId = lightNode.GetGuid().ToString();
 
-            babylonShadowGenerator.mapSize = maxLight.GetMapSize(0, Interval.Forever);
+            babylonShadowGenerator.mapSize = maxLight.GetMapSize(0, Tools.Forever);
 
-            var maxScene = Kernel.Scene;
             var list = new List<string>();
 
-            var inclusion = maxLight._Light.ExclList.TestFlag(1); //NT_INCLUDE 
-            var checkExclusionList = maxLight._Light.ExclList.TestFlag(4); //NT_AFFECT_SHADOWCAST 
+            var inclusion = maxLight.ExclList.TestFlag(1); //NT_INCLUDE 
+            var checkExclusionList = maxLight.ExclList.TestFlag(4); //NT_AFFECT_SHADOWCAST 
 
-            foreach (var meshNode in maxScene.NodesListBySuperClass(SuperClassID.GeometricObject))
+            foreach (var meshNode in Loader.Core.RootNode.NodesListBySuperClass(SClass_ID.Geomobject))
             {
-                if (meshNode._Node.CastShadows == 1)
+                if (meshNode.CastShadows == 1)
                 {
-                    var inList = maxLight._Light.ExclList.FindNode(meshNode._Node) != -1;
+                    var inList = maxLight.ExclList.FindNode(meshNode) != -1;
 
                     if (!checkExclusionList || (inList && inclusion) || (!inList && !inclusion))
                     {

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

@@ -1,8 +1,6 @@
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
 using Autodesk.Max;
 using BabylonExport.Entities;
-using MaxSharp;
 using SharpDX;
 
 namespace Max2Babylon

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

@@ -2,9 +2,7 @@
 using System.Collections.Generic;
 using System.IO;
 using Autodesk.Max;
-using Autodesk.Max.MaxSDK.Util;
 using BabylonExport.Entities;
-using MaxSharp;
 
 namespace Max2Babylon
 {

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

@@ -7,9 +7,7 @@ using System.Text;
 using System.Windows.Forms;
 using Autodesk.Max;
 using BabylonExport.Entities;
-using MaxSharp;
 using Newtonsoft.Json;
-using Animatable = MaxSharp.Animatable;
 using Color = System.Drawing.Color;
 
 namespace Max2Babylon
@@ -82,7 +80,7 @@ namespace Max2Babylon
             RaiseMessage("Exportation started");
             ReportProgressChanged(0);
             var babylonScene = new BabylonScene(Path.GetDirectoryName(outputFile));
-            var maxScene = Kernel.Scene;
+            var maxScene = Loader.Core.RootNode;
             alreadyExportedTextures.Clear();
 
             if (!Directory.Exists(babylonScene.OutputPath))
@@ -103,17 +101,17 @@ namespace Max2Babylon
 
             // Global
             babylonScene.autoClear = true;
-            babylonScene.clearColor = Loader.Core.GetBackGround(0, Interval.Forever._IInterval).ToArray();
-            babylonScene.ambientColor = Loader.Core.GetAmbient(0, Interval.Forever._IInterval).ToArray();
+            babylonScene.clearColor = Loader.Core.GetBackGround(0, Tools.Forever).ToArray();
+            babylonScene.ambientColor = Loader.Core.GetAmbient(0, Tools.Forever).ToArray();
 
-            babylonScene.gravity = maxScene.RootNode._Node.GetVector3Property("babylonjs_gravity");
-            exportQuaternionsInsteadOfEulers = maxScene.RootNode._Node.GetBoolProperty("babylonjs_exportquaternions");
+            babylonScene.gravity = maxScene.GetVector3Property("babylonjs_gravity");
+            exportQuaternionsInsteadOfEulers = maxScene.GetBoolProperty("babylonjs_exportquaternions");
 
             // Cameras
             BabylonCamera mainCamera = null;
 
             RaiseMessage("Exporting cameras");
-            foreach (var cameraNode in maxScene.NodesListBySuperClass(SuperClassID.Camera))
+            foreach (var cameraNode in maxScene.NodesListBySuperClass(SClass_ID.Camera))
             {
                 ExportCamera(cameraNode, babylonScene);
 
@@ -141,18 +139,21 @@ namespace Max2Babylon
 
                 if (atmospheric.Active(0) && atmospheric.ClassName == "Fog")
                 {
-                    RaiseMessage("Exporting fog");
-                    var reference = atmospheric.GetReference(0);
-                    var parameters = Animatable.CreateWrapper<ParameterBlock1>(reference);
+                    var fog = atmospheric as IStdFog;
 
-                    babylonScene.fogColor = (parameters["fog color"].Value as IColor).ToArray();
-                    babylonScene.fogDensity = (float)parameters["density"].Value;
-                    babylonScene.fogMode = ((int)parameters["fog type"].Value) == 0 ? 3 : 1;
-
-                    if (mainCamera != null)
+                    if (fog != null)
                     {
-                        babylonScene.fogStart = mainCamera.minZ * (float)parameters["near %"].Value;
-                        babylonScene.fogEnd = mainCamera.maxZ * (float)parameters["far %"].Value;
+                        RaiseMessage("Exporting fog");
+
+                        babylonScene.fogColor = fog.GetColor(0).ToArray();
+                        babylonScene.fogDensity = fog.GetDensity(0);
+                        babylonScene.fogMode = fog.GetType_ == 0 ? 3 : 1;
+
+                        if (mainCamera != null)
+                        {
+                            babylonScene.fogStart = mainCamera.minZ*fog.GetNear(0);
+                            babylonScene.fogEnd = mainCamera.maxZ*fog.GetFar(0);
+                        }
                     }
                 }
             }
@@ -160,14 +161,14 @@ namespace Max2Babylon
             // Meshes
             ReportProgressChanged(10);
             RaiseMessage("Exporting meshes");
-            var meshes = maxScene.NodesListBySuperClasses(new[] {SuperClassID.GeometricObject, SuperClassID.Helper});
+            var meshes = maxScene.NodesListBySuperClasses(new[] { SClass_ID.Geomobject, SClass_ID.Helper });
             var progressionStep = 80.0f / meshes.Count();
             var progression = 10.0f;
             foreach (var meshNode in meshes)
             {
-                Tools.PreparePipeline(meshNode._Node, true);
+                Tools.PreparePipeline(meshNode, true);
                 ExportMesh(meshNode, babylonScene);
-                Tools.PreparePipeline(meshNode._Node, false);
+                Tools.PreparePipeline(meshNode, false);
 
                 progression += progressionStep;
                 ReportProgressChanged((int)progression);
@@ -188,7 +189,7 @@ namespace Max2Babylon
 
             // Lights
             RaiseMessage("Exporting lights");
-            foreach (var lightNode in maxScene.NodesListBySuperClass(SuperClassID.Light))
+            foreach (var lightNode in maxScene.NodesListBySuperClass(SClass_ID.Light))
             {
                 ExportLight(lightNode, babylonScene);
                 CheckCancelled();

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

@@ -74,7 +74,7 @@
             // 
             this.txtFilename.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.txtFilename.Location = new System.Drawing.Point(18, 33);
+            this.txtFilename.Location = new System.Drawing.Point(18, 34);
             this.txtFilename.Name = "txtFilename";
             this.txtFilename.Size = new System.Drawing.Size(420, 20);
             this.txtFilename.TabIndex = 3;
@@ -84,7 +84,7 @@
             // 
             this.butBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.butBrowse.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.butBrowse.Location = new System.Drawing.Point(444, 31);
+            this.butBrowse.Location = new System.Drawing.Point(444, 32);
             this.butBrowse.Name = "butBrowse";
             this.butBrowse.Size = new System.Drawing.Size(43, 23);
             this.butBrowse.TabIndex = 4;
@@ -145,7 +145,7 @@
             // 
             this.chkManifest.AutoSize = true;
             this.chkManifest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkManifest.Location = new System.Drawing.Point(18, 102);
+            this.chkManifest.Location = new System.Drawing.Point(18, 104);
             this.chkManifest.Name = "chkManifest";
             this.chkManifest.Size = new System.Drawing.Size(112, 17);
             this.chkManifest.TabIndex = 2;
@@ -156,7 +156,7 @@
             // 
             this.chkQuaternions.AutoSize = true;
             this.chkQuaternions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkQuaternions.Location = new System.Drawing.Point(18, 79);
+            this.chkQuaternions.Location = new System.Drawing.Point(18, 81);
             this.chkQuaternions.Name = "chkQuaternions";
             this.chkQuaternions.Size = new System.Drawing.Size(221, 17);
             this.chkQuaternions.TabIndex = 1;
@@ -166,7 +166,7 @@
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(6, 60);
+            this.label2.Location = new System.Drawing.Point(6, 62);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(46, 13);
             this.label2.TabIndex = 11;
@@ -177,7 +177,7 @@
             this.chkCopyTextures.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.chkCopyTextures.AutoSize = true;
             this.chkCopyTextures.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkCopyTextures.Location = new System.Drawing.Point(338, 79);
+            this.chkCopyTextures.Location = new System.Drawing.Point(338, 81);
             this.chkCopyTextures.Name = "chkCopyTextures";
             this.chkCopyTextures.Size = new System.Drawing.Size(132, 17);
             this.chkCopyTextures.TabIndex = 12;
@@ -207,7 +207,7 @@
             this.chkHidden.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.chkHidden.AutoSize = true;
             this.chkHidden.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.chkHidden.Location = new System.Drawing.Point(338, 102);
+            this.chkHidden.Location = new System.Drawing.Point(338, 104);
             this.chkHidden.Name = "chkHidden";
             this.chkHidden.Size = new System.Drawing.Size(125, 17);
             this.chkHidden.TabIndex = 13;
@@ -229,7 +229,6 @@
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
             this.MinimumSize = new System.Drawing.Size(750, 400);
             this.Name = "ExporterForm";
-            this.ShowInTaskbar = true;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "Babylon.js - Export scene to .babylon file";
             this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ExporterForm_FormClosed);

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

@@ -1,12 +1,11 @@
 using System;
 using System.Windows.Forms;
-using MaxCustomControls;
-using MaxSharp;
+
 using Color = System.Drawing.Color;
 
 namespace Max2Babylon
 {
-    public partial class ExporterForm : MaxForm
+    public partial class ExporterForm : Form
     {
         private readonly BabylonExportActionItem babylonExportAction;
         private BabylonExporter exporter;
@@ -23,11 +22,11 @@ namespace Max2Babylon
 
         private void ExporterForm_Load(object sender, EventArgs e)
         {
-            txtFilename.Text = Kernel.Scene.RootNode.GetLocalData();
-            Tools.PrepareCheckBox(chkQuaternions, Kernel.Scene.RootNode._Node, "babylonjs_exportquaternions");
-            Tools.PrepareCheckBox(chkManifest, Kernel.Scene.RootNode._Node, "babylonjs_generatemanifest");
-            Tools.PrepareCheckBox(chkCopyTextures, Kernel.Scene.RootNode._Node, "babylonjs_copytextures", 1);
-            Tools.PrepareCheckBox(chkHidden, Kernel.Scene.RootNode._Node, "babylonjs_exporthidden");
+            txtFilename.Text = Loader.Core.RootNode.GetLocalData();
+            Tools.PrepareCheckBox(chkQuaternions, Loader.Core.RootNode, "babylonjs_exportquaternions");
+            Tools.PrepareCheckBox(chkManifest, Loader.Core.RootNode, "babylonjs_generatemanifest");
+            Tools.PrepareCheckBox(chkCopyTextures, Loader.Core.RootNode, "babylonjs_copytextures", 1);
+            Tools.PrepareCheckBox(chkHidden, Loader.Core.RootNode, "babylonjs_exporthidden");
         }
 
         private void butBrowse_Click(object sender, EventArgs e)
@@ -40,11 +39,11 @@ namespace Max2Babylon
 
         private void butExport_Click(object sender, EventArgs e)
         {
-            Tools.UpdateCheckBox(chkQuaternions, Kernel.Scene.RootNode._Node, "babylonjs_exportquaternions");
-            Tools.UpdateCheckBox(chkManifest, Kernel.Scene.RootNode._Node, "babylonjs_generatemanifest");
-            Tools.UpdateCheckBox(chkCopyTextures, Kernel.Scene.RootNode._Node, "babylonjs_copytextures");
-            Tools.UpdateCheckBox(chkHidden, Kernel.Scene.RootNode._Node, "babylonjs_exporthidden");
-            Kernel.Scene.RootNode.SetLocalData(txtFilename.Text);
+            Tools.UpdateCheckBox(chkQuaternions, Loader.Core.RootNode, "babylonjs_exportquaternions");
+            Tools.UpdateCheckBox(chkManifest, Loader.Core.RootNode, "babylonjs_generatemanifest");
+            Tools.UpdateCheckBox(chkCopyTextures, Loader.Core.RootNode, "babylonjs_copytextures");
+            Tools.UpdateCheckBox(chkHidden, Loader.Core.RootNode, "babylonjs_exporthidden");
+            Loader.Core.RootNode.SetLocalData(txtFilename.Text);
 
             exporter = new BabylonExporter();
 
@@ -154,7 +153,10 @@ namespace Max2Babylon
 
         private void ExporterForm_FormClosed(object sender, FormClosedEventArgs e)
         {
-            exporter.IsCancelled = true;
+            if (exporter != null)
+            {
+                exporter.IsCancelled = true;                
+            }
             babylonExportAction.Close();
         }
 

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

@@ -1,6 +1,5 @@
 using System;
 using System.Windows.Forms;
-using MaxSharp;
 
 namespace Max2Babylon
 {
@@ -13,12 +12,12 @@ namespace Max2Babylon
 
         private void butOK_Click(object sender, EventArgs e)
         {
-            Tools.UpdateVector3Control(gravityControl, Kernel.Scene.RootNode._Node, "babylonjs_gravity");
+            Tools.UpdateVector3Control(gravityControl, Loader.Core.RootNode, "babylonjs_gravity");
         }
 
         private void ScenePropertiesForm_Load(object sender, EventArgs e)
         {
-            Tools.PrepareVector3Control(gravityControl, Kernel.Scene.RootNode._Node, "babylonjs_gravity", 0, -0.9f, 0);
+            Tools.PrepareVector3Control(gravityControl, Loader.Core.RootNode, "babylonjs_gravity", 0, -0.9f, 0);
         }
     }
 }

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

@@ -1,8 +1,6 @@
-using System;
-using Autodesk.Max;
+using Autodesk.Max;
 using Autodesk.Max.IQuadMenuContext;
 using Autodesk.Max.Plugins;
-using MaxSharp;
 
 namespace Max2Babylon
 {

+ 58 - 49
Exporters/3ds Max/Max2Babylon/Tools/Tools.cs

@@ -4,9 +4,7 @@ using System.IO;
 using System.Linq;
 using System.Windows.Forms;
 using Autodesk.Max;
-using MaxSharp;
 using SharpDX;
-using Color = MaxSharp.Color;
 
 namespace Max2Babylon
 {
@@ -14,6 +12,18 @@ namespace Max2Babylon
     {
         public const float Epsilon = 0.001f;
 
+        public static IPoint3 XAxis { get { return Loader.Global.Point3.Create(1, 0, 0); } }
+        public static IPoint3 YAxis { get { return Loader.Global.Point3.Create(0, 1, 0); } }
+        public static IPoint3 ZAxis { get { return Loader.Global.Point3.Create(0, 0, 1); } }
+        public static IPoint3 Origin { get { return Loader.Global.Point3.Create(0, 0, 0); } }
+
+        public static IInterval Forever
+        {
+            get { return Loader.Global.Interval.Create(int.MinValue, int.MaxValue); }
+        }
+
+        public static IMatrix3 Identity { get { return Loader.Global.Matrix3.Create(XAxis, YAxis, ZAxis, Origin); } }
+
         public static bool IsTextureCube(string filepath)
         {
             try
@@ -107,7 +117,7 @@ namespace Max2Babylon
             }
         }
 
-        public static VNormal[] ComputeNormals(IMesh mesh)
+        public static VNormal[] ComputeNormals(IMesh mesh, bool optimize)
         {
             var vnorms = new VNormal[mesh.NumVerts];
             var fnorms = new Vector3[mesh.NumFaces];
@@ -128,7 +138,7 @@ namespace Max2Babylon
 
                 for (var j = 0; j < 3; j++)
                 {
-                    vnorms[(int)face.V[j]].AddNormal(fnorms[index], face.SmGroup);
+                    vnorms[(int)face.V[j]].AddNormal(fnorms[index], optimize ? 1 : face.SmGroup);
                 }
 
                 fnorms[index].Normalize();
@@ -187,13 +197,9 @@ namespace Max2Babylon
             return new[] { value.X, value.Z, value.Y, value.W };
         }
 
-        public static float[] Scale(this Color value, float scale)
-        {
-            return new[] { value.r * scale, value.g * scale, value.b * scale };
-        }
-        public static float[] ToArray(this Color value)
+        public static float[] Scale(this IColor value, float scale)
         {
-            return new[] { value.r, value.g, value.b };
+            return new[] { value.R * scale, value.G * scale, value.B * scale };
         }
 
         public static float[] ToArray(this IPoint4 value)
@@ -226,14 +232,31 @@ namespace Max2Babylon
             return new[] { value.R, value.G, value.B };
         }
 
-        public static IEnumerable<Node> NodesListBySuperClass(this Scene scene, SuperClassID sid)
+        public static IEnumerable<IINode> Nodes(this IINode node)
         {
-            return from n in scene.NodeTree where n.Object != null && n._Node.EvalWorldState(0, false).Obj.SuperClassID == sid select n;
+            for (int i = 0; i < node.NumberOfChildren; ++i)
+                if (node.GetChildNode(i) != null)
+                    yield return node.GetChildNode(i);
         }
 
-        public static IEnumerable<Node> NodesListBySuperClasses(this Scene scene, SuperClassID[] sids)
+        public static IEnumerable<IINode> NodeTree(this IINode node)
         {
-            return from n in scene.NodeTree where n.Object != null && sids.Any(sid => n._Node.EvalWorldState(0, false).Obj.SuperClassID == sid) select n;
+            foreach (var x in node.Nodes())
+            {
+                foreach (var y in x.NodeTree())
+                    yield return y;
+                yield return x;
+            }
+        }
+
+        public static IEnumerable<IINode> NodesListBySuperClass(this IINode rootNode, SClass_ID sid)
+        {
+            return from n in rootNode.NodeTree() where n.ObjectRef != null && n.EvalWorldState(0, false).Obj.SuperClassID == sid select n;
+        }
+
+        public static IEnumerable<IINode> NodesListBySuperClasses(this IINode rootNode, SClass_ID[] sids)
+        {
+            return from n in rootNode.NodeTree() where n.ObjectRef != null && sids.Any(sid => n.EvalWorldState(0, false).Obj.SuperClassID == sid) select n;
         }
 
         public static float ConvertFov(float fov)
@@ -241,78 +264,62 @@ namespace Max2Babylon
             return (float)(2.0f * Math.Atan(Math.Tan(fov / 2.0f) / Loader.Core.ImageAspRatio));
         }
 
-        public static bool HasParent(this Node node)
+        public static bool HasParent(this IINode node)
         {
-            return node.Parent != null && node.Parent.Object != null;
+            return node.ParentNode != null && node.ParentNode.ObjectRef != null;
         }
 
-        public static Guid GetGuid(this Animatable node)
+        public static Guid GetGuid(this IAnimatable node)
         {
-            var appData = node.GetAppData(new ClassID(Loader.Class_ID), SuperClassID.BaseNode);
-
-            var uidData = appData.GetChunk(0);
+            var uidData = node.GetAppDataChunk(Loader.Class_ID, SClass_ID.Basenode, 0);
             Guid uid;
 
             if (uidData != null)
             {
-                uid = new Guid(uidData);
+                uid = new Guid(uidData.Data);
             }
             else
             {
                 uid = Guid.NewGuid();
-                appData.AddChunk(0, uid.ToByteArray());
+                node.AddAppDataChunk(Loader.Class_ID, SClass_ID.Basenode, 0, uid.ToByteArray());
             }
 
             return uid;
         }
 
-        public static Guid GetGuid(this IINode node)
-        {
-            return GetGuid(Animatable.CreateWrapper<Node>(node));
-        }
-
-        public static string GetLocalData(this Node node)
+        public static string GetLocalData(this IAnimatable node)
         {
-            var appData = node.GetAppData(new ClassID(Loader.Class_ID), SuperClassID.BaseNode);
-
-            var uidData = appData.GetChunk(1);
+            var uidData = node.GetAppDataChunk(Loader.Class_ID, SClass_ID.Basenode, 1);
 
             if (uidData != null)
             {
-                return System.Text.Encoding.UTF8.GetString(uidData);
+                return System.Text.Encoding.UTF8.GetString(uidData.Data);
             }
 
             return "";
         }
 
-        public static void SetLocalData(this Node node, string value)
+        public static void SetLocalData(this IAnimatable node, string value)
         {
-            var appData = node.GetAppData(new ClassID(Loader.Class_ID), SuperClassID.BaseNode);
-
-            var uidData = appData.GetChunk(1);
+            var uidData = node.GetAppDataChunk(Loader.Class_ID, SClass_ID.Basenode, 1);
 
             if (uidData != null)
             {
-                appData.RemoveChunk(1);
+                node.RemoveAppDataChunk(Loader.Class_ID, SClass_ID.Basenode, 1);
             }
 
-            appData.AddChunk(1, System.Text.Encoding.UTF8.GetBytes(value));
-        }
-
-        public static IMatrix3 GetWorldMatrix(this Node node, TimeValue t, bool parent)
-        {
-            return node._Node.GetWorldMatrix(t, parent);
+            node.AddAppDataChunk(Loader.Class_ID, SClass_ID.Basenode, 1, System.Text.Encoding.UTF8.GetBytes(value));
         }
 
-        public static IMatrix3 GetWorldMatrix(this IINode node, TimeValue t, bool parent)
+        public static IMatrix3 GetWorldMatrix(this IINode node, int t, bool parent)
         {
-            var tm = node.GetNodeTM(t, Interval.Forever._IInterval);
-            var ptm = node.ParentNode.GetNodeTM(t, Interval.Forever._IInterval);
+            var tm = node.GetNodeTM(t, Forever);
+            var ptm = node.ParentNode.GetNodeTM(t, Forever);
 
             if (!parent)
                 return tm;
 
-            if (node.ParentNode.SuperClassID == SuperClassID.Camera)
+            if (node.ParentNode.SuperClassID == SClass_ID.Camera)
             {
                 var r = ptm.GetRow(3);
                 ptm.IdentityMatrix();
@@ -325,10 +332,12 @@ namespace Max2Babylon
 
         public static ITriObject GetMesh(this IObject obj)
         {
-            if (obj.CanConvertToType(ClassID.TriObject._IClass_ID) == 0)
+            var triObjectClassId = Loader.Global.Class_ID.Create(0x0009, 0);
+
+            if (obj.CanConvertToType(triObjectClassId) == 0)
                 return null;
 
-            return obj.ConvertToType(0, ClassID.TriObject._IClass_ID) as ITriObject;
+            return obj.ConvertToType(0, triObjectClassId) as ITriObject;
         }
 
         public static bool IsAlmostEqualTo(this IPoint4 current, IPoint4 other, float epsilon)