Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Save Meshes as Assets will fail with multiple CSGModels in the scene #220

Open
damagefilter opened this issue Jan 21, 2019 · 1 comment
Open

Comments

@damagefilter
Copy link
Contributor

damagefilter commented Jan 21, 2019

Basically what the title says.

It will write out the meshes next to the scene, labelled "VisualMesh" + materialMeshDictionary.MeshCount + ".asset".
While perfectly fine with one single CSG model in the scene, it breaks with multiple CSGModels. Each one has its own materialMeshDictionary (makes perfect sense too) and each one is counting from zero upward, overriding meshes from another CSGModel.

The same happens for the collision mesh of course.

I went there and looked if the names can be made unique somewhat.
Certainly, there are many ways to make it so.
Add a GUID to the file name. Add a timestamp to the file name. Add some form of Hash value. Whatever.
Those are, perhaps, not exactly pretty solutions though, hence I didn't jump straight in and PR the thing.

Anyone fancy dropping some input on this?
The places in question are MeshGroupManager.FinalizeVisualMesh and MeshGroupManager.FinalizeCollisionMesh

@vertxxyz
Copy link

If the assets are not discovered by their path a AssetDatabase.GenerateUniqueAssetPath or two should do it, but I'll let someone who knows better than me to make the changes :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants