- Modifié
IK constraints now available in Spine 1.9.0+!
Edit: See IK documentation! http://esotericsoftware.com/spine-using-ik
IK constraints are in Spine version 1.9.0, which is now available. :clap: It currently allows for two bone IK as well as IK/FK mixing, which can be keyed. This allows you to mix and match FK and IK within the same animations. Coupled with skinning, IK makes for extremely easy animating of meshes that deform realistically.
Loading Image
In the animation above, IK is used on the raptor's feet. This locks the feet to the ground and the knees and ankles adjust automatically as the body bounces up and down.
I'm going on a short vacation soon, so we did a big crunch time push to get this released before then. It works from start to finish and has a good deal of polish, but there are some minor features we will be working on in the future.
Currently none of the runtimes support IK. The IK data is also not yet output in the JSON or binary formats. We wanted to get IK in your hands as soon as possible.
If you aren't familiar with IK, it stands for inverse kinematics. IK adjusts the rotation of a hierarchy of bones so the tip of the last bone points at a specific place. Eg, you can use this to pin feet to the ground, so when your character crouches the knees bend instead of the feet going through the ground. You can also animate the target the bones point to, which can make many kinds of animation much easier and use a lot fewer keys.
To use IK in Spine, select two bones, click Constraints
in the tree, add a new IK constraint, then choose a target bone. Now the two bones will always point to the target bone. You probably want to create a bone solely for the purpose of being the IK target.
You can adjust the IK/FK mixing on the constraint's properties in the tree. This allows you to use keys on your FK pose to use a mix of FK and IK. To see the FK pose, IK pose and the mix pose at the same time, check the visibility dot next to the constraint. When the visibility dot is unchecked (the default) then you will only see the mix pose and the bones are drawn as an outline to show that the scale, rotation and/or translation is being controlled by a constraint and cannot be edited.
1.9.01 fixes a few issues. A few more still remain, but are relatively minor. Eg, the translation axes when dragging the translate tool can be incorrect on bones controlled by an IK constraint when the constraint is visible, bone compensation can be incorrect on bones controlled by an IK constraint, etc.
I am taking a short vacation to visit family and will be unavailable for 3 weeks. Shiu is available to field your questions.
Broken my brain (( Can you plz make a video tutorial?
https://www.youtube.com/watch?v=orqb4Hz ... e=youtu.be here you go It's not step by step but should help you get started.
where is the example file?
There is no example file yet since the feature isn't fully complete. I will create an example scene today so you can check that out when I upload it, just keep in mind that things are likely to change slightly.
I've created an example project now, you can find it at http://esotericsoftware.com/files/examp ... xample.zip
There are a couple of things that will become much easier to do once we are finished with IK. The Spineboy skeleton has two animations you can check.
The awesome features just keep rolling in, If there was one thing about Spine I missed from modern 3D modeling programs it was IK constraints. I notice you mention IK data not being exported out in JSON format, are there going to be options to check what data we would like exported out in JSON? skinning data, IK, FFD, Mesh? Curiosity for some runtimes that are not updated as quickly as Spine does or legacy options for outdated runtimes (if that occurs).
I can't say if there will be options for what data to export since I don't know, but it's not something I've heard Nate mention. Currently if you want to use IK for animation and export it, you'll need to key the bones after IK, not ideal but it will be sorted when Nate is back from the US. The reason we wanted to release IK already is that we can then receive input from users to improve on it and also bugs will be found quicker, so in the end it means it will reach a more polished state quicker. I've certainly had a lot of fun with it already but I am already aware of a couple of things that needs sorting out.
Oh, Awesome! Thank you for this tutorial!
Nate already did some work on skeletons as attachments but it's not ready yet. "Just" custom renderer
How far is he with the progress? I would be glad to see that custom renderer, though.
I don't know how much work is left on it. What exactly do you mean with custom renderer?
I have managed to change SkeletonRenderer and SkeletonAttachment class to support custom draw order, but I ran into this problem... The pogo and that indian are two different skeletons.
Should probably create a new thread to discuss custom draw order rendering. I'm afraid it's something Nate will have to give his input on since I won't be able to help you with it, I'm not a programmer by trade.
Looking great! I was wondering if Spine skeletons will be supporting IK in realtime as well, where IK targets can be positioned dynamically? As it is done in the Spine editor, I'm sure this could also be done inside a runtime?
Thanks! Yes that is the plan, this is why we made IK only two bones since anything more takes too much processing power and it is also much easier to control. The exact details are not yet decided though.
Is it possible to use more than 2 bones for IK?
puzzler a écritIs it possible to use more than 2 bones for IK?
Hehe I answered that right above your post. But no it is not possible to use more than 2 bones for IK. We want IK to be available at runtime so it has to be lightweight. We do plan on allowing 1 bone constraints as well. But at this moment no more than 2 bones.
We'll only support 1 and 2 bone IK to start. Note you can use IK on any two bones in the hierarchy, even if there are other bones between them. Eg if you have torso, neck, head then you could do IK on torso and head if you wanted.
Awesome feature!Thank you!
Terrific feature! Wet dream for animators!
ANYHOW, want to use on this new project just started. AFAIK, constraints info won't be exported, so is for now cosmetic, right?
I've heard that keying the bones that uses IK, might be a way to properly use animations at runtime. Question is: is there a easy way to do that? There will be a way to export bone rotations set by IK as bone keys, like, automatically?
What I'm doing now is kinda tedious, as i have to see fancy rotation of bones, to turn off the IK, key each one, advance in the animation... turn on IK, see position of bones, turn off IK, key bones, turn on IK, set positions, key stuff, repeat for 60 frames... :sweat:
Would be cool to automagically have this button that says 'key all bones affected by constraints, each frame" so animations can be used on all targets.
It's only cosmetic now or if you export as an image sequence, this will be of course be sorted when Nate is back from vacation.
It was actually supposed to key bones based on the IK but a bug must have crept in and this does not happen currently. You can click the visibility dot next to the IK constraint in the Constraints list in the tree to see both FK and IK at the same time then move your FK bone to the IK location and key it, a little less tedious than what you're doing now.
Thanks Shiu for the tip and info, my wolf is more happy since can be better animated now >
Image supprimée en raison de l'absence de support de HTTPS. | Afficher quand même
Cool, I see you are doing something a bit like a standard footroll setup. We'll make it possible to only use a single bone that is constrained and then you can disable rotation inheritance on the toe bone which will then give really nice control over the foot
When can i see the t-rax example? not the example boy.
You can find the raptor project here http://esotericsoftware.com/files/proje ... rn_WIP.zip
Please keep in mind that this project is not yet complete and is a bit messy. It won't be completely finished and included with the launcher before IK Constraints are final.
Shiu a écrit... before IK Constraints are final.
ETA on final IK Constraints? Please please, a hint at least :heart:
3-6 weeks maybe.
Hi! When IK pinning will appear in the Unity runtimes?
Nate is currently on vacation, when he is back IK Pinning will need to be polished a bit and then he will start working on the runtimes. Can't give you an exact date for when IK Pinning will be available in the runtimes yet I'm afraid, but I would expect it to be somewhere between 3-5 weeks.
Hi. I'm new to Spine and loving it so far! I just need some clarification though.
Until IK is supported in the runtimes, when animating my character if I use FK and key those specific frames, I shouldn't have any issues with exporting all the animation data?
If I do use IK however, is keying those frames all I need to do in order to do the same?
Or is this just an issue with IK Pinning?
The runtimes still don't support IK Pinning at runtime so you would need to set FK keys before export. Unfortunately there is a bug with IK Constraints currently so you can't easily set FK keys based on IK positions. This will be fixed when Nate is back from vacation this week.
Thanks very much for the prompt reply. This is frustrating but I appreciate the assistance. I look forward to the fix.
I think this feature is what I've been wanting for the game we are making. I wanted to ask if the IK runtime will solve the problem I have...
I have a human character with an upper and lower arm which is holding a gun. When the player moves the joystick, the characters gun should point the direction the joystick is pushed. The difficulty has been in adjusting the characters upper and lower arm bones correctly as the gun points towards the joystick direction. (Because it can be aimed 360 degrees, so i've been trying to animate this with code...)
Do you think that the IK in runtime would allow a good solution for this problem?
It can certainly make it easier since you can then just move the IK Constraint at runtime. We're making some pretty big changes to IK at the moment so we haven't been able to work at the runtimes yet for IK.
Awesome, just wanted to make sure that it does what I'm thinking it does. That would make life so easy to be able to have the arms just follow that IK Constraint. Best of luck, looking forward to when its in the runtimes, thanks!
IK constraints are completely revamped in 1.9.03. Existing projects will load as they should. No runtime IK yet, but it's coming. We've written some documentation on how to use IK:
http://esotericsoftware.com/spine-using-ik
Hi Shiu,
Shiu a écritUnfortunately there is a bug with IK Constraints currently so you can't easily set FK keys based on IK positions. This will be fixed when Nate is back from vacation this week.
Can you explain me how I can set FK keys based on IK postitions?
Thanks
tmz a écritHi Shiu,
Shiu a écritUnfortunately there is a bug with IK Constraints currently so you can't easily set FK keys based on IK positions. This will be fixed when Nate is back from vacation this week.
Can you explain me how I can set FK keys based on IK postitions?
Thanks
If you click the dot next to the constraint node (so it's hidden) in the tree you will be able to modify FK tranforms without having to set your mix value to 0 first, you can then move your FK bone to the position of your IK bone and key it. We've created a guide for using IK here http://esotericsoftware.com/spine-using-ik