Recording to IK Controls breaks with "From Retargeting" but work with "From Start"

Hello! I’m hoping to get a little help understanding why an IK control might break when the simulation is recorded.

When I set the “Maintain Offset” option to “From Start” everything works great, but when I set the option to “From Retargeting” the recording breaks and the IK control is messed up.

I’ve been testing out some different things, and I think it might be due to an issue with the IK control itself.

When I make a new node and place it at the IK control’s location with the same parenting/transforms/pivot information, the new node works great, but the IK control breaks.

I tried looking into possible differences inside recording.py and I noticed that _snap_from_retarget() seems to be doing some work with Matrices while _snap_from_start() doesn’t.

So, perhaps my control has something funky going on with it’s transform matrix?

I can upload a sample scene to help debug things. So far, the root cause has eluded me. :slight_smile:

Hi,

A screen shot would help a lot, if you retargeting right onto an IK handle once that IK gets keys on it, it could get activate the IK FK switch , or if you still have joints that are part of the IK setup that Aren’t retargeted the recorded data might try force its self on the joints ?

Can you clarify what “break” means? What results are you expecting, and what results are you getting? If the From Start option works, why change it?

That would certainly help! I think you should be able to upload .zip files here.

Sure! Here’s a visual to show what’s going on. The ik feet controls are being placed in an odd spot.

from_retargeting
from_start

And part of the reason I’m asking is to get a better sense of what the different options mean.

I intuit that “From Start” means something like - “keep whatever offset between the controls and marker existed at the first frame of the simulation”, but it’s not clear what “From Retargeting” means.

Does it use the offset between the marker and control from the time the retarget was applied?

Thanks, that does indeed look less than ideal.

That is the idea yes, but there are a few things retargeting doesn’t capture and some of those are probably involved in this problem here, like the rotate pivot and rotate axis.

The From Retargeting option is something I’d love to remove entirely, since From Start covers just about every usecase. There is at least one known exception to that, @Jason could you remind me what this was?

In any case, does From Start work for you this case @jstrong?

Yes, “From Start” works just fine.

I’ve uploaded a sample file for inspection. “bad_foot_ik_sample_scene_upload.ma” over at files.ragdolldynamics.com

I also made an empty text file by accident “record_issue_with_ik_feet” sorry about that! Had a bit of a mis-adventure figuring out how to upload files.

In the sample scene, all you should need to do is hit “record simulation”. With From Start, things look great, and with From Retargeting you should see the feet controls flip out.

Thanks for this, will take a look!

Sorry for the delay on this one, it completely slipped off my radar! I’ve taken this for a spin and can confirm the issue.

The From Start option is the newer of the two, with From Retargeting dating back to last year; I’d reckon it’s time to sunset this as From Start has worked wonders in every situation. So what’ll happen is I’ll remove the From Retarget option altogether for the next release.

If you do run into any issue with From Start, let me know.

1 Like

Touching on this now that the next release is out the door; there is still one occasion where From Retargeting shines; namely this exact circumstance:

  • One marker
  • Being retargeted to an FK control
  • And an IK control
  • And these two controls being in different positions on the start frame

Because recording uses a Maya Parent Constraint, with Maintain Offset enabled, it would preserve the distance between the IK and FK controls. One of those is normally hidden when the other is visible, so it isn’t immediately obvious that this happens. But hidden or not hidden, it does maintain the offset from the other control.

Recording From Retargeting solves this, because at the time of retargeting, the controls are normally in the same position. But, they may also not be, for example if you assign an already animated character. Then the same problem arises.

The general solution to this, is to simply not retarget to multiple controls. Assign to either a control or the skeleton that is driven by your multiple controls, such that the simulation follows whichever you choose to animate, and then retarget onto one of them. Use that as your simulated result.

More on this to follow shortly, as the coming few weeks are going to be about tutorials, coving this and many more aspects of working with Ragdoll. :partying_face: