- Home /
Can a Bone's Rotation along a specific Axis drive an animaton
Hello,
As a rigger, I was just wondering if I can script an interaction in Unity to make a bones rotation run back and forth through an additive animation on that same rig?
i.e. Bone y can rotates 90 deg on its local x axis, which in turn drives a 9 frame animation to play forwards and backwards depending on the bones current rotation.
i.e. Bone y rotates 10 deg and animation x interpolates smoothly between frame 1 and stops on 2.
Thanks,
Answer by eses · Aug 24, 2018 at 11:18 AM
@Phelan-Simpson
Edit: I'm not quite sure what you meant by "an additive animation on that same rig". So sorry if this is too basic / wrong answer.
Hi, yes you can, although I'm not sure about the cost, how taxing it is or not.
You can at least use legacy Animation (not Animator) component, and set it's animation clip frame. See: https://docs.unity3d.com/ScriptReference/Animation.Sample.html
With this knowledge, you could create a script that takes some rotation, normalizes it between values 0-1 and then use that value to drive animation clip, i.e. you sample the animation clip with values between 0-1 (or any range), instead of playing the clip.
So the answer is, you can create systems like Maya Set Driven key or 3ds Max Script Controller animation controller.
Take a look at examples - Some rigger even created full blown auto-rigger in Unity: https://assetstore.unity.com/packages/tools/animation/puppet3d-111554
And then there are other neat assets like FinalIK and Puppet Master, which show that you can go far beyond driven keys.
Example:
That's cool, thanks for checking if it worked, that's using the legacy animation system right? I am thinking maybe with animation layers I could get this working with $$anonymous$$ecanim. A separate layer that is purely the driven animations. Time for experimentation.
@Phelan-Simpson - yep it's using animation component.
Answer by Phelan-Simpson · Aug 24, 2018 at 06:10 PM
Thanks for the reply, I have seen those assets before, Final IK seems awesome, but just not needed for what I want to create. I too was wondering about the cost of an operation like this, especially If I am using it at a number of different joints.
Its already works great with baked animation, except I need it for dynamic aiming and foot placement, so it has to been driven off of rotations, otherwise, say hello to terrible deformations.
"EDIT" Does a mod want to make this a reply to the other guys answer, whoops.
...I think you can just add comment yourself and also delete your own answer - I think?