mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-06-02 22:14:30 -05:00
follow test
This commit is contained in:
parent
86d1dc0db7
commit
157c7091f7
|
|
@ -56,7 +56,7 @@ namespace UniGLTF
|
|||
s_foldTextures = EditorGUILayout.Foldout(s_foldTextures, "Remapped Textures");
|
||||
if (s_foldTextures)
|
||||
{
|
||||
importer.DrawRemapGUI<UnityEngine.Texture>(textureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct().Select(x => x.SubAssetKey));
|
||||
importer.DrawRemapGUI<UnityEngine.Texture>(textureSetImporter.GetTextureImportParamSet().GetEnumerable().Select(x => x.SubAssetKey));
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Clear"))
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace UniGLTF
|
|||
using (var loader = new ImporterContext(parser, extractedObjects))
|
||||
{
|
||||
// Configure TextureImporter to Extracted Textures.
|
||||
foreach (var textureInfo in loader.TextureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct())
|
||||
foreach (var textureInfo in loader.TextureSetImporter.GetTextureImportParamSet().GetEnumerable())
|
||||
{
|
||||
TextureImporterConfigurator.Configure(textureInfo, loader.TextureFactory.ExternalTextures);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace UniGLTF
|
|||
Action<IEnumerable<UnityPath>> onCompleted = null)
|
||||
{
|
||||
var extractor = new TextureExtractor(parser, textureDirectory, subAssets);
|
||||
foreach (var param in textureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct())
|
||||
foreach (var param in textureSetImporter.GetTextureImportParamSet().GetEnumerable())
|
||||
{
|
||||
extractor.Extract(param.SubAssetKey, param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ namespace UniGLTF
|
|||
|
||||
public async Task LoadTexturesAsync()
|
||||
{
|
||||
var textures = TextureSetImporter.GetTextureImportParamSet().GetTextureParamsDistinct();
|
||||
var textures = TextureSetImporter.GetTextureImportParamSet().GetEnumerable();
|
||||
foreach (var param in textures)
|
||||
{
|
||||
var tex = await TextureFactory.GetTextureAsync(param);
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ namespace UniGLTF
|
|||
}
|
||||
|
||||
// should unique
|
||||
var gltfTextures = new GltfTextureSetImporter(parser).GetTextureParamsDistinct()
|
||||
var gltfTextures = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable()
|
||||
.Select(x => x.SubAssetKey)
|
||||
.ToArray();
|
||||
var distinct = gltfTextures.Distinct().ToArray();
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ namespace UniGLTF
|
|||
{
|
||||
GLTF = TwoTexture(),
|
||||
};
|
||||
var items = new GltfTextureSetImporter(parser).GetTextureParamsDistinct().ToArray();
|
||||
var items = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable().ToArray();
|
||||
Assert.AreEqual(2, items.Length);
|
||||
}
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ namespace UniGLTF
|
|||
{
|
||||
GLTF = TwoTextureOneUri(),
|
||||
};
|
||||
var items = new GltfTextureSetImporter(parser).GetTextureParamsDistinct().ToArray();
|
||||
var items = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable().ToArray();
|
||||
Assert.AreEqual(1, items.Length);
|
||||
}
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ namespace UniGLTF
|
|||
{
|
||||
GLTF = TwoTextureOneImage(),
|
||||
};
|
||||
var items = new GltfTextureSetImporter(parser).GetTextureParamsDistinct().ToArray();
|
||||
var items = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable().ToArray();
|
||||
Assert.AreEqual(1, items.Length);
|
||||
}
|
||||
|
||||
|
|
@ -234,7 +234,7 @@ namespace UniGLTF
|
|||
{
|
||||
GLTF = CombineMetallicSmoothOcclusion(),
|
||||
};
|
||||
var items = new GltfTextureSetImporter(parser).GetTextureParamsDistinct().ToArray();
|
||||
var items = new GltfTextureSetImporter(parser).GetTextureImportParamSet().GetEnumerable().ToArray();
|
||||
Assert.AreEqual(1, items.Length);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,8 @@ namespace UniGLTF
|
|||
|
||||
// extractor
|
||||
var extractor = new TextureExtractor(parser, UnityPath.FromUnityPath(""), context.TextureFactory.ConvertedTextures);
|
||||
var m = context.TextureSetImporter.GetTextureParamsDistinct().FirstOrDefault(x => x.SubAssetKey.Name == "texture_1.standard");
|
||||
var m = context.TextureSetImporter.GetTextureImportParamSet().GetEnumerable()
|
||||
.FirstOrDefault(x => x.SubAssetKey.Name == "texture_1.standard");
|
||||
|
||||
Assert.Catch<NotImplementedException>(() => extractor.Extract(m.SubAssetKey, m));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace VRM
|
|||
using (var context = new VRMImporterContext(parser, map))
|
||||
{
|
||||
var editor = new VRMEditorImporterContext(context, prefabPath);
|
||||
foreach (var textureInfo in editor.TextureSetImporter.GetTextureParamsDistinct())
|
||||
foreach (var textureInfo in editor.TextureSetImporter.GetTextureImportParamSet().GetEnumerable())
|
||||
{
|
||||
VRMShaders.TextureImporterConfigurator.Configure(textureInfo, context.TextureFactory.ExternalTextures);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace VRM
|
|||
using (var context = new VRMImporterContext(parser, map))
|
||||
{
|
||||
var editor = new VRMEditorImporterContext(context, prefabPath);
|
||||
foreach (var textureInfo in context.TextureSetImporter.GetTextureParamsDistinct())
|
||||
foreach (var textureInfo in context.TextureSetImporter.GetTextureImportParamSet().GetEnumerable())
|
||||
{
|
||||
VRMShaders.TextureImporterConfigurator.Configure(textureInfo, context.TextureFactory.ExternalTextures);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace VRM
|
|||
},
|
||||
}
|
||||
};
|
||||
var items = new VRMTextureSetImporter(parser, vrm).GetTextureParamsDistinct().ToArray();
|
||||
var items = new VRMTextureSetImporter(parser, vrm).GetTextureImportParamSet().GetEnumerable().ToArray();
|
||||
Assert.AreEqual(1, items.Length);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ namespace UniVRM10
|
|||
using (var loader = new Vrm10Importer(parser, extractedObjects))
|
||||
{
|
||||
// settings TextureImporters
|
||||
foreach (var textureInfo in loader.TextureSetImporter.GetTextureParamsDistinct())
|
||||
foreach (var textureInfo in loader.TextureSetImporter.GetTextureImportParamSet().GetEnumerable())
|
||||
{
|
||||
VRMShaders.TextureImporterConfigurator.Configure(textureInfo, loader.TextureFactory.ExternalTextures);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace VRMShaders
|
||||
{
|
||||
/// <summary>
|
||||
/// TextureImportParam の集合を Unique な集合にする。
|
||||
/// </summary>
|
||||
public sealed class TextureImportParamSet
|
||||
{
|
||||
private readonly Dictionary<SubAssetKey, TextureImportParam> _params = new Dictionary<SubAssetKey, TextureImportParam>();
|
||||
|
|
@ -13,7 +16,7 @@ namespace VRMShaders
|
|||
_params.Add(param.SubAssetKey, param);
|
||||
}
|
||||
|
||||
public IEnumerable<TextureImportParam> GetTextureParamsDistinct()
|
||||
public IEnumerable<TextureImportParam> GetEnumerable()
|
||||
{
|
||||
foreach (var kv in _params)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user