ID 602091 - The hiero.ui.Viewer.goToTrackItemMiddle() method does not work and raises an OverflowError

Follow

Problem summary:
The hiero.ui.Viewer.goToTrackItemMiddle() method does not work and raises an OverflowError
 
Customer reported version:
Hiero 16.0v1
 
Customer reported platform:
Rocky 9
 
Steps to reproduce:
1) Launch Nuke Studio and navigate to File > Import File(s)... to import some footage.
2) Create a new Sequence, and then add a Clip to the Timeline.
3) Open the Script Editor, and run the following code:

timeline_editor = hiero.ui.getTimelineEditor(hiero.ui.activeSequence())track_item = timeline_editor.selection()[0]hiero.ui.currentViewer().goToTrackItemMiddle(track_item)
4) Observe the OverFlow error:
# Result: TypeError: 'float' object cannot be interpreted as an integer C:\Program Files\Nuke16.0v3\pythonextensions\site-packages\hiero\ui\FnViewerMethods.py:82: RuntimeWarning: libshiboken: Overflow: Value 49.0 exceeds limits of type  [signed] "__int64" (8bytes).   viewer.setTime(time) Traceback (most recent call last):   File "<string>", line 3, in <module>   File "C:\Program Files\Nuke16.0v3\pythonextensions\site-packages\hiero\ui\FnViewerMethods.py", line 118, in _goToTrackItemMiddle     _goToPosInTrackItem(self, trackItem, _getTimelineIn)   File "C:\Program Files\Nuke16.0v3\pythonextensions\site-packages\hiero\ui\FnViewerMethods.py", line 82, in _goToPosInTrackItem     viewer.setTime(time) OverflowError
 
Expected behavior:
The hiero.ui.Viewer.goToTrackItemMiddle() function should work and set the Viewer's time to the middle of the supplied TrackItem.
 
Actual behavior:
The hiero.ui.Viewer.goToTrackItemMiddle() function no longer works, and returns various Overflow and Type errors.
 
Workaround:
It is possible to override the function responsible and prevent this error, by running code similar to the following:
from hiero.ui import FnViewerMethods def _goToPosInTrackItemEdit(viewer, trackItem, trackItemTimeMethod ):   """ Helper method to move the playhead to a position of the trackItem   according to trackItemTimeMethod   @param viewer: hiero.ui.Viewer object   @param trackItem: hiero.core.TrackItem object   @param trackItemTimeMethod: method to get the desired time from the track   item   """   if not isinstance(trackItem, hiero.core.TrackItem):     raise RuntimeError("'%s' must be a hiero.core.TrackItem object", trackItem)   sequence = viewer.player().sequence()   if not sequence:     raise RuntimeError("Viewer does not have a sequence")   sequenceTrackItems = []   for vt in sequence.videoTracks():     sequenceTrackItems.extend( list(vt.items()) )   if trackItem not in sequenceTrackItems:     RuntimeError("%s is not in %s" % (trackItem, sequence))   time = int(trackItemTimeMethod(trackItem)) ### EDIT ###   viewer.setTime(time) FnViewerMethods._goToPosInTrackItem = _goToPosInTrackItemEdit 
 
Reproduced by Support in:
Nuke Studio 16.0v3 - Windows 11, macOS 14 Sonoma
Nuke Studio 15.0v1 - Windows 11, macOS 14 Sonoma -- Regression
 
Unable to reproduce bug in:
Nuke Studio 14.1v8 - Windows 11, macOS 14 Sonoma
 
Earliest version tested:
Nuke Studio 14.1v8 - This issue doesn't appear in this version and has regressed

    We're sorry to hear that

    Please tell us why