1
\$\begingroup\$

Sorry guys! I am super new to this, and I'm trying to teach myself Unity. I have a very small knowledge of Maya from a 3d modeling course I took a year ago in college, and have made a very simple object and animated it using keyframes (2 keyframes to be exact) in maya, but I can't seem to figure out how to get that animation into Unity.

I've been playing around with this for hours now, and all the tutorials and such I find online are for really complex objects like people, and they have joints and stuff going on. Are joints required for an animation to work in Unity?

I've saved my maya file into my assets folder, but I don't see any animations in the import settings in Unity.

Here is my object:

img1

And it animates to this position: img2

\$\endgroup\$
2
\$\begingroup\$

I saw your post on Stack Exchange and followed you here. I can't comment yet as I just linked y SE account. You could also ask this on answers.unity.com, but whatever.

You have not used joints to animate it I see, but did you use a blend shape, or nothing at all (?). From your question, it sounds like you are keyframing mesh edits, which is not ideal. The "standard" approach to this would be to use either joints or blendshapes in Maya or just animate it in Unity.

Blendshapes is closest to what you are currently doing:

1) Create your base shape.

2) Duplicate it with ctrl+d.

3) Delete all history on both so they are clean.

4) Modify your copy to be the shape you want in the end. Delete its history again. (When you modify stuff you keep a history stack on the object. I'm telling you to delete them because they will bite you later if you don't.)

5) Select the copy, add select the base. Go Animation Shelf > Create Deformers > Blend shape options > Advanced, select "Front of Chain". Click Create.

6) Your copy will be gone, but you will have a blendshape1 node for your base mesh in the channel box on the right (under Inputs). Click it. You should then have two fields beside it, Envelope and (when I tested this just now I created 2 cubes so my copy was named pCube2). DON'T delete history after this. You will delete the blendshape1 node from your model. Creating the blendshapes deformers should be the very last thing you do. So if you have more than one shape you want it to animate to, create all of them from copies of the original base mesh, then select all of them (base mesh last) then do step 5 onward. You will have a field in the blendshape1 node for each shape you combined.

7) Change the value of that second field to something between 0 (meaning not applied) and 1.0 (meaning fully applied). You can key those values. So goto frame 1, set pCube2 to 0, right click it and select key selected. Goto whatever other frame you want to goto and set it to 1, then right-click > key selected.

8) If you are exporting as fbx then importing in Unity (instead of just importing the Maya file) then I think you have to bake the animations first (in the fbx animations section). When you do that it will let you select the frames you want to export as well.

Notes: Blendshapes are supported in Unity, but if you combine joint-based animation and blendshape animations together on the same mesh the joint-based/keyframe animation takes precedence, and your blendshapes will have to be hand keyed because your driven keys won't work in Unity. If you go that far.

Cheers.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.