ID 355981 - nuke.localization.localizationProgress()incorrectly updates when localized node is removed

Follow

Problem summary
With Nuke11.1's new Localization API, the nuke.localization.localizationProgress() function was introduced, which gets the percentage of localization completed in the project.

The function appears to have some incorrect/undocumented behavour, for instance:

Using nuke.localization.localizationProgress() will output a value relative to the amount of nodes on script open, but will not update as expected when nodes are deleted during a Nuke session.

This can lead to confusion when a localised node is removed from a scene, the function will tell users that the localizationProgress() is not 100% anymore (Even when every existing node in the scene is localised)

Customer reported version
nuke.11.1v4

Customer reported platform
n_a_mac

Steps to reproduce

1)  Open Nuke, Create a Checkerboard node and a Write node.

2)  Export out a 2 frame sequence (Named twoFrames.####.exr) and an 8 frame sequence (Named eightFrames.####.exr).

3) Read in both newly created sequence as follows:



4) Open Read1 ( eightFrames.exr ) and set the localization policy to 'on'.

The Read node should now have a Green bar above.


5) Within the Script Editor, execute the following command:
 nuke.localization.localizationProgress()

You should receive a result of '0.8' as 80% of read in frames in the scene are localised:



6) Follow step 3 and 4 again with Read2 ( twoFrames.exr ).

The localizationProgress result should now be '1.0' as 100% of frames in the scene are localised.


7) Delete Read2 and run the function in the Script Editor.

Result:  The nuke.localization.localizationProgress() result is now '0.8', when it should be '1.0' as all read nodes in the scene are still localized.

Workaround
Option 1:
After removing the node(s), do the following processes:

1)  Clear all unused local files
2)  Turn localization mode 'off'
3)  Turn localization mode 'on'
4)  Run nuke.localization.localizationProgress() again.

Option 2:
This will most likely take longer, but the user does not need to delete unused localization caches.

1)  Save your project
2)  Exit Nuke completely
3)  Re-launch Nuke
4)  Reload your project
5)  Run nuke.localization.localizationProgress().

Reproduced by support
This bug has been reproduced in:
Nuke11.1v4 - Windows 7 - Mac10.13 - CentOS6.9
Nuke11.1v1 - Windows 7 - Mac10.13 - CentOS6.9
Earliest version tested
- This feature did not exist before this version

Expected behaviour
Removing a localised node should refresh the localization function.

Actual behaviour
The function thinks the localizationProgress is incomplete if a localized node is removed.

    We're sorry to hear that

    Please tell us why