mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-08 03:48:19 -05:00
rename VRMMtoonMaterialImporter to VRMMaterialImporter
This commit is contained in:
@@ -149,7 +149,7 @@ namespace VRM
|
||||
.Where(x => x.IsUsed)
|
||||
.Select(x => (new SubAssetKey(typeof(Texture2D), x.Texture.name), x.Texture))
|
||||
.ToArray();
|
||||
var vrmTextures = new VRMMtoonMaterialImporter(m_context.VRM);
|
||||
var vrmTextures = new VRMMaterialImporter(m_context.VRM);
|
||||
var dirName = $"{m_prefabPath.FileNameWithoutExtension}.Textures";
|
||||
TextureExtractor.ExtractTextures(m_context.Parser, m_prefabPath.Parent.Child(dirName), vrmTextures.EnumerateAllTexturesDistinct, subAssets, (_x, _y) => { }, onTextureReloaded);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace VRM
|
||||
using (var context = new VRMImporterContext(parser, map))
|
||||
{
|
||||
var editor = new VRMEditorImporterContext(context, prefabPath);
|
||||
foreach (var (key, textureInfo) in new VRMMtoonMaterialImporter(context.VRM).EnumerateAllTexturesDistinct(parser))
|
||||
foreach (var (key, textureInfo) in new VRMMaterialImporter(context.VRM).EnumerateAllTexturesDistinct(parser))
|
||||
{
|
||||
TextureImporterConfigurator.Configure(textureInfo, map.ToDictionary(x => x.name, x => x.texture as Texture2D));
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace VRM
|
||||
using (var context = new VRMImporterContext(parser, map))
|
||||
{
|
||||
var editor = new VRMEditorImporterContext(context, prefabPath);
|
||||
foreach (var (key, textureInfo) in new VRMMtoonMaterialImporter(context.VRM).EnumerateAllTexturesDistinct(parser))
|
||||
foreach (var (key, textureInfo) in new VRMMaterialImporter(context.VRM).EnumerateAllTexturesDistinct(parser))
|
||||
{
|
||||
TextureImporterConfigurator.Configure(textureInfo, map.ToDictionary(x => x.name, x => x.texture as Texture2D));
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace VRM
|
||||
{
|
||||
VRM = vrm;
|
||||
// override material importer
|
||||
GltfMaterialImporter.GltfMaterialParamProcessors.Insert(0, new VRMMtoonMaterialImporter(VRM).TryCreateParam);
|
||||
GltfMaterialImporter.GltfMaterialParamProcessors.Insert(0, new VRMMaterialImporter(VRM).TryCreateParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ using VRMShaders;
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class VRMMtoonMaterialImporter
|
||||
public class VRMMaterialImporter
|
||||
{
|
||||
readonly glTF_VRM_extensions m_vrm;
|
||||
public VRMMtoonMaterialImporter(glTF_VRM_extensions vrm)
|
||||
public VRMMaterialImporter(glTF_VRM_extensions vrm)
|
||||
{
|
||||
m_vrm = vrm;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bad75b40d017eb74ba79f561d22dc372
|
||||
guid: 9dd63f87d0de96f4ca4ad4dcd8540584
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -30,7 +30,7 @@ namespace VRM
|
||||
var vrmMaterial = VRMMaterialExporter.CreateFromMaterial(srcMaterial, textureManager);
|
||||
Assert.AreEqual(vrmMaterial.vectorProperties["_MainTex"], new float[] { 0.3f, 0.2f, 0.5f, 0.6f });
|
||||
|
||||
var materialImporter = new VRMMtoonMaterialImporter(new glTF_VRM_extensions
|
||||
var materialImporter = new VRMMaterialImporter(new glTF_VRM_extensions
|
||||
{
|
||||
materialProperties = new System.Collections.Generic.List<glTF_VRM_Material> { vrmMaterial }
|
||||
});
|
||||
@@ -49,7 +49,7 @@ namespace VRM
|
||||
|
||||
var importer = new VRMImporterContext(parser, null);
|
||||
|
||||
var materialImporter = new VRMMtoonMaterialImporter(importer.VRM);
|
||||
var materialImporter = new VRMMaterialImporter(importer.VRM);
|
||||
|
||||
Assert.AreEqual(73, parser.GLTF.materials.Count);
|
||||
Assert.True(materialImporter.TryCreateParam(parser, 0, out MaterialImportParam param));
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace VRM
|
||||
},
|
||||
}
|
||||
};
|
||||
var items = new VRMMtoonMaterialImporter(vrm).EnumerateAllTexturesDistinct(parser).ToArray();
|
||||
var items = new VRMMaterialImporter(vrm).EnumerateAllTexturesDistinct(parser).ToArray();
|
||||
Assert.AreEqual(1, items.Length);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user