Browse Source

removed shadermaterial check

Kacey Coley 7 năm trước cách đây
mục cha
commit
cd509e80fe
1 tập tin đã thay đổi với 10 bổ sung12 xóa
  1. 10 12
      serializers/src/glTF/2.0/babylon.glTFExporter.ts

+ 10 - 12
serializers/src/glTF/2.0/babylon.glTFExporter.ts

@@ -954,20 +954,18 @@ module BABYLON.GLTF2 {
 
                         let materialIndex: Nullable<number> = null;
                         if (babylonMaterial) {
-                            if (babylonMaterial instanceof ShaderMaterial) {
-                                if (bufferMesh instanceof LinesMesh) {
-                                    // get the color from the lines mesh and set it in the material
-                                    const material: IMaterial = {
-                                        name: bufferMesh.name + ' material'
-                                    }
-                                    if (!bufferMesh.color.equals(Color3.White()) || bufferMesh.alpha < 1) {
-                                        material.pbrMetallicRoughness = {
-                                            baseColorFactor: bufferMesh.color.asArray().concat([bufferMesh.alpha])
-                                        }
+                            if (bufferMesh instanceof LinesMesh) {
+                                // get the color from the lines mesh and set it in the material
+                                const material: IMaterial = {
+                                    name: bufferMesh.name + ' material'
+                                }
+                                if (!bufferMesh.color.equals(Color3.White()) || bufferMesh.alpha < 1) {
+                                    material.pbrMetallicRoughness = {
+                                        baseColorFactor: bufferMesh.color.asArray().concat([bufferMesh.alpha])
                                     }
-                                    this.materials.push(material);
-                                    materialIndex = this.materials.length - 1;
                                 }
+                                this.materials.push(material);
+                                materialIndex = this.materials.length - 1;
                             }
                             if (babylonMaterial instanceof MultiMaterial) {
                                 babylonMaterial = babylonMaterial.subMaterials[submesh.materialIndex];