• Runtimes
  • IK supported by runtimes and do I need the pro-version?

Hi, I searched for an answer to this question, but so far didn't find it here on the forum, so I'm hoping I'm not asking a double question here.
I have Spine Essential at the moment and need to create an interactive with inverse kinematics in Javascript, using pixijs. I thought this was already supported by the essential version and I could create IK's in the editor. Just to find out it's not exporting and telling me Spine Essential is unable to export skeletons containing an IK constraint.

I have everything set up in js/pixijs, but so just found out that Inverse Kinematics are supported in the editor, but can't export with the Essential version. At the moment for me unfortunately the Professional version is pretty expensive for my financial state at the moment, but I might buy it anyway if that has Inverse Kinematics support for exporting to be used by the pixi runtime. But I must be absolutely sure that is supported and works the way I expect it to.

What I need is to be able to move spine skeleton-parts dynamically at realtime with inverse kinematics by a mouse or touch with the spine runtime (using pixijs's runtime). So when, for example, a user is moving a hand with a mouse, the arm moves with it and so on (in the javascript interactive).

Do I really need to buy the Pro version to do this? And if I do, is this really working at realtime as I describe it here? And is there perhaps a document describing how to accomplish this IK-behaviour (generally) using a runtime?

Thanks a lot in advance!

Related Discussions
...

Pixijs' Spine support is based on our core runtimes, so it does support IK constraints. They are evaluated at runtime. The way it would work is you setup an IK constraint, which causes one or two bones to rotate so the tip of the bone (the second bone if a two bone IK) is at a target bone (or as close as possible, if out of range). At runtime, you can get the target bone and put it at the mouse position (or anywhere else) and the IK will adjust the rotation of the constrained bones.

You can see a demo of how that works here:
Spine: Demos: Inverse kinematics
Drag the red balls around and you'll see spineboy is posed in a reasonable way


that is all done by using multiple IK constraints. You can read more about how spineboy is rigged here:
Spineboy example

Sorry if it was surprising that Essential doesn't support IK constraints. You do need Professional to create and export IK constraints. However, IK constraints are in the runtimes. If it is enough that the IK is only applied at runtime, you could create a new IK constraint at runtime. You can look at how SkeletonJson creates one. If you give it a try and get stuck, post your code here and we can help.

BTW, you could open your project using the Spine trial so you can see how applying IK works in the editor. IK docs are here:
Inverse Kinematics - Spine User Guide
This video shows how the Preview view can be used to mimic moving a bone around at runtime:
Spine 3.6 - New Features - YouTube

Another way to do it is to rotate the bones yourself so they point at the mouse. This is sufficient if you just need a bone to point at the mouse. If you need 2 bones (like an arm) to bend then you need IK and, while you could write your own IK, it's easier to add an IK constraint. Anyway, the Super Spineboy demo game has some code that points bones at the mouse (and a bit more). It's quite a bit of code, but it's relatively simple. Basically you use atan2 to get the world angle you want, then you adjust that using the parent bones (subtract the parent bone's Bone getWorldRotationX from the world angle


that method didn't exist when Super Spineboy was written).

Hello Nate,

Thanks a lot for your incredible helpful answer. Thanks for putting your time and enthousiasm into really trying to help me with this answer. Even on a saturday. I'll deep dive into the demos and information you're giving here and I'll either make it work with the tools I have rightnow (and perhaps spend more time into development which will also help me better understand the runtimes, which is great) or look for ways to buy and upgrade soon. But I want to upgrade to the pro-version on a later stage anyhow for sure when my situation is better, because I really like to use the deforms and other great pro-features. They have a lot of potential and I've seen some pretty great results with it.
So thanks again, I'm going to dive into it and going for it to make it work one way or the other and I'm working on better times, so I can hopefully get the pro version soon. Have a nice weekend!