Skip to content

Commit

Permalink
fix Null Reference Exeption during Priitives export when a GameObject…
Browse files Browse the repository at this point in the history
… contain both MeshFilter and SkinnedMeshRenderer components
  • Loading branch information
plepers committed Apr 12, 2020
1 parent 1e00333 commit c5349dd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ private MeshPrimitive[] ExportPrimitive(GameObject gameObject, GLTFMesh mesh)
Debug.LogError(string.Format("MeshFilter.sharedMesh on gameobject:{0} is missing , skipping", gameObject.name));
return null;
}

var renderer = gameObject.GetComponent<MeshRenderer>();
var renderer = gameObject.GetComponent<Renderer>();
var materialsObj = renderer != null ? renderer.sharedMaterials : smr.sharedMaterials;

var prims = new MeshPrimitive[meshObj.subMeshCount];
Expand Down

0 comments on commit c5349dd

Please sign in to comment.