Problem summary:
The snap_menu can produce a "local variable 'normal' referenced before assignment" error when used on certain Alembic geometry subsets.
This issue seems to affect the Classic 3D System, and the New 3D System.
Customer reported version:
Nuke 14.1v1
Customer reported platform:
CentOS 7
Steps to reproduce:
1) Download the attached alembic_subsets.abc file and launch Nuke.
2) Create a ReadGeo node in the Node Graph, and select the alembic_subsets.abc file.
3) View the ReadGeo node, and select vertices on the top half of the sphere only:
4) Create an Axis node, and use any of its snap_menu options:
5) Observe the error message that appears: local variable 'normal' referenced before assignment
Expected behavior:
The snap_menu options should work without error, regardless of which vertices/geometry subsets might be selected.
Actual behavior:
After loading an Alembic file with geometry subsets, the snap_menu options may produce a local variable 'normal' referenced before assignment error message and generate the following Traceback in Nuke's Terminal window:
Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Program Files/Nuke15.0v3/plugins\nukescripts\snap3d.py", line 33, in translateToPoints return translateSelectionToPoints(nodeToSnap, getSelection()) File "C:\Program Files/Nuke15.0v3/plugins\nukescripts\snap3d.py", line 657, in getSelection for info in selectedVertexInfos(selectionThreshold): File "C:\Program Files/Nuke15.0v3/plugins\nukescripts\snap3d.py", line 714, in selectedVertexInfos yield VertexInfo(o, p, value, _nukemath.Vector3(tPos.x, tPos.y, tPos.z), normal)UnboundLocalError: local variable 'normal' referenced before assignment
If vertices are selected on the lower half of the sphere (the bottom subset), or both halves of the sphere, the error does not occur and the snap_menu options work as expected.
Workaround:
In the ReadGeo node's Scenegraph tab, unloading all geometry subsets except for whichever subset was producing the error seems to prevent the problem. So in this instance, unloading the bottom subset appears to allow the snap_menu to work without issue:
Reproduced by Support in:
Nuke 15.0v3 - Windows 10, macOS 13 Ventura
Nuke 14.1v1 - Windows 10
Nuke 14.0v1 - Windows 10
Nuke 13.2v8 - Windows 10
Nuke 13.2v2 - Windows 10 - REGRESSION
Unable to reproduce bug in:
Nuke 13.2v1 - Windows 10
Earliest version tested:
Nuke 13.2v1 - This issue doesn't appear in this version and has regressed