Animation - using character@anim method

Greetings all!

I have a couple of questions about importing animations into Unity using exported FBX files.
I would like to use seperate files for each of my character’s animations (@run @walk @idle etc). However, I can’t seem to make it work when exporting the RIG ONLY. To clarify:

character.fbx - weighted model in neutral pose, with rig
character@idle.fbx - RIG ONLY with idle animation

Unity finds the idle animation and attaches it to the character fine, but upon playing the scene the character freezes (animation doesn’t play), resets to 0,0,0 and tips over 90 degrees (I’m exporting from MAX and the FBX exporter refuses to convert to Y-up world co-ordinates).

If I export the character@idle.fbx WITH THE MESH included the animation works, BUT the file size doubles since it’s including the duplicate mesh info (which when distributing on web is needlessly wasteful).

Will Unity discard duplicate imported mesh data when building the game, or is there a way to make it work importing just the rig+animation?

Can someone shed some light on this matter?

I am wondering about this too. When you have an advanced character with 20+ animations, combining all of them in one file is difficult, what if you wanted to change one of the anims? you will have to re-enter the new frame numbers for all the following animation ranges.

And as IdleJohn said, having the geometry included in every single animation file is not practical either.

For that exact purpose, I’m using a custom script that imports the rig only into a gameobject, and then import the mesh to a skinnedMeshRenderer, to finally create the rigged mesh during loading time with a scripted bones binding.
Either the rig and the mesh are in separate FBX files, but the mesh file has to include that rig (with no animation, so it’s not really a problem).

The animated rig is imported into gameObjects (bones), and have to stay physically on scene in order to correctly influence the mesh.

I’m also using a set of predefined “universal” animations of that rig, that I’m attaching to each different character. I’m attaching it with a simple foreach that parse AnimationStates and copy it to the main gameObject Animation class.

I tried the file@pose approach, but it was too restricting in term of various skinning, and it was the same as packing all into the same file with a manual animation splitting inside importing prefs.

Actually, the method I’m using doesn’t take that much of a loadtime.

sounds interesting, would you be kind enough to share this script? I am sure a lot of people will find it useful.

I’m sorry, but this is a very, very customized (and long) script.

This was just to say that other methods are possible and practical :wink:

You could try to give an eye to these threads :

http://forum.unity3d.com//viewtopic.php?t=23103&highlight=skinnedmesh

http://forum.unity3d.com//viewtopic.php?t=16698&highlight=skinnedmesh

I finally got it to work, just now. I have a fbx with mesh + rig, and then a character@anim fbx which included only the rig + animation. And the character is animating just fine! It just… works. Without any scripts!

Also, we did some testing this morning, and we’re fairly sure Unity discards duplicated mesh data when it builds the game anyway. Which is nice of it. So it turns out that you can just export all your animations + mesh without worrying about the final file size. So even though I worked out my problem, turns out it didn’t really matter anyway.

Would have been nice if this info had been IN THE BLEEDIN’ MANUAL! Would have saved me a lot of time and effort.

I like having the mesh in each of my char@anim.max files. That way I can see how the animation looks for the character (notice when the model penetrates itself or the joints rotate and look unnatural). It works perfectly.

It doesn’t matter if the mesh is in the @ file or not… You’re still going to see it animate the mesh either way. And it’s always going to use the skin weights from the base character file so it’s not like you can customise the weights for different anims.

I prefer not to have the mesh in the @ files because it’s pointless re-exporting the mesh every time if it’s just going to get discarded in the end anyway! Also it is neater :slight_smile:

It works indeed. But is there a way of exporting the rig and the animation only from 3DS Max but without deleting the mesh in the animation file? I really like to keep the mesh in case I wanted to modify an animation to check deformation.

I don’t quite understand… You want to export the rig and animation ONLY, but not delete the mesh? Contradiction?

its quite simple, I have a file called walk.max which contains the mesh+rig+animation.

Ideally what I want is to choose File->export>FBX and untick “geometry” so that I only export the rig and the animation while retaining the mesh in the .max file. (I can already untick animation but I cannot find a similar option for geometry)

just delete the mesh before export… and then don’t save the max file??

Yup, that will work :smile:

Sometimes the solution can be so simple.

:slight_smile:

When using this method (bringing in Animations on additional character rigs. Does the additional animation need to be offset in time? I mean if the first file contained idle(from frame 1-30), must the next import, say ‘walk’ start at >31?

Or can this offset be done in Unity somehow?

thanks,
B.

Bueler? Bueler?

Ani @ file only use ani date,not use “mesh”,

Thanks for the response. But my question was, do addition animations brought in, need to start at different ranges so they don’t over lap.

Example…

Bob, has 1 animation idle 0-30 I import the rig again with a ‘walk’ animation. If that walk starts at frame 0-15 can I offset it on bob, so it occurs at as 31-45, or does it need to be animated /imported on 31-45?

thanks,
B

Don’t know if you still need the answer… but there is no offset needed. Just let all the animations start at 0.