Пример #1
0
def playblast( fi ):
	"""fi = <path>/file.png
	import general.houdini.utils as hut
	hut.playblast( 'D:/testPlay/test.png' )
	"""
	gl = hou.node( '/out' ).createNode( 'opengl' )
	gl.setName( 'playblast' )
	tmpFile = tempfile.gettempdir() + '/playblastTmp/' + fi.name
	gl.parm( 'picture' ).set( tmpFile + '.$F4.png' )
	gl.parm( 'picture' ).pressButton()
	gl.parm( 'imgformat' ).set( 'PNG' )
	cam = getRenderCamera()
	gl.parm( 'camera' ).set( cam.path() )
	#set frame range
	gl.parm( 'trange' ).set(1)
	gl.parm( 'aamode' ).set( 3 )
	gl.parm( 'gamma' ).set( 2.2 )
	frameRange = getFrameRangeFromTimeline()
	gl.parm( 'f1' ).set(frameRange[0])
	gl.parm( 'f2' ).set(frameRange[1])
	gl.parm( 'execute').pressButton()
	sqFile = sqFil.sequenceFile( tmpFile + '.png' )

	sqFile.createMov( fi.dirPath, '', int(hou.fps()), sqFile.name )
	os.system("start "+ str( fi.path ) )	
	shutil.rmtree( tempfile.gettempdir() + '/playblastTmp/' )
	gl.destroy()
Пример #2
0
def playblast( movFil ):
	"""main playblast function
	param path: string for the path for the playblast"""
	mm.eval( 'setAllMainWindowComponentsVisible 0;' )
	try:
		resNode = mn.Node( 'defaultResolution' )
		#resolution = [ resNode.a.width.v, resNode.a.height.v ]
		resolution = [ 1280, 720 ]
		#CREATE PLAYBLAST
		#write files in tmp dir
		mc.setAttr ('defaultRenderGlobals.imageFormat',32)
		tmpFile = tempfile.gettempdir() + '/playblastTmp/' + movFil.name
		asd = mc.playblast( format = "image", filename = tmpFile, forceOverwrite = True, viewer = 0, showOrnaments = 0, percent = 100, widthHeight = resolution )
		print asd
	finally:
		mm.eval( 'setAllMainWindowComponentsVisible 1;' )
	#ADD FRAME NUMBERS
	print tmpFile + '.png'
	#sqFil.sequenceFile( tmpFile + '.png' ).insertFrameNumber( tempfile.gettempdir() + '/playblastTmp/', 1, movFil.name )
	#EXPORT MOV FILE
	audioPath = ''
	audio =[a for a in  mn.ls( typ = 'audio' ) if a.a.mute.v == 0]
	if audio:
		audioPath = audio[0].a.filename.v
	fps = { 'film':24, 'pal':25 }
	curFps = mc.currentUnit( q = True, time=True)
	sqFile = sqFil.sequenceFile( tmpFile + '.png' )
	sqFile.createMov( movFil.dirPath.replace( '\\', '/').replace('//','/'), audioPath, fps[curFps], movFil.name )
	os.system("start "+ str( movFil.path ) )
	shutil.rmtree( tempfile.gettempdir() + '/playblastTmp/' )
Пример #3
0
	def addLayer(self):
		"""docstring for fname"""
		stacks = commands.nodesOfType("RVStackGroup")
		commands.setViewNode( stacks[0] )
		layer = self._selectedRender
		version = self._selectedVersion
		sqfFil = sqf.sequenceFile( layer + '/' + version + '/' + self._selectedLayer + '.exr' )
		asd = commands.addSourceVerbose( [layer + '/' + version + '/' + self._selectedLayer + '.' + str(sqfFil.start) + '-' + str(sqfFil.end) + '#.exr'], None )
		assGroup = commands.nodeGroup(asd)
		commands.setStringProperty(assGroup + '.ui.name', [self._selectedShot.name + ' - ' + self._selectedLayer + ' - ' + version])
		item = QtGui.QListWidgetItem(self._selectedShot.name + ' - ' + self._selectedLayer + ' - ' + version )
		item.setCheckState( QtCore.Qt.Checked )
		item.setData(32, [asd, [sqfFil, self._selectedShot, self._selectedLayer, version ]] )
		self.viewLayers_lw.addItem( item )
