Use Mesh.subMeshCount to set the number of submeshes, then SetTriangles to set the triangle list for each submesh. There isn’t a “main” mesh in this case. Then, make a Material array (where each material corresponds to each submesh), and set renderer.materials to that Material array.
You can’t have submeshes as children. The point of submeshes is that they are all part of the same mesh. If you want children, just make separate meshes.
Yes, the only purpose of using submeshes is to be able to use different materials on each submesh. There's no other advantage. If you have a mesh that is too big for a single mesh, split it into multiple objects. That means a new Gameobject, a new mesh, a new MeshRenderer / MeshFilter. This new object can be the child of your first object by setting it's <a href="http://docs.unity3d.com/Documentation/ScriptReference/Transform-parent.html">transform.parent</a> to your parent object's transform.
Definitely not. As I mentioned, if you want the meshes to be separate like that, you should just make them as separate meshes and attach them to child GameObjects. In this case submeshes are not what you want at all.
And hopefully I can use different transformations for each submesh, right?
you may be able to add a bone like in blender pragmatically if you can’t achieveit using SkinnedMeshRenderer.bones Unity - Scripting API: SkinnedMeshRenderer.bones
look at how blender does it (all in easy to read python) but it looks like unity imports the bone data to the public Transform SkinnedMeshRenderer.bones
my bet is that one bone is made up of a set of 2 transforms, i don’t know what other arrays you might need to populate to connect the vertices if that even how its done…
this is how blender would do some mesh setup bone set up… https://wiki.blender.org/index.php/Dev:Py/Scripts/Cookbook/Code_snippets/Three_ways_to_create_objects
at worse this could also export it to your server via file transfer or even ftp, python is awesome, if you need a web hook just use yo the social network api
just stuff i ran into doing research to see how I would add some features im working on …
@Fattie: thanks for the help. So the submesh index 0 is the first submesh? Or it's the main mesh?
– Heisenbugthis is what all of you are looking for: https://answers.unity.com/questions/1436857/small-submesh-example.html don't forget to add the Mesh.Clear(); at the top and not accidentally erase the Mesh.subMeshCount; like I was doing.
– mexicano