Skip to content

Commit

Permalink
Merge pull request #2 from owilliamailliwo/feature/no-enable-renderer
Browse files Browse the repository at this point in the history
Don`t export primitives if the MeshRenderer or SkinnedMeshRenderer is…
  • Loading branch information
hybridherbst authored Oct 2, 2020
2 parents 87be36c + 7fb0f9f commit 646a69e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,10 @@ private CameraId ExportCamera(Camera unityCamera)

private static bool ContainsValidRenderer(GameObject gameObject)
{
return (gameObject.GetComponent<MeshFilter>() != null && gameObject.GetComponent<MeshRenderer>() != null)
|| (gameObject.GetComponent<SkinnedMeshRenderer>() != null);
var meshRender = gameObject.GetComponent<MeshRenderer>();
var meshFilter = gameObject.GetComponent<MeshFilter>();
var skinnedMeshRender = gameObject.GetComponent<SkinnedMeshRenderer>();
return (meshFilter != null && meshRender != null && meshRender.enabled) || (skinnedMeshRender != null && skinnedMeshRender.enabled);
}

private void FilterPrimitives(Transform transform, out GameObject[] primitives, out GameObject[] nonPrimitives)
Expand Down

0 comments on commit 646a69e

Please sign in to comment.