So, I’m using Maya as a modelling program, and I’ve been having this issue for a while. So far I’ve been able to ignore it, but as the number of different meshes racks up, it’s becoming more and more of a problem. It seems that no matter what I do, Unity always imports the mesh as a prefab, containing another prefab and the mesh itself. However, both the contained prefab and the mesh are named “default”, and I cannot work out how to change this. I really need to be able to give my meshes sensible names, because when selecting a mesh in the inspector, it is these that show up, which means I have a selection of many different meshes, all named “default”. I’m not sure what I’m doing wrong, but I can’t work out where it could be getting this from, as as far as I know, Maya has not named anything “default”. Could anyone tell me how I can set the names of meshes I export from Maya? Or how to rename existing meshes in Unity?
Hey You can Rename your mesh in Maya before export it to .obj,As follow…
- select your mesh in maya and go to outline and rename your mesh which you required .
- export it to .Obj .
you will get which you required
I am Attaching screen shots of maya and unity ,you can check it .
ok, so I think I found a partial solution for this:
When exporting an .OBJ from Maya, in the export dialog box there are some options.
If you turn on the ‘Groups’ option, export your mesh, and import into Unity you should find that the submesh has taken the name based on the hierarchy of your scene.
That doesnt allow you to name it separately from the mesh when theres only one mesh in the export but it may be different for exports with multiple submeshes.
This has to do with the ‘group’ header inside the OBJ file. If the mesh is saved with groups, it will give each group a name and Unity will load those names inside the main OBJ in the Project view.
You can choose the option to save the mesh with Groups on in both Maya & Blender. Or you could manually inspect the OBJ file (open it in any text editor), and add a group name, e.g. here’s a simple cube OBJ (Note the line starting with ‘g’ – that’s the group label):
v -0.500000 -0.500000 0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 0.500000 0.500000
v 0.500000 0.500000 0.500000
v -0.500000 0.500000 -0.500000
v 0.500000 0.500000 -0.500000
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
g pCube1
f 1/1/1 2/2/2 4/4/3 3/3/4
f 3/3/5 4/4/6 6/6/7 5/5/8
f 5/5/9 6/6/10 8/8/11 7/7/12
f 7/7/13 8/8/14 2/10/15 1/9/16
f 2/2/17 8/11/18 6/12/19 4/4/20
f 7/13/21 1/1/22 3/3/23 5/14/24
If you save the above text as an OBJ file and load into Unity, it should load with the mesh object called ‘pCube1’ instead of ‘default’