- Home /
How can I modify the mesh in OnPostprocessModel?
I've had success modifying GameObject structure in OnPostprocessModel, and I do not need to do anything special to have the changes saved. However, when I try to make modifications to the mesh, the results are ignored.
What would be the best way to do this?
I start off by getting the MeshFilter...
MeshFilter filter = go.GetComponentInChildren< MeshFilter >();
And then with the filter I attempt to make a change...
filter.sharedMesh.triangles[ 0 ] = newtriangle;
Answer by Lucas Meijer 1 · May 27, 2010 at 12:04 AM
This is supposed to work. If you could file a bug on this, great. (UnityMenu->Help->Report a Problem). I'll add writing a testcase to our testframework for this scenario to my todolist.
Thanks for the response! Bug 353813 filed with some example code.
Answer by Bezzy · Feb 10, 2012 at 04:18 PM
This was a while ago, but I'd be interested to know if it has worked? I'd quite like a "cheap" way of setting up geometry based silhouettes on models, without resorting to shaders.
Your answer
Follow this Question
Related Questions
How do I access Mesh/ Meshfilter in Editor code? 3 Answers
Weird issue with mesh.Clear() 1 Answer
Prevent Unity from serializing MeshFilter.mesh 1 Answer
Is there any way to reset the default meshes? 3 Answers
Mesh memory leak error 0 Answers