ElmarJ / waterlooplein-timemachine

3D time machine reconstruction of the of the Amsterdam Waterlooplein neighborhood between 1800 and 2000.
https://waterloopleintimemachine.nl
GNU General Public License v3.0
14 stars 3 forks source link

Probuilder meshes are stored in scene file #109

Open ElmarJ opened 2 years ago

ElmarJ commented 2 years ago

Even though all buildings and other city-elements reside in (single instance) prefabs, there are still details about all the buildings in the main MainScene file. Specifically, all the probuilder meshes remain stored in the Prefab, even after applying overrides to the prefab.

The prevents the code from being truly modularized over different files, and more specifically messes up git merge as it is almost imposible to have commit that does not in some way alter the enormous and disorganized MainScene file.

More details about the underlying Probuilder bug can be found here https://issuetracker.unity3d.com/issues/probuilder-mesh-slash-mesh-collider-changes-do-not-get-applied-to-prefab and another report here https://forum.unity.com/threads/probuilder-prefab-mode.621154/

In the end it would be nice if we could ditch the probuilder dependancy altogether, right after generating the buildings. This requires solving https://github.com/ElmarJ/GeoJsonCityBuilder/issues/15 .

ElmarJ commented 2 years ago

According to the bugtracker on Unity, this is now solved? Might be worth checking out whether a probuilder upgrade solves the issue.

ElmarJ commented 2 years ago

Even after update, this problem persists. Weirdly enough, even when removing all probuilder scripts, the meshes keep being stored as overrides in the scene...

ElmarJ commented 2 years ago

Did some further research. Some points:

  1. Meshes are references to external assets, so cannot be applied to a prefab (as the mesh wouldn't be available from the prefab, it resides in the Scene).
  2. Even when generating the buildings in the prefab editor, Probuilder seems to store the data in the Scene, again creating overrides
  3. Stripping probuilder from the prefab results in missing meshes (although that is not immediatly visible in the prefab editor).

Solution might be to generate all meshes as files (export from probuilder).