ID 433803 - Planar tracking the same bezier twice in the Roto node results in a NaN error

Follow

Problem summary
When a Roto node's bezier is selected within the Viewer, you have the option to planar track this shape by right-clicking on the shape and selecting 'planar track this shape'. (with an option of forwards of backwards)

This creates a PlanarTrackerLayer folder with the Roto node properties, and starts the track as expected.

If this bezier is tracked, then removed from the PlanarTrackerLayer folder, and a new track is attempted using the 'planar track this shape' option, the track will not work and the following error will occur in the terminal window.


Note: This only appears to occur when using the 'planar track this shape' option via the right-click menu, as you are blocked to track after the initial track in the Viewer's tracking toolbar (below).


Customer reported version
nuke.12.1v1

Customer reported platform
centos7

Steps to reproduce

1) Read in footage to planar track

2) Create a Roto node and draw a bezier around an object that moves and will not be occluded in the footage

3) With your playhead at the first frame of the footage, select the bezier in the Viewer and right-click on it, selecting the 'planar track this shape (forward)' option

4) Track a short range of frames

5) Remove the bezier from the planar track folder in the Roto node's preferences bin, back to the root hierarchy.


6) Repeat steps 3 and 4 above, re-tracking the bezier.
Result: The track will not work and you will receive the NaN error (see above).

Expected behaviour
Bezier should be allowed to be re-tracked when outside of a planar track folder, or the 'planar track this shape' option should only be able to be run once (similar to the tracking toolbar)

Actual behaviour
Bezier does not track and an error occurs.

Workaround
Unknown. Avoid using the same bezier twice within the Roto node.

Reproduced by support
This bug has been reproduced in:
Nuke 12.1v2 - Windows 10
Nuke 12.1v1 - Windows 10
Nuke 12.0v6 - Windows 10
Nuke 12.0v1 - Windows 10
Nuke 11.3v1 - Windows 10
Nuke 11.2v1 - Windows 10
Nuke 11.1v1 - Windows 10
Nuke 11.0v1 - Windows 10
Nuke 10.5v1 - Windows 10
Nuke 10.0v1 - Windows 10 - regression

Unable to reproduce bug in:
Nuke 9.0v9 - Windows 10

Earliest version tested
Nuke 9.0v9
- This issue doesn't appear in this version and has regressed

    We're sorry to hear that

    Please tell us why