#NEWLINE# def _updateFromPath( self ) : #NEWLINE# #INDENT# self . __script [ 'SceneReader' ] [ 'fileName' ] . setValue ( '' ) #NEWLINE# self . __script [ 'AlembicSource' ] [ 'fileName' ] . setValue ( '' ) #NEWLINE# self . __script [ 'ObjectPreview' ] [ 'fileName' ] . setValue ( '' ) #NEWLINE# if ( not self . isValid ( ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# path = self . getPath ( ) #NEWLINE# if isinstance ( path , Gaffer . SequencePath ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# sequence = IECore . FileSequence ( str ( path ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# fileName = str ( sequence ) #NEWLINE# ext = sequence . fileName . split ( '.' ) [ ( - 1 ) ] #NEWLINE# calc = IECore . OversamplesCalculator ( ) #NEWLINE# if ( isinstance ( sequence . frameList , IECore . FrameRange ) and ( sequence . frameList . step == 1 ) ) : #NEWLINE# #INDENT# calc . setTicksPerSecond ( 24 ) #NEWLINE# #UNINDENT# frames = sequence . frameList . asList ( ) #NEWLINE# startFrame = int ( calc . ticksToFrames ( min ( frames ) ) ) #NEWLINE# endFrame = int ( calc . ticksToFrames ( max ( frames ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fileName = str ( path ) #NEWLINE# ext = str ( path ) . split ( '.' ) [ ( - 1 ) ] #NEWLINE# startFrame = None #NEWLINE# endFrame = None #NEWLINE# #UNINDENT# outPlug = None #NEWLINE# if ( ext in GafferScene . SceneReader . supportedExtensions ( ) ) : #NEWLINE# #INDENT# self . __script [ 'SceneReader' ] [ 'fileName' ] . setValue ( numSamples ) #NEWLINE# outPlug = self . __script [ 'SceneReader' ] [ 'out' ] #NEWLINE# scene = IECore . SharedSceneInterfaces . get ( fileName ) #NEWLINE# if hasattr ( scene , 'numBoundSamples' ) : #NEWLINE# #INDENT# numSamples = scene . numBoundSamples ( ) #NEWLINE# if ( numSamples > 1 ) : #NEWLINE# #INDENT# startFrame = int ( round ( ( scene . boundSampleTime ( 0 ) * 24.0 ) ) ) #NEWLINE# endFrame = int ( round ( ( scene . boundSampleTime ( ( numSamples - 1 ) ) * 24.0 ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ext in IECore . Reader . supportedExtensions ( ) ) : #NEWLINE# #INDENT# self . __script [ 'ObjectPreview' ] [ 'fileName' ] . setValue ( fileName ) #NEWLINE# outPlug = self . __script [ 'ObjectPreview' ] [ 'out' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ext == 'abc' ) : #NEWLINE# #INDENT# self . __script [ 'AlembicSource' ] [ 'fileName' ] . setValue ( fileName ) #NEWLINE# outPlug = self . __script [ 'AlembicSource' ] [ 'out' ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . __script [ 'OpenGLAttributes' ] [ 'in' ] . setInput ( outPlug ) #NEWLINE# if ( ( startFrame is not None ) and ( endFrame is not None ) ) : #NEWLINE# #INDENT# self . __script . context ( ) . setFrame ( startFrame ) #NEWLINE# self . __script [ 'frameRange' ] [ 'start' ] . setValue ( startFrame ) #NEWLINE# self . __script [ 'frameRange' ] [ 'end' ] . setValue ( endFrame ) #NEWLINE# GafferUI . Playback . acquire ( self . __script . context ( ) ) . setFrameRange ( startFrame , endFrame ) #NEWLINE# #UNINDENT# with self . __script . context ( ) : #NEWLINE# #INDENT# self . __viewer . viewGadgetWidget ( ) . getViewportGadget ( ) . frame ( self . __script [ 'OpenGLAttributes' ] [ 'out' ] . bound ( '/' ) )