diff --git a/CHANGELOG.md b/CHANGELOG.md index 45fe06f9..1e480002 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.0.1] - 2023-10-11 + +### Fixed +- Compilation error when Animation module is disabled and Newtonsoft JSON package installed. + ## [6.0.0] - 2023-10-04 ### Added diff --git a/Runtime/Scripts/Export/Constants.cs b/Runtime/Scripts/Export/Constants.cs index f19fd866..7393b836 100644 --- a/Runtime/Scripts/Export/Constants.cs +++ b/Runtime/Scripts/Export/Constants.cs @@ -7,7 +7,7 @@ namespace GLTFast.Export { static class Constants { - public const string version = "6.0.0"; + public const string version = "6.0.1"; internal const string mimeTypePNG = "image/png"; internal const string mimeTypeJPG = "image/jpeg"; diff --git a/Runtime/Scripts/Newtonsoft/Schema/AnimationChannel.cs b/Runtime/Scripts/Newtonsoft/Schema/AnimationChannel.cs index fca45290..d5bbef7f 100644 --- a/Runtime/Scripts/Newtonsoft/Schema/AnimationChannel.cs +++ b/Runtime/Scripts/Newtonsoft/Schema/AnimationChannel.cs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 -#if NEWTONSOFT_JSON +#if UNITY_ANIMATION && NEWTONSOFT_JSON using System.Collections.Generic; diff --git a/Runtime/Scripts/Newtonsoft/Schema/AnimationChannelTarget.cs b/Runtime/Scripts/Newtonsoft/Schema/AnimationChannelTarget.cs index 73a092fb..afcc71ad 100644 --- a/Runtime/Scripts/Newtonsoft/Schema/AnimationChannelTarget.cs +++ b/Runtime/Scripts/Newtonsoft/Schema/AnimationChannelTarget.cs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 -#if NEWTONSOFT_JSON +#if UNITY_ANIMATION && NEWTONSOFT_JSON using System.Collections.Generic; diff --git a/Runtime/Scripts/Newtonsoft/Schema/AnimationSampler.cs b/Runtime/Scripts/Newtonsoft/Schema/AnimationSampler.cs index 007e0fb7..5c8400a8 100644 --- a/Runtime/Scripts/Newtonsoft/Schema/AnimationSampler.cs +++ b/Runtime/Scripts/Newtonsoft/Schema/AnimationSampler.cs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 -#if NEWTONSOFT_JSON +#if UNITY_ANIMATION && NEWTONSOFT_JSON using System.Collections.Generic; diff --git a/Runtime/Scripts/Newtonsoft/Schema/GltfAnimation.cs b/Runtime/Scripts/Newtonsoft/Schema/GltfAnimation.cs index 42e274d1..0f8f6e83 100644 --- a/Runtime/Scripts/Newtonsoft/Schema/GltfAnimation.cs +++ b/Runtime/Scripts/Newtonsoft/Schema/GltfAnimation.cs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 -#if NEWTONSOFT_JSON +#if UNITY_ANIMATION && NEWTONSOFT_JSON using System.Collections.Generic; diff --git a/Runtime/Scripts/Newtonsoft/glTFast.Newtonsoft.asmdef b/Runtime/Scripts/Newtonsoft/glTFast.Newtonsoft.asmdef index 4254926c..e615c17d 100644 --- a/Runtime/Scripts/Newtonsoft/glTFast.Newtonsoft.asmdef +++ b/Runtime/Scripts/Newtonsoft/glTFast.Newtonsoft.asmdef @@ -12,6 +12,11 @@ "autoReferenced": false, "defineConstraints": [], "versionDefines": [ + { + "name": "com.unity.modules.animation", + "expression": "1.0.0", + "define": "UNITY_ANIMATION" + }, { "name": "com.unity.nuget.newtonsoft-json", "expression": "", diff --git a/Tests/Runtime/Extensions.cs b/Tests/Runtime/Extensions.cs index 02215f37..6ffefd89 100644 --- a/Tests/Runtime/Extensions.cs +++ b/Tests/Runtime/Extensions.cs @@ -378,6 +378,7 @@ public void CustomExtensionEverywhere() CertifyCustomExtensions(gltf.accessors[0].sparse.values.extensions); CertifyCustomExtras(gltf.accessors[0].sparse.values.extras); +#if UNITY_ANIMATION CertifyCustomData(gltf.animations[0], 43); CertifyCustomExtensions(gltf.animations[0].extensions); CertifyCustomExtras(gltf.animations[0].extras); @@ -393,6 +394,7 @@ public void CustomExtensionEverywhere() CertifyCustomData(gltf.animations[0].samplers[0], 431); CertifyCustomExtensions(gltf.animations[0].samplers[0].extensions); CertifyCustomExtras(gltf.animations[0].samplers[0].extras); +#endif CertifyCustomData(gltf.asset, 44); CertifyCustomExtensions(gltf.asset.extensions); @@ -570,8 +572,10 @@ public void CustomExtensionNowhere() Assert.IsNull(gltf.accessors[0].extras); Assert.IsNull(gltf.accessors[0].extensions); +#if UNITY_ANIMATION Assert.IsNull(gltf.animations[0].extras); Assert.IsNull(gltf.animations[0].extensions); +#endif Assert.IsNull(gltf.asset.extras); Assert.IsNull(gltf.asset.extensions); diff --git a/package.json b/package.json index e971b5e9..8b2071e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.atteneder.gltfast", - "version": "6.0.0", + "version": "6.0.1", "displayName": "glTFast", "description": "Use glTFast to import and export glTF 3D files efficiently at runtime or in the Editor", "unity": "2020.3",