Unlit/Color だと

var index = textureExporter.RegisterExportingAsSRgb(src.mainTexture, false); // GetTexture("_MainTex");

が例外を発生させる。
This commit is contained in:
ousttrue 2024-11-12 17:53:15 +09:00
parent 791a80225f
commit a4936617f6

View File

@ -89,10 +89,14 @@ namespace UniVRM10.Test
// remove textures
instance.Vrm.Meta.Thumbnail = null;
var m = new Material(Shader.Find("Unlit/Color"));
foreach (var r in instance.GetComponentsInChildren<Renderer>())
{
r.sharedMaterials = r.sharedMaterials.Select(x => m).ToArray();
r.sharedMaterials = r.sharedMaterials.Select(x =>
{
var m = new Material(Shader.Find("UniGLTF/UniUnlit"));
return m;
}).ToArray();
}
var settings = new GltfExportSettings();