ControlRig GetLengthOfChain node causing infinite output log messages.

Summary

  • There is a simple code error inside the GetLengthOfChain in the control rig StandardFunctionLibrary uasset. “Engine\Plugins\Animation\ControlRig\Content\StandardFunctionLibrary\StandardFunctionLibrary.uasset”

  • The algorithm requires that the last element in the array is skipped. The code which attempts to skip the last item of the array reads (in pseudo code):
    if (CurrentIndex != CurrentIndex - 1) { continue; }.
    This is obviously incorrect. It causes an out of bounds on the next step when the function attempts to get the next array element. Getting the next index will always be out of bounds if your on the last index.

  • This bloats the output log, causing the computer to run out of memory quickly.
    Navigate to the “If loop != last item” comment.

  • This is a simple mistake and should be replaced with (in pseudo code):
    if (CurrentIndex != Bones.Num() - 1) { continue; }

What Type of Bug are you experiencing?

Editor

Steps to Reproduce

  1. Create a control rig.
  2. Add the GetLengthOfChain node.
  3. Provide any valid array.
  4. Watch output log fill with out of bounds errors.

Expected Result

  • It is expected that GetLengthOfChain skips the last element in the array. This is how the algorithm should work.
  • It is expected that it does not produce infinite error messages.

Observed Result

  • It is observed that providing any array will always result in infinite error messages.

Affects Versions

5.8

Platform(s)

Windows

Upload an image