From a13d552c06fc6af9593bae860d7c9cdde6e786d1 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 10 Nov 2025 15:21:57 +0900 Subject: [PATCH] `Assets/UniGLTF` to `Packages/com.vrmc.gltf` --- .../SimpleViewer/FileDialog/FileUtil.cs | 2 +- .../Editor/UniGLTF/Gizmo/BoneInfoDrawer.cs | 6 +++--- .../UniGLTF/Tests/UniGLTF/GltfLoadTests.cs | 2 +- Packages/UniGLTF/Tests/UniGLTF/TestAssets.cs | 2 +- Packages/VRM/Editor/Format/VRMVersionMenu.cs | 10 ++++----- Packages/VRM/README.md | 21 ------------------- Packages/VRM/README.md.meta | 7 ------- Packages/VRM10/Editor/PackageResource.cs | 17 +++------------ .../VrmScriptedImporterImpl.cs | 5 ----- .../ScriptedImporter/VrmaScriptedImporter.cs | 5 ----- .../VRM10/Editor/Vrm10SerializerGenerator.cs | 2 +- 11 files changed, 15 insertions(+), 64 deletions(-) delete mode 100644 Packages/VRM/README.md delete mode 100644 Packages/VRM/README.md.meta diff --git a/Assets/VRM_Samples/SimpleViewer/FileDialog/FileUtil.cs b/Assets/VRM_Samples/SimpleViewer/FileDialog/FileUtil.cs index 4d98bd9c5..f5f104f3d 100644 --- a/Assets/VRM_Samples/SimpleViewer/FileDialog/FileUtil.cs +++ b/Assets/VRM_Samples/SimpleViewer/FileDialog/FileUtil.cs @@ -13,7 +13,7 @@ namespace VRM.SimpleViewer return FileDialogForWindows.FileDialog(title, extensions); #elif UNITY_WEBGL // Open WebGL_VRM0X_SimpleViewer_FileDialog - // see: Assets/UniGLTF/Runtime/Utils/Plugins/OpenFile.jslib + // see: Packages/com.vrmc.gltf/Runtime/Utils/Plugins/OpenFile.jslib WebGLUtil.WebGL_VRM0X_SimpleViewer_FileDialog("Canvas", "FileSelected"); // Control flow does not return here. return empty string with dummy return ""; diff --git a/Packages/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfoDrawer.cs b/Packages/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfoDrawer.cs index f16cd85b6..e48c6d853 100644 --- a/Packages/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfoDrawer.cs +++ b/Packages/UniGLTF/Editor/UniGLTF/Gizmo/BoneInfoDrawer.cs @@ -8,7 +8,7 @@ namespace UniGLTF public static class BoneInfoDrawer { #region Bone - const string BONE_GIZMO = "Assets/UniGLTF/Editor/UniGLTF/Gizmo/Models/BoneGizmo.prefab"; + const string BONE_GIZMO = "Packages/com.vrmc.gltf/Editor/UniGLTF/Gizmo/Models/BoneGizmo.prefab"; static GameObject _bone; static GameObject BonePrefab { @@ -57,7 +57,7 @@ namespace UniGLTF #endregion #region Selected - const string SELECTED_BONE_GIZMO = "Assets/UniGLTF/Editor/UniGLTF/Gizmo/Models/SelectedBoneGizmo.prefab"; + const string SELECTED_BONE_GIZMO = "Packages/com.vrmc.gltf/Editor/UniGLTF/Gizmo/Models/SelectedBoneGizmo.prefab"; static GameObject _selected; static GameObject SelectedPrefab { @@ -110,7 +110,7 @@ namespace UniGLTF #endregion #region Hover - const string HOVER_BONE_GIZMO = "Assets/UniGLTF/Editor/UniGLTF/Gizmo/Models/HoverBoneGizmo.prefab"; + const string HOVER_BONE_GIZMO = "Packages/com.vrmc.gltf/Editor/UniGLTF/Gizmo/Models/HoverBoneGizmo.prefab"; static GameObject _hover; static GameObject HoverPrefab { diff --git a/Packages/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs b/Packages/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs index e9d7aa201..c9adcc0c5 100644 --- a/Packages/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs +++ b/Packages/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs @@ -320,7 +320,7 @@ namespace UniGLTF [Test] public void Preprocess_DupMorphTargetName() { - var asset = UnityEditor.AssetDatabase.LoadAssetAtPath("Assets/UniGLTF/Tests/UniGLTF/gltfTutorial_017_SimpleMorphTarget.txt"); + var asset = UnityEditor.AssetDatabase.LoadAssetAtPath("Packages/com.vrmc.gltf/Tests/UniGLTF/gltfTutorial_017_SimpleMorphTarget.txt"); Assert.True(asset); var gltf = GlbLowLevelParser.ParseGltf("tmp", asset.text, null, null, default); Assert.AreEqual(1, gltf.GLTF.nodes.Count); diff --git a/Packages/UniGLTF/Tests/UniGLTF/TestAssets.cs b/Packages/UniGLTF/Tests/UniGLTF/TestAssets.cs index 96319bbf4..aacce45c2 100644 --- a/Packages/UniGLTF/Tests/UniGLTF/TestAssets.cs +++ b/Packages/UniGLTF/Tests/UniGLTF/TestAssets.cs @@ -2,7 +2,7 @@ { public static class TestAssets { - public static readonly string AssetPath = "Assets/UniGLTF/Tests/Objects"; + public static readonly string AssetPath = "Packages/com.vrmc.gltf/Tests/Objects"; public static T LoadAsset(string filename) where T : UnityEngine.Object { diff --git a/Packages/VRM/Editor/Format/VRMVersionMenu.cs b/Packages/VRM/Editor/Format/VRMVersionMenu.cs index 65514ae25..0eb226035 100644 --- a/Packages/VRM/Editor/Format/VRMVersionMenu.cs +++ b/Packages/VRM/Editor/Format/VRMVersionMenu.cs @@ -22,7 +22,7 @@ namespace VRM /// /// UNIGLTF /// - static string UniGltfVersionPath = "Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs"; + static string UniGltfVersionPath = "Packages/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs"; const string UniGltfVersionTemplate = @" namespace UniGLTF @@ -40,7 +40,7 @@ namespace UniGLTF /// /// VRM /// - const string VrmVersionPath = "Assets/UniGLTF/Runtime/UniGLTF/PackageVersion.cs"; + const string VrmVersionPath = "Packages/UniGLTF/Runtime/UniGLTF/PackageVersion.cs"; const string VrmVersionTemplate = @" namespace UniGLTF {{ @@ -68,7 +68,7 @@ namespace UniGLTF UpmPackage[] Packages = new UpmPackage[] { - new UpmPackage("Assets/VRM/package.json", + new UpmPackage("Packages/VRM/package.json", @"{{ ""name"": ""com.vrmc.univrm"", ""version"": ""{1}"", @@ -113,7 +113,7 @@ namespace UniGLTF }} "), - new UpmPackage("Assets/VRM10/package.json", + new UpmPackage("Packages/VRM10/package.json", @"{{ ""name"": ""com.vrmc.vrm"", ""version"": ""{1}"", @@ -155,7 +155,7 @@ namespace UniGLTF }; - UpmPackage UniGLTFPackage = new UpmPackage("Assets/UniGLTF/package.json", + UpmPackage UniGLTFPackage = new UpmPackage("Packages/UniGLTF/package.json", @"{{ ""name"": ""com.vrmc.gltf"", ""version"": ""{0}"", diff --git a/Packages/VRM/README.md b/Packages/VRM/README.md deleted file mode 100644 index 54359ffbc..000000000 --- a/Packages/VRM/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# VRM - -The core library for UniVRM-0.XX. - -## Import VRM (Unity 2019.3.4f1~) - -`Window` -> `Package Manager` -> `Add package from git URL` and add the followings in order: - -* `https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders` -* `https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM` => depends on VRMShaders - -or add the package name and git URL in `Packages/manifest.json`: - -```json -{ - "dependencies": { - "com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders", - "com.vrmc.univrm": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM", - } -} -``` diff --git a/Packages/VRM/README.md.meta b/Packages/VRM/README.md.meta deleted file mode 100644 index ca2d11bd1..000000000 --- a/Packages/VRM/README.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 27376b07a49e57442a9c2d6a2a0805b9 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/VRM10/Editor/PackageResource.cs b/Packages/VRM10/Editor/PackageResource.cs index 593319022..ae50d521c 100644 --- a/Packages/VRM10/Editor/PackageResource.cs +++ b/Packages/VRM10/Editor/PackageResource.cs @@ -8,11 +8,6 @@ namespace UniVRM10 /// public static class PackageResource { - /// - /// Local時のAssetPath - /// - public const string LocalBase = "Assets/VRM10"; - /// /// UPM参照時のAssetPath /// @@ -26,14 +21,8 @@ namespace UniVRM10 /// public static T ResourceLocalOrUPM(string relpath) where T : UnityEngine.Object { - var path = $"{LocalBase}/{relpath}"; - var asset = AssetDatabase.LoadAssetAtPath(path); - if (asset is null) - { - path = $"{PackageResource.PackageBase}/{relpath}"; - asset = AssetDatabase.LoadAssetAtPath(path); - } - return asset; + var path = $"{PackageResource.PackageBase}/{relpath}"; + return AssetDatabase.LoadAssetAtPath(path); } } -} +} \ No newline at end of file diff --git a/Packages/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs b/Packages/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs index 4b58034e5..234bf0275 100644 --- a/Packages/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs +++ b/Packages/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs @@ -28,11 +28,6 @@ namespace UniVRM10 // try package _AssetIcon = UnityEditor.AssetDatabase.LoadAssetAtPath("Packages/com.vrmc.vrm/Icons/vrm-48x48.png"); } - if (_AssetIcon == null) - { - // try assets - _AssetIcon = UnityEditor.AssetDatabase.LoadAssetAtPath("Assets/VRM10/Icons/vrm-48x48.png"); - } return _AssetIcon; } } diff --git a/Packages/VRM10/Editor/ScriptedImporter/VrmaScriptedImporter.cs b/Packages/VRM10/Editor/ScriptedImporter/VrmaScriptedImporter.cs index df4680277..ecd958260 100644 --- a/Packages/VRM10/Editor/ScriptedImporter/VrmaScriptedImporter.cs +++ b/Packages/VRM10/Editor/ScriptedImporter/VrmaScriptedImporter.cs @@ -22,11 +22,6 @@ namespace UniVRM10 // try package _AssetIcon = UnityEditor.AssetDatabase.LoadAssetAtPath("Packages/com.vrmc.vrm/Icons/vrm-48x48.png"); } - if (_AssetIcon == null) - { - // try assets - _AssetIcon = UnityEditor.AssetDatabase.LoadAssetAtPath("Assets/VRM10/Icons/vrm-48x48.png"); - } return _AssetIcon; } } diff --git a/Packages/VRM10/Editor/Vrm10SerializerGenerator.cs b/Packages/VRM10/Editor/Vrm10SerializerGenerator.cs index 5cb7d8a34..ec5b753d9 100644 --- a/Packages/VRM10/Editor/Vrm10SerializerGenerator.cs +++ b/Packages/VRM10/Editor/Vrm10SerializerGenerator.cs @@ -35,7 +35,7 @@ namespace UniVRM10 } private const string Vrm10SpecDir = "vrm-specification/specification"; - private const string Vrm10FormatGeneratedDir = "Assets/VRM10/Runtime/Format"; + private const string Vrm10FormatGeneratedDir = "Packages/VRM10/Runtime/Format"; public static void Run(bool debug) {