diff --git a/Assets/UniGLTF/Editor/UniGLTF/ImporterMenu.cs b/Assets/UniGLTF/Editor/UniGLTF/ImporterMenu.cs index 63f450459..2e6dc1eb2 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ImporterMenu.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ImporterMenu.cs @@ -7,10 +7,10 @@ namespace UniGLTF { public static class ImporterMenu { - [MenuItem(UniGLTFVersion.MENU + "/Import", priority = 1)] + [MenuItem(UniGLTFVersion.MENU + "/Import(gltf, glb)", priority = 1)] public static void ImportMenu() { - var path = EditorUtility.OpenFilePanel("open gltf", "", "gltf,glb,zip"); + var path = EditorUtility.OpenFilePanel("open gltf", "", "gltf,glb"); if (string.IsNullOrEmpty(path)) { return; diff --git a/Assets/UniGLTF/MeshUtility/Editor/MeshUtility.cs b/Assets/UniGLTF/MeshUtility/Editor/MeshUtility.cs index a3be198c5..535278bb4 100644 --- a/Assets/UniGLTF/MeshUtility/Editor/MeshUtility.cs +++ b/Assets/UniGLTF/MeshUtility/Editor/MeshUtility.cs @@ -8,7 +8,7 @@ namespace MeshUtility { public class MeshUtility { - public const string MENU_PARENT = "Mesh Utility/"; + public const string MENU_PARENT = "UniGLTF/Mesh Utility/"; public const int MENU_PRIORITY = 11; private const string ASSET_SUFFIX = ".mesh.asset"; @@ -55,7 +55,7 @@ namespace MeshUtility } } - [MenuItem("Mesh Utility/MeshUtility Docs", priority = MeshUtility.MENU_PRIORITY)] + [MenuItem(MENU_PARENT + "MeshSeparator Docs", priority = MeshUtility.MENU_PRIORITY)] public static void LinkToMeshSeparatorDocs() { Application.OpenURL("https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/MeshUtility/README.md"); @@ -282,5 +282,70 @@ namespace MeshUtility Debug.LogFormat("CreateAsset: {0}", assetPath); AssetDatabase.CreateAsset(newMesh, assetPath); } + +#if UNITY_EDITOR + [MenuItem(MENU_PARENT + "Integrate Static Mesh", validate = true)] + public static bool CanIntegrateSelected() + { + return Selection.activeObject != null && Selection.activeObject is GameObject; + } + + [MenuItem(MENU_PARENT + "Integrate Static Mesh", priority = 3)] + public static void IntegrateSelected() + { + var go = Selection.activeObject as GameObject; + var meshWithMaterials = StaticMeshIntegrator.Integrate(go.transform); + + // save as asset + var assetPath = ""; +#if UNITY_2018_2_OR_NEWER + var prefab = PrefabUtility.GetCorrespondingObjectFromSource(go); +#else + var prefab = PrefabUtility.GetPrefabParent(go); +#endif + if (prefab != null) + { + var prefabPath = AssetDatabase.GetAssetPath(prefab); + assetPath = string.Format("{0}/{1}_{2}{3}", + Path.GetDirectoryName(prefabPath), + Path.GetFileNameWithoutExtension(prefabPath), + go.name, + ASSET_SUFFIX + ); + } + else + { + var path = EditorUtility.SaveFilePanel( + "Save mesh", + "Assets", + go.name + ".asset", + "asset"); + if (string.IsNullOrEmpty(path)) + { + return; + } + assetPath = UnityPath.FromFullpath(path).Value; + } + + assetPath = AssetDatabase.GenerateUniqueAssetPath(assetPath); + Debug.LogFormat("CreateAsset: {0}", assetPath); + AssetDatabase.CreateAsset(meshWithMaterials.Mesh, assetPath); + + // add component + var meshObject = new GameObject(go.name + ".integrated"); + if (go.transform.parent != null) + { + meshObject.transform.SetParent(go.transform.parent, false); + } + meshObject.transform.localPosition = go.transform.localPosition; + meshObject.transform.localRotation = go.transform.localRotation; + meshObject.transform.localScale = go.transform.localScale; + + var filter = meshObject.AddComponent(); + filter.sharedMesh = meshWithMaterials.Mesh; + var renderer = meshObject.AddComponent(); + renderer.sharedMaterials = meshWithMaterials.Materials; + } +#endif } } \ No newline at end of file diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/StaticMeshIntegrator.cs b/Assets/UniGLTF/MeshUtility/Runtime/StaticMeshIntegrator.cs similarity index 62% rename from Assets/UniGLTF/Runtime/UniGLTF/IO/StaticMeshIntegrator.cs rename to Assets/UniGLTF/MeshUtility/Runtime/StaticMeshIntegrator.cs index 3bcff4a6d..9edbcc936 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/StaticMeshIntegrator.cs +++ b/Assets/UniGLTF/MeshUtility/Runtime/StaticMeshIntegrator.cs @@ -7,7 +7,7 @@ using UnityEditor; #endif -namespace UniGLTF +namespace MeshUtility { public static class StaticMeshIntegrator { @@ -118,69 +118,5 @@ namespace UniGLTF }; } -#if UNITY_EDITOR - [MenuItem("Mesh Utility/Integrate Static Mesh", validate = true)] - public static bool CanIntegrateSelected() - { - return Selection.activeObject != null && Selection.activeObject is GameObject; - } - - [MenuItem("Mesh Utility/Integrate Static Mesh", priority = 3)] - public static void IntegrateSelected() - { - var go = Selection.activeObject as GameObject; - var meshWithMaterials = Integrate(go.transform); - - // save as asset - var assetPath = ""; -#if UNITY_2018_2_OR_NEWER - var prefab = PrefabUtility.GetCorrespondingObjectFromSource(go); -#else - var prefab = PrefabUtility.GetPrefabParent(go); -#endif - if (prefab != null) - { - var prefabPath = AssetDatabase.GetAssetPath(prefab); - assetPath = string.Format("{0}/{1}_{2}{3}", - Path.GetDirectoryName(prefabPath), - Path.GetFileNameWithoutExtension(prefabPath), - go.name, - ASSET_SUFFIX - ); - } - else - { - var path = EditorUtility.SaveFilePanel( - "Save mesh", - "Assets", - go.name+".asset", - "asset"); - if (string.IsNullOrEmpty(path)) - { - return; - } - assetPath = UnityPath.FromFullpath(path).Value; - } - - assetPath = AssetDatabase.GenerateUniqueAssetPath(assetPath); - Debug.LogFormat("CreateAsset: {0}", assetPath); - AssetDatabase.CreateAsset(meshWithMaterials.Mesh, assetPath); - - // add component - var meshObject = new GameObject(go.name + ".integrated"); - if (go.transform.parent != null) - { - meshObject.transform.SetParent(go.transform.parent, false); - } - meshObject.transform.localPosition = go.transform.localPosition; - meshObject.transform.localRotation = go.transform.localRotation; - meshObject.transform.localScale = go.transform.localScale; - - var filter = meshObject.AddComponent(); - filter.sharedMesh = meshWithMaterials.Mesh; - var renderer = meshObject.AddComponent(); - renderer.sharedMaterials = meshWithMaterials.Materials; - } -#endif } } diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/StaticMeshIntegrator.cs.meta b/Assets/UniGLTF/MeshUtility/Runtime/StaticMeshIntegrator.cs.meta similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/IO/StaticMeshIntegrator.cs.meta rename to Assets/UniGLTF/MeshUtility/Runtime/StaticMeshIntegrator.cs.meta diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion_partial.cs b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion_partial.cs index aff790da9..d7af7a843 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion_partial.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion_partial.cs @@ -3,6 +3,6 @@ public static partial class UniGLTFVersion { public const string UNIGLTF_VERSION = "UniGLTF-" + VERSION; - public const string MENU = "VRM/" + UNIGLTF_VERSION; + public const string MENU = "UniGLTF"; } -} \ No newline at end of file +} diff --git a/Assets/UniGLTF/Runtime/UniJSON/ConcreteCast.cs b/Assets/UniGLTF/Runtime/UniJSON/ConcreteCast.cs index 603346973..10cf4d09e 100644 --- a/Assets/UniGLTF/Runtime/UniJSON/ConcreteCast.cs +++ b/Assets/UniGLTF/Runtime/UniJSON/ConcreteCast.cs @@ -43,7 +43,7 @@ namespace UniJSON typeof(double), }; - [MenuItem("VRM/UniJSON/Generate ConcreteCast")] + [MenuItem("UniGLTF/UniJSON/Generate ConcreteCast")] public static void GenerateGenericCast() { var s = new StringBuilder(); diff --git a/Assets/UniGLTF/Runtime/UniJSON/GenericCallUtility/GenericExpressionCallFactory.cs b/Assets/UniGLTF/Runtime/UniJSON/GenericCallUtility/GenericExpressionCallFactory.cs index d644936e1..57ff1e342 100644 --- a/Assets/UniGLTF/Runtime/UniJSON/GenericCallUtility/GenericExpressionCallFactory.cs +++ b/Assets/UniGLTF/Runtime/UniJSON/GenericCallUtility/GenericExpressionCallFactory.cs @@ -15,7 +15,7 @@ namespace UniJSON #if UNITY_EDITOR && VRM_DEVELOP const int NET35MAX = 4; const int ARGS = 6; - const string GENERATE_PATH = "/VRM/UniJSON/Scripts/GenericCallUtility/GenericExpressionCallFactory.g.cs"; + const string GENERATE_PATH = "UniGLTF/UniJSON/Scripts/GenericCallUtility/GenericExpressionCallFactory.g.cs"; static System.Collections.Generic.IEnumerable GetArgs(string prefix, int n) { @@ -25,7 +25,7 @@ namespace UniJSON } } - [MenuItem("VRM/UniJSON/Generate GenericExpressionCallFactory")] + [MenuItem("UniGLTF/UniJSON/Generate GenericExpressionCallFactory")] static void Generate() { var sb = new StringBuilder(); diff --git a/Assets/UniGLTF/Runtime/UniJSON/GenericCallUtility/GenericInvokeCallFactory.cs b/Assets/UniGLTF/Runtime/UniJSON/GenericCallUtility/GenericInvokeCallFactory.cs index 9ceeca036..4d8296554 100644 --- a/Assets/UniGLTF/Runtime/UniJSON/GenericCallUtility/GenericInvokeCallFactory.cs +++ b/Assets/UniGLTF/Runtime/UniJSON/GenericCallUtility/GenericInvokeCallFactory.cs @@ -24,7 +24,7 @@ namespace UniJSON #if UNITY_EDITOR && VRM_DEVELOP const int NET35MAX = 4; const int ARGS = 6; - const string GENERATE_PATH = "/VRM/UniJSON/Scripts/GenericCallUtility/GenericInvokeCallFactory.g.cs"; + const string GENERATE_PATH = "/UniGLTF/UniJSON/Scripts/GenericCallUtility/GenericInvokeCallFactory.g.cs"; static System.Collections.Generic.IEnumerable GetArgs(string prefix, int n) { @@ -34,7 +34,7 @@ namespace UniJSON } } - [MenuItem("VRM/UniJSON/Generate GenericInvokeCallFactory")] + [MenuItem("UniGLTF/UniJSON/Generate GenericInvokeCallFactory")] static void Generate() { var sb = new StringBuilder(); diff --git a/Assets/UniGLTF/package.json b/Assets/UniGLTF/package.json index b9a12e111..1e0f5ec91 100644 --- a/Assets/UniGLTF/package.json +++ b/Assets/UniGLTF/package.json @@ -11,6 +11,6 @@ "name": "VRM Consortium" }, "dependencies": { - "com.vrmc.vrmshaders": "0.63.2" + "com.vrmc.vrmshaders": "0.64.0" } } \ No newline at end of file diff --git a/Assets/VRM/Editor/Format/VRMExporterWizard.cs b/Assets/VRM/Editor/Format/VRMExporterWizard.cs index d422fe12f..03cebe28c 100644 --- a/Assets/VRM/Editor/Format/VRMExporterWizard.cs +++ b/Assets/VRM/Editor/Format/VRMExporterWizard.cs @@ -10,7 +10,7 @@ namespace VRM { public class VRMExporterWizard : EditorWindow { - const string CONVERT_HUMANOID_KEY = VRMVersion.MENU + "/Export humanoid"; + const string CONVERT_HUMANOID_KEY = VRMVersion.MENU + "/Export " + VRMVersion.VRM_VERSION; [MenuItem(CONVERT_HUMANOID_KEY, false, 1)] private static void ExportFromMenu() diff --git a/Assets/VRM/Editor/SkinnedMeshUtility/MeshIntegratorEditor.cs b/Assets/VRM/Editor/SkinnedMeshUtility/MeshIntegratorEditor.cs index 9eb266a12..6795a3a55 100644 --- a/Assets/VRM/Editor/SkinnedMeshUtility/MeshIntegratorEditor.cs +++ b/Assets/VRM/Editor/SkinnedMeshUtility/MeshIntegratorEditor.cs @@ -16,7 +16,7 @@ namespace VRM [DisallowMultipleComponent] public static class MeshIntegratorEditor { - const string MENU_KEY = "Mesh Utility/MeshIntegrator"; + const string MENU_KEY = VRMVersion.MENU + "/MeshIntegrator"; const string ASSET_SUFFIX = ".mesh.asset"; [MenuItem(MENU_KEY, true)] diff --git a/Assets/VRM/Runtime/Format/VRMVersion.cs b/Assets/VRM/Runtime/Format/VRMVersion.cs index ca8e7e76e..5daf5d653 100644 --- a/Assets/VRM/Runtime/Format/VRMVersion.cs +++ b/Assets/VRM/Runtime/Format/VRMVersion.cs @@ -4,8 +4,8 @@ namespace VRM public static partial class VRMVersion { public const int MAJOR = 0; - public const int MINOR = 63; - public const int PATCH = 2; - public const string VERSION = "0.63.2"; + public const int MINOR = 64; + public const int PATCH = 0; + public const string VERSION = "0.64.0"; } } diff --git a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs b/Assets/VRM/Runtime/Format/VRMVersionPartial.cs index ebaaa3df1..2fe04e6da 100644 --- a/Assets/VRM/Runtime/Format/VRMVersionPartial.cs +++ b/Assets/VRM/Runtime/Format/VRMVersionPartial.cs @@ -100,6 +100,6 @@ namespace VRM } public const string VRM_VERSION = "UniVRM-" + VERSION; - public const string MENU = "VRM/" + VRM_VERSION; + public const string MENU = "VRM0"; } } diff --git a/Assets/VRM/package.json b/Assets/VRM/package.json index 15f3931aa..ee4192e6b 100644 --- a/Assets/VRM/package.json +++ b/Assets/VRM/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.univrm", - "version": "0.63.2", + "version": "0.64.0", "displayName": "VRM", "description": "VRM importer", "unity": "2018.4", @@ -14,7 +14,7 @@ "name": "VRM Consortium" }, "dependencies": { - "com.vrmc.vrmshaders": "0.63.2", + "com.vrmc.vrmshaders": "0.64.0", "com.vrmc.unigltf": "2.0.0" } } diff --git a/Assets/VRM10/Editor/Components/SpringBone/VRMSpringBoneWindow.cs b/Assets/VRM10/Editor/Components/SpringBone/VRMSpringBoneWindow.cs index 21f772519..e4e8aeea9 100644 --- a/Assets/VRM10/Editor/Components/SpringBone/VRMSpringBoneWindow.cs +++ b/Assets/VRM10/Editor/Components/SpringBone/VRMSpringBoneWindow.cs @@ -10,7 +10,7 @@ namespace UniVRM10 { public class VRMSpringBoneWindow : EditorWindow { - [MenuItem("VRM/UniVRM-" + UniVRM10.VRMVersion.VERSION + "/VRMSpringBoneWindow")] + [MenuItem(VRMVersion.MENU + "/VRMSpringBoneWindow")] public static void ShowEditorWindow() { var wnd = GetWindow(); diff --git a/Assets/VRM10/Editor/GeneratorMenu.cs b/Assets/VRM10/Editor/GeneratorMenu.cs index d2680c55d..e491852bb 100644 --- a/Assets/VRM10/Editor/GeneratorMenu.cs +++ b/Assets/VRM10/Editor/GeneratorMenu.cs @@ -19,7 +19,7 @@ namespace UniVRM10 /// public static class Menu { - [MenuItem("VRM/UniVRM-" + UniVRM10.VRMVersion.VERSION + "/Generate from JsonSchema")] + [MenuItem(UniVRM10.VRMVersion.MENU + "/Generate from JsonSchema")] public static void Main() { var root = new DirectoryInfo(Path.GetFullPath(Path.Combine(Application.dataPath, "../../"))); diff --git a/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs b/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs index 045add381..fb7514b54 100644 --- a/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs +++ b/Assets/VRM10/Runtime/Version/VRMVersionPartial.cs @@ -102,8 +102,6 @@ namespace UniVRM10 public string Pre; } - public const string VRM_VERSION = "UniVRM-" + VERSION; - public const string MENU = "VRM/" + VRM_VERSION; - + public const string MENU = "VRM1/"; } } diff --git a/Assets/VRMShaders/ShaderProperty/Editor/ShaderPropMenu.cs b/Assets/VRMShaders/ShaderProperty/Editor/ShaderPropMenu.cs index b13dec97e..0d5151696 100644 --- a/Assets/VRMShaders/ShaderProperty/Editor/ShaderPropMenu.cs +++ b/Assets/VRMShaders/ShaderProperty/Editor/ShaderPropMenu.cs @@ -11,7 +11,7 @@ namespace UniGLTF public static class ShaderPropMenu { #if VRM_DEVELOP - [MenuItem("VRM/ShaderProperty/PreExport ShaderProps")] + [MenuItem("VRMShaders/PreExport ShaderProps")] #endif public static void PreExport() { diff --git a/Assets/VRMShaders/package.json b/Assets/VRMShaders/package.json index 1136f7224..efbb0ce4c 100644 --- a/Assets/VRMShaders/package.json +++ b/Assets/VRMShaders/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.vrmshaders", - "version": "0.63.2", + "version": "0.64.0", "displayName": "VRM Shaders", "description": "VRM Shaders", "unity": "2018.4",