Whinarn / UnityMeshSimplifier

Mesh simplification for Unity.
MIT License
1.76k stars 277 forks source link

Meshes are always readable in Editor #20

Closed hybridherbst closed 4 years ago

hybridherbst commented 5 years ago

Despite what mesh.isReadable says, meshes are always readable in Editor Mode and readable in Play Mode when accessed from an Editor Script (not through game logic - see https://docs.unity3d.com/ScriptReference/Mesh-isReadable.html).

This PR addresses that; unfortunately some of the functionality is hidden behind reflection and not exposed in Unity.

I mostly copied the code from my other PR here that fixed the same thing on a Unity project: https://github.com/Unity-Technologies/usd-unity-sdk/pull/123 - this also contains some of the reasoning behind this and why the reflection is necessary.

Long story short: this PR allows to generate LODs from the LODGeneratorHelper even if mesh.isReadable is false.

Whinarn commented 5 years ago

Hi @soraryu ! I just wanted to let you know that I know about your issues and PRs, but I haven't yet had enough time to properly go through and review or reply yet. I hope that I can get some time this weekend. Sorry for the wait!

hybridherbst commented 4 years ago

Hi @Whinarn , any news? :)

Whinarn commented 4 years ago

Hi @soraryu! Sorry I have been busy preparing for moving between countries and have forgotten about your pull requests. I will look through them now.