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/VRM/Runtime/Format/VRMVersion.cs b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs similarity index 73% rename from Assets/VRM/Runtime/Format/VRMVersion.cs rename to Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs index a0da2efa8..a4cedba3c 100644 --- a/Assets/VRM/Runtime/Format/VRMVersion.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs @@ -1,7 +1,7 @@ -namespace VRM +namespace UniGLTF { - public static partial class VRMVersion + public static partial class PackageVersion { public const int MAJOR = 0; public const int MINOR = 115; diff --git a/Assets/VRM10/Runtime/Version/VRMVersion.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs.meta similarity index 83% rename from Assets/VRM10/Runtime/Version/VRMVersion.cs.meta rename to Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs.meta index b107aec7b..d61dbbf3b 100644 --- a/Assets/VRM10/Runtime/Version/VRMVersion.cs.meta +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b7339aecd19a8ec4fbe33ca20d8ef675 +guid: ab81045d7751d4040b553ecbac5ab9e4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs similarity index 97% rename from Assets/VRM/Runtime/Format/VRMVersionPartial.cs rename to Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs index 4a739ac0b..513826f1e 100644 --- a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs @@ -1,9 +1,9 @@ using System; using System.Text.RegularExpressions; -namespace VRM +namespace UniGLTF { - public static partial class VRMVersion + public static partial class PackageVersion { /// /// Returns true if a passed version is newer than current UniVRM. diff --git a/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs.meta similarity index 83% rename from Assets/VRM10/Runtime/Version/VRMVersionPartial.cs.meta rename to Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs.meta index 4e7afa499..ce011769d 100644 --- a/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs.meta +++ b/Assets/UniGLTF/Runtime/UniGLTF/PackageVersionPartial.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: daece183c090e0b4aa9097151202c316 +guid: a025b7dc17054bb41ae56d364d78d120 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/VRM/Editor/Format/VRMVersionMenu.cs b/Assets/VRM/Editor/Format/VRMVersionMenu.cs index a8196d7bc..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/VRM/Runtime/Format/VRMVersion.cs"; + const string VrmVersionPath = "Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs"; const string VrmVersionTemplate = @" -namespace VRM +namespace UniGLTF {{ - public static partial class VRMVersion + public static partial class PackageVersion {{ 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: {PackageVersion.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 = 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 92c82a082..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 (VRMVersion.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 532809479..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, - VRMVersion.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 cabea8ec6..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 = VRMVersion.MENU; - private const string DevelopmentMenuPrefix = VRMVersion.MENU + "/Development"; + private const string UserMenuPrefix = PackageVersion.MENU; + private const string DevelopmentMenuPrefix = PackageVersion.MENU + "/Development"; - [MenuItem(UserMenuPrefix + "/Version: " + VRMVersion.VRM_VERSION, validate = true)] + [MenuItem(UserMenuPrefix + "/Version: " + PackageVersion.VRM_VERSION, validate = true)] private static bool ShowVersionValidation() => false; - [MenuItem(UserMenuPrefix + "/Version: " + VRMVersion.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/VRMVersionPartial.cs.meta b/Assets/VRM/Runtime/Format/VRMVersionPartial.cs.meta deleted file mode 100644 index b505fdb09..000000000 --- a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 4ab9ac9856a4d4c4aa652c07c5b496e6 -timeCreated: 1522130257 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs b/Assets/VRM/Runtime/Format/glTF_VRM_extensions.cs index 19b41c3d4..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. " + VRMVersion.VRM_VERSION)] - public string exporterVersion = "UniVRM-" + VRMVersion.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 6e64cc997..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 (!VRMVersion.ParseVersion(exportedVrmVersionString, out var exportedVrmVersion)) return; + if (!PackageVersion.ParseVersion(exportedVrmVersionString, out var exportedVrmVersion)) return; - migrationFlags.IsBaseColorFactorGamma = VRMVersion.IsNewer( - new VRMVersion.Version + migrationFlags.IsBaseColorFactorGamma = PackageVersion.IsNewer( + new PackageVersion.Version { Major = 0, Minor = 54, @@ -35,8 +35,8 @@ namespace VRM exportedVrmVersion ); - migrationFlags.IsRoughnessTextureValueSquared = VRMVersion.IsNewer( - new VRMVersion.Version + migrationFlags.IsRoughnessTextureValueSquared = PackageVersion.IsNewer( + new PackageVersion.Version { Major = 0, Minor = 69, @@ -45,8 +45,8 @@ namespace VRM }, exportedVrmVersion ); - migrationFlags.IsEmissiveFactorGamma = VRMVersion.IsNewer( - new VRMVersion.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 27294ec96..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}", - VRMVersion.MAJOR, VRMVersion.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 db40493cc..a55a5331b 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.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, VRMVersion.IsNewer(newer)); + Assert.AreEqual(isNewer, UniGLTF.PackageVersion.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.PackageVersion.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.PackageVersion.Version v; + var res = UniGLTF.PackageVersion.ParseVersion(version, out v); Assert.AreEqual(canBeParsed, res); if (res) { 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/VRM/Runtime/Format/VRMVersion.cs.meta b/Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs.meta similarity index 71% rename from Assets/VRM/Runtime/Format/VRMVersion.cs.meta rename to Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs.meta index b953c85a9..83deb9556 100644 --- a/Assets/VRM/Runtime/Format/VRMVersion.cs.meta +++ b/Assets/VRM10/Runtime/Version/VRMSpecVersionPartial.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: 93c46c8b64555f14bada9f5bb0b7761a -timeCreated: 1522130257 -licenseType: Free +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/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/VRM10/vrmlib/Runtime/Model.cs b/Assets/VRM10/vrmlib/Runtime/Model.cs index 2df1be094..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; + public string AssetGenerator = $"UniVRM-{PackageVersion.VERSION}"; public string AssetCopyright; public string AssetMinVersion; 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..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}", - VRMVersion.MAJOR, VRMVersion.MINOR); + PackageVersion.MAJOR, PackageVersion.MINOR); m_open.onClick.AddListener(OnOpenClicked); m_useFastSpringBone.onValueChanged.AddListener(OnUseFastSpringBoneValueChanged); OnUseFastSpringBoneValueChanged(m_useFastSpringBone.isOn);