Home Technical Talk

Fbx export from Maya

Elie
polycounter lvl 7
Offline / Send Message
Elie polycounter lvl 7
Hey all, 

how do you export your files from Maya to Unity ?

I only have my Lambert1, so it's made to be simple. But when I import my fbx in an empty scene in Maya, I have a Lambert2 created on top of it, so it brings some problems:

I have some strange texture when importing in Unity :(

Replies

  • oglu
    Options
    Offline / Send Message
    oglu polycount lvl 666
  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    Maya's default material is called Lambert1, if an object is imported with the same name it'll rename it so it can fit it in the scene. Your Lambert1 material is being renamed to Lambert2.

    Rename your Material something else before you export it to import it with the same name.
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    thanks a lot, I'll test that a soon as I can. One thing I have to mention is that some scenes work fine and others not, and that is really weird...
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    something else I want to notice is that the bad texture I mentionned in my first post is precisely a sort of white reflexion on the model in unity, when it all should be just all grey, with nothing applied on it in fact^^ just to clarify a bit:)
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Looks like my problem comes from my soften edge... Any other way to smooth it in Unity ??
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Well it appears like it's better when I do: edit / delete by type / non deformer history... I continue to test it out
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    One other question with materials:

    I have a character with his pants, for everything it's just one single object skinned and animated.
    I need to have 2 materials though, one for the body and one for the pants. So here's what I did when I exported in fbx for unity:

    I had the character with the lambert1 already assigned on everything for the body. Then I selected the faces of the pants and assigned to this selection an other lambert that I could re-name.

    So in Unity we had the Lambert1 and the other material, which is fine. But is it dirty to do it like that ? Would you recommend this method or do you use an other way to go?
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Something funny: I have a character with 20.000 vertices in Maya, but in Unity I see 60.000 vertices! Something must be wrong with this fbx export...
  • throttlekitty
    Options
    Offline / Send Message
    Elie said:
    Something funny: I have a character with 20.000 vertices in Maya, but in Unity I see 60.000 vertices! Something must be wrong with this fbx export...
    That's might be correct depending on your model but that does sound a bit high for I assume a human character. Maya shows you the number of vertices that only "physically" exist. Game engines need to split vertices when there's a hard edge or a uv seam. Reading back a bit, you had an issue smoothing the model, did you get that solved?

    For the question about not using lambert1, it's more of a Best Practice(tm) to avoid using it. Since it's the default material, it's usually best to avoid making any real changes to it or start attaching textures. Say you needed to start on Pants v.2 in the same scene, all your blockouts and other models using lambert1 would now have those textures or whatever.
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    thanks for your help throttlekitty, to answer your questions, it's for a new character, that's not human but more of a creature.
    For smoothing, I usually do a soften edge and delete by type non deformer history which worked pretty fine on other models.

    I now try to avoid using lambert1, and even create face Sets for quick selections to assign materials for my characters
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    But I still have too much vertices for Unity... If anybody else have an idea of what's going on... throttlekitty what do you mean by "Game engines need to split vertices when there's a hard edge or a uv seam"? 
  • throttlekitty
    Options
    Offline / Send Message
    Elie said:
    But I still have too much vertices for Unity... If anybody else have an idea of what's going on... throttlekitty what do you mean by "Game engines need to split vertices when there's a hard edge or a uv seam"? 
    So, under the hood, all the model data is stored in lists. There's a list for vertices, UVs, Faces, and so on. When we have a UV seam, that single vertex has at least two UV coordinates now. Maya will track this behind the scenes for you, but it takes extra work to say that Vertex #201 corresponds with UV #201 and #570. Game engines need to keep things streamlined; each vertex entry can only store one set of XYZ UV and Normals data. So the solution is to create a new vertex where they are needed. It might seem counter-intuitive to have more data, but it's preferable to having lists of data types that can change size arbitrarily.
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    throttlekitty, you said "So the solution is to create a new vertex where they are needed.
    What do you mean? Is it me or the engine who has to add vertices? And how could I know where it's needed?
  • Udjani
    Options
    Offline / Send Message
    Udjani interpolator
    Elie said:
    throttlekitty, you said "So the solution is to create a new vertex where they are needed." 
    What do you mean? Is it me or the engine who has to add vertices? And how could I know where it's needed?
    It's the engine, you don't need to know where its needed, but you can know where the engine will ''add'' them, and it will be where you have hard edges and uv seams. 

    Edit:
    About the high difference between the polycount. There is more for that than just the smoothing split and uv seams apparently. Coincidentally i made a question about that yesterday on unity forum, and got this answer.
    ----
    ''Where did you get the numbers from?

    If you use the stats overlay in the Game view, it might also include shadow and depth passes, depending on platform. So if your model has 2k tris, you would at least end up with 2k*3 = 6k tris. Even more if you use shadow cascades or use more than one light, etc.

    If you get the numbers from the imported Mesh itself, when you select it in the project and look at it in the inspector, the those should be correct.''


  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Thanks Udjani for your help, one more question:

    My animations are all named "Take001" in Unity, is there a way to rename this in Maya? It could cause some problems when I will have a lot to manage...
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Elie said:
    Thanks Udjani for your help, one more question:

    My animations are all named "Take001" in Unity, is there a way to rename this in Maya? It could cause some problems when I will have a lot to manage...
    typically you rename animations using unity's editor - the names are stored in the meta file. 
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Thanks sprunghunt, I try to use in the fbx exporter in Maya the use scene name option.
  • Skjaldmo
    Options
    Offline / Send Message
    Skjaldmo null
    Hello! I want to export from maya to unity, but I dont want to use bridge because I need to send the model to the programmer so he can put it in the scene. I have Albedo, Metallic, Roughness, Normal, AO and Height map. What material can I use to export all those textures with the model in fbx? I'm already using Stingray PBS but doesn't recognize the Height map in Unity. (I put the height map as displacement in maya)
    Pls help me!
  • Skjaldmo
    Options
    Offline / Send Message
    Skjaldmo null
    Hello! I want to export from maya to unity, but I dont want to use bridge because I need to send the model to the programmer so he can put it in the scene. I have Albedo, Metallic, Roughness, Normal, AO and Height map. What material can I use to export all those textures with the model in fbx? I'm already using Stingray PBS but doesn't recognize the Height map in Unity. (I put the height map as displacement in maya)
    Pls help me!
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Hi, I have a weird problem : some of my animations don't work in Unity, and I don't know why... Any ideas anybody?
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    What's happening is we call in Unity a mesh and the seperated animations should all be connected to it. But it seems sometimes the process is broken and I don't know why...
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Hey everyone, I'm having an issue... I have to export a character in fbx, he has a joint-chain constrained to his back. But the root of this is staying to 0 because the constrain is applied to a nurb curve controller on top of it. Any tips to make it follow nicely for the export?
  • sibiu2142
    Options
    Offline / Send Message
    sibiu2142 polycounter lvl 2
    Elie said:
    Hey everyone, I'm having an issue... I have to export a character in fbx, he has a joint-chain constrained to his back. But the root of this is staying to 0 because the constrain is applied to a nurb curve controller on top of it. Any tips to make it follow nicely for the export?
    I don;t have a good answer but maybe a solution for you:  https://app.pluralsight.com/player?name=32802061-51e1-4e8b-a044-17b799aef1dc&mode=live&clip=0&course=unity-maya-game-character-animation&author=mark-butler
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Thanks sibiu2142 I'll try to check that

  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Hi, an other question: I have a monster crawling, I did an animation in Maya but in Unity I don't know how to make it loop AND make a real step forward without coming back to pose 1 at the center of the world...
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    I've been able to fix this in my rig and in some dark settings in Unity, but now I have something else to fix in an other file: I want to export a kind of cloth simulation from Maya in fbx for Unity, but still can't make it. Anybody knows how could I do this?
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    It seems there is the alembic export. Or a system with a mesh with a matrice of joints skinned (I did not test it): Each joint should be constrained to a vertex of the cloth mesh - or a duplicated one, that we could bake the animation on as usual.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Elie said:
    Hi, an other question: I have a monster crawling, I did an animation in Maya but in Unity I don't know how to make it loop AND make a real step forward without coming back to pose 1 at the center of the world...
    You want to enable root node animation and turn on looping - you'll need an animation controller for this. 

    https://docs.unity3d.com/Manual/RootMotion.html

    Or you can just re-export your model with the root of the model parented to something that doesn't move. 
  • 23ds
    Options
    Offline / Send Message
    23ds null
    Dear Elie,

    it's not a direct answer to the thread title, but to your question how to get data from Maya to Unity.

    (And dear all, if this helps anyone:)
    You can import/load maya binary files directly


    You just need a working Maya on your system. Takes Unity about 20 seconds to ''connect''/start a maya process in the background and the import might take a while, but it worked very well for me. Also keeps the updating of the assets easy.

  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Thanks a lot for your answers everybody. Here is an other problem with a new character. I'm working on a facial animated rig done with advanced skeleton in Maya. But I can't export the face to Unity... I have all the body but the face is weird; disappears and is not working.... The face doesn't show up also when I simply re-import the .fbx in an empty Maya scene. Could you help me with this?
  • Elie
    Options
    Offline / Send Message
    Elie polycounter lvl 7
    Well, edit: I converted the rig to simplify for game / feature and it kinda works better. I have to skin again some expressions here and there but I hope it will make the magic.
Sign In or Register to comment.