Hello!
I’m having an issue with the FBIK node in Control Rig affecting Nulls improperly. It seems to affect all Nulls that are in the hierarchy, causing them to translate and spin. I expected them to simply move along with their parent bones, and this is causing me quite a bit of grief since I use those Nulls as offsets. I’ve provided a repro for this issue.
Thanks!
-Nathaniel
[Attachment Removed]
Steps to Reproduce
- Create a new ThirdPerson project
- Open the Control Rig that’s in ABP_Unarmed
- Add a few Null elements to the Rig Hierarchy
- Change the preview window to show All Bones to see the effect on the last step.
- Add a Control for the pelvis
- Add an Effector for the pelvis on the FBIK node
- Set the Effector for the pelvis to the Control created above
- Change to Pre Pull on the FBIK node
- In the preview window move the pelvis Control
- Notice how the Nulls begin to spin and translate unexpectedly
[Image Removed]
What I expect to happen is that all Nulls move along with their respective bones with no change in Local Space transform.
[Attachment Removed]
Hi, yeah there’s definitely an issue here with the FBIK node in the 5.6 release. It turns out that whatever the issue is, it’s been resolved in the 5.7 release but it’s not immediately clear what the change was that fixed the problem. I’m going to spend a bit more time digging through the changes between 5.6 and 5.7 to see if I can track down what the issue is. I’ll follow up once I’ve done that.
[Attachment Removed]
Hi Nathaniel, sorry it’s taken a while to follow up on this. I was pulled onto some tasks for 5.8, which have taken a while. I just got back to looking at this today, and while I haven’t been able to track down the change that has fixed this issue in 5.7, I do have a potential workaround. It just sets each null element back to its initial transform after the FBIK solve has run.
In FRigUnit_PBIK_Execute can you try making the following change:
// copy transforms back
const bool bPropagateTransform = false;
for(int32 BoneIndex = 0; BoneIndex < WorkData.Solver.GetNumBones(); BoneIndex++)
{
FTransform NewTransform;
WorkData.Solver.GetBoneGlobalTransform(BoneIndex, NewTransform);
Hierarchy->SetGlobalTransform(WorkData.SolverBoneToElementIndex[BoneIndex], NewTransform, false, bPropagateTransform);
}
// fix start
for (FRigNullElement* NullElement : Hierarchy->GetNulls())
{
const FRigElementKey NullKey = NullElement->GetKey();
const FTransform InitialLocal = Hierarchy->GetLocalTransform(NullKey, true);
Hierarchy->SetLocalTransform(NullKey, InitialLocal, false, false);
}
// fix end
// do all debug drawing
Debug.Draw(ExecuteContext.GetDrawInterface(), &WorkData.Solver);
I think that should be fine since, as far as I’m aware, nulls should always retain their initial local space transform relative to their parent.
Let me know if that gets things working for you.
[Attachment Removed]
no problem, glad that helped!
[Attachment Removed]
Thanks for looking Euan! I noticed the same thing with 5.7 and was also unable to find a specific fix for this. I wonder if the perf refactor accidentally fixed this.
[Attachment Removed]
Yeah, I was also thinking that. Although I’ve backported quite a few of those changes and can still repro the issue, so there may be more going on
[Attachment Removed]