mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-12 22:10:11 -05:00
コード整理。IMaterialValidator.EnumerateTextureProperties 追加した
Exporter がテクスチャー列挙という形式をとらずに全部展開してするという手法を取っているため、それほど共通化されない。
This commit is contained in:
@@ -124,6 +124,9 @@ namespace VRM
|
||||
m_meshes = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// VRM0
|
||||
/// </summary>
|
||||
class VRMMaterialValidator : DefaultMaterialValidator
|
||||
{
|
||||
public override string GetGltfMaterialTypeFromUnityShaderName(string shaderName)
|
||||
@@ -135,6 +138,26 @@ namespace VRM
|
||||
}
|
||||
return base.GetGltfMaterialTypeFromUnityShaderName(shaderName);
|
||||
}
|
||||
|
||||
public override IEnumerable<(string propertyName, Texture texture)> EnumerateTextureProperties(Material m)
|
||||
{
|
||||
if (m.shader.name != "VRM/MToon")
|
||||
{
|
||||
foreach (var x in base.EnumerateTextureProperties(m))
|
||||
{
|
||||
yield return x;
|
||||
}
|
||||
}
|
||||
|
||||
var prop = UniGLTF.ShaderPropExporter.PreShaderPropExporter.GetPropsForSupportedShader(m.shader.name);
|
||||
foreach (var kv in prop.Properties)
|
||||
{
|
||||
if (kv.ShaderPropertyType == UniGLTF.ShaderPropExporter.ShaderPropertyType.TexEnv)
|
||||
{
|
||||
yield return (kv.Key, m.GetTexture(kv.Key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override IEnumerable<Validator> ValidatorFactory()
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"VRMShaders.GLTF.IO.Runtime",
|
||||
"VRMShaders.GLTF.IO.Editor",
|
||||
"UniGLTF",
|
||||
"UniGLTF.Editor"
|
||||
"UniGLTF.Editor",
|
||||
"VRMShaders.VRM.IO.Runtime"
|
||||
],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [
|
||||
|
||||
Reference in New Issue
Block a user