x


Sharing animations with models

Can someone point me to a code example that will apply a common animation to a model in Unity?

I have several character biped models from 3DS Max that all share the exact same animations (walk, talk, run etc.)

Rather than export each model with all their animations it seems to me that I can save a lot of space by exporting only the model and each animation once and apply the animation at run time.

Thanks for your time!

more ▼

asked Nov 07 '09 at 05:19 PM

MadCow gravatar image

MadCow
39 2 2 6

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

If you have dude.fbx, try calling your animations dude@walk.fbx, dude@talk.fbx, etc.

Unity will automatically recognize this convention, and add the animationclip's from those fbx's to the Animation component of the imported dude.fbx. Alternatively, you can use Animation.AddClip() to add any AnimationClip to an Animation component.

var walkClip : AnimationClip;
animation.AddClip(walkClip, "walk");
more ▼

answered Nov 08 '09 at 04:14 PM

Lucas Meijer 1 gravatar image

Lucas Meijer 1 ♦♦
8k 19 43 85

Thanks Lucas. Does Unity recognize it is the same mesh and not duplicate the mesh data when building the player?

Nov 08 '09 at 07:07 PM MadCow
(comments are locked)
10|3000 characters needed characters left

For the specific case of building asset bundles out of the animations, we export the skinned mesh, and then delete the mesh in maya when exporting the various animations.

If you don't trust Unity, or want to do an A-B comparison, or want to make asset bundles, this is an option.

more ▼

answered Nov 21 '09 at 03:01 AM

Brian Kehrer gravatar image

Brian Kehrer
2.8k 9 11 50

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3791
x1044
x574
x28

asked: Nov 07 '09 at 05:19 PM

Seen: 3371 times

Last Updated: Nov 07 '09 at 05:19 PM