From 3b08cccc0678ab723f8cca482514921fe520e492 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 20 Oct 2023 17:53:29 +0900 Subject: [PATCH 1/4] =?UTF-8?q?VRMVersion=20=E3=82=92=20VRMSpecVersion=20?= =?UTF-8?q?=E3=81=AB=E3=83=AA=E3=83=8D=E3=83=BC=E3=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM10/Editor/Vrm10TopMenu.cs | 6 ++--- .../VRM10/Runtime/Version/VRMSpecVersion.cs | 26 +++++-------------- ...ionPartial.cs => VRMSpecVersionPartial.cs} | 5 +--- ....cs.meta => VRMSpecVersionPartial.cs.meta} | 2 +- Assets/VRM10/Runtime/Version/VRMVersion.cs | 13 ---------- .../Runtime/Version/VRMVersionPartial.cs.meta | 11 -------- .../VRM10Viewer/VRM10ViewerUI.cs | 2 +- 7 files changed, 12 insertions(+), 53 deletions(-) rename Assets/VRM10/Runtime/Version/{VRMVersionPartial.cs => VRMSpecVersionPartial.cs} (95%) rename Assets/VRM10/Runtime/Version/{VRMVersion.cs.meta => VRMSpecVersionPartial.cs.meta} (83%) delete mode 100644 Assets/VRM10/Runtime/Version/VRMVersion.cs delete mode 100644 Assets/VRM10/Runtime/Version/VRMVersionPartial.cs.meta diff --git a/Assets/VRM10/Editor/Vrm10TopMenu.cs b/Assets/VRM10/Editor/Vrm10TopMenu.cs index 91e144bff..914101aa3 100644 --- a/Assets/VRM10/Editor/Vrm10TopMenu.cs +++ b/Assets/VRM10/Editor/Vrm10TopMenu.cs @@ -4,9 +4,9 @@ namespace UniVRM10 { public static class Vrm10TopMenu { - private const string UserMenuPrefix = VRMVersion.MENU; - private const string DevelopmentMenuPrefix = VRMVersion.MENU + "/Development"; - private const string ExperimentalMenuPrefix = VRMVersion.MENU + "/Experimental"; + private const string UserMenuPrefix = VRM10SpecVersion.MENU; + private const string DevelopmentMenuPrefix = VRM10SpecVersion.MENU + "/Development"; + private const string ExperimentalMenuPrefix = VRM10SpecVersion.MENU + "/Experimental"; [MenuItem(UserMenuPrefix + "/Export VRM-1.0", priority = 1)] private static void OpenExportDialog() => VRM10ExportDialog.Open(); diff --git a/Assets/VRM10/Runtime/Version/VRMSpecVersion.cs b/Assets/VRM10/Runtime/Version/VRMSpecVersion.cs index 7fe7d3c90..149013e2d 100644 --- a/Assets/VRM10/Runtime/Version/VRMSpecVersion.cs +++ b/Assets/VRM10/Runtime/Version/VRMSpecVersion.cs @@ -1,27 +1,13 @@ -using System; namespace UniVRM10 { - /// - /// https://github.com/vrm-c/vrm-specification/tree/master/specification - /// - /// spec version として解釈できる git tag を運用するべきか。 - /// - /// コード生成を通して自動で更新する必要がある。 - /// - public class VRMSpecVersion + public static partial class VRM10SpecVersion { - public const int Major = 1; - public const int Minor = 0; + public const int MAJOR = 1; + public const int MINOR = 0; + public const int PATCH = 0; + public const string PRE_ID = ""; - public static string Version - { - get - { - return String.Format("{0}.{1}.draft", Major, Minor); - } - } - - public const string VERSION = "1.0.draft"; + const string VERSION = "1.0.0"; } } diff --git a/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs b/Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs similarity index 95% rename from Assets/VRM10/Runtime/Version/VRMVersionPartial.cs rename to Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs index 9a235bb0c..6d5e26472 100644 --- a/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs +++ b/Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs @@ -1,12 +1,9 @@ using System; -using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Json; using System.Text.RegularExpressions; namespace UniVRM10 { - public static partial class VRMVersion + public static partial class VRM10SpecVersion { /// /// Returns true if a passed version is newer than current UniVRM. diff --git a/Assets/VRM10/Runtime/Version/VRMVersion.cs.meta b/Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs.meta similarity index 83% rename from Assets/VRM10/Runtime/Version/VRMVersion.cs.meta rename to Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs.meta index b107aec7b..83deb9556 100644 --- a/Assets/VRM10/Runtime/Version/VRMVersion.cs.meta +++ b/Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b7339aecd19a8ec4fbe33ca20d8ef675 +guid: 83197292b727c684ea74bbdbf6d40ef0 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/VRM10/Runtime/Version/VRMVersion.cs b/Assets/VRM10/Runtime/Version/VRMVersion.cs deleted file mode 100644 index d1a33a915..000000000 --- a/Assets/VRM10/Runtime/Version/VRMVersion.cs +++ /dev/null @@ -1,13 +0,0 @@ - -namespace UniVRM10 -{ - public static partial class VRMVersion - { - public const int MAJOR = 1; - public const int MINOR = 0; - public const int PATCH = 0; - public const string PRE_ID = ""; - - public const string VERSION = "1.0.0.beta"; - } -} diff --git a/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs.meta b/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs.meta deleted file mode 100644 index 4e7afa499..000000000 --- a/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: daece183c090e0b4aa9097151202c316 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs b/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs index fc5b9fe08..4fd52bd8a 100644 --- a/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs +++ b/Assets/VRM10_Samples/VRM10Viewer/VRM10ViewerUI.cs @@ -310,7 +310,7 @@ namespace UniVRM10.VRM10Viewer private void Start() { m_version.text = string.Format("VRMViewer {0}.{1}", - VRMVersion.MAJOR, VRMVersion.MINOR); + VRM10SpecVersion.MAJOR, VRM10SpecVersion.MINOR); m_openModel.onClick.AddListener(OnOpenModelClicked); m_openMotion.onClick.AddListener(OnOpenMotionClicked); From 443e0048bdb4d60a1b6a176c924d38939aae540f Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 20 Oct 2023 18:05:43 +0900 Subject: [PATCH 2/4] =?UTF-8?q?VRMVersion=E3=82=92=E3=83=AA=E3=83=8D?= =?UTF-8?q?=E3=83=BC=E3=83=A0=E3=81=97=E3=81=A6=E5=A0=B4=E6=89=80=E7=A7=BB?= =?UTF-8?q?=E5=8B=95=E3=80=82VRM10=E3=81=8B=E3=82=89=E5=8F=82=E7=85=A7?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E3=80=82=20assets.generator=20=E3=81=AB=E4=BD=BF?= =?UTF-8?q?=E3=81=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 + .../UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs | 2 +- .../Runtime/UniGLTF/UniVrmPackageVersion.cs} | 4 ++-- .../Runtime/UniGLTF/UniVrmPackageVersion.cs.meta} | 4 +--- .../UniGLTF/UniVrmPackageVersionPartial.cs} | 4 ++-- .../UniGLTF/UniVrmPackageVersionPartial.cs.meta} | 4 +--- Assets/VRM/Editor/Format/VRMVersionMenu.cs | 10 +++++----- Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs | 2 +- Assets/VRM/Editor/VRMExportUnityPackage.cs | 2 +- Assets/VRM/Editor/VrmTopMenu.cs | 8 ++++---- Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs | 4 ++-- Assets/VRM/Runtime/IO/VRMData.cs | 14 +++++++------- Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs | 2 +- Assets/VRM/Tests/VersionTests.cs | 15 +++++---------- .../VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs | 2 +- Assets/VRM_Samples/SimpleViewer/ViewerUI.cs | 2 +- 16 files changed, 36 insertions(+), 44 deletions(-) rename Assets/{VRM/Runtime/Format/VRMVersion.cs => UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs} (71%) rename Assets/{VRM/Runtime/Format/VRMVersion.cs.meta => UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs.meta} (71%) rename Assets/{VRM/Runtime/Format/VRMVersionPartial.cs => UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs} (97%) rename Assets/{VRM/Runtime/Format/VRMVersionPartial.cs.meta => UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs.meta} (71%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 27167fe5c..b0ac5b0e0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -53,6 +53,7 @@ "Temp/":true }, "cSpell.words": [ + "GLTF", "UNIVRM" ] } \ No newline at end of file diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs b/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs index b2e3e6248..b1a5ba67b 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs @@ -6,7 +6,7 @@ namespace UniGLTF [Serializable] public class glTFAssets { - public string generator; + public string generator = $"UniVRM-{UniVrmPackageVersion.VERSION}"; [JsonSchema(Required = true, Pattern = "^[0-9]+\\.[0-9]+$")] public string version; diff --git a/Assets/VRM/Runtime/Format/VRMVersion.cs b/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs similarity index 71% rename from Assets/VRM/Runtime/Format/VRMVersion.cs rename to Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs index a0da2efa8..43108c8fc 100644 --- a/Assets/VRM/Runtime/Format/VRMVersion.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs @@ -1,7 +1,7 @@ -namespace VRM +namespace UniGLTF { - public static partial class VRMVersion + public static partial class UniVrmPackageVersion { public const int MAJOR = 0; public const int MINOR = 115; diff --git a/Assets/VRM/Runtime/Format/VRMVersion.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs.meta similarity index 71% rename from Assets/VRM/Runtime/Format/VRMVersion.cs.meta rename to Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs.meta index b953c85a9..4e7c8cfb1 100644 --- a/Assets/VRM/Runtime/Format/VRMVersion.cs.meta +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: 93c46c8b64555f14bada9f5bb0b7761a -timeCreated: 1522130257 -licenseType: Free +guid: 4769e8b6530fee0459f0b415a1444ed8 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs b/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs similarity index 97% rename from Assets/VRM/Runtime/Format/VRMVersionPartial.cs rename to Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs index 4a739ac0b..254f6faaf 100644 --- a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs @@ -1,9 +1,9 @@ using System; using System.Text.RegularExpressions; -namespace VRM +namespace UniGLTF { - public static partial class VRMVersion + public static partial class UniVrmPackageVersion { /// /// Returns true if a passed version is newer than current UniVRM. diff --git a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs.meta similarity index 71% rename from Assets/VRM/Runtime/Format/VRMVersionPartial.cs.meta rename to Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs.meta index b505fdb09..aa06a7686 100644 --- a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs.meta +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: 4ab9ac9856a4d4c4aa652c07c5b496e6 -timeCreated: 1522130257 -licenseType: Free +guid: ae6336d2e58d3c94884d2c40bd910bef MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/VRM/Editor/Format/VRMVersionMenu.cs b/Assets/VRM/Editor/Format/VRMVersionMenu.cs index a8196d7bc..7fac15276 100644 --- a/Assets/VRM/Editor/Format/VRMVersionMenu.cs +++ b/Assets/VRM/Editor/Format/VRMVersionMenu.cs @@ -40,11 +40,11 @@ namespace UniGLTF /// /// VRM /// - const string VrmVersionPath = "Assets/VRM/Runtime/Format/VRMVersion.cs"; + const string VrmVersionPath = "Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs"; const string VrmVersionTemplate = @" -namespace VRM +namespace UniGLTF {{ - public static partial class VRMVersion + public static partial class UniVrmPackageVersion {{ public const int MAJOR = {0}; public const int MINOR = {1}; @@ -251,7 +251,7 @@ namespace VRM void OnGUI() { GUILayout.Label("VRM"); - GUILayout.Label($"Current version: {VRMVersion.VERSION}"); + GUILayout.Label($"Current version: {UniVrmPackageVersion.VERSION}"); m_vrmVersion = EditorGUILayout.TextField("Major.Minor.Patch", m_vrmVersion); GUILayout.Space(30); @@ -324,7 +324,7 @@ namespace VRM public static void ShowVersionDialog() { var window = ScriptableObject.CreateInstance(); - window.m_vrmVersion = VRMVersion.VERSION; + window.m_vrmVersion = UniVrmPackageVersion.VERSION; // window.m_uniGltfVersion = UniGLTFVersion.VERSION; window.ShowUtility(); } diff --git a/Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs b/Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs index 92c82a082..937d3a40c 100644 --- a/Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs +++ b/Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs @@ -176,7 +176,7 @@ namespace VRM { serializedObject.Update(); - if (VRMVersion.IsNewer(m_exporterVersion.stringValue)) + if (UniVrmPackageVersion.IsNewer(m_exporterVersion.stringValue)) { // モデルのバージョンが、ライブラリのバージョンより新しい EditorGUILayout.HelpBox("Check UniVRM new version.", MessageType.Warning); diff --git a/Assets/VRM/Editor/VRMExportUnityPackage.cs b/Assets/VRM/Editor/VRMExportUnityPackage.cs index 532809479..8ff83f751 100644 --- a/Assets/VRM/Editor/VRMExportUnityPackage.cs +++ b/Assets/VRM/Editor/VRMExportUnityPackage.cs @@ -73,7 +73,7 @@ namespace VRM.DevOnly.PackageExporter var path = string.Format("{0}/{1}-{2}_{3}.unitypackage", folder, prefix, - VRMVersion.VERSION, + UniGLTF.UniVrmPackageVersion.VERSION, GetGitHash(Application.dataPath + "/VRM").Substring(0, 4) ).Replace("\\", "/"); diff --git a/Assets/VRM/Editor/VrmTopMenu.cs b/Assets/VRM/Editor/VrmTopMenu.cs index cabea8ec6..f783c7b97 100644 --- a/Assets/VRM/Editor/VrmTopMenu.cs +++ b/Assets/VRM/Editor/VrmTopMenu.cs @@ -6,13 +6,13 @@ namespace VRM { public static class VrmTopMenu { - private const string UserMenuPrefix = VRMVersion.MENU; - private const string DevelopmentMenuPrefix = VRMVersion.MENU + "/Development"; + private const string UserMenuPrefix = UniVrmPackageVersion.MENU; + private const string DevelopmentMenuPrefix = UniVrmPackageVersion.MENU + "/Development"; - [MenuItem(UserMenuPrefix + "/Version: " + VRMVersion.VRM_VERSION, validate = true)] + [MenuItem(UserMenuPrefix + "/Version: " + UniVrmPackageVersion.VRM_VERSION, validate = true)] private static bool ShowVersionValidation() => false; - [MenuItem(UserMenuPrefix + "/Version: " + VRMVersion.VRM_VERSION, priority = 0)] + [MenuItem(UserMenuPrefix + "/Version: " + UniVrmPackageVersion.VRM_VERSION, priority = 0)] private static void ShowVersion() { } [MenuItem(UserMenuPrefix + "/Export to VRM 0.x", priority = 1)] diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs b/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs index 19b41c3d4..12a3dc354 100644 --- a/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs +++ b/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs @@ -15,8 +15,8 @@ VRM extension is for 3d humanoid avatars (and models) in VR applications. public static readonly Utf8String ExtensionNameUtf8 = Utf8String.From(ExtensionName); - [JsonSchema(Description = @"Version of exporter that vrm created. " + VRMVersion.VRM_VERSION)] - public string exporterVersion = "UniVRM-" + VRMVersion.VERSION; + [JsonSchema(Description = @"Version of exporter that vrm created. " + UniVrmPackageVersion.VRM_VERSION)] + public string exporterVersion = "UniVRM-" + UniVrmPackageVersion.VERSION; [JsonSchema(Description = @"Version of VRM specification. " + VRMSpecVersion.VERSION)] public string specVersion = VRMSpecVersion.Version; diff --git a/Assets/VRM/Runtime/IO/VRMData.cs b/Assets/VRM/Runtime/IO/VRMData.cs index 6e64cc997..62adf3d89 100644 --- a/Assets/VRM/Runtime/IO/VRMData.cs +++ b/Assets/VRM/Runtime/IO/VRMData.cs @@ -22,10 +22,10 @@ namespace VRM private static void UpdateMigrationFlags(MigrationFlags migrationFlags, string exportedVrmVersionString) { - if (!VRMVersion.ParseVersion(exportedVrmVersionString, out var exportedVrmVersion)) return; + if (!UniVrmPackageVersion.ParseVersion(exportedVrmVersionString, out var exportedVrmVersion)) return; - migrationFlags.IsBaseColorFactorGamma = VRMVersion.IsNewer( - new VRMVersion.Version + migrationFlags.IsBaseColorFactorGamma = UniVrmPackageVersion.IsNewer( + new UniVrmPackageVersion.Version { Major = 0, Minor = 54, @@ -35,8 +35,8 @@ namespace VRM exportedVrmVersion ); - migrationFlags.IsRoughnessTextureValueSquared = VRMVersion.IsNewer( - new VRMVersion.Version + migrationFlags.IsRoughnessTextureValueSquared = UniVrmPackageVersion.IsNewer( + new UniVrmPackageVersion.Version { Major = 0, Minor = 69, @@ -45,8 +45,8 @@ namespace VRM }, exportedVrmVersion ); - migrationFlags.IsEmissiveFactorGamma = VRMVersion.IsNewer( - new VRMVersion.Version + migrationFlags.IsEmissiveFactorGamma = UniVrmPackageVersion.IsNewer( + new UniVrmPackageVersion.Version { Major = 0, Minor = 107, diff --git a/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs b/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs index 27294ec96..6d776d2f4 100644 --- a/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs @@ -253,7 +253,7 @@ namespace VRM.SimpleViewer private void Start() { m_version.text = string.Format("VRMViewer {0}.{1}", - VRMVersion.MAJOR, VRMVersion.MINOR); + UniVrmPackageVersion.MAJOR, UniVrmPackageVersion.MINOR); m_open.onClick.AddListener(OnOpenClicked); m_useFastSpringBone.onValueChanged.AddListener(OnUseFastSpringBoneValueChanged); OnUseFastSpringBoneValueChanged(m_useFastSpringBone.isOn); diff --git a/Assets/VRM/Tests/VersionTests.cs b/Assets/VRM/Tests/VersionTests.cs index db40493cc..9792e1e80 100644 --- a/Assets/VRM/Tests/VersionTests.cs +++ b/Assets/VRM/Tests/VersionTests.cs @@ -1,22 +1,17 @@ using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Linq; -using UniJSON; -using UnityEngine; namespace VRM { public class UniVRMVersionTests { [Test] - [TestCase(VRMVersion.VERSION, false)] + [TestCase(UniGLTF.UniVrmPackageVersion.VERSION, false)] [TestCase("0.199", true)] [TestCase("0.199.0", true)] [TestCase("1.0.0", true)] public void IsNewerTest(string newer, bool isNewer) { - Assert.AreEqual(isNewer, VRMVersion.IsNewer(newer)); + Assert.AreEqual(isNewer, UniGLTF.UniVrmPackageVersion.IsNewer(newer)); } [Test] @@ -31,7 +26,7 @@ namespace VRM [TestCase("1.0.0", "0.51.0", true)] public void IsNewerTest(string newer, string older, bool isNewer) { - Assert.AreEqual(isNewer, VRMVersion.IsNewer(newer, older)); + Assert.AreEqual(isNewer, UniGLTF.UniVrmPackageVersion.IsNewer(newer, older)); } [Test] @@ -43,8 +38,8 @@ namespace VRM [TestCase("aaaaa", false, 0, 0, 0, "")] public void ParseVersionTest(string version, bool canBeParsed, int major, int minor, int patch, string pre) { - VRMVersion.Version v; - var res = VRMVersion.ParseVersion(version, out v); + UniGLTF.UniVrmPackageVersion.Version v; + var res = UniGLTF.UniVrmPackageVersion.ParseVersion(version, out v); Assert.AreEqual(canBeParsed, res); if (res) { diff --git a/Assets/VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs b/Assets/VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs index fc5b9fe08..4fd52bd8a 100644 --- a/Assets/VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs +++ b/Assets/VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs @@ -310,7 +310,7 @@ namespace UniVRM10.VRM10Viewer private void Start() { m_version.text = string.Format("VRMViewer {0}.{1}", - VRMVersion.MAJOR, VRMVersion.MINOR); + VRM10SpecVersion.MAJOR, VRM10SpecVersion.MINOR); m_openModel.onClick.AddListener(OnOpenModelClicked); m_openMotion.onClick.AddListener(OnOpenMotionClicked); diff --git a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs index 27294ec96..6d776d2f4 100644 --- a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs @@ -253,7 +253,7 @@ namespace VRM.SimpleViewer private void Start() { m_version.text = string.Format("VRMViewer {0}.{1}", - VRMVersion.MAJOR, VRMVersion.MINOR); + UniVrmPackageVersion.MAJOR, UniVrmPackageVersion.MINOR); m_open.onClick.AddListener(OnOpenClicked); m_useFastSpringBone.onValueChanged.AddListener(OnUseFastSpringBoneValueChanged); OnUseFastSpringBoneValueChanged(m_useFastSpringBone.isOn); From 372f8869a6b5a8b381c2b0d5352114d4348e88b8 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 20 Oct 2023 19:13:04 +0900 Subject: [PATCH 3/4] =?UTF-8?q?glTFAssets.generator=20=E3=81=AE=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=82=92=20VRM10=20=E3=82=A8=E3=82=AF=E3=82=B9?= =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=82=BF=E3=83=BC=E9=A0=98=E5=9F=9F=E3=81=AB?= =?UTF-8?q?=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs | 2 +- Assets/VRM10/vrmlib/Runtime/Model.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs b/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs index b1a5ba67b..b2e3e6248 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFAssets.cs @@ -6,7 +6,7 @@ namespace UniGLTF [Serializable] public class glTFAssets { - public string generator = $"UniVRM-{UniVrmPackageVersion.VERSION}"; + public string generator; [JsonSchema(Required = true, Pattern = "^[0-9]+\\.[0-9]+$")] public string version; diff --git a/Assets/VRM10/vrmlib/Runtime/Model.cs b/Assets/VRM10/vrmlib/Runtime/Model.cs index 2df1be094..703326903 100644 --- a/Assets/VRM10/vrmlib/Runtime/Model.cs +++ b/Assets/VRM10/vrmlib/Runtime/Model.cs @@ -25,7 +25,7 @@ namespace VrmLib public Coordinates Coordinates; public string AssetVersion = "2.0"; - public string AssetGenerator; + public string AssetGenerator = $"UniVRM-{UniVrmPackageVersion.VERSION}"; public string AssetCopyright; public string AssetMinVersion; From 8ff3faa85708d34cba6feeec85fcc78f2a2b07e1 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 20 Oct 2023 19:16:20 +0900 Subject: [PATCH 4/4] rename UniVrmPackageVersion to PackageVersion --- .../{UniVrmPackageVersion.cs => PackageVersion.cs} | 2 +- ...ckageVersion.cs.meta => PackageVersion.cs.meta} | 2 +- ...eVersionPartial.cs => PackageVersionPartial.cs} | 2 +- ...rtial.cs.meta => PackageVersionPartial.cs.meta} | 2 +- Assets/VRM/Editor/Format/VRMVersionMenu.cs | 8 ++++---- Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs | 2 +- Assets/VRM/Editor/VRMExportUnityPackage.cs | 2 +- Assets/VRM/Editor/VrmTopMenu.cs | 8 ++++---- Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs | 4 ++-- Assets/VRM/Runtime/IO/VRMData.cs | 14 +++++++------- Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs | 2 +- Assets/VRM/Tests/VersionTests.cs | 10 +++++----- Assets/VRM10/vrmlib/Runtime/Model.cs | 2 +- Assets/VRM_Samples/SimpleViewer/ViewerUI.cs | 2 +- 14 files changed, 31 insertions(+), 31 deletions(-) rename Assets/UniGLTF/Runtime/UniGLTF/{UniVrmPackageVersion.cs => PackageVersion.cs} (78%) rename Assets/UniGLTF/Runtime/UniGLTF/{UniVrmPackageVersion.cs.meta => PackageVersion.cs.meta} (83%) rename Assets/UniGLTF/Runtime/UniGLTF/{UniVrmPackageVersionPartial.cs => PackageVersionPartial.cs} (98%) rename Assets/UniGLTF/Runtime/UniGLTF/{UniVrmPackageVersionPartial.cs.meta => PackageVersionPartial.cs.meta} (83%) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs similarity index 78% rename from Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs rename to Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs index 43108c8fc..a4cedba3c 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs @@ -1,7 +1,7 @@ namespace UniGLTF { - public static partial class UniVrmPackageVersion + public static partial class PackageVersion { public const int MAJOR = 0; public const int MINOR = 115; diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs.meta similarity index 83% rename from Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs.meta rename to Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs.meta index 4e7c8cfb1..d61dbbf3b 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs.meta +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4769e8b6530fee0459f0b415a1444ed8 +guid: ab81045d7751d4040b553ecbac5ab9e4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs similarity index 98% rename from Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs rename to Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs index 254f6faaf..513826f1e 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs @@ -3,7 +3,7 @@ using System.Text.RegularExpressions; namespace UniGLTF { - public static partial class UniVrmPackageVersion + public static partial class PackageVersion { /// /// Returns true if a passed version is newer than current UniVRM. diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs.meta similarity index 83% rename from Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs.meta rename to Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs.meta index aa06a7686..ce011769d 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersionPartial.cs.meta +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ae6336d2e58d3c94884d2c40bd910bef +guid: a025b7dc17054bb41ae56d364d78d120 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/VRM/Editor/Format/VRMVersionMenu.cs b/Assets/VRM/Editor/Format/VRMVersionMenu.cs index 7fac15276..95aea3333 100644 --- a/Assets/VRM/Editor/Format/VRMVersionMenu.cs +++ b/Assets/VRM/Editor/Format/VRMVersionMenu.cs @@ -40,11 +40,11 @@ namespace UniGLTF /// /// VRM /// - const string VrmVersionPath = "Assets/UniGLTF/Runtime/UniGLTF/UniVrmPackageVersion.cs"; + const string VrmVersionPath = "Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs"; const string VrmVersionTemplate = @" namespace UniGLTF {{ - public static partial class UniVrmPackageVersion + public static partial class PackageVersion {{ public const int MAJOR = {0}; public const int MINOR = {1}; @@ -251,7 +251,7 @@ namespace UniGLTF void OnGUI() { GUILayout.Label("VRM"); - GUILayout.Label($"Current version: {UniVrmPackageVersion.VERSION}"); + GUILayout.Label($"Current version: {PackageVersion.VERSION}"); m_vrmVersion = EditorGUILayout.TextField("Major.Minor.Patch", m_vrmVersion); GUILayout.Space(30); @@ -324,7 +324,7 @@ namespace UniGLTF public static void ShowVersionDialog() { var window = ScriptableObject.CreateInstance(); - window.m_vrmVersion = UniVrmPackageVersion.VERSION; + window.m_vrmVersion = PackageVersion.VERSION; // window.m_uniGltfVersion = UniGLTFVersion.VERSION; window.ShowUtility(); } diff --git a/Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs b/Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs index 937d3a40c..19c4d1ac0 100644 --- a/Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs +++ b/Assets/VRM/Editor/Meta/VRMMetaObjectEditor.cs @@ -176,7 +176,7 @@ namespace VRM { serializedObject.Update(); - if (UniVrmPackageVersion.IsNewer(m_exporterVersion.stringValue)) + if (PackageVersion.IsNewer(m_exporterVersion.stringValue)) { // モデルのバージョンが、ライブラリのバージョンより新しい EditorGUILayout.HelpBox("Check UniVRM new version.", MessageType.Warning); diff --git a/Assets/VRM/Editor/VRMExportUnityPackage.cs b/Assets/VRM/Editor/VRMExportUnityPackage.cs index 8ff83f751..35be05607 100644 --- a/Assets/VRM/Editor/VRMExportUnityPackage.cs +++ b/Assets/VRM/Editor/VRMExportUnityPackage.cs @@ -73,7 +73,7 @@ namespace VRM.DevOnly.PackageExporter var path = string.Format("{0}/{1}-{2}_{3}.unitypackage", folder, prefix, - UniGLTF.UniVrmPackageVersion.VERSION, + UniGLTF.PackageVersion.VERSION, GetGitHash(Application.dataPath + "/VRM").Substring(0, 4) ).Replace("\\", "/"); diff --git a/Assets/VRM/Editor/VrmTopMenu.cs b/Assets/VRM/Editor/VrmTopMenu.cs index f783c7b97..baaadad12 100644 --- a/Assets/VRM/Editor/VrmTopMenu.cs +++ b/Assets/VRM/Editor/VrmTopMenu.cs @@ -6,13 +6,13 @@ namespace VRM { public static class VrmTopMenu { - private const string UserMenuPrefix = UniVrmPackageVersion.MENU; - private const string DevelopmentMenuPrefix = UniVrmPackageVersion.MENU + "/Development"; + private const string UserMenuPrefix = PackageVersion.MENU; + private const string DevelopmentMenuPrefix = PackageVersion.MENU + "/Development"; - [MenuItem(UserMenuPrefix + "/Version: " + UniVrmPackageVersion.VRM_VERSION, validate = true)] + [MenuItem(UserMenuPrefix + "/Version: " + PackageVersion.VRM_VERSION, validate = true)] private static bool ShowVersionValidation() => false; - [MenuItem(UserMenuPrefix + "/Version: " + UniVrmPackageVersion.VRM_VERSION, priority = 0)] + [MenuItem(UserMenuPrefix + "/Version: " + PackageVersion.VRM_VERSION, priority = 0)] private static void ShowVersion() { } [MenuItem(UserMenuPrefix + "/Export to VRM 0.x", priority = 1)] diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs b/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs index 12a3dc354..631b3fc9e 100644 --- a/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs +++ b/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs @@ -15,8 +15,8 @@ VRM extension is for 3d humanoid avatars (and models) in VR applications. public static readonly Utf8String ExtensionNameUtf8 = Utf8String.From(ExtensionName); - [JsonSchema(Description = @"Version of exporter that vrm created. " + UniVrmPackageVersion.VRM_VERSION)] - public string exporterVersion = "UniVRM-" + UniVrmPackageVersion.VERSION; + [JsonSchema(Description = @"Version of exporter that vrm created. " + PackageVersion.VRM_VERSION)] + public string exporterVersion = "UniVRM-" + PackageVersion.VERSION; [JsonSchema(Description = @"Version of VRM specification. " + VRMSpecVersion.VERSION)] public string specVersion = VRMSpecVersion.Version; diff --git a/Assets/VRM/Runtime/IO/VRMData.cs b/Assets/VRM/Runtime/IO/VRMData.cs index 62adf3d89..763ccde72 100644 --- a/Assets/VRM/Runtime/IO/VRMData.cs +++ b/Assets/VRM/Runtime/IO/VRMData.cs @@ -22,10 +22,10 @@ namespace VRM private static void UpdateMigrationFlags(MigrationFlags migrationFlags, string exportedVrmVersionString) { - if (!UniVrmPackageVersion.ParseVersion(exportedVrmVersionString, out var exportedVrmVersion)) return; + if (!PackageVersion.ParseVersion(exportedVrmVersionString, out var exportedVrmVersion)) return; - migrationFlags.IsBaseColorFactorGamma = UniVrmPackageVersion.IsNewer( - new UniVrmPackageVersion.Version + migrationFlags.IsBaseColorFactorGamma = PackageVersion.IsNewer( + new PackageVersion.Version { Major = 0, Minor = 54, @@ -35,8 +35,8 @@ namespace VRM exportedVrmVersion ); - migrationFlags.IsRoughnessTextureValueSquared = UniVrmPackageVersion.IsNewer( - new UniVrmPackageVersion.Version + migrationFlags.IsRoughnessTextureValueSquared = PackageVersion.IsNewer( + new PackageVersion.Version { Major = 0, Minor = 69, @@ -45,8 +45,8 @@ namespace VRM }, exportedVrmVersion ); - migrationFlags.IsEmissiveFactorGamma = UniVrmPackageVersion.IsNewer( - new UniVrmPackageVersion.Version + migrationFlags.IsEmissiveFactorGamma = PackageVersion.IsNewer( + new PackageVersion.Version { Major = 0, Minor = 107, diff --git a/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs b/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs index 6d776d2f4..519b9d35c 100644 --- a/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs @@ -253,7 +253,7 @@ namespace VRM.SimpleViewer private void Start() { m_version.text = string.Format("VRMViewer {0}.{1}", - UniVrmPackageVersion.MAJOR, UniVrmPackageVersion.MINOR); + PackageVersion.MAJOR, PackageVersion.MINOR); m_open.onClick.AddListener(OnOpenClicked); m_useFastSpringBone.onValueChanged.AddListener(OnUseFastSpringBoneValueChanged); OnUseFastSpringBoneValueChanged(m_useFastSpringBone.isOn); diff --git a/Assets/VRM/Tests/VersionTests.cs b/Assets/VRM/Tests/VersionTests.cs index 9792e1e80..a55a5331b 100644 --- a/Assets/VRM/Tests/VersionTests.cs +++ b/Assets/VRM/Tests/VersionTests.cs @@ -5,13 +5,13 @@ namespace VRM public class UniVRMVersionTests { [Test] - [TestCase(UniGLTF.UniVrmPackageVersion.VERSION, false)] + [TestCase(UniGLTF.PackageVersion.VERSION, false)] [TestCase("0.199", true)] [TestCase("0.199.0", true)] [TestCase("1.0.0", true)] public void IsNewerTest(string newer, bool isNewer) { - Assert.AreEqual(isNewer, UniGLTF.UniVrmPackageVersion.IsNewer(newer)); + Assert.AreEqual(isNewer, UniGLTF.PackageVersion.IsNewer(newer)); } [Test] @@ -26,7 +26,7 @@ namespace VRM [TestCase("1.0.0", "0.51.0", true)] public void IsNewerTest(string newer, string older, bool isNewer) { - Assert.AreEqual(isNewer, UniGLTF.UniVrmPackageVersion.IsNewer(newer, older)); + Assert.AreEqual(isNewer, UniGLTF.PackageVersion.IsNewer(newer, older)); } [Test] @@ -38,8 +38,8 @@ namespace VRM [TestCase("aaaaa", false, 0, 0, 0, "")] public void ParseVersionTest(string version, bool canBeParsed, int major, int minor, int patch, string pre) { - UniGLTF.UniVrmPackageVersion.Version v; - var res = UniGLTF.UniVrmPackageVersion.ParseVersion(version, out v); + UniGLTF.PackageVersion.Version v; + var res = UniGLTF.PackageVersion.ParseVersion(version, out v); Assert.AreEqual(canBeParsed, res); if (res) { diff --git a/Assets/VRM10/vrmlib/Runtime/Model.cs b/Assets/VRM10/vrmlib/Runtime/Model.cs index 703326903..5cb1195f8 100644 --- a/Assets/VRM10/vrmlib/Runtime/Model.cs +++ b/Assets/VRM10/vrmlib/Runtime/Model.cs @@ -25,7 +25,7 @@ namespace VrmLib public Coordinates Coordinates; public string AssetVersion = "2.0"; - public string AssetGenerator = $"UniVRM-{UniVrmPackageVersion.VERSION}"; + public string AssetGenerator = $"UniVRM-{PackageVersion.VERSION}"; public string AssetCopyright; public string AssetMinVersion; diff --git a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs index 6d776d2f4..519b9d35c 100644 --- a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs @@ -253,7 +253,7 @@ namespace VRM.SimpleViewer private void Start() { m_version.text = string.Format("VRMViewer {0}.{1}", - UniVrmPackageVersion.MAJOR, UniVrmPackageVersion.MINOR); + PackageVersion.MAJOR, PackageVersion.MINOR); m_open.onClick.AddListener(OnOpenClicked); m_useFastSpringBone.onValueChanged.AddListener(OnUseFastSpringBoneValueChanged); OnUseFastSpringBoneValueChanged(m_useFastSpringBone.isOn);