diff --git a/Packages/UniGLTF/package.json b/Packages/UniGLTF/package.json index 37af138ec..e9abc0bd2 100644 --- a/Packages/UniGLTF/package.json +++ b/Packages/UniGLTF/package.json @@ -3,6 +3,7 @@ "version": "0.130.1", "displayName": "UniGLTF", "description": "GLTF importer and exporter", + "documentationUrl": "https://github.com/vrm-c/UniVRM", "unity": "2021.3", "keywords": [ "gltf" @@ -14,7 +15,8 @@ "com.unity.modules.animation": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", - "com.unity.test-framework": "1.4.6" + "com.unity.test-framework": "1.4.6", + "com.unity.mathematics": "1.2.6" }, "samples": [ { diff --git a/Packages/VRM/Editor/Format/VRMSampleCopy.cs b/Packages/VRM/Editor/Format/VRMSampleCopy.cs index b08ad4796..c47731e78 100644 --- a/Packages/VRM/Editor/Format/VRMSampleCopy.cs +++ b/Packages/VRM/Editor/Format/VRMSampleCopy.cs @@ -21,9 +21,9 @@ namespace VRM } static CopyInfo[] CopyList = new CopyInfo[]{ - new CopyInfo(Path.Combine(Application.dataPath, "VRM_Samples"), Path.Combine(Application.dataPath, "VRM/Samples~")), - new CopyInfo(Path.Combine(Application.dataPath, "VRM10_Samples"), Path.Combine(Application.dataPath, "VRM10/Samples~")), - new CopyInfo(Path.Combine(Application.dataPath, "UniGLTF_Samples"), Path.Combine(Application.dataPath, "UniGLTF/Samples~")), + new CopyInfo(Path.Combine(Application.dataPath, "VRM_Samples"), Path.Combine(Application.dataPath, "../Packages/VRM/Samples~")), + new CopyInfo(Path.Combine(Application.dataPath, "VRM10_Samples"), Path.Combine(Application.dataPath, "../Packages/VRM10/Samples~")), + new CopyInfo(Path.Combine(Application.dataPath, "UniGLTF_Samples"), Path.Combine(Application.dataPath, "../Packages/UniGLTF/Samples~")), }; /// diff --git a/Packages/VRM/Editor/VRMExportUnityPackage.cs b/Packages/VRM/Editor/VRMExportUnityPackage.cs index 132a7c785..ac5434e5c 100644 --- a/Packages/VRM/Editor/VRMExportUnityPackage.cs +++ b/Packages/VRM/Editor/VRMExportUnityPackage.cs @@ -79,7 +79,7 @@ namespace VRM.DevOnly.PackageExporter folder, prefix, UniGLTF.PackageVersion.VERSION, - GetGitHash(Application.dataPath + "/VRM").Substring(0, 4) + GetGitHash(Application.dataPath + "/../Packages/VRM").Substring(0, 4) ).Replace("\\", "/"); return path; @@ -221,32 +221,16 @@ namespace VRM.DevOnly.PackageExporter new PackageInfo("UniVRM") { List = new []{ - new GlobList("Assets/VRMShaders"), - new GlobList("Assets/UniGLTF"), - new GlobList("Assets/VRM"), - } - }, - // VRM_Samples - new PackageInfo("UniVRM_Samples") - { - List = new []{ - new GlobList("Assets/VRM_Samples"), + new GlobList("Packages/UniGLTF"), + new GlobList("Packages/VRM"), } }, // VRM-1.0 new PackageInfo("VRM") { List = new []{ - new GlobList("Assets/VRMShaders"), - new GlobList("Assets/UniGLTF"), - new GlobList("Assets/VRM10"), - } - }, - // VRM-1.0_Samples - new PackageInfo("VRM_Samples") - { - List = new []{ - new GlobList("Assets/VRM10_Samples"), + new GlobList("Packages/UniGLTF"), + new GlobList("Packages/VRM10"), } }, }; @@ -257,12 +241,43 @@ namespace VRM.DevOnly.PackageExporter } } + static readonly Dictionary PkgMap = new Dictionary + { + {"UniGLTF", "com.vrmc.gltf"}, + {"VRM", "com.vrmc.univrm"}, + {"VRM10", "com.vrmc.vrm"}, + }; + + /// + /// Packages/DIR_NAME/path/to/asset を + /// Packages/PKG_ID/path/to/asset に変換する。 + /// + private static string FilePathToPackage(string src) + { + var items = src.Split("/"); + if (items[0] != "Packages") + { + throw new ArgumentException(src); + } + if (PkgMap.TryGetValue(items[1], out var pkg)) + { + items[1] = pkg; + return string.Join("/", items); + } + else + { + throw new ArgumentException(src); + } + } + private static void CreateUnityPackage( string outputDir, PackageInfo package ) { - var targetFileNames = package.List.SelectMany(x => x.Files).ToArray(); + var targetFileNames = package.List.SelectMany(x => x.Files) + .Select(FilePathToPackage) + .ToArray(); UniGLTFLogger.Log($"Package '{package.Name}' will include {targetFileNames.Count()} files..."); UniGLTFLogger.Log($"{string.Join("", targetFileNames.Select((x, i) => string.Format("[{0:##0}] {1}\n", i, x)).ToArray())}"); diff --git a/Packages/VRM/package.json b/Packages/VRM/package.json index b526aeb3e..5a99f96d2 100644 --- a/Packages/VRM/package.json +++ b/Packages/VRM/package.json @@ -3,6 +3,7 @@ "version": "0.130.1", "displayName": "VRM", "description": "VRM importer", + "documentationUrl": "https://github.com/vrm-c/UniVRM", "unity": "2021.3", "keywords": [ "vrm", @@ -39,4 +40,4 @@ "path": "Samples~/AnimationBridgeSample" } ] -} +} \ No newline at end of file diff --git a/Packages/VRM10/package.json b/Packages/VRM10/package.json index 14804a7c8..fc499631d 100644 --- a/Packages/VRM10/package.json +++ b/Packages/VRM10/package.json @@ -3,6 +3,7 @@ "version": "0.130.1", "displayName": "VRM-1.0", "description": "VRM-1.0 importer", + "documentationUrl": "https://github.com/vrm-c/UniVRM", "unity": "2021.3", "keywords": [ "vrm", @@ -34,4 +35,4 @@ "path": "Samples~/ClothSample" } ] -} +} \ No newline at end of file diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index f483141b7..9ea5e1be8 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -154,7 +154,8 @@ "com.unity.modules.animation": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", - "com.unity.test-framework": "1.4.6" + "com.unity.test-framework": "1.4.6", + "com.unity.mathematics": "1.2.6" } }, "com.vrmc.univrm": {