Rename IGltfData to GltfData

This commit is contained in:
Masataka SUMI 2021-06-28 00:26:54 +09:00
parent a1c40eeda0
commit 3ed5c4fe5c
41 changed files with 86 additions and 86 deletions

View File

@ -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;

View File

@ -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;

View File

@ -12,7 +12,7 @@ namespace UniGLTF
public RemapEditorAnimation(IEnumerable<SubAssetKey> 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<AnimationClip>(importer.GetExternalObjectMap());
}
public static void Extract(ScriptedImporter importer, IGltfData data)
public static void Extract(ScriptedImporter importer, GltfData data)
{
if (string.IsNullOrEmpty(importer.assetPath))
{

View File

@ -25,7 +25,7 @@ namespace UniGLTF
public RemapEditorMaterial(IEnumerable<SubAssetKey> 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<string, string> textureDir,
Func<string, string> materialDir)
@ -63,7 +63,7 @@ namespace UniGLTF
}
}
void ExtractMaterialsAndTextures(ScriptedImporter self, IGltfData data, ITextureDescriptorGenerator textureDescriptorGenerator, Func<string, string> textureDir, Func<string, string> materialDir)
void ExtractMaterialsAndTextures(ScriptedImporter self, GltfData data, ITextureDescriptorGenerator textureDescriptorGenerator, Func<string, string> textureDir, Func<string, string> materialDir)
{
if (string.IsNullOrEmpty(self.assetPath))
{

View File

@ -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<SubAssetKey, Texture> m_subAssets;
UnityPath m_textureDirectory;
public TextureExtractor(IGltfData data, UnityPath textureDirectory, IReadOnlyDictionary<SubAssetKey, Texture> subAssets)
public TextureExtractor(GltfData data, UnityPath textureDirectory, IReadOnlyDictionary<SubAssetKey, Texture> subAssets)
{
m_data = data;
m_textureDirectory = textureDirectory;
@ -74,7 +74,7 @@ namespace UniGLTF
/// <param name="importer"></param>
/// <param name="dirName"></param>
/// <param name="onCompleted"></param>
public static void ExtractTextures(IGltfData data, UnityPath textureDirectory,
public static void ExtractTextures(GltfData data, UnityPath textureDirectory,
ITextureDescriptorGenerator textureDescriptorGenerator, IReadOnlyDictionary<SubAssetKey, Texture> subAssets,
Action<SubAssetKey, Texture2D> addRemap,
Action<IEnumerable<UnityPath>> onCompleted = null)

View File

@ -7,7 +7,7 @@ using UnityEngine;
namespace UniGLTF
{
public sealed class IGltfData
public sealed class GltfData
{
/// <summary>
/// Source file path.
@ -37,11 +37,11 @@ namespace UniGLTF
public IStorage Storage { get; }
/// <summary>
///
/// Migration Flags used by ImporterContext
/// </summary>
public MigrationFlags MigrationFlags { get; }
public IGltfData(string targetPath, string json, glTF gltf, IReadOnlyList<GlbChunk> chunks, IStorage storage, MigrationFlags migrationFlags)
public GltfData(string targetPath, string json, glTF gltf, IReadOnlyList<GlbChunk> 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,

View File

@ -19,7 +19,7 @@ namespace UniGLTF
IReadOnlyDictionary<SubAssetKey, UnityEngine.Object> _externalObjectMap;
public ImporterContext(
IGltfData data,
GltfData data,
IReadOnlyDictionary<SubAssetKey, UnityEngine.Object> 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;

View File

@ -10,7 +10,7 @@ namespace UniGLTF
/// </summary>
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))
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -8,6 +8,6 @@ namespace UniGLTF
/// </summary>
public interface IMaterialDescriptorGenerator
{
MaterialDescriptor Get(IGltfData data, int i);
MaterialDescriptor Get(GltfData data, int i);
}
}

View File

@ -15,7 +15,7 @@ namespace UniGLTF
_path = path;
}
public IGltfData Parse()
public GltfData Parse()
{
var ext = Path.GetExtension(_path).ToLower();
switch (ext)

View File

@ -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();

View File

@ -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<GlbChunk> chunks, IStorage storage, MigrationFlags migrationFlags)
public static GltfData ParseGltf(string path, string json, IReadOnlyList<GlbChunk> 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)

View File

@ -24,7 +24,7 @@ namespace UniGLTF
_gltfRootPath = Path.GetDirectoryName(gltfFilePath);
}
public IGltfData Parse()
public GltfData Parse()
{
var binary = File.ReadAllBytes(_gltfFilePath);

View File

@ -18,7 +18,7 @@ namespace UniGLTF
_storage = storage ?? new SimpleStorage(new ArraySegment<byte>());
}
public IGltfData Parse()
public GltfData Parse()
{
return GlbLowLevelParser.ParseGltf(
string.Empty,

View File

@ -23,7 +23,7 @@ namespace UniGLTF
_zippedFilePath = zippedFilePath;
}
public IGltfData Parse()
public GltfData Parse()
{
var binary = File.ReadAllBytes(_zippedFilePath);

View File

@ -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);

View File

@ -27,10 +27,10 @@ namespace UniGLTF
/// </summary>
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
/// <summary>
/// glTF 全体で使うテクスチャーを列挙。
/// </summary>
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)
{

View File

@ -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;

View File

@ -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
/// <param name="root"></param>
static void EditorLoad(FileInfo gltf, int subStrStart)
{
IGltfData data = null;
GltfData data = null;
try
{
data = new AmbiguousGltfFileParser(gltf.FullName).Parse();

View File

@ -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,

View File

@ -21,7 +21,7 @@ namespace VRM
public VRM.glTF_VRM_extensions VRM { get; private set; }
public VRMImporterContext(
IGltfData data,
GltfData data,
IReadOnlyDictionary<SubAssetKey, Object> externalObjectMap = null,
ITextureDeserializer textureDeserializer = null)
: base(data, externalObjectMap, textureDeserializer)

View File

@ -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)

View File

@ -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 を許容する

View File

@ -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))

View File

@ -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)
{

View File

@ -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)

View File

@ -17,7 +17,7 @@ namespace VRM
public void TextureEnumerationTest()
{
{
var data = IGltfData.CreateFromGltfData(
var data = GltfData.CreateFromGltfData(
new glTF
{
images = new List<glTFImage>
@ -88,7 +88,7 @@ namespace VRM
[Test]
public void TextureEnumerationInUnknownShader()
{
var data = IGltfData.CreateFromGltfData(
var data = GltfData.CreateFromGltfData(
new glTF
{
images = new List<glTFImage>

View File

@ -18,7 +18,7 @@ namespace UniVRM10
public RemapEditorVrm(IEnumerable<SubAssetKey> 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 対象となる
///
/// </summary>
public static void Extract(ScriptedImporter importer, IGltfData data)
public static void Extract(ScriptedImporter importer, GltfData data)
{
if (string.IsNullOrEmpty(importer.assetPath))
{

View File

@ -18,7 +18,7 @@ namespace UniVRM10
/// <summary>
/// VMRC_materials_mtoon の場合にマテリアル生成情報を作成する
/// </summary>
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,

View File

@ -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))

View File

@ -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));

View File

@ -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
{

View File

@ -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
/// <summary>
/// glTF 全体で使うテクスチャーを列挙する
/// </summary>
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
/// <summary>
/// VRM-1 の thumbnail テクスチャー。gltf.textures ではなく gltf.images の参照であることに注意(sampler等の設定が無い)
/// </summary>
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)
{

View File

@ -21,7 +21,7 @@ namespace UniVRM10
IReadOnlyDictionary<SubAssetKey, UnityEngine.Object> 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<SubAssetKey, UnityEngine.Object> externalObjectMap = null,
ITextureDeserializer textureDeserializer = null)
: base(data, externalObjectMap, textureDeserializer)

View File

@ -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;

View File

@ -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<UniGLTF.IBytesBuffer> Buffers;
@ -26,7 +26,7 @@ namespace UniVRM10
/// </summary>
public Vrm10Storage()
{
m_data = new IGltfData(
m_data = new GltfData(
string.Empty,
string.Empty,
new glTF
@ -50,7 +50,7 @@ namespace UniVRM10
/// </summary>
/// <param name="json"></param>
/// <param name="bin"></param>
public Vrm10Storage(UniGLTF.IGltfData data)
public Vrm10Storage(UniGLTF.GltfData data)
{
m_data = data;

View File

@ -39,7 +39,7 @@ namespace UniVRM10.Test
return ToUnity(result.Data, result.Vrm);
}
private (GameObject, IReadOnlyList<VRMShaders.MaterialFactory.MaterialLoadInfo>) ToUnity(IGltfData data, VRMC_vrm vrm)
private (GameObject, IReadOnlyList<VRMShaders.MaterialFactory.MaterialLoadInfo>) ToUnity(GltfData data, VRMC_vrm vrm)
{
// Model => Unity
using (var loader = new Vrm10Importer(data, vrm))

View File

@ -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))
{