IK solver with constraints?

I’ve seen many similar old questions on the forum, but maybe there is something new that appeared recently?

I want to use an IK node, similar to FABRIK, but limit rotation of certain bones.

So far I found: rtik GitHub - hacoo/rtik: Comprehensive inverse kinematics system for Unreal Engine 4 but I can’t setup constraints properly, it doesn’t seems to work.

And this thread…nd-constraints
but it’s just like an example (and I cannot make it work with 4.19)

Is there something that works?

After few days of searching, it seems there is really no such thing. Only one I found is IKinema, but it doesn’t work with source build of engine, you can’t do full rebuild when packaging, it can be installed on one pc only and it seems that full license costs a lot (there is no price on their website, which is kind of scary).

I’ve seen different solutions for other engines (FinalIK for unity, HIK for autodesk stingray), but nothing for UE4.

Is this something very complicated to do?

I have same issue. I belive Epics will do something with it

Really? That would be cool.

New CCDIK has a limited form of constraint. You can constrain how much a joint is allowed to bend. But you still cannot specify a limit per axis.

I stupidly tried to add per axis constraints to the CCDIK, it kinda works but it shacks a lot and not always reaches the target.
I copied AnimNode_CCDIK and added this code after line 240:

                FVector EAngles = CurrentLink.LocalTransform.GetRotation().Euler();
                const FVector Min = RotationLimitPerJointsAxis[LinkIndex].Min;
                const FVector Max = RotationLimitPerJointsAxis[LinkIndex].Max;

                EAngles.X = FMath::Clamp(EAngles.X, Min.X, Max.X);
                EAngles.Y = FMath::Clamp(EAngles.Y, Min.Y, Max.Y);
                EAngles.Z = FMath::Clamp(EAngles.Z, Min.Z, Max.Z);

Maybe someone who understands how those things work can help?

I think the “Apply Limits” node might work for you. If you place it after your IK it will limit it, but the limit isn’t taken into account when the IK calcs so it isn’t perfect but it’s close.

Make sure you switch the X and Z min/max values though because it’s flipped in the code (I’ve already submitted a bug report for it). And you’ll have to ignore the preview display of the constraints because they are displaying the correct values from min/max. And the offset values just delta the constraint ranges - they don’t rotate the constraint in any way.

@gryphen_76 Thanks :slight_smile:

I have the indie version of ikinema and i did ask how much is for the source code they said it was 10k+ the indie version is barely updated it only works good on 4.18 the other updated versions are buggy and only works in editor it cannot be packaged, i found a way to use the binary version of ikinema on source built engines but is a pain

If you are using FABRIK node, shouldn’t you first transform the target location and rotation into actor space then clamp values before sending it to the animation blueprint?