From 9cd3288e4d7c7f6fe3b546773ca62850a8980520 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Mon, 24 May 2021 20:12:19 +0900 Subject: [PATCH] mv SubAssetKey --- .../ScriptedImporterExtension.cs | 1 + .../Editor/Format/VRMEditorImporterContext.cs | 5 +++-- .../Runtime/VRM10.Samples.Runtime.asmdef | 18 ++++++++++++++++++ .../Runtime/VRM10.Samples.Runtime.asmdef.meta | 7 +++++++ .../VRM10/Editor/ScriptedImporter/EditorVrm.cs | 1 + .../VrmScriptedImporterImpl.cs | 3 ++- .../Components/Expression/ExpressionKey.cs | 1 + .../Runtime/Components/Meta/VRM10MetaObject.cs | 1 + Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 1 + Assets/VRM10/Tests/MaterialImportTests.cs | 1 + .../GLTF/IO/Runtime}/SubAssetKey.cs | 10 +++++----- .../GLTF/IO/Runtime}/SubAssetKey.cs.meta | 0 12 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 Assets/VRM10.Samples/Runtime/VRM10.Samples.Runtime.asmdef create mode 100644 Assets/VRM10.Samples/Runtime/VRM10.Samples.Runtime.asmdef.meta rename Assets/{UniGLTF/Runtime/UniGLTF/IO => VRMShaders/GLTF/IO/Runtime}/SubAssetKey.cs (97%) rename Assets/{UniGLTF/Runtime/UniGLTF/IO => VRMShaders/GLTF/IO/Runtime}/SubAssetKey.cs.meta (100%) diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/ScriptedImporterExtension.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/ScriptedImporterExtension.cs index be763313d..07d5b4ed8 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/ScriptedImporterExtension.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/ScriptedImporterExtension.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using UnityEditor; +using VRMShaders; #if UNITY_2020_2_OR_NEWER using UnityEditor.AssetImporters; #else diff --git a/Assets/VRM/Editor/Format/VRMEditorImporterContext.cs b/Assets/VRM/Editor/Format/VRMEditorImporterContext.cs index 2ff8f2367..979a8c7dd 100644 --- a/Assets/VRM/Editor/Format/VRMEditorImporterContext.cs +++ b/Assets/VRM/Editor/Format/VRMEditorImporterContext.cs @@ -4,6 +4,7 @@ using System.Linq; using UniGLTF; using UnityEditor; using UnityEngine; +using VRMShaders; namespace VRM { @@ -70,7 +71,7 @@ namespace VRM /// public void ConvertAndExtractImages(Action> onTextureReloaded) { - // + // // convert images(metallic roughness, occlusion map) // var task = m_context.LoadMaterialsAsync(); @@ -112,7 +113,7 @@ namespace VRM if (!string.IsNullOrEmpty(AssetDatabase.GetAssetPath(o))) { // already exists. not dispose -#if VRM_DEVELOP +#if VRM_DEVELOP Debug.Log($"Loaded. skip: {o}"); #endif return true; diff --git a/Assets/VRM10.Samples/Runtime/VRM10.Samples.Runtime.asmdef b/Assets/VRM10.Samples/Runtime/VRM10.Samples.Runtime.asmdef new file mode 100644 index 000000000..19ceecc8e --- /dev/null +++ b/Assets/VRM10.Samples/Runtime/VRM10.Samples.Runtime.asmdef @@ -0,0 +1,18 @@ +{ + "name": "VRM10.Samples.Runtime", + "references": [ + "UniGLTF", + "VRMShaders.GLTF.IO.Runtime", + "VRM10", + "UniHumanoid" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/VRM10.Samples/Runtime/VRM10.Samples.Runtime.asmdef.meta b/Assets/VRM10.Samples/Runtime/VRM10.Samples.Runtime.asmdef.meta new file mode 100644 index 000000000..42227ff25 --- /dev/null +++ b/Assets/VRM10.Samples/Runtime/VRM10.Samples.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 25cb04f3bb4e1844d871da234c1dcc93 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs b/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs index 1a1caf646..4c64342ee 100644 --- a/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs +++ b/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs @@ -3,6 +3,7 @@ using UnityEngine; using System.Linq; using System.IO; using UnityEditor; +using VRMShaders; #if UNITY_2020_2_OR_NEWER using UnityEditor.AssetImporters; #else diff --git a/Assets/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs b/Assets/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs index 833bf8733..79ba6b0d0 100644 --- a/Assets/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs +++ b/Assets/VRM10/Editor/ScriptedImporter/VrmScriptedImporterImpl.cs @@ -4,6 +4,7 @@ using UniGLTF; using System.IO; using System; using UniJSON; +using VRMShaders; #if UNITY_2020_2_OR_NEWER using UnityEditor.AssetImporters; #else @@ -39,7 +40,7 @@ namespace UniVRM10 return "vrm1 not found"; } - // try migrateion + // try migrateion Byte[] migrated = default; try { diff --git a/Assets/VRM10/Runtime/Components/Expression/ExpressionKey.cs b/Assets/VRM10/Runtime/Components/Expression/ExpressionKey.cs index 1376b713b..f9bb60ab6 100644 --- a/Assets/VRM10/Runtime/Components/Expression/ExpressionKey.cs +++ b/Assets/VRM10/Runtime/Components/Expression/ExpressionKey.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using UniGLTF; +using VRMShaders; namespace UniVRM10 { diff --git a/Assets/VRM10/Runtime/Components/Meta/VRM10MetaObject.cs b/Assets/VRM10/Runtime/Components/Meta/VRM10MetaObject.cs index 4a39948ed..e6b0f9037 100644 --- a/Assets/VRM10/Runtime/Components/Meta/VRM10MetaObject.cs +++ b/Assets/VRM10/Runtime/Components/Meta/VRM10MetaObject.cs @@ -4,6 +4,7 @@ using System.Linq; using MeshUtility; using UniGLTF; using UnityEngine; +using VRMShaders; namespace UniVRM10 diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index b90ec6a4f..f984a635b 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using UniGLTF; using UnityEngine; using VrmLib; +using VRMShaders; namespace UniVRM10 diff --git a/Assets/VRM10/Tests/MaterialImportTests.cs b/Assets/VRM10/Tests/MaterialImportTests.cs index 444bc9b3c..4568eeb7a 100644 --- a/Assets/VRM10/Tests/MaterialImportTests.cs +++ b/Assets/VRM10/Tests/MaterialImportTests.cs @@ -3,6 +3,7 @@ using System.Linq; using NUnit.Framework; using UniGLTF; using UnityEngine; +using VRMShaders; namespace UniVRM10 { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/SubAssetKey.cs b/Assets/VRMShaders/GLTF/IO/Runtime/SubAssetKey.cs similarity index 97% rename from Assets/UniGLTF/Runtime/UniGLTF/IO/SubAssetKey.cs rename to Assets/VRMShaders/GLTF/IO/Runtime/SubAssetKey.cs index 3dd25ce0d..6f583a008 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/SubAssetKey.cs +++ b/Assets/VRMShaders/GLTF/IO/Runtime/SubAssetKey.cs @@ -1,21 +1,21 @@ using System; using System.Collections.Generic; -namespace UniGLTF +namespace VRMShaders { /// /// UnityEditor.Experimental.AssetImporter.SourceAssetIdentifier に対応する - /// + /// /// * SourceAssetIdentifier が UnityEditor なので、 Runtime でも使えるように /// * Type が違うが Name が同じだと警告が出る。例えば、Material と 同じ名前の Texture がある場合。 /// Identifier uniqueness violation: 'Alicia_body'. Scripted Importers do not guarantee that subsequent imports of this asset will properly re-link to these targets. /// * なので、SourceAssetIdentifier は、$"{Type.Name}.{UnityObject.name}" のように強制的に Unique にするのが良さそう /// * 一方で、Extract したファイル名に $"{Type.Name}." が付属するのは煩わしいのでこれは無しにしたい。 - /// + /// /// public void AddRemap(SourceAssetIdentifier identifier, UnityEngine.Object externalObject); - /// + /// /// の呼び出し時に、identifier.name と externalObject.name が同じでない運用にしてみる。 - /// + /// /// public struct SubAssetKey : IEquatable { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/SubAssetKey.cs.meta b/Assets/VRMShaders/GLTF/IO/Runtime/SubAssetKey.cs.meta similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/IO/SubAssetKey.cs.meta rename to Assets/VRMShaders/GLTF/IO/Runtime/SubAssetKey.cs.meta