Пример #4
0
def loadFile():
	node    = nuke.thisNode()
	#HERE WE NEED TO CREATE PATH SO WE CAN READ FILE
	settings = sti.Settings()
	gen = settings.General
	if gen:
		renderPath = gen[ "renderpath" ]
		localNuke  = gen[ "localnukepath" ]
	pathDir = getPathDir( renderPath, node )
	seqNode = sqFil.sequenceFile( pathDir + node[ 'layerSel' ].value() + '.*' )
	if node[ 'copy' ].value():
		newPath = pathFromStructure( localNuke, node[ 'projectSel' ].value(), node[ 'seqSel' ].value(), node[ 'shotSel' ].value(), node[ 'layerSel' ].value() )
		seqNode = seqNode.copy( newPath + node[ '_version' ].value() + '/' )
	node['file'].setValue( seqNode.seqPath )
	node['first'].setValue( seqNode.start )
	node['last'].setValue( seqNode.end )
	checkVersion( node, renderPath )
Пример #5
0
	def load(self):
		"""docstring for load"""
		proj = str( self.projects_cmb.currentText() )
		sequ = str( self.sequences_cmb.currentText() )
		sho  = str( self.shots_cmb.currentText() )
		curShot = sht.Shot( sho, sq.Sequence( sequ, prj.Project( proj )))
		renderPath = self.gen[ "renderpath" ]
		localNuke  = self.gen[ "localnukepath" ]
		layers = curShot.renderedLayers( renderPath )

		root = nuke.root()
		if not root.knob( 'pipPorject' ):
			pipProj = nuke.String_Knob( 'pipPorject', 'Project' )
			root.addKnob( pipProj ) 
		if not root.knob( 'pipSequence' ):
			pipSeq = nuke.String_Knob( 'pipSequence', 'Sequence' )
			root.addKnob( pipSeq ) 
		if not root.knob( 'pipShot' ):
			pipShot = nuke.String_Knob( 'pipShot', 'Shot' )
			root.addKnob( pipShot ) 
		root[ 'pipPorject' ].setValue( proj )
		root[ 'pipSequence' ].setValue( sequ )
		root[ 'pipShot' ].setValue( sho )

		for l in layers:
			l = str( l )
			node = nuke.createNode( 'Read' )
			if node:
				node['PipeL'].setFlag( 0 )
				node[ 'name' ].setValue( l )
				node[ 'projectSel' ].setValue( proj )
				node[ 'seqSel' ].setValue( sequ )
				node[ 'shotSel' ].setValue( sho )
				node[ 'layerSel' ].setValue( l )
				vers = curShot.renderedLayerVersions( renderPath, l )
				node[ '_version' ].setValue( vers[-1] )
				pat = curShot.renderedLayerVersionPath( renderPath, l, vers[-1] )
				seqNode = sqFil.sequenceFile( pat + l + '.*' )
				if self.copyLocal_chb.isChecked():
					newPath = self.pathFromStructure( localNuke, proj, sequ, sho, l )
					seqNode = seqNode.copy( newPath + vers[-1] + '/' )
				node['file'].setValue( seqNode.seqPath )
				node['first'].setValue( seqNode.start )
				node['last'].setValue( seqNode.end )
Пример #6
0
def playblast(movFil):
    """main playblast function
	param path: string for the path for the playblast"""
    mm.eval('setAllMainWindowComponentsVisible 0;')
    try:
        resNode = mn.Node('defaultResolution')
        #resolution = [ resNode.a.width.v, resNode.a.height.v ]
        resolution = [1280, 720]
        #CREATE PLAYBLAST
        #write files in tmp dir
        mc.setAttr('defaultRenderGlobals.imageFormat', 32)
        tmpFile = tempfile.gettempdir() + '/playblastTmp/' + movFil.name
        asd = mc.playblast(format="image",
                           filename=tmpFile,
                           forceOverwrite=True,
                           viewer=0,
                           showOrnaments=0,
                           percent=100,
                           widthHeight=resolution)
        print asd
    finally:
        mm.eval('setAllMainWindowComponentsVisible 1;')
    #ADD FRAME NUMBERS
    print tmpFile + '.png'
    #sqFil.sequenceFile( tmpFile + '.png' ).insertFrameNumber( tempfile.gettempdir() + '/playblastTmp/', 1, movFil.name )
    #EXPORT MOV FILE
    audioPath = ''
    audio = [a for a in mn.ls(typ='audio') if a.a.mute.v == 0]
    if audio:
        audioPath = audio[0].a.filename.v
    fps = {'film': 24, 'pal': 25}
    curFps = mc.currentUnit(q=True, time=True)
    sqFile = sqFil.sequenceFile(tmpFile + '.png')
    sqFile.createMov(
        movFil.dirPath.replace('\\', '/').replace('//', '/'), audioPath,
        fps[curFps], movFil.name)
    os.system("start " + str(movFil.path))
    shutil.rmtree(tempfile.gettempdir() + '/playblastTmp/')