Skip to content

Commit

Permalink
Pull request KhronosGroup#9: ARES-2233 moving the BakeMesh out of Uni…
Browse files Browse the repository at this point in the history
…tyGltf

Merge in ARES/ares.unity_gltf from ARES-2233-terrain-flattening to ares

Squashed commit of the following:

commit 73c7e9dfe4724e44a21655cb5151b9323b3b3576
Author: Jason Schutz <[email protected]>
Date:   Fri Mar 5 11:49:59 2021 -0500

    ARES-2233 moving the BakeMesh out of UnityGltf
  • Loading branch information
js-dignitas committed Mar 15, 2021
1 parent c173451 commit 41fe510
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions UnityGLTF/Assets/UnityGLTF/Scripts/GLTFSceneImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -990,11 +990,6 @@ async Task ConstructUnityTextureFromBytes(byte[] buffer, int offset, int length,
if (doTextureCompression)
{
texture.Compress(true);
if (verbose)
{
var raw = texture.GetRawTextureData();
Debug.Log("Compressed format: " + texture.format + ", size: " + raw.Length + ",mips: " + texture.mipmapCount + ", bytes: " + raw[0] + " " + raw[1] + " " + raw[2] + " " + raw[3]);
}
}
}
textureRef.texture = texture;
Expand Down Expand Up @@ -1782,20 +1777,6 @@ protected virtual async Task ConstructMesh(GLTFMesh mesh, Transform parent, int
meshFilter.sharedMesh = curMesh;
}

// Doing this after the mesh is assigned to the MeshFilter because
// sometimes when terrain is replaced, the first mesh is destroyed after
// the call to BakeMesh to no known reason
#if UNITY_2019_3_OR_NEWER
if (this.Collider == ColliderType.Mesh)
{
int unityMeshId = curMesh.GetInstanceID();
await Task.Run(() => Physics.BakeMesh(unityMeshId, false));
if (mesh == null)
{
Debug.Log("Mesh is now null after baking the colliders!");
}
}
#endif
UnityEngine.Collider collider = null;
switch (Collider)
{
Expand Down

0 comments on commit 41fe510

Please sign in to comment.