mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-11 21:38:56 -05:00
Merge pull request #2613 from cpetry/master
#2612 - Empty primitive meshes
This commit is contained in:
@@ -310,9 +310,6 @@ namespace UniGLTF
|
||||
{
|
||||
var node = data.GLTF.nodes[channel.target.node];
|
||||
var mesh = data.GLTF.meshes[node.mesh];
|
||||
var primitive = mesh.primitives.FirstOrDefault();
|
||||
var targets = primitive.targets;
|
||||
|
||||
if (!gltf_mesh_extras_targetNames.TryGet(mesh, out List<string> targetNames))
|
||||
{
|
||||
throw new UniGLTFNotSupportedException("glTF BlendShape Animation. targetNames invalid.");
|
||||
|
||||
@@ -78,6 +78,10 @@ namespace UniGLTF
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (Mesh.triangles.Length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (Materials == null)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -273,6 +273,12 @@ namespace UniGLTF
|
||||
? MeshExporter_DividedVertexBuffer.Export(_data, unityMesh, Materials, m_settings.InverseAxis.Create(), m_settings)
|
||||
: MeshExporter_SharedVertexBuffer.Export(_data, unityMesh, Materials, m_settings.InverseAxis.Create(), m_settings)
|
||||
;
|
||||
|
||||
if (gltfMesh.primitives == null || gltfMesh.primitives.Count == 0)
|
||||
{
|
||||
Debug.LogError($"gltfMesh.primitives is empty: {unityMesh.Mesh.name}");
|
||||
}
|
||||
|
||||
_gltf.meshes.Add(gltfMesh);
|
||||
Meshes.Add(unityMesh.Mesh);
|
||||
if (!MeshBlendShapeIndexMap.ContainsKey(unityMesh.Mesh))
|
||||
|
||||
Reference in New Issue
Block a user