Newcomer here looking for some help. I’m having some problems getting a character model into Unity from Maya and looking for advice.
As far as I can tell I’m not doing anything wrong exporting the .fbx from Maya (I have the latest plug-ins, etc.). The animations seem to be working alright. The problem I’m having is that:
A) There is extra geometry in that comes in with the character that shouldn’t be part of the ‘scene’. I’ve checked and re-checked in Maya and can’t find out where these phantom objects/meshes are coming from. There’s nothing wrong in the scene’s hierarchy that I can find, and I’ve deleted the history on my meshes, etc. I can’t figure out where these shapes are from or how to get rid of them (incidentally, yes, they are actual objects that were from the scene at some point, but as far as I can tell they are -nowhere- in Maya any more).
B) There’s something weird with some of the normals on my model. I’ve UV mapped it more or less, and I know that in Maya all the normals are facing the correct directions (i.e. when Backface Culling is enabled, the mesh appears as it should). However, in Unity there are certain parts of the mesh where the normals appear reversed. Is there any way to ensure that Unity will use the backface culling/normal information from Maya correctly?
I’ve been fiddling around with these issues and searching online for some sort of solution to them but haven’t had much luck so far…hopefully someone will be able to help me out with this.
A) You have some empty transforms in your Maya scene. Open up the Outliner to find these transforms and delete them.
B) By default Unity uses the normal information in the file so this probably isn’t the issue. My guess would be that in Maya you are using 4 bones per vertice and in Unity it is set to 2. To change this go to “Edit/Project Settings/Quality” and change the Blend Weights to 4 Bones. If that doesn’t fix the problem then please post an image of the errant facing polygons to get a better sense of what is happening.
Hi there. Been gone for Christmas so it’s taken me a while to get back to this…
Any way, you were right about the Outliner. Can’t believe I forgot that - thank you!
As for the normals, Well…I don’t have this character rigged to the skeleton exactly. He’s mechanical so most of his parts are simply parented to bones…any other ideas as to why Unity would not be using the same normals as seen in Maya?
I’ll try playing around with it some more and see if I can come up with anything, and if not I guess I’ll post a screen shot, see if that helps…
Alright, I’ve been fiddling around with this thing some more and I really need some help. Some of what I’m inquiring about pertains to Maya, but most of it involves Unity.
I’ll try to explain as best I can what’s going on, but I’m not entirely sure myself, and I’m pulling my hair out over this…
Okay, well, first off, my character’s animations keep breaking, and I’m not sure why.
I’m exporting my character as an .fbx file for use in Unity, and this seems to go over well enough. However, when I import the fbx file into Unity, a whole bunch of animation is ‘missing’ from the walk cycle, and it seems like a bunch of contraint/IK information is broken (my character is mechanical and made up of a lot of hydraulic constraints, etc.).
When I open this same fbx file in Maya (are there any import settings for Unity I’m missing…?) the animations appear fine - except that another part of the character is broken. The walk cycle (which is what I’m trying to get to work here) plays just fine, but the character’s arm starts spinning around, even though it has no animation applied to it at all!
I’m not sure what I’m doing wrong or where the problem is exactly…if anyone has any idea where I can start looking into this I’d really appreciate it. I’ve been at this for far too long now…
One more concern I have is that my normals are still broken on roughly half of my character. The normals are all facing the same way in Maya (with backface culling enabled and in the UV editor, etc.), but whenever I bring the character into Unity roughly half of the polygons on the model are ‘inside out’ (the faces are facing the wrong way). Any ideas on why this is?
I don’t know if it will help, but I’ve attached a screenshot of the normal problems I’m seeing in Maya.
As a side note to both of my questions, please not that my character is not rigged with a smooth or rigid bind mesh. As I’ve stated the character is mechanical in nature, and as such the rig I have set up involved a skeleton with separate pieces of geometry parented to their respective bones (as this was the quickest and easiest way to ‘rig’ this character).
Yes, I’m using IK controls (for the legs, the one poseable arm and some cables that require the ability to flex when the model moves, like those hanging between the legs).
I’m not sure I know how to do that (bake animations to the bones). :? Virtually all of my Maya knowledge pertains to modeling and texturing, not animation.
I have “bake animation” ticked off when I export the fbx - I take it that’s not what you’re referring to, though?
In addition to baking animations to the bones, is anyone familiar with exporting a geometry cache with my fbx file? I’ve been looking around and think that might help me, too, but I haven’t found anywhere that explains that in enough detail.
I know how to export a geometry cache. I know how to export the scene as an fbx; how do I export a geo cache with/as my fbx?
When you mirrored the geometry for the legs etc did you use “Mesh/Mirror Geometry” or did you just scale the duplicate to -1? If you did the latter then that is why you’re seeing the reversed normals.
I scaled the duplicate to -1. However, when I was UV mapping the mesh, all of the backwards faces had their normals reversed; they’re all facing the correct direction right now in Maya, but for some reason not in Unity.
Make sure your IK handles share the same parent as your bones do. Group them.
Select the top of the group.
Go to:
Edit–>Keys–>Bake Simulation (click the box on the right)
In the Bake Simulation Options window in Hierarchy make sure Below is checked.
Click Bake.
Now select one of your bones. You should see animation keys on every frame. Try temporarily deleting your IK handles and press Play. You should still see everything animate fine.
I’m not sure why this happens, but the reason you’re seeing those reversed normals in Unity is because you scaled the duplicates to -1 in Maya.
To fix this combine the meshes in Maya and you should see the errant normals appear in Maya as well. Now separate the meshes and then reverse the normals that are pointing in the wrong direction.
Alright, I managed to bake and get the animation keys in every frame, etc.
However, when I exported the fbx and then tried to import it back into Maya to check it, Maya crashed. It crashes every time I try to open that file, now. What specific settings should I have enabled for the export/import options (I’m using the latest fbx plug-in for Maya 2009).
Does it require separating things? The main part in the screenshot there (the blocky ‘body’) is a single piece; the duplicate half was combined with the other half and the vertices in the middle have all been merged…it’s essentially a single mesh piece. The history for it has been deleted and everything, and when it was UV mapped the normals were all made to face the same direction. Isn’t there a better way to get Unity to recognize the normals as Maya sees them?
Well, those settings aren’t too different from what I have, but it worked. I mean, I was able to export/import just fine.
However, it didn’t fix the problem I was having before at all. The walk cycle is perfectly intact, but the character’s arm (which has no animation input whatsoever) is randomly flailing around during said walk cycle. I know a screenshot won’t do it justice, but I’ve attached one any way to try and give you an idea of what I mean…
So you’re actually seeing this flailing in Maya then?
Is that particular arm connected to an IK handle? You mentioned that there is no animation on that arm, so if it’s connected to an IK handle then the IK handle is probably staying in one place.
Make sure that you have the IK weight set to 0 and use a Stepped tangent so that it stays 0 for the entire animation.
It sounds like you have IK on. When your character’s body moves the IK handle is still pulling it’s arm.
Hm, I parented the arm IK to the shoulder (which is in turn parented to the body’s skeleton, etc.) and that seemed to do the trick! Thanks!
Now I still have the problem of the walk cycle being broken in Unity. This is the same fbx file that I’m importing, but it’s still displaying the same issues that I’ve been having with Maya–>Unity from before. When I import the asset into Unity and trigger the walk cycle, it looks, well, broken.
There are a series of constraints used for hydraulics on the hips and feet of the model, as well as IK handles/constraints used for the flexing cables between the legs. When the animation plays in Unity, none of these are moving at all. The walk cycle is still playing, technically, but without any of the contraints/IKs working properly it looks broken and awful…how do I fiddle around with the import settings for Unity to offset something like this?
Yeah, I’m used to smooth-bound meshes that are weighted as well. :?
I arrived at the setup I have now after struggling for a really long time to find a way of rigging a character with mechanical components like this that made sense and didn’t require a ridiculous amount of unnecessary work.
Thanks for all your help, though! One major crisis dealt with, two more to go.
Alright, so, if anyone is still reading this, here is a breakdown of the current problems I’m experiencing.
The normals issue, as seen in my first screenshot. The normals for about half of my model are backwards in Unity, even though they are all facing the same way in Maya. Evidently this is as a result of using -1 scaling to mirror parts of my model. Surely there is some way around this (short of taking the model apart or selecting face-by-face to reverse normals)? I find it hard to believe that there’s no way to simply make Unity interpret my normals correctly as they are in Maya…
My animation is broken now in Unity and I have no idea why.
As you can see in the screenshots I’ve posted in here, my character is mechanical in nature. As such it has no smooth or rigid bound skeleton. Rather, individual objects are parented to their respective bones on the skeleton. He also has a handful of hydraulics (in the hips, feet, arms) and some cables which flex whenever the model moves (on the legs and arms). The hydraulics are created using constraints in Maya, which I understand to be a pretty common and straightforward way of simulating hydraulic systems. The cables are created with bones/IK handles and constraints.
Previously when importing my character into Unity, the rudimentary animation I had was more or less working fine.
Now whenever I import it, however, the IKs and constraints all seem broken…only the most basic movement remains from my walk cycle.
I can’t see what I would have changed that would cause this to occur; the only changes I made between my working walk cycle and the broken one now are minute adjustments to the animation, moving some keyframes around to blend things better, and the addition of the cables on the arm and legs. I may not have all of the import/export settings the same, however (my old, functional animation was created before I went away for Christmas) so I’m wondering if there is some really basic export/import setting I’m missing… I’ve tried fiddling around with that and so far haven’t had any luck.
I have been looking around for some way of baking the animation or using a geometry cache to make sure the animation is exported and imported into Unity intact, but I haven’t found anything detailed enough to work off of or that I haven’t already tried.
Does anyone have any help in regard to my problems? Particularly the second one.