- Home /
Add submesh to imported asset?
Hi,
I would like to add another submesh to .fbx files that I import. For the test's sake, I started writing code that looks like this :
public class TestReader : AssetPostprocessor { void OnPostprocessModel(GameObject g) { Debug.Log("TestReader processing " + assetPath); Mesh mesh = new Mesh(); mesh.vertices = new Vector3[] { new Vector3(0, 0, 0), new Vector3(0, 0, 1), new Vector3(0, 1, 1) }; mesh.triangles = new int[] { 0, 1, 2 };
//How do I add it?
}
}
The question is, How do I add it to the imported model as another submesh. Does anyone know? Couldn't find it in the docs... Thanks!
Your answer
Follow this Question
Related Questions
Can't import assets 7 Answers
Importing assets 0 Answers
Update an Assest (.fbx) once added to the scene in Unity 1 Answer
Asset with guid and path is missing a legacy import error 3 Answers
Creating a Material from shader string 2 Answers