diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/GlbScriptedImporterEditorGUI.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/GlbScriptedImporterEditorGUI.cs index 182295a5a..26c49f684 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/GlbScriptedImporterEditorGUI.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/GlbScriptedImporterEditorGUI.cs @@ -17,7 +17,7 @@ namespace UniGLTF public class GlbScriptedImporterEditorGUI : RemapScriptedImporterEditorBase { GlbScriptedImporter m_importer; - IGltfData m_data; + GltfData m_data; RemapEditorMaterial m_materialEditor; RemapEditorAnimation m_animationEditor; diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/GltfScriptedImporterEditorGUI.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/GltfScriptedImporterEditorGUI.cs index 81595409d..52716f6b2 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/GltfScriptedImporterEditorGUI.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/GltfScriptedImporterEditorGUI.cs @@ -17,7 +17,7 @@ namespace UniGLTF public class GltfScriptedImporterEditorGUI : RemapScriptedImporterEditorBase { GltfScriptedImporter m_importer; - IGltfData m_data; + GltfData m_data; RemapEditorMaterial m_materialEditor; RemapEditorAnimation m_animationEditor; diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/RemapEditorAnimation.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/RemapEditorAnimation.cs index 2f34e29ca..714c35b66 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/RemapEditorAnimation.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/RemapEditorAnimation.cs @@ -12,7 +12,7 @@ namespace UniGLTF public RemapEditorAnimation(IEnumerable keys, EditorMapGetterFunc getter, EditorMapSetterFunc setter) : base(keys, getter, setter) { } - public void OnGUI(ScriptedImporter importer, IGltfData data) + public void OnGUI(ScriptedImporter importer, GltfData data) { if (!HasKeys) { @@ -40,7 +40,7 @@ namespace UniGLTF DrawRemapGUI(importer.GetExternalObjectMap()); } - public static void Extract(ScriptedImporter importer, IGltfData data) + public static void Extract(ScriptedImporter importer, GltfData data) { if (string.IsNullOrEmpty(importer.assetPath)) { diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/RemapEditorMaterial.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/RemapEditorMaterial.cs index 69410dbd9..f31edc23a 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/RemapEditorMaterial.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/RemapEditorMaterial.cs @@ -25,7 +25,7 @@ namespace UniGLTF public RemapEditorMaterial(IEnumerable keys, EditorMapGetterFunc getter, EditorMapSetterFunc setter) : base(keys, getter, setter) { } - public void OnGUI(ScriptedImporter importer, IGltfData data, + public void OnGUI(ScriptedImporter importer, GltfData data, ITextureDescriptorGenerator textureDescriptorGenerator, Func textureDir, Func materialDir) @@ -63,7 +63,7 @@ namespace UniGLTF } } - void ExtractMaterialsAndTextures(ScriptedImporter self, IGltfData data, ITextureDescriptorGenerator textureDescriptorGenerator, Func textureDir, Func materialDir) + void ExtractMaterialsAndTextures(ScriptedImporter self, GltfData data, ITextureDescriptorGenerator textureDescriptorGenerator, Func textureDir, Func materialDir) { if (string.IsNullOrEmpty(self.assetPath)) { diff --git a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs index a4d52cb9c..262c1dea2 100644 --- a/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs +++ b/Assets/UniGLTF/Editor/UniGLTF/ScriptedImporter/TextureExtractor.cs @@ -13,8 +13,8 @@ namespace UniGLTF { const string TextureDirName = "Textures"; - IGltfData m_data; - public IGltfData Data => m_data; + GltfData m_data; + public GltfData Data => m_data; public glTF GLTF => m_data.GLTF; public IStorage Storage => m_data.Storage; @@ -23,7 +23,7 @@ namespace UniGLTF private readonly IReadOnlyDictionary m_subAssets; UnityPath m_textureDirectory; - public TextureExtractor(IGltfData data, UnityPath textureDirectory, IReadOnlyDictionary subAssets) + public TextureExtractor(GltfData data, UnityPath textureDirectory, IReadOnlyDictionary subAssets) { m_data = data; m_textureDirectory = textureDirectory; @@ -74,7 +74,7 @@ namespace UniGLTF /// /// /// - public static void ExtractTextures(IGltfData data, UnityPath textureDirectory, + public static void ExtractTextures(GltfData data, UnityPath textureDirectory, ITextureDescriptorGenerator textureDescriptorGenerator, IReadOnlyDictionary subAssets, Action addRemap, Action> onCompleted = null) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/IGltfData.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs similarity index 81% rename from Assets/UniGLTF/Runtime/UniGLTF/IO/IGltfData.cs rename to Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs index c8206fd0c..02dc704ce 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/IGltfData.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs @@ -7,7 +7,7 @@ using UnityEngine; namespace UniGLTF { - public sealed class IGltfData + public sealed class GltfData { /// /// Source file path. @@ -37,11 +37,11 @@ namespace UniGLTF public IStorage Storage { get; } /// - /// + /// Migration Flags used by ImporterContext /// public MigrationFlags MigrationFlags { get; } - public IGltfData(string targetPath, string json, glTF gltf, IReadOnlyList chunks, IStorage storage, MigrationFlags migrationFlags) + public GltfData(string targetPath, string json, glTF gltf, IReadOnlyList chunks, IStorage storage, MigrationFlags migrationFlags) { TargetPath = targetPath; Json = json; @@ -51,9 +51,9 @@ namespace UniGLTF MigrationFlags = migrationFlags; } - public static IGltfData CreateFromGltfData(glTF gltf) + public static GltfData CreateFromGltfData(glTF gltf) { - return new IGltfData( + return new GltfData( string.Empty, string.Empty, gltf, diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/IGltfData.cs.meta b/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs.meta similarity index 100% rename from Assets/UniGLTF/Runtime/UniGLTF/IO/IGltfData.cs.meta rename to Assets/UniGLTF/Runtime/UniGLTF/IO/GltfData.cs.meta diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs index c36123cc9..644fed31d 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs @@ -19,7 +19,7 @@ namespace UniGLTF IReadOnlyDictionary _externalObjectMap; public ImporterContext( - IGltfData data, + GltfData data, IReadOnlyDictionary externalObjectMap = null, ITextureDeserializer textureDeserializer = null) { @@ -40,7 +40,7 @@ namespace UniGLTF } #region Source - public IGltfData Data { get; } + public GltfData Data { get; } public String Json => Data.Json; public glTF GLTF => Data.GLTF; public IStorage Storage => Data.Storage; diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfMaterialDescriptorGenerator.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfMaterialDescriptorGenerator.cs index 23697e371..c42568d8a 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfMaterialDescriptorGenerator.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfMaterialDescriptorGenerator.cs @@ -10,7 +10,7 @@ namespace UniGLTF /// public sealed class GltfMaterialDescriptorGenerator : IMaterialDescriptorGenerator { - public MaterialDescriptor Get(IGltfData data, int i) + public MaterialDescriptor Get(GltfData data, int i) { if (!GltfUnlitMaterialImporter.TryCreateParam(data, i, out var param)) { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfPbrMaterialImporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfPbrMaterialImporter.cs index 04f527caf..d1b8b3632 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfPbrMaterialImporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfPbrMaterialImporter.cs @@ -48,7 +48,7 @@ namespace UniGLTF Transparent } - public static bool TryCreateParam(IGltfData data, int i, out MaterialDescriptor matDesc) + public static bool TryCreateParam(GltfData data, int i, out MaterialDescriptor matDesc) { if (i < 0 || i >= data.GLTF.materials.Count) { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfUnlitMaterialImporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfUnlitMaterialImporter.cs index 7965d6726..a49b0ed54 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfUnlitMaterialImporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/GltfUnlitMaterialImporter.cs @@ -8,7 +8,7 @@ namespace UniGLTF { public const string ShaderName = "UniGLTF/UniUnlit"; - public static bool TryCreateParam(IGltfData data, int i, out MaterialDescriptor matDesc) + public static bool TryCreateParam(GltfData data, int i, out MaterialDescriptor matDesc) { if (i < 0 || i >= data.GLTF.materials.Count) { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/IMaterialDescriptorGenerator.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/IMaterialDescriptorGenerator.cs index aa8a76f89..10f877c23 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/IMaterialDescriptorGenerator.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialIO/IMaterialDescriptorGenerator.cs @@ -8,6 +8,6 @@ namespace UniGLTF /// public interface IMaterialDescriptorGenerator { - MaterialDescriptor Get(IGltfData data, int i); + MaterialDescriptor Get(GltfData data, int i); } } diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/AmbiguousGltfFileParser.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/AmbiguousGltfFileParser.cs index ca33bd36c..deaab897c 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/AmbiguousGltfFileParser.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/AmbiguousGltfFileParser.cs @@ -15,7 +15,7 @@ namespace UniGLTF _path = path; } - public IGltfData Parse() + public GltfData Parse() { var ext = Path.GetExtension(_path).ToLower(); switch (ext) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbFileParser.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbFileParser.cs index 1f0f623d7..d6132266d 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbFileParser.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbFileParser.cs @@ -11,7 +11,7 @@ namespace UniGLTF _path = glbFilePath; } - public IGltfData Parse() + public GltfData Parse() { var data = File.ReadAllBytes(_path); return new GlbLowLevelParser(_path, data).Parse(); diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs index e63cf28d9..40e6f973f 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GlbLowLevelParser.cs @@ -17,7 +17,7 @@ namespace UniGLTF _binary = specifiedBinary; } - public IGltfData Parse() + public GltfData Parse() { try { @@ -63,7 +63,7 @@ namespace UniGLTF return chunks; } - public static IGltfData ParseGltf(string path, string json, IReadOnlyList chunks, IStorage storage, MigrationFlags migrationFlags) + public static GltfData ParseGltf(string path, string json, IReadOnlyList chunks, IStorage storage, MigrationFlags migrationFlags) { var GLTF = GltfDeserializer.Deserialize(json.ParseAsJson()); if (GLTF.asset.version != "2.0") @@ -91,7 +91,7 @@ namespace UniGLTF buffer.OpenStorage(storage); } - return new IGltfData(path, json, GLTF, chunks, storage, migrationFlags); + return new GltfData(path, json, GLTF, chunks, storage, migrationFlags); } private static void FixMeshNameUnique(glTF GLTF) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GltfFileWithResourceFilesParser.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GltfFileWithResourceFilesParser.cs index 754b1687a..8ce0a007a 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GltfFileWithResourceFilesParser.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/GltfFileWithResourceFilesParser.cs @@ -24,7 +24,7 @@ namespace UniGLTF _gltfRootPath = Path.GetDirectoryName(gltfFilePath); } - public IGltfData Parse() + public GltfData Parse() { var binary = File.ReadAllBytes(_gltfFilePath); diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/JsonWithStorageParser.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/JsonWithStorageParser.cs index 57bff4813..53cb0ebfb 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/JsonWithStorageParser.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/JsonWithStorageParser.cs @@ -18,7 +18,7 @@ namespace UniGLTF _storage = storage ?? new SimpleStorage(new ArraySegment()); } - public IGltfData Parse() + public GltfData Parse() { return GlbLowLevelParser.ParseGltf( string.Empty, diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/ZipArchivedGltfFileParser.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/ZipArchivedGltfFileParser.cs index 91513df37..5a5e23baa 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/ZipArchivedGltfFileParser.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Parser/ZipArchivedGltfFileParser.cs @@ -23,7 +23,7 @@ namespace UniGLTF _zippedFilePath = zippedFilePath; } - public IGltfData Parse() + public GltfData Parse() { var binary = File.ReadAllBytes(_zippedFilePath); diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfPbrTextureImporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfPbrTextureImporter.cs index bd7b12cbe..ca963e882 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfPbrTextureImporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfPbrTextureImporter.cs @@ -5,7 +5,7 @@ namespace UniGLTF { public sealed class GltfPbrTextureImporter { - public static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(IGltfData data, int i) + public static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(GltfData data, int i) { var m = data.GLTF.materials[i]; @@ -51,13 +51,13 @@ namespace UniGLTF } } - public static (SubAssetKey, TextureDescriptor) BaseColorTexture(IGltfData data, glTFMaterial src) + public static (SubAssetKey, TextureDescriptor) BaseColorTexture(GltfData data, glTFMaterial src) { var (offset, scale) = GltfTextureImporter.GetTextureOffsetAndScale(src.pbrMetallicRoughness.baseColorTexture); return GltfTextureImporter.CreateSRGB(data, src.pbrMetallicRoughness.baseColorTexture.index, offset, scale); } - public static (SubAssetKey, TextureDescriptor) StandardTexture(IGltfData data, glTFMaterial src) + public static (SubAssetKey, TextureDescriptor) StandardTexture(GltfData data, glTFMaterial src) { var metallicFactor = 1.0f; var roughnessFactor = 1.0f; @@ -75,13 +75,13 @@ namespace UniGLTF roughnessFactor); } - public static (SubAssetKey, TextureDescriptor) NormalTexture(IGltfData data, glTFMaterial src) + public static (SubAssetKey, TextureDescriptor) NormalTexture(GltfData data, glTFMaterial src) { var (offset, scale) = GltfTextureImporter.GetTextureOffsetAndScale(src.normalTexture); return GltfTextureImporter.CreateNormal(data, src.normalTexture.index, offset, scale); } - public static (SubAssetKey, TextureDescriptor) EmissiveTexture(IGltfData data, glTFMaterial src) + public static (SubAssetKey, TextureDescriptor) EmissiveTexture(GltfData data, glTFMaterial src) { var (offset, scale) = GltfTextureImporter.GetTextureOffsetAndScale(src.emissiveTexture); return GltfTextureImporter.CreateSRGB(data, src.emissiveTexture.index, offset, scale); diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureDescriptorGenerator.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureDescriptorGenerator.cs index 8879a3c72..be3cc2f63 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureDescriptorGenerator.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureDescriptorGenerator.cs @@ -27,10 +27,10 @@ namespace UniGLTF /// public sealed class GltfTextureDescriptorGenerator : ITextureDescriptorGenerator { - private readonly IGltfData m_data; + private readonly GltfData m_data; private TextureDescriptorSet _textureDescriptorSet; - public GltfTextureDescriptorGenerator(IGltfData data) + public GltfTextureDescriptorGenerator(GltfData data) { m_data = data; } @@ -51,7 +51,7 @@ namespace UniGLTF /// /// glTF 全体で使うテクスチャーを列挙。 /// - private static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(IGltfData data) + private static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(GltfData data) { for (int i = 0; i < data.GLTF.materials.Count; ++i) { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs index 5edad7284..5cc96bc8c 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/TextureIO/GltfTextureImporter.cs @@ -29,7 +29,7 @@ namespace UniGLTF } } - public static (SubAssetKey, TextureDescriptor) CreateSRGB(IGltfData data, int textureIndex, Vector2 offset, Vector2 scale) + public static (SubAssetKey, TextureDescriptor) CreateSRGB(GltfData data, int textureIndex, Vector2 offset, Vector2 scale) { var gltfTexture = data.GLTF.textures[textureIndex]; var gltfImage = data.GLTF.images[gltfTexture.source]; @@ -40,7 +40,7 @@ namespace UniGLTF return (param.SubAssetKey, param); } - public static (SubAssetKey, TextureDescriptor) CreateLinear(IGltfData data, int textureIndex, Vector2 offset, Vector2 scale) + public static (SubAssetKey, TextureDescriptor) CreateLinear(GltfData data, int textureIndex, Vector2 offset, Vector2 scale) { var gltfTexture = data.GLTF.textures[textureIndex]; var gltfImage = data.GLTF.images[gltfTexture.source]; @@ -51,7 +51,7 @@ namespace UniGLTF return (param.SubAssetKey, param); } - public static (SubAssetKey, TextureDescriptor) CreateNormal(IGltfData data, int textureIndex, Vector2 offset, Vector2 scale) + public static (SubAssetKey, TextureDescriptor) CreateNormal(GltfData data, int textureIndex, Vector2 offset, Vector2 scale) { var gltfTexture = data.GLTF.textures[textureIndex]; var gltfImage = data.GLTF.images[gltfTexture.source]; @@ -62,7 +62,7 @@ namespace UniGLTF return (param.SubAssetKey, param); } - public static (SubAssetKey, TextureDescriptor) CreateStandard(IGltfData data, int? metallicRoughnessTextureIndex, int? occlusionTextureIndex, Vector2 offset, Vector2 scale, float metallicFactor, float roughnessFactor) + public static (SubAssetKey, TextureDescriptor) CreateStandard(GltfData data, int? metallicRoughnessTextureIndex, int? occlusionTextureIndex, Vector2 offset, Vector2 scale, float metallicFactor, float roughnessFactor) { string name = default; diff --git a/Assets/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs b/Assets/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs index 48df97fbc..145ab3fd1 100644 --- a/Assets/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs +++ b/Assets/UniGLTF/Tests/UniGLTF/GltfLoadTests.cs @@ -78,7 +78,7 @@ namespace UniGLTF static void RuntimeLoadExport(FileInfo gltf, int subStrStart) { - IGltfData data = null; + GltfData data = null; try { data = new AmbiguousGltfFileParser(gltf.FullName).Parse(); @@ -124,7 +124,7 @@ namespace UniGLTF /// static void EditorLoad(FileInfo gltf, int subStrStart) { - IGltfData data = null; + GltfData data = null; try { data = new AmbiguousGltfFileParser(gltf.FullName).Parse(); diff --git a/Assets/UniGLTF/Tests/UniGLTF/TextureEnumerateTests.cs b/Assets/UniGLTF/Tests/UniGLTF/TextureEnumerateTests.cs index ab6dd44db..25765b3ef 100644 --- a/Assets/UniGLTF/Tests/UniGLTF/TextureEnumerateTests.cs +++ b/Assets/UniGLTF/Tests/UniGLTF/TextureEnumerateTests.cs @@ -228,9 +228,9 @@ namespace UniGLTF } } - private IGltfData CreateGltfData(glTF gltf) + private GltfData CreateGltfData(glTF gltf) { - return new IGltfData( + return new GltfData( string.Empty, string.Empty, gltf, diff --git a/Assets/VRM/Runtime/IO/VRMImporterContext.cs b/Assets/VRM/Runtime/IO/VRMImporterContext.cs index f6d9bae5d..9595006e2 100644 --- a/Assets/VRM/Runtime/IO/VRMImporterContext.cs +++ b/Assets/VRM/Runtime/IO/VRMImporterContext.cs @@ -21,7 +21,7 @@ namespace VRM public VRM.glTF_VRM_extensions VRM { get; private set; } public VRMImporterContext( - IGltfData data, + GltfData data, IReadOnlyDictionary externalObjectMap = null, ITextureDeserializer textureDeserializer = null) : base(data, externalObjectMap, textureDeserializer) diff --git a/Assets/VRM/Runtime/IO/VRMMToonMaterialImporter.cs b/Assets/VRM/Runtime/IO/VRMMToonMaterialImporter.cs index 6029c573f..4ab6d48a3 100644 --- a/Assets/VRM/Runtime/IO/VRMMToonMaterialImporter.cs +++ b/Assets/VRM/Runtime/IO/VRMMToonMaterialImporter.cs @@ -6,7 +6,7 @@ namespace VRM { public static class VRMMToonMaterialImporter { - public static bool TryCreateParam(IGltfData data, glTF_VRM_extensions vrm, int materialIdx, out MaterialDescriptor matDesc) + public static bool TryCreateParam(GltfData data, glTF_VRM_extensions vrm, int materialIdx, out MaterialDescriptor matDesc) { var vrmMaterial = vrm.materialProperties[materialIdx]; if (vrmMaterial.shader == VRM.glTF_VRM_Material.VRM_USE_GLTFSHADER) diff --git a/Assets/VRM/Runtime/IO/VRMMToonTextureImporter.cs b/Assets/VRM/Runtime/IO/VRMMToonTextureImporter.cs index 7252a38ea..596999e89 100644 --- a/Assets/VRM/Runtime/IO/VRMMToonTextureImporter.cs +++ b/Assets/VRM/Runtime/IO/VRMMToonTextureImporter.cs @@ -7,7 +7,7 @@ namespace VRM { public static class VRMMToonTextureImporter { - public static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(IGltfData data, glTF_VRM_extensions vrm, int materialIdx) + public static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(GltfData data, glTF_VRM_extensions vrm, int materialIdx) { var vrmMaterial = vrm.materialProperties[materialIdx]; foreach (var kv in vrmMaterial.textureProperties) @@ -19,7 +19,7 @@ namespace VRM } } - public static bool TryGetTextureFromMaterialProperty(IGltfData data, glTF_VRM_extensions vrm, int materialIdx, string textureKey, out (SubAssetKey, TextureDescriptor) texture) + public static bool TryGetTextureFromMaterialProperty(GltfData data, glTF_VRM_extensions vrm, int materialIdx, string textureKey, out (SubAssetKey, TextureDescriptor) texture) { var vrmMaterial = vrm.materialProperties[materialIdx]; // 任意の shader の import を許容する diff --git a/Assets/VRM/Runtime/IO/VRMMaterialDescriptorGenerator.cs b/Assets/VRM/Runtime/IO/VRMMaterialDescriptorGenerator.cs index 4192dc201..83c30e42b 100644 --- a/Assets/VRM/Runtime/IO/VRMMaterialDescriptorGenerator.cs +++ b/Assets/VRM/Runtime/IO/VRMMaterialDescriptorGenerator.cs @@ -14,7 +14,7 @@ namespace VRM m_vrm = vrm; } - public MaterialDescriptor Get(IGltfData data, int i) + public MaterialDescriptor Get(GltfData data, int i) { // mtoon if (!VRMMToonMaterialImporter.TryCreateParam(data, m_vrm, i, out MaterialDescriptor matDesc)) diff --git a/Assets/VRM/Runtime/IO/VrmTextureDescriptorGenerator.cs b/Assets/VRM/Runtime/IO/VrmTextureDescriptorGenerator.cs index 6d0fe1080..4e484f878 100644 --- a/Assets/VRM/Runtime/IO/VrmTextureDescriptorGenerator.cs +++ b/Assets/VRM/Runtime/IO/VrmTextureDescriptorGenerator.cs @@ -8,11 +8,11 @@ namespace VRM { public sealed class VrmTextureDescriptorGenerator : ITextureDescriptorGenerator { - private readonly IGltfData m_data; + private readonly GltfData m_data; private readonly glTF_VRM_extensions m_vrm; private TextureDescriptorSet _textureDescriptorSet; - public VrmTextureDescriptorGenerator(IGltfData data, glTF_VRM_extensions vrm) + public VrmTextureDescriptorGenerator(GltfData data, glTF_VRM_extensions vrm) { m_data = data; m_vrm = vrm; @@ -32,7 +32,7 @@ namespace VRM } - private static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(IGltfData data, glTF_VRM_extensions vrm) + private static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(GltfData data, glTF_VRM_extensions vrm) { // Materials for (var materialIdx = 0; materialIdx < data.GLTF.materials.Count; ++materialIdx) @@ -65,7 +65,7 @@ namespace VRM } } - private static bool TryGetThumbnailTexture(IGltfData data, glTF_VRM_extensions vrm, out (SubAssetKey, TextureDescriptor) texture) + private static bool TryGetThumbnailTexture(GltfData data, glTF_VRM_extensions vrm, out (SubAssetKey, TextureDescriptor) texture) { if (vrm.meta.texture > -1) { diff --git a/Assets/VRM/Tests/VRMLoadTests.cs b/Assets/VRM/Tests/VRMLoadTests.cs index ce18753af..fe8beef1f 100644 --- a/Assets/VRM/Tests/VRMLoadTests.cs +++ b/Assets/VRM/Tests/VRMLoadTests.cs @@ -51,7 +51,7 @@ namespace VRM static GameObject Load(FileInfo gltf, DirectoryInfo root, byte[] bytes = null) { - IGltfData data = null; + GltfData data = null; try { if (bytes != null) diff --git a/Assets/VRM/Tests/VRMTextureEnumerateTests.cs b/Assets/VRM/Tests/VRMTextureEnumerateTests.cs index c19a35009..dfbf33f78 100644 --- a/Assets/VRM/Tests/VRMTextureEnumerateTests.cs +++ b/Assets/VRM/Tests/VRMTextureEnumerateTests.cs @@ -17,7 +17,7 @@ namespace VRM public void TextureEnumerationTest() { { - var data = IGltfData.CreateFromGltfData( + var data = GltfData.CreateFromGltfData( new glTF { images = new List @@ -88,7 +88,7 @@ namespace VRM [Test] public void TextureEnumerationInUnknownShader() { - var data = IGltfData.CreateFromGltfData( + var data = GltfData.CreateFromGltfData( new glTF { images = new List diff --git a/Assets/VRM10/Editor/ScriptedImporter/RemapEditorVrm.cs b/Assets/VRM10/Editor/ScriptedImporter/RemapEditorVrm.cs index fad499a9f..669668b19 100644 --- a/Assets/VRM10/Editor/ScriptedImporter/RemapEditorVrm.cs +++ b/Assets/VRM10/Editor/ScriptedImporter/RemapEditorVrm.cs @@ -18,7 +18,7 @@ namespace UniVRM10 public RemapEditorVrm(IEnumerable keys, EditorMapGetterFunc getter, EditorMapSetterFunc setter) : base(keys, getter, setter) { } - public void OnGUI(ScriptedImporter importer, IGltfData data, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm) + public void OnGUI(ScriptedImporter importer, GltfData data, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm) { if (CanExtract(importer)) { @@ -49,7 +49,7 @@ namespace UniVRM10 /// が Extract 対象となる /// /// - public static void Extract(ScriptedImporter importer, IGltfData data) + public static void Extract(ScriptedImporter importer, GltfData data) { if (string.IsNullOrEmpty(importer.assetPath)) { diff --git a/Assets/VRM10/Runtime/IO/Material/Vrm10MToonMaterialImporter.cs b/Assets/VRM10/Runtime/IO/Material/Vrm10MToonMaterialImporter.cs index abf4ad66a..7eb8fd58b 100644 --- a/Assets/VRM10/Runtime/IO/Material/Vrm10MToonMaterialImporter.cs +++ b/Assets/VRM10/Runtime/IO/Material/Vrm10MToonMaterialImporter.cs @@ -18,7 +18,7 @@ namespace UniVRM10 /// /// VMRC_materials_mtoon の場合にマテリアル生成情報を作成する /// - public static bool TryCreateParam(IGltfData data, int i, out MaterialDescriptor matDesc) + public static bool TryCreateParam(GltfData data, int i, out MaterialDescriptor matDesc) { var m = data.GLTF.materials[i]; if (!UniGLTF.Extensions.VRMC_materials_mtoon.GltfDeserializer.TryGet(m.extensions, diff --git a/Assets/VRM10/Runtime/IO/Material/Vrm10MaterialDescriptorGenerator.cs b/Assets/VRM10/Runtime/IO/Material/Vrm10MaterialDescriptorGenerator.cs index e80db190e..c15038180 100644 --- a/Assets/VRM10/Runtime/IO/Material/Vrm10MaterialDescriptorGenerator.cs +++ b/Assets/VRM10/Runtime/IO/Material/Vrm10MaterialDescriptorGenerator.cs @@ -6,7 +6,7 @@ namespace UniVRM10 { public sealed class Vrm10MaterialDescriptorGenerator : IMaterialDescriptorGenerator { - public MaterialDescriptor Get(IGltfData data, int i) + public MaterialDescriptor Get(GltfData data, int i) { // mtoon if (!Vrm10MToonMaterialImporter.TryCreateParam(data, i, out MaterialDescriptor matDesc)) diff --git a/Assets/VRM10/Runtime/IO/Model/ModelReader.cs b/Assets/VRM10/Runtime/IO/Model/ModelReader.cs index 65ab1eeed..8a3a871b0 100644 --- a/Assets/VRM10/Runtime/IO/Model/ModelReader.cs +++ b/Assets/VRM10/Runtime/IO/Model/ModelReader.cs @@ -74,7 +74,7 @@ namespace UniVRM10 return model; } - public static Model Read(UniGLTF.IGltfData data) + public static Model Read(UniGLTF.GltfData data) { var storage = new Vrm10Storage(data); var model = Load(storage, Path.GetFileName(data.TargetPath)); diff --git a/Assets/VRM10/Runtime/IO/Texture/Vrm10MToonTextureImporter.cs b/Assets/VRM10/Runtime/IO/Texture/Vrm10MToonTextureImporter.cs index b64b13439..10c46f0f2 100644 --- a/Assets/VRM10/Runtime/IO/Texture/Vrm10MToonTextureImporter.cs +++ b/Assets/VRM10/Runtime/IO/Texture/Vrm10MToonTextureImporter.cs @@ -10,7 +10,7 @@ namespace UniVRM10 { public static class Vrm10MToonTextureImporter { - public static IEnumerable<(string key, (SubAssetKey, TextureDescriptor))> EnumerateAllTextures(IGltfData data, glTFMaterial material, VRMC_materials_mtoon mToon) + public static IEnumerable<(string key, (SubAssetKey, TextureDescriptor))> EnumerateAllTextures(GltfData data, glTFMaterial material, VRMC_materials_mtoon mToon) { if (TryGetBaseColorTexture(data, material, out var litTex)) { @@ -58,7 +58,7 @@ namespace UniVRM10 } } - private static bool TryGetBaseColorTexture(IGltfData data, glTFMaterial src, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetBaseColorTexture(GltfData data, glTFMaterial src, out (SubAssetKey, TextureDescriptor) pair) { try { @@ -77,7 +77,7 @@ namespace UniVRM10 } } - private static bool TryGetEmissiveTexture(IGltfData data, glTFMaterial src, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetEmissiveTexture(GltfData data, glTFMaterial src, out (SubAssetKey, TextureDescriptor) pair) { try { @@ -97,7 +97,7 @@ namespace UniVRM10 } - private static bool TryGetNormalTexture(IGltfData data, glTFMaterial src, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetNormalTexture(GltfData data, glTFMaterial src, out (SubAssetKey, TextureDescriptor) pair) { try { @@ -116,37 +116,37 @@ namespace UniVRM10 } } - private static bool TryGetShadeMultiplyTexture(IGltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetShadeMultiplyTexture(GltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) { return TryGetSRGBTexture(data, new Vrm10TextureInfo(mToon.ShadeMultiplyTexture), out pair); } - private static bool TryGetShadingShiftTexture(IGltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetShadingShiftTexture(GltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) { return TryGetLinearTexture(data, new Vrm10TextureInfo(mToon.ShadingShiftTexture), out pair); } - private static bool TryGetMatcapTexture(IGltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetMatcapTexture(GltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) { return TryGetSRGBTexture(data, new Vrm10TextureInfo(mToon.ShadingShiftTexture), out pair); } - private static bool TryGetRimMultiplyTexture(IGltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetRimMultiplyTexture(GltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) { return TryGetSRGBTexture(data, new Vrm10TextureInfo(mToon.RimMultiplyTexture), out pair); } - private static bool TryGetOutlineWidthMultiplyTexture(IGltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetOutlineWidthMultiplyTexture(GltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) { return TryGetLinearTexture(data, new Vrm10TextureInfo(mToon.OutlineWidthMultiplyTexture), out pair); } - private static bool TryGetUvAnimationMaskTexture(IGltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetUvAnimationMaskTexture(GltfData data, VRMC_materials_mtoon mToon, out (SubAssetKey, TextureDescriptor) pair) { return TryGetLinearTexture(data, new Vrm10TextureInfo(mToon.UvAnimationMaskTexture), out pair); } - private static bool TryGetSRGBTexture(IGltfData data, Vrm10TextureInfo info, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetSRGBTexture(GltfData data, Vrm10TextureInfo info, out (SubAssetKey, TextureDescriptor) pair) { try { @@ -165,7 +165,7 @@ namespace UniVRM10 return false; } } - private static bool TryGetLinearTexture(IGltfData data, Vrm10TextureInfo info, out (SubAssetKey, TextureDescriptor) pair) + private static bool TryGetLinearTexture(GltfData data, Vrm10TextureInfo info, out (SubAssetKey, TextureDescriptor) pair) { try { diff --git a/Assets/VRM10/Runtime/IO/Texture/Vrm10TextureDescriptorGenerator.cs b/Assets/VRM10/Runtime/IO/Texture/Vrm10TextureDescriptorGenerator.cs index ced7ef231..53fa5b0d1 100644 --- a/Assets/VRM10/Runtime/IO/Texture/Vrm10TextureDescriptorGenerator.cs +++ b/Assets/VRM10/Runtime/IO/Texture/Vrm10TextureDescriptorGenerator.cs @@ -9,10 +9,10 @@ namespace UniVRM10 { public sealed class Vrm10TextureDescriptorGenerator : ITextureDescriptorGenerator { - private readonly IGltfData m_data; + private readonly GltfData m_data; private TextureDescriptorSet _textureDescriptorSet; - public Vrm10TextureDescriptorGenerator(IGltfData data) + public Vrm10TextureDescriptorGenerator(GltfData data) { m_data = data; } @@ -33,7 +33,7 @@ namespace UniVRM10 /// /// glTF 全体で使うテクスチャーを列挙する /// - private static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(IGltfData data) + private static IEnumerable<(SubAssetKey, TextureDescriptor)> EnumerateAllTextures(GltfData data) { if (!UniGLTF.Extensions.VRMC_vrm.GltfDeserializer.TryGet(data.GLTF.extensions, out UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm)) { @@ -71,7 +71,7 @@ namespace UniVRM10 /// /// VRM-1 の thumbnail テクスチャー。gltf.textures ではなく gltf.images の参照であることに注意(sampler等の設定が無い) /// - public static bool TryGetMetaThumbnailTextureImportParam(IGltfData data, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm, out (SubAssetKey, TextureDescriptor) value) + public static bool TryGetMetaThumbnailTextureImportParam(GltfData data, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm, out (SubAssetKey, TextureDescriptor) value) { if (vrm?.Meta?.ThumbnailImage == null) { diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index 04a09a98c..9d75b6cad 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -21,7 +21,7 @@ namespace UniVRM10 IReadOnlyDictionary m_externalMap; public Vrm10Importer( - UniGLTF.IGltfData data, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm, + UniGLTF.GltfData data, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm, IReadOnlyDictionary externalObjectMap = null, ITextureDeserializer textureDeserializer = null) : base(data, externalObjectMap, textureDeserializer) diff --git a/Assets/VRM10/Runtime/IO/Vrm10Parser.cs b/Assets/VRM10/Runtime/IO/Vrm10Parser.cs index 4c84f564e..2f4df743a 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Parser.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Parser.cs @@ -17,11 +17,11 @@ namespace UniVRM10 { public readonly struct Result { - public readonly IGltfData Data; + public readonly GltfData Data; public readonly VRMC_vrm Vrm; public readonly Vrm10FileType FileType; public readonly String Message; - public Result(IGltfData data, VRMC_vrm vrm, Vrm10FileType fileType, string message) + public Result(GltfData data, VRMC_vrm vrm, Vrm10FileType fileType, string message) { Data = data; Vrm = vrm; diff --git a/Assets/VRM10/Runtime/IO/Vrm10Storage.cs b/Assets/VRM10/Runtime/IO/Vrm10Storage.cs index a9f5fa38a..fd6856238 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Storage.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Storage.cs @@ -12,7 +12,7 @@ namespace UniVRM10 { public class Vrm10Storage { - UniGLTF.IGltfData m_data; + UniGLTF.GltfData m_data; public UniGLTF.glTF Gltf => m_data.GLTF; public List Buffers; @@ -26,7 +26,7 @@ namespace UniVRM10 /// public Vrm10Storage() { - m_data = new IGltfData( + m_data = new GltfData( string.Empty, string.Empty, new glTF @@ -50,7 +50,7 @@ namespace UniVRM10 /// /// /// - public Vrm10Storage(UniGLTF.IGltfData data) + public Vrm10Storage(UniGLTF.GltfData data) { m_data = data; diff --git a/Assets/VRM10/Tests.PlayMode/MaterialTests.cs b/Assets/VRM10/Tests.PlayMode/MaterialTests.cs index 1a07acb05..8895efc61 100644 --- a/Assets/VRM10/Tests.PlayMode/MaterialTests.cs +++ b/Assets/VRM10/Tests.PlayMode/MaterialTests.cs @@ -39,7 +39,7 @@ namespace UniVRM10.Test return ToUnity(result.Data, result.Vrm); } - private (GameObject, IReadOnlyList) ToUnity(IGltfData data, VRMC_vrm vrm) + private (GameObject, IReadOnlyList) ToUnity(GltfData data, VRMC_vrm vrm) { // Model => Unity using (var loader = new Vrm10Importer(data, vrm)) diff --git a/Assets/VRM10/Tests/ApiSampleTests.cs b/Assets/VRM10/Tests/ApiSampleTests.cs index ee1c12d07..6ea9d972e 100644 --- a/Assets/VRM10/Tests/ApiSampleTests.cs +++ b/Assets/VRM10/Tests/ApiSampleTests.cs @@ -19,7 +19,7 @@ namespace UniVRM10.Test return model; } - GameObject BuildGameObject(IGltfData data, VRMC_vrm vrm, bool showMesh) + GameObject BuildGameObject(GltfData data, VRMC_vrm vrm, bool showMesh) { using (var loader = new Vrm10Importer(data, vrm)) {