- Home /
Change models scale factor messes up animation
Hi,
I have a model animated with mecanim and has around 20 animations, I have another model again animated with mecanim and has around 30 animations, what i did was use the first Idle animation on model 2 in the mecanim controller of model 1, all's been working great up till now when I decided to change model 2's scale factor by 0.01 and now when model 1 goes into the shared idle animation of model 2 it's off the ground, I presume because of the scale factor change, model 2 works fine after resizing it.
Anyone know why this might happen ?
Answer by Owen-Reynolds · Aug 02, 2013 at 01:39 PM
Like you observed, the import scale of an animation needs to be the same as the model using it. Like you, I've only assumed this rule through trial and error.
Why isn't important -- it's just a rule.
But: transform.scale is fine since it's applied after everything else. The animation moves and positions the bones, mesh deforms verts. Then it's just like scaling a baked model (the shader code does it, which is the usual place.)
Import scale is like moving the bones in the original model, after you've skinned it. Animation scale won't change the rotation angles, or apply scale to the verts. But it will move bones attached to other bones (it scales the attachment point.) So, your tibia now starts roughly in your kidney, dragging all the lower-leg verts up with it.
Thanks for that .. I need to plan ahead in future when sharing $$anonymous$$ecanim animations.
Owen - thanks for this. Is it true then that it is, simply absolutely impossible to "do that" at the Unity level?
Is it a fact that, if you import-scale a model, you simply cannot "fix" the $$anonymous$$ecanima / $$anonymous$$ixamo animation, in Unity?
ie, the model would have to be redone at the rigging level outside Unity?
Thanks again
Note this question for instance
http://answers.unity3d.com/questions/517200/how-do-i-permanently-resize-a-model-with-children.html
(I completely realise you can scale it later in the scene, transform.scale. I'm strictly talking at the Unity "import" level here.)
Thanks !!
$$anonymous$$y thinking is the animation/bone scale has to match the model scale, but anyway you can do this should work. On a model+animation gameObject there's currently no way to scale just the model or just the animation. So, they need the same Import scale.
It seems that rescaling the mesh verts in code, the way that link does, should also work.
You know, I simply changed the $$anonymous$$O$$anonymous$$ scale like this --
and it all goes to hell. I actually can't even see where you could change the animation scale? Thanks though...
Yes, for a model+animation, there's one import scale. It scales model+animation together.
I (and the OP, maybe) was thinking if the modeller used the rabbit@walk animation method. Then the model and each animation has it's own panel like that, with it's own import-scale. That's the case where I believe they just need to be the same.
Your answer
Follow this Question
Related Questions
mecanim scale issue 1 Answer
Is there a way to Scale Root Motion with the model? 0 Answers
animation issue - different characters, same animation 0 Answers
A few basic playables questions. 0 Answers
Scale animation with model 1 Answer