State:Closed|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:602091|TargetRelease:16.0v5|
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 hiero.ui.Viewer.goToTrackItemMiddle() function should work and set the Viewer's time to the middle of the supplied TrackItem.hiero.ui.Viewer.goToTrackItemMiddle() function no longer works, and returns various Overflow and Type errors.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 We're sorry to hear that
Please tell us why