Parcourir la source

Babylon Exporter Entities Update

Added a few entity properties to bring up to date
MackeyK24 il y a 8 ans
Parent
commit
9a2ccf74c2

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

@@ -68,6 +68,12 @@ namespace BabylonExport.Entities
         [DataMember]
         [DataMember]
         public BabylonAnimation[] animations { get; set; }
         public BabylonAnimation[] animations { get; set; }
 
 
+        [DataMember]
+        public object metadata { get; set; }
+
+        [DataMember]
+        public string tags { get; set; }
+
         public BabylonCamera()
         public BabylonCamera()
         {
         {
             position = new[] { 0f, 0f, 0f };
             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]
         [DataMember]
         public BabylonAnimation[] animations { get; set; }
         public BabylonAnimation[] animations { get; set; }
 
 
+        [DataMember]
+        public object metadata { get; set; }
+
+        [DataMember]
+        public string tags { get; set; }
+
         public BabylonLight()
         public BabylonLight()
         {
         {
             diffuse = new[] {1.0f, 1.0f, 1.0f};
             diffuse = new[] {1.0f, 1.0f, 1.0f};

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

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

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

@@ -142,6 +142,9 @@ namespace BabylonExport.Entities
         [DataMember]
         [DataMember]
         public BabylonFresnelParameters opacityFresnelParameters { get; set; }
         public BabylonFresnelParameters opacityFresnelParameters { get; set; }
 
 
+        [DataMember]
+        public bool disableLighting { get; set; }
+
         public BabylonPBRMaterial() : base()
         public BabylonPBRMaterial() : base()
         {
         {
             customType = "BABYLON.PBRMaterial";
             customType = "BABYLON.PBRMaterial";

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

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

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

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

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

@@ -59,6 +59,9 @@ namespace BabylonExport.Entities
         [DataMember]
         [DataMember]
         public bool useSpecularOverAlpha { get; set; }
         public bool useSpecularOverAlpha { get; set; }
 
 
+        [DataMember]
+        public bool disableLighting { get; set; }
+
         public BabylonStandardMaterial() : base()
         public BabylonStandardMaterial() : base()
         {
         {
             ambient = new[] {1.0f, 1.0f, 1.0f};
             ambient = new[] {1.0f, 1.0f, 1.0f};

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

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