Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Export2Maya - Export Unity Scene to Maya Scene File

Discussion in 'Works In Progress - Archive' started by Fishypants, Mar 20, 2014.

Thread Status:
Not open for further replies.
  1. prestonplatt

    prestonplatt

    Joined:
    Mar 28, 2014
    Posts:
    9
    For some reason I was trying to import again and I cant seem to get the export to maya selection in the "Window" tab. Ive tried re importing and deleting the asset. Any suggestions??? The folder is in the assets folder as well.
     
  2. davem250

    davem250

    Joined:
    May 28, 2013
    Posts:
    186
    Hi Fishypants, i have now bought and tested your asset and you're right about the .mel script... i can get it to show me the menu bar in the top but i cannot execute the light map baking command (at least nothing happens!) so i'm guessing you're very right about that one :) but otherwise i can perfectly load my scene into MayaKT 2015 so that is very nice ;) thank you very much... see you later :)
     
  3. bahaka

    bahaka

    Joined:
    May 24, 2013
    Posts:
    1
    hello Fishypants are you still in development of the Export2maya plugin shall i invest in it?
    will you make updates and/or upgrades?
     
  4. Fishypants

    Fishypants

    Joined:
    Jan 25, 2009
    Posts:
    444
    @bahaka - Yep, still working on it. Just did a bug fix for a user yesterday for an issue they were having. I'll probably push the new version out soon with a few more features.
     
  5. Rosie-Posie

    Rosie-Posie

    Joined:
    Nov 20, 2013
    Posts:
    54
    Hello Fishypants, I've been using your plugin for a while now and its been a life saver. I encounter an issue however that is giving me some trouble. Every time I use it, the imported mesh appears to be a single object, but it is segmented into multiple un-welded islands. Am I doing something wrong? Normally I wouldn't mind manually merging my vertices by hand, but I happen to have a large number of complex objects to work with.

    Thanks for the help!

     
  6. Fishypants

    Fishypants

    Joined:
    Jan 25, 2009
    Posts:
    444
    @ Rosie Posie -
    What you are seeing is unfortunately the result of how Unity works internally. It would be impossible to get the mesh exactly out of Unity the same way it was in Maya, because when you load your mesh into Unity it converts it into how it likes to use meshes.

    In Maya, you can have multiple shaders assigned to individual faces of a mesh, and have UV seams on your mesh but it will still look like a single mesh. The vertices will still be welded together.

    In Unity however, this is not the case. Anywhere there are multiple shaders assigned to faces, Unity will actually split your mesh so each mesh will only have 1 material assigned to it, but have multiple meshes. It stores these meshes as submeshes, and that is one of the reasons why draw calls go up with meshes with multi-materials. It will also split your mesh along any UV seams, and it will split it depending on if you have smoothed or hard vertex normals.

    It's kind of annoying how it works, but Unity does this because the way it stores the data is very fast and efficient for real time use. Trying to work with data the way Maya stores it is really bad and very slow for trying to be used in real time applications. The way Unity stores data however is horrible though for polygon editing, which is why Maya stores it the way it does. Maya is less concerned with realtime speed and more about easy data access and manipulation.

    If I were to guess, by looking at your screen shot I would say the side that is "detached" is probably along a UV seam and that is why it isn't welded to the main mesh.

    Unfortunately theres really no easy way to tell which vertices should be welded or not. It's just the way Unity works. What you are seeing in Maya when you export your meshes is a raw data dump of how Unity has the meshes stored.

    In Maya you could always try the Edit Polygons > Merge tool, with a very low value like 0.0001. This will weld all the vertices if they are touching each other. It might give you what you want. If you would like to do this to many objects at once, select the objects you want to weld and run this MEL script in Maya:

    // Get selected objects
    string $sel[] = `ls -sl -fl`;
    for($i=0; $i<size($sel); $i++){
    select -cl;
    // Check for mesh
    string $mesh[] = `listRelatives -s -type mesh -f $sel[$i]`;
    if(size($mesh)>0){
    polyMergeVertex -d 0.001 -am 1 -ch 0 $sel[$i];
    }
    }
    // Reselect objects
    select $sel;


    That code will go through every selected object, check that it is a mesh, and if so it will perform the merge command to all the selected objects. This way you can merge all the objects in your scene at once. If you have any issues, let me know.
     
  7. Rosie-Posie

    Rosie-Posie

    Joined:
    Nov 20, 2013
    Posts:
    54
    Thank you so much for the lightning fast response!! I was just about to resort to a mel scrip, but sadly lack the scripting knowledge, and you just when right out and did it for me! This is awesome!! The script works like a charm! I do notice that it wont weld selected parent objects though, only the last child of a chain. Is there something I can add to the script to make it see the parent and weld its vertices as well? worst comes to worst I can always just un-parent everybody, pass the script and then deal with the re-parenting. but if there is an easy Mel solution I would love to know. ( I really gotta get to know my Mel...)

    Just a little note for beginner scriptwriters like me (AKA people who copy past), the two } Symboles should be on the previous line, or else it wont run fully.

    Thanks again for you help! Your customer service is Rock Solid Awesome!
     
  8. Fishypants

    Fishypants

    Joined:
    Jan 25, 2009
    Posts:
    444
    Sure thing, if you want to perform the merge operation to all meshes in your scene (its actually less code :p ) run this:

    // Get all meshes in your scene (selection doesn't matter)
    string $meshes[] = `ls -fl -type mesh`;
    for($i=0; $i<size($meshes); $i++){
    polyMergeVertex -d 0.001 -am 1 -ch 0 $meshes[$i];
    select -cl;
    }
     
  9. Rosie-Posie

    Rosie-Posie

    Joined:
    Nov 20, 2013
    Posts:
    54
    Thank you so much!! It works like a charm! You just saved me a full day of hassle!
     
  10. Fishypants

    Fishypants

    Joined:
    Jan 25, 2009
    Posts:
    444
    Sure thing! Glad its working for you :D
     
  11. Duoz

    Duoz

    Joined:
    Sep 3, 2014
    Posts:
    1
    Hello @Fishypants, I've been using your plugin for a while and is really great. But I think I've found a bug:

    the export gets stuck when exporting objects without mesh renderer. Just this. When I reactivate the mesh renderer, it exports well.

    This sucks because in my scene I have a lot of objects with invisible meshes inside used as colliders and I cannot export it without doing a lot of work every time.

    Thanks for the support, cheers
     
  12. Fishypants

    Fishypants

    Joined:
    Jan 25, 2009
    Posts:
    444
    @ Duoz -
    I will take a look, hopefully I can get a fix out soon.
     
  13. Fishypants

    Fishypants

    Joined:
    Jan 25, 2009
    Posts:
    444
    @Duoz -
    I sent you a PM.
     
  14. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    hi guys, I'm pretty new to Maya. Really appreciate any sharing tips that I could use to make the most out of this awesome Export2Maya tool.

    Right now, one workflow I can think of is I can export the "whole, final Scene" to Maya, and, I can make a "low-poly mesh of the whole Scene" for the Scene Mesh-Collider. Any other ideas guys? :)
     
  15. Fishypants

    Fishypants

    Joined:
    Jan 25, 2009
    Posts:
    444
    export2maya_skinned-mesh-export_01.jpg
    Export2Maya Update 1.0.8:

    Hey everyone, just wanted to give you a little update on what is happening with Export2Maya. First off, apologies for the long wait, its been a while since an update but hopefully I have more free time to work on the exporter now. Secondly, I wanted to give an update of whats been added already, and whats to come.

    1) Skinned Mesh support! (finally) It is almost done. Its about 60% there. The skinned meshes export correctly, and I have all the nodes that need to be created for the skinning, just have to connect everything together. It's difficult because Unity doesn't have "bones" like in Maya, only transforms, so you have to do a bit of a workaround to figure out which objects should be bones and which shouldn't. Its almost done.

    2) Added light support. Your scene lights should all export now (Spot Light, Area Light, Directional Light, and Point Light). I have tried to match the light intensities as close as possible in Maya, although with the way that lights in Unity work, it will never be a 100% perfect match, but its close.

    3) Added option for Units Type export. You can specify upon export what units you would like your scene to default to (centimeters, meters, etc)

    4) Added Export Scale Multiplier. If you are working in Maya and bring in your FBX but your import scale is something other than 1 (ex the default of 0.01) then when you export your scene from Unity back to Maya, the scale will not match. So the Export Scale Multiplier will compensate for that, allowing you to scale your scene at export time to whatever size you like (including vertex positions, light positions, and transform positions)

    This plus a bunch of bug fixes. I'm planning on pushing out a new version to the Asset Store once the skinned mesh export is complete.

    After that, next up on the list is Better Shader Export, Terrain Export, and Animation Export.
     
    ikemen_blueD likes this.
Thread Status:
Not open for further replies.