From 361954aa9deafd09133f22c9f19be58d58ff034e Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 24 Sep 2020 15:19:31 +0900 Subject: [PATCH] fix warning Alpha cutoff is supported only for 'MASK' alpha mode. --- Assets/VRM/UniGLTF/Editor/Serialization/SerializerGenerator.cs | 2 +- Assets/VRM/UniGLTF/Scripts/IO/FormatterExtensionsGltf.g.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/VRM/UniGLTF/Editor/Serialization/SerializerGenerator.cs b/Assets/VRM/UniGLTF/Editor/Serialization/SerializerGenerator.cs index 27a81c1bb..e1ea54345 100644 --- a/Assets/VRM/UniGLTF/Editor/Serialization/SerializerGenerator.cs +++ b/Assets/VRM/UniGLTF/Editor/Serialization/SerializerGenerator.cs @@ -80,7 +80,7 @@ namespace UniGLTF {"gltf/meshes[]/primitives[]/extras", "if(value.extras!=null && value.extras.targetNames!=null && value.extras.targetNames.Count>0)"}, {"gltf/meshes[]/weights", "if(value.weights!=null && value.weights.Length>0)" }, {"gltf/materials", "if(value.materials!=null && value.materials.Count>0)" }, - {"gltf/materials[]/alphaCutoff", "if(!string.IsNullOrEmpty(value.alphaMode))" }, + {"gltf/materials[]/alphaCutoff", "if(value.alphaMode == \"MASK\")" }, {"gltf/nodes", "if(value.nodes!=null && value.nodes.Count>0)" }, {"gltf/nodes[]/camera", "if(value.camera!=-1)"}, {"gltf/nodes[]/mesh", "if(value.mesh!=-1)"}, diff --git a/Assets/VRM/UniGLTF/Scripts/IO/FormatterExtensionsGltf.g.cs b/Assets/VRM/UniGLTF/Scripts/IO/FormatterExtensionsGltf.g.cs index 246f88b09..4a4065a66 100644 --- a/Assets/VRM/UniGLTF/Scripts/IO/FormatterExtensionsGltf.g.cs +++ b/Assets/VRM/UniGLTF/Scripts/IO/FormatterExtensionsGltf.g.cs @@ -572,7 +572,7 @@ namespace UniGLTF { f.Key("alphaMode"); f.GenSerialize(value.alphaMode); } - if(!string.IsNullOrEmpty(value.alphaMode)) + if(value.alphaMode == "MASK") { f.Key("alphaCutoff"); f.GenSerialize(value.alphaCutoff); }