- Home /
Curves in .anim files?
Hi, I'm trying to add curves to my .anim files, since I need it to controll the IK in my feet and hands, but .anim files seems like they don't have this option, at least no so easy. Does anyone know how to add curves to .anim files or if it is even possible?
Thanks
Answer by theANMATOR2b · Apr 02, 2017 at 05:32 PM
Does this help?
https://docs.unity3d.com/Manual/animeditor-AnimationCurves.html https://docs.unity3d.com/Manual/AnimationCurvesOnImportedClips.html
Hi, unlucky no, sorry. The second link is about the curves that I'm talking about, but the thing is, that they are not there in the .anim files (just in the fbx files, I think), so I cannot create a good I$$anonymous$$ animation. I think that there should be a method to do this with .anim files but I cannot find out.
Are you talking about build in Unity animations, Animations created in Unity? All animation files even those from a fbx file are considered anim files when defined in the inspector, from the fbx file.
Does duplicating (ctrl+D) the .anim file provide the curve access desired?
Well, could be build in Unity animations or could be imported animations (that's my case) but it would be the same. If I have an fbx file I do have access to this curves (https://docs.unity3d.com/$$anonymous$$anual/AnimationCurvesOnImportedClips.html), but I don't have it with a .anim file. The extension makes the difference (.fbx or .anim) I think.
Nope, duplicate doesn't do that.
thank's anyway!
Answer by B3Designs · Jun 04, 2021 at 10:42 AM
Really old thread, but I found it so maybe others will too.
I also had this problem, and the simple answer is that you can't add a curve to a '.anim' file directly. You can however add a curve, using the animation window, to the class that controls the character. That is, the script that contains the OnAnimatorIK() method.
Create two public floats, say 'leftFootWeight' and 'rightFootWeight'.
Then select the character in hierarchy, and in the Animation window, select the animation to add the curves to and click the 'Add Property' button at the bottom of the properties list.
In the drop down that appears you should see the name of the class followed by the word 'Script' (in brackets). Open this drop down and you should see your foot weight variables.
Add these to the animation, and set their values as required.
The animation will now update these values directly, and you can use them in your SetIK*Weight() methods.
Animations can be used to directly edit any publicly accessible values within class that contains the animator controller, and it's a really powerful piece of kit.
Hope this helps someone.
Danny