|
Hi, I have an object that I imported with several meshes. Some of them have nontrivial translations, and I would like to bake those translations in. The code I wrote was this :
I want to be able to do this only once per mesh, and that the next time that I add the object to the scene hierarchy it will already be fixed. The code that I wrote takes care of the mesh for good, but it only takes care of the translation for the instance that I added. This is because the sharedMesh gets saved back to the model, but the changes to the mesh filter don't get changed - the next time I will add the model, the vertices will be baked but the transform will remain the original one. Is there a way to modify the mesh's transform for future insertions into the scene?
(comments are locked)
|
|
Call your function in AssetPostprocessor.OnPostprocessModel and modify the shared mesh. This sounds useful. Where is this documented?
Oct 03 '10 at 01:24 PM
Noam
Oct 18 '10 at 02:51 PM
Paulius Liekis
(comments are locked)
|
|
You could save it as a prefab at the end of your script. The problem with that is that it is still possible to add the normalized mesh with the un-zeroed transformed afterwards, and the script will run again and transform the already transformed vertices. If what I want to do is impossible, I'll try to solve the issue in the exporting software instead.
Sep 21 '10 at 11:08 AM
Noam
(comments are locked)
|
