Unity-Technologies / AutoLOD

Automatic LOD generation + scene optimization
https://blogs.unity3d.com/2018/01/12/unity-labs-autolod-experimenting-with-automatic-performance-improvements/
Other
1.84k stars 215 forks source link

Editor #33

Closed ddutchie closed 6 years ago

ddutchie commented 6 years ago

Hello Unity Labs.

I'm having an issue using this. I have cloned, pulled dependencies and imported into a project.

But whenever It tries to run it logs this:

Can't add script behaviour LODVolume because it is an editor script. To attach a script it needs to be outside the 'Editor' folder.
UnityEngine.GameObject:.ctor(String, Type[])
LODVolume:Create() (at Assets/AutoLOD/Scripts/LODVolume.cs:187)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

and this:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.AutoLOD.SceneLOD+<UpdateOctree>c__Iterator2.MoveNext () (at Assets/AutoLOD/Scripts/Editor/SceneLOD.cs:338)
UnityEngine.Experimental.AutoLOD.TimedEnumerator.MoveNext () (at Assets/AutoLOD/Scripts/Helpers/TimedEnumerator.cs:38)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

Any ideas?

fpywzywzy commented 6 years ago

the same with you

amirebrahimi commented 6 years ago

What version of Unity?

fpywzywzy commented 6 years ago

unity 2017.4.6f1

Alverik commented 6 years ago

Same on Unity 2018.2.02f, LOD meshes are generated properly (UnityMeshSimplifier seems to work really well) but I get an error when trying to "Activate SceneLOD" (same error as shown above).

Alverik commented 6 years ago

OK, it's something to do with the _AutoLOD.asmdef file, when I tick Windows x64 (my OS) in the Include platforms section and restart Unity, then SceneLOD starts working, but then it's not possible to Build the project. I notice the LODVolume script and other components are freely using some editor only API (like a few attributes and the EditorUtility class, etc)............. was it ever even possible to build a project using the SceneLOD feature?... Anyway, this is one of the coolest features I've been waiting for for a while (plus now also Kinematica and FacialMocap), so I really hope it keeps growing. Cheers and thanks in advance for the hard work!

amirebrahimi commented 6 years ago

Confirmed the problem was introduced after changing assembly definition files. Now the assembly is added back to builds. Fixed with 1f5acb9

SceneLOD is untested in builds, but theoretically should work as long as objects don't move (LOD generation doesn't work in the runtime, currently).