Skip to content

Commit

Permalink
fixed draco ifdef compiler error + nullref fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pfcDorn committed Oct 24, 2023
1 parent f6634ad commit 660161e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Runtime/Scripts/SceneImporter/ImporterMeshes.cs
Expand Up @@ -351,7 +351,7 @@ protected async Task ConstructUnityMesh(GLTFMesh gltfMesh,DracoMeshLoader.Decode
var firstPrim = gltfMesh.Primitives[0];
var unityMeshData = CreateUnityMeshData(gltfMesh, firstPrim, verticesLength,true);

int vertOffset = 0;
uint vertOffset = 0;
var meshCache = _assetCache.MeshCache[meshIndex];

unityMeshData.BoneWeights = mesh.boneWeights;
Expand All @@ -367,7 +367,7 @@ protected async Task ConstructUnityMesh(GLTFMesh gltfMesh,DracoMeshLoader.Decode
{
ConvertAttributeAccessorsToUnityTypes(primCache, unityMeshData, vertOffset, i);
}
vertOffset += mesh.GetSubMesh(i).vertexCount;
vertOffset += (uint)mesh.GetSubMesh(i).vertexCount;
}

mesh.RecalculateBounds();
Expand Down Expand Up @@ -795,7 +795,7 @@ protected virtual async Task ConstructPrimitiveAttributes(MeshPrimitive primitiv
}

// Only add vertex data when it's not already added to the unity mesh data !
if (!unityData.alreadyAddedAccessors.Contains(meshAttributes[SemanticProperties.POSITION].AccessorId.Id))
if (meshAttributes.ContainsKey(SemanticProperties.POSITION) && !unityData.alreadyAddedAccessors.Contains(meshAttributes[SemanticProperties.POSITION].AccessorId.Id))
{

if (meshAttributes.TryGetValue(SemanticProperties.POSITION, out var attrPos))
Expand Down

0 comments on commit 660161e

Please sign in to comment.