fix primitive.material

This commit is contained in:
ousttrue
2021-04-21 16:44:45 +09:00
parent b90e781773
commit 366ea016f7
2 changed files with 7 additions and 7 deletions

View File

@@ -316,7 +316,7 @@ namespace UniVRM10
var prim = new glTFPrimitives
{
mode = (int)mesh.Topology,
material = materials.IndexOf(y.Material),
material = y.Material,
indices = indicesAccessorIndex,
attributes = new glTFAttributes(),
};

View File

@@ -162,12 +162,6 @@ namespace UniVRM10
Reserve(reserveBytes);
}
// mesh
ExportMeshes(model.MeshGroups, model.Materials, option);
// node
ExportNodes(model.Root, model.Nodes, model.MeshGroups, option);
// material
var materialExporter = new Vrm10MaterialExporter();
foreach (Material material in model.Materials)
@@ -176,6 +170,12 @@ namespace UniVRM10
Storage.Gltf.materials.Add(glTFMaterial);
}
// mesh
ExportMeshes(model.MeshGroups, model.Materials, option);
// node
ExportNodes(model.Root, model.Nodes, model.MeshGroups, option);
var (vrm, vrmSpringBone, thumbnailTextureIndex) = ExportVrm(root, model, converter, metaObject);
// Extension で Texture が増える場合があるので最後に呼ぶ