State:New|TargetRelease:No Target|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:544734|
Problem summary
3D data is not returned via Python when using it across a frame range and viewing the 2D Viewer.
Customer reported version
Nuke 12.1v5
Customer reported platform
Windows 10
Steps to reproduce
1) Save the following code to a file named examples.py in your ~/.nuke folder:
import nukeimport nukescripts.snap3ddef snapToPointsAnim( node=None, mode='t'): ''' Animated versions of the three default snapping funtions in the axis menu args: node - node to snap mode - which mode. Available modes are: 't' to match translation, 'tr', to match translation ans rotation, 'trs' to match translation, rotation and scale. default: 't' ''' node = node or nuke.thisNode() if mode not in ( 't', 'tr', 'trs' ): # raise ValueError, 'mode must be "t", "tr" or "trs"' print("mode wrong") # KNOB MAP knobs = dict( t=['translate'], tr=['translate', 'rotate'], trs=['translate', 'rotate','scaling'] ) # SNAP FUNCTION MAP snapFn = dict( t=nukescripts.snap3d.translateToPoints, tr=nukescripts.snap3d.translateRotateToPoints, trs=nukescripts.snap3d.translateRotateScaleToPoints ) # SET REQUIRED KNOBS TO BE ANIMATED for k in knobs[ mode ]: node[ k ].clearAnimated() node[ k ].setAnimated() # GET FRAME RANGE fRange = nuke.getInput( 'Frame Range', '%s-%s' % ( nuke.root().firstFrame(), nuke.root().lastFrame() )) if not fRange: return # DO THE WORK tmp = nuke.nodes.CurveTool() # HACK TO FORCE PROPER UPDATE. THIS SHOULD BE FIXED for f in nuke.FrameRange( fRange ): nuke.execute( tmp, f, f ) snapFn[ mode ](node) nuke.delete( tmp ) # CLEAN UP THE HACKY BIT import examplesm = nuke.menu( 'Axis' )m.addCommand( 'Snap/Match selected position (animated)', lambda: examples.snapToPointsAnim( mode='t' ) )m.addCommand( 'Snap/Match selected position, orientation (animated)', lambda: examples.snapToPointsAnim( mode='tr' ) )m.addCommand( 'Snap/Match selected position, orientation, size (animated)', lambda: examples.snapToPointsAnim( mode='trs' ) ) 


We're sorry to hear that
Please tell us why