public static string ToJson(this glTFMaterialBaseColorTextureInfo self) { var f = new JsonFormatter(); GltfSerializer.Serialize_gltf_materials__pbrMetallicRoughness_baseColorTexture(f, self); return(f.ToString()); }
public static glTFMaterialBaseColorTextureInfo GetBaseColorTexture(JsonNode vrm0XMaterial) { try { var textureInfo = new glTFMaterialBaseColorTextureInfo { index = vrm0XMaterial[TexturePropertiesKey][MainTexKey].GetInt32(), }; var os = GetBaseColorTextureOffsetScale(vrm0XMaterial); glTF_KHR_texture_transform.Serialize(textureInfo, (os.offsetX, os.offsetY), (os.scaleX, os.scaleY)); return(textureInfo); } catch (Exception) { Debug.LogWarning($"Migration Warning: BaseColorTexture fallback default."); return(null); } }