Exemple #1
0
    def buildTaskTree(self):

        self.JobObj = Job(self.job['title'])

        maintask = self.mainTask()

        self.JobObj.addTask(maintask)
Exemple #2
0
    def buildTaskTree(self):

        self.JobObj = Job(self.job['title'])

        qttask = None
        maintask = self.mainTask()

        if self.job['quicktime']:
            qttask = quicktimeTask()
            qttask.addTask(maintask)

        else:
            self.JobObj.addTask(maintask)
    def buildTaskTree(self):

        self.JobObj = Job(self.job["title"])

        maintask = self.mainTask()

        self.JobObj.addTask(maintask)
def test_taskTree():

    job = Job('my simple job')

    preflight = job.addTask('preflight')
    preflight.serialsubtasks = True

    preview = preflight.addTask('preview')

    task = preview.addTask(
        'frame_1')  # three frames to render from our sequence in the preview
    task.addCmd("maya -s 1 -e 1")

    task = preview.addTask('frame_15')
    task.addCmd("maya -s 15 -e 15")

    task = preview.addTask('frame_30')
    task.addCmd("maya -s 30 -e 30")

    main = preflight.addTask(
        'main')  # and then the main body of the job broken into 3 chunks
    task = main.addTask('frame_1-10')
    task.addCmd("maya -s 1 -e 10"
                )  # this is the simple way to define a command to execute
    task = main.addTask('frame_11-20')
    task.addCmd("maya -s 11 -e 20")

    task = main.addTask('frame_21_30')
    task.addCmd()
    cmd = task.lastCmd
    cmd.addExecutable(
        "maya-render")  # and this one is a little more convoluted
    cmd.addOption("-r", "mr")
    cmd.addOption("-rt", 4)
    cmd.addOption("-s", 21)
    cmd.addOption("-e", 30)
    cmd.addOption("-im", job.title)
    cmd.addOption("/tmp/maya-1-100-andrew.bunday-1296468388.ma")

    print "job tasks: ", job.tasks
    print "preflight tasks: ", job.preflight_Node1.tasks
    print "preview tasks: ", job.preflight_Node1.preview_Node1.tasks
    print "preview frame1 tasks: ", job.preflight_Node1.preview_Node1.frame_1_Node1.tasks
    print "preview frame1 cmds: ", job.preflight_Node1.preview_Node1.frame_1_Node1.commands
    print ""
    print "main cmd frame 21-30 :", job.preflight_Node1.main_Node1.frame_21_30_Node1.lastCmd.executable
    print "main cmd frame 21-30 :", job.preflight_Node1.main_Node1.frame_21_30_Node1.lastCmd.flags
def test_taskTree():
	
	job = Job('my simple job')

	preflight = job.addTask( 'preflight' )
	preflight.serialsubtasks = True 
	
	preview = preflight.addTask( 'preview' )

	task = preview.addTask( 'frame_1'  )	# three frames to render from our sequence in the preview
	task.addCmd( "maya -s 1 -e 1" )

	task = preview.addTask( 'frame_15' )
	task.addCmd( "maya -s 15 -e 15" )

	task = preview.addTask( 'frame_30' )
	task.addCmd( "maya -s 30 -e 30" )

	main = preflight.addTask( 'main' )		# and then the main body of the job broken into 3 chunks
	task = main.addTask( 'frame_1-10'  )
	task.addCmd( "maya -s 1 -e 10" )		# this is the simple way to define a command to execute
	task = main.addTask( 'frame_11-20' )
	task.addCmd( "maya -s 11 -e 20" )

	task = main.addTask( 'frame_21_30' )
	task.addCmd()
	cmd  = task.lastCmd
	cmd.addExecutable("maya-render") 	# and this one is a little more convoluted
	cmd.addOption( "-r", "mr" )
	cmd.addOption( "-rt", 4 )
	cmd.addOption( "-s", 21 )
	cmd.addOption( "-e", 30 )
	cmd.addOption( "-im", job.title )
	cmd.addOption( "/tmp/maya-1-100-andrew.bunday-1296468388.ma" )

	print "job tasks: ", job.tasks
	print "preflight tasks: ", job.preflight_Node1.tasks
	print "preview tasks: ", job.preflight_Node1.preview_Node1.tasks
	print "preview frame1 tasks: ", job.preflight_Node1.preview_Node1.frame_1_Node1.tasks
	print "preview frame1 cmds: ", job.preflight_Node1.preview_Node1.frame_1_Node1.commands
	print ""
	print "main cmd frame 21-30 :",  job.preflight_Node1.main_Node1.frame_21_30_Node1.lastCmd.executable
	print "main cmd frame 21-30 :",  job.preflight_Node1.main_Node1.frame_21_30_Node1.lastCmd.flags
Exemple #6
0
	def buildTaskTree( self ):
		
		self.JobObj = Job( self.job['title'] )
		
		qttask = None
		maintask = self.mainTask()
		
		if self.job['quicktime']:
			qttask = quicktimeTask();
			qttask.addTask( maintask )

		else:
			self.JobObj.addTask( maintask )
Exemple #7
0
#!/usr/bin/env python
#
# Example script demonstrating building a simple tree of tasks which
# can be executed of iterated over.
#

from tractor.api.tasktree import Job, Task, RemoteCmd
import tractor.api.serialize as serialize

myjob = Job('Simple Job Script')

task1 = Task('1', 'Task number 1')
cmd1 = task1.addRemoteCmd(service='Default')
cmd1.addExecutable('echo')
cmd1.addOption('hello')

myjob.addTask(task1)

task2 = myjob.addTask('2')
cmd2 = RemoteCmd('echo hello')
task2.addRemoteCmd(cmd2)

serializer = tractor.TractorSerializer(myjob)
serializer.spool('stdout')
"""
job = { type':'job', 'label':'Simple Job Script', 
		'tasks': { 
					'task1': {
								'type':'task',
								'cmds': [
										'cmd1':{ 
Exemple #8
0
class Nuke( Render ):
	"""Simple command line render of a nuke script. Breaks the script up in (n) number of chunks
	based on n = number of frames / chunk size."""
		
	def __init__( self, jobargs, cmdargs ):
		
		super( Nuke, self ).__init__( jobargs, cmdargs )
			
		self.job['title']        = self.command['file']
		self.job['chunksize'] = 10
		self.command['quiet'] = False
		self.command['threads']  = 4
		self.command['nodes']  = ''
		self.command['fullsize']  = True
				
		if 'title' in jobargs: self.job['title'] = jobargs['title']
		if 'chunksize' in jobargs: self.job['chunksize'] = jobargs['chunksize']	
		if 'quiet'       in cmdargs: self.command['quiet'] = cmdargs['quiet']
		if 'threads'   in cmdargs: self.command['threads']  = cmdargs['threads']
		if 'nodes'       in cmdargs: self.command['nodes']  = cmdargs['nodes']
		if 'fullsize' in cmdargs: self.command['fullsize']  = cmdargs['fullsize']
		
	def buildTaskTree( self ):
		
		self.JobObj = Job( self.job['title'] )
		
		qttask = None
		maintask = self.mainTask()
		
		if self.job['quicktime']:
			qttask = quicktimeTask();
			qttask.addTask( maintask )

		else:
			self.JobObj.addTask( maintask )

	
	def multiFrameTask( self, f_range ):
		name = 'Main_MultiFr__%s_%s' % ( f_range['first'],f_range['last'] )
		label  = 'Nuke : Render : %s-%s :: %s' %(  f_range['first'],f_range['last'], name )
		task = Task( name, label )
		
		cmd = task.addRemoteCmd()
		
		cmd.addShell( '/bin/bash -c' )
		
		cmd.addExecutable( 'nuke' )
		cmd.tags = ['nuke']
		cmd.service = 'NukeRender'
				
		if 'quiet' in self.command:
			if self.command['quiet'] == True:
				cmd.addOption( '-q' )
				
		if self.command['fullsize'] == True:
			cmd.addOption( '-f' )
			
		if 'threads' in self.command:
			cmd.addOption( '-m',  self.command['threads'] )
		
		if 'step' in f_range:
			cmd.addOption( '-F' , "%s-%sx%s" % ( f_range['first'],f_range['last'],f_range['step'] )  )
		else:
			cmd.addOption( '-F' , "%s-%s" % ( f_range['first'],f_range['last'] )  )
		
		cmd.addOption( '-x' )

		cmd.addOption( self.command['file'] )
		
		if self.job['progress']:
			cmd.addPipe( self.job['progress'] )
			
		return task
	
				
	def singleFrameTask( self, frame ):			
		"""
		Single frame render task. Takes a single frame as argument and adds other options from self.cmdargs
		Options are written to the cmdline in the order they are added to the cmd obj.
		"""
		name = 'Main_IndivFr__%s' % frame
		label  = 'Nuke : Render : %s :: %s' % ( frame, name )
		task = Task( name, label )
		
		cmd = task.addRemoteCmd()
		cmd.addExecutable( 'nuke' )
		cmd.tags = ['nuke']
		cmd.service = 'NukeRender'
		cmd.addOption( '-x' )
		
		if 'quiet' in self.command:
			if self.command['quiet'] == True:
				cmd.addOption( '-q' )
		
		if self.command['fullsize'] == True:
			cmd.addOption( '-f' )
			
		if 'threads' in self.command:
			cmd.addOption( '-m',  self.command['threads'] )
		
		cmd.addOption( '-F' , frame )
		cmd.addOption( self.command['file'] )
		
		if self.job['progress']:
			cmd.addPipe( self.job['progress'] )
		
		return task
Exemple #9
0
class Shake(Render):
    """Simple command line render of a maya scene. Breaks the render up in (n) number of chunks
	based on n = number of frames / chunk size."""

    #init needs to set threads and layers

    def __init__(self, jobargs, cmdargs):

        super(Shake, self).__init__(jobargs, cmdargs)

        self.job['title'] = 'Shake Job'
        self.command['proxyscale'] = 1

        if 'proxyscale' in cmdargs:
            self.command['proxyscale'] = cmdargs['proxyscale']
        if 'title' in jobargs: self.job['title'] = jobargs['title']

    def buildTaskTree(self):

        self.JobObj = Job(self.job['title'])

        maintask = self.mainTask()

        self.JobObj.addTask(maintask)

    def multiFrameTask(self, f_range):
        name = 'Main_MultiFr__%s_%s' % (f_range['first'], f_range['last'])
        label = 'Shake : Render : %s-%s :: %s' % (f_range['first'],
                                                  f_range['last'], name)

        task = Task(name, label)
        cmd = task.addRemoteCmd()

        cmd.addShell('/bin/bash -c')

        cmd.addExecutable('shake')
        cmd.service = 'ShakeRender'
        cmd.tags = ['shake']

        cmd.addOption('-exec')

        cmd.addOption(self.command['file'])

        cmd.addOption('-vv')

        if self.command['proxyscale']:
            cmd.addOption('-proxyscale', self.command['proxyscale'])

        if 'step' in f_range:
            cmd.addOption(
                '-t', "%s-%sx%s" %
                (f_range['first'], f_range['last'], f_range['step']))
        else:
            cmd.addOption('-t', "%s-%s" % (f_range['first'], f_range['last']))

        if self.job['progress']:
            cmd.addPipe(self.job['progress'])

        return task

    def singleFrameTask(self, frame):
        """
		Single frame render task. Takes a single frame as argument and adds other options from self.cmdargs
		Options are written to the cmdline in the order they are added to the cmd obj.
		"""
        name = 'Main_IndivFr__%s' % frame
        label = 'Shake : Render : %s :: %s' % (frame, name)
        task = Task(name, label)

        cmd = task.addRemoteCmd()

        cmd.addShell('/bin/bash -c')

        cmd.addExecutable('shake')
        cmd.service = 'ShakeRender'
        cmd.tags = ['shake']

        cmd.addOption('-exec')

        cmd.addOption(self.command['file'])

        cmd.addOption('-vv')

        if self.command['proxyscale']:
            cmd.addOption('-proxyscale', self.command['proxyscale'])

        cmd.addOption('-t', frame)

        if self.job['progress']:
            cmd.addPipe(self.job['progress'])

        return task
class Shake(Render):
    """Simple command line render of a maya scene. Breaks the render up in (n) number of chunks
	based on n = number of frames / chunk size."""

    # init needs to set threads and layers

    def __init__(self, jobargs, cmdargs):

        super(Shake, self).__init__(jobargs, cmdargs)

        self.job["title"] = "Shake Job"
        self.command["proxyscale"] = 1

        if "proxyscale" in cmdargs:
            self.command["proxyscale"] = cmdargs["proxyscale"]
        if "title" in jobargs:
            self.job["title"] = jobargs["title"]

    def buildTaskTree(self):

        self.JobObj = Job(self.job["title"])

        maintask = self.mainTask()

        self.JobObj.addTask(maintask)

    def multiFrameTask(self, f_range):
        name = "Main_MultiFr__%s_%s" % (f_range["first"], f_range["last"])
        label = "Shake : Render : %s-%s :: %s" % (f_range["first"], f_range["last"], name)

        task = Task(name, label)
        cmd = task.addRemoteCmd()

        cmd.addShell("/bin/bash -c")

        cmd.addExecutable("shake")
        cmd.service = "ShakeRender"
        cmd.tags = ["shake"]

        cmd.addOption("-exec")

        cmd.addOption(self.command["file"])

        cmd.addOption("-vv")

        if self.command["proxyscale"]:
            cmd.addOption("-proxyscale", self.command["proxyscale"])

        if "step" in f_range:
            cmd.addOption("-t", "%s-%sx%s" % (f_range["first"], f_range["last"], f_range["step"]))
        else:
            cmd.addOption("-t", "%s-%s" % (f_range["first"], f_range["last"]))

        if self.job["progress"]:
            cmd.addPipe(self.job["progress"])

        return task

    def singleFrameTask(self, frame):
        """
		Single frame render task. Takes a single frame as argument and adds other options from self.cmdargs
		Options are written to the cmdline in the order they are added to the cmd obj.
		"""
        name = "Main_IndivFr__%s" % frame
        label = "Shake : Render : %s :: %s" % (frame, name)
        task = Task(name, label)

        cmd = task.addRemoteCmd()

        cmd.addShell("/bin/bash -c")

        cmd.addExecutable("shake")
        cmd.service = "ShakeRender"
        cmd.tags = ["shake"]

        cmd.addOption("-exec")

        cmd.addOption(self.command["file"])

        cmd.addOption("-vv")

        if self.command["proxyscale"]:
            cmd.addOption("-proxyscale", self.command["proxyscale"])

        cmd.addOption("-t", frame)

        if self.job["progress"]:
            cmd.addPipe(self.job["progress"])

        return task
#!/usr/bin/env python
#
# Example script demonstrating building a simple tree of tasks which
# can be executed of iterated over.
#

from tractor.api.tasktree import Job, Task, RemoteCmd
import tractor.api.serialize as serialize


myjob = Job("Simple Job Script")

task1 = Task("1", "Task number 1")
cmd1 = task1.addRemoteCmd(service="Default")
cmd1.addExecutable("echo")
cmd1.addOption("hello")

myjob.addTask(task1)

task2 = myjob.addTask("2")
cmd2 = RemoteCmd("echo hello")
task2.addRemoteCmd(cmd2)

serializer = tractor.TractorSerializer(myjob)
serializer.spool("stdout")

"""
job = { type':'job', 'label':'Simple Job Script', 
		'tasks': { 
					'task1': {
								'type':'task',
Exemple #12
0
class Nuke(Render):
    """Simple command line render of a nuke script. Breaks the script up in (n) number of chunks
	based on n = number of frames / chunk size."""
    def __init__(self, jobargs, cmdargs):

        super(Nuke, self).__init__(jobargs, cmdargs)

        self.job['title'] = self.command['file']
        self.job['chunksize'] = 10
        self.command['quiet'] = False
        self.command['threads'] = 4
        self.command['nodes'] = ''
        self.command['fullsize'] = True

        if 'title' in jobargs: self.job['title'] = jobargs['title']
        if 'chunksize' in jobargs: self.job['chunksize'] = jobargs['chunksize']
        if 'quiet' in cmdargs: self.command['quiet'] = cmdargs['quiet']
        if 'threads' in cmdargs: self.command['threads'] = cmdargs['threads']
        if 'nodes' in cmdargs: self.command['nodes'] = cmdargs['nodes']
        if 'fullsize' in cmdargs:
            self.command['fullsize'] = cmdargs['fullsize']

    def buildTaskTree(self):

        self.JobObj = Job(self.job['title'])

        qttask = None
        maintask = self.mainTask()

        if self.job['quicktime']:
            qttask = quicktimeTask()
            qttask.addTask(maintask)

        else:
            self.JobObj.addTask(maintask)

    def multiFrameTask(self, f_range):
        name = 'Main_MultiFr__%s_%s' % (f_range['first'], f_range['last'])
        label = 'Nuke : Render : %s-%s :: %s' % (f_range['first'],
                                                 f_range['last'], name)
        task = Task(name, label)

        cmd = task.addRemoteCmd()

        cmd.addShell('/bin/bash -c')

        cmd.addExecutable('nuke')
        cmd.tags = ['nuke']
        cmd.service = 'NukeRender'

        if 'quiet' in self.command:
            if self.command['quiet'] == True:
                cmd.addOption('-q')

        if self.command['fullsize'] == True:
            cmd.addOption('-f')

        if 'threads' in self.command:
            cmd.addOption('-m', self.command['threads'])

        if 'step' in f_range:
            cmd.addOption(
                '-F', "%s-%sx%s" %
                (f_range['first'], f_range['last'], f_range['step']))
        else:
            cmd.addOption('-F', "%s-%s" % (f_range['first'], f_range['last']))

        cmd.addOption('-x')

        cmd.addOption(self.command['file'])

        if self.job['progress']:
            cmd.addPipe(self.job['progress'])

        return task

    def singleFrameTask(self, frame):
        """
		Single frame render task. Takes a single frame as argument and adds other options from self.cmdargs
		Options are written to the cmdline in the order they are added to the cmd obj.
		"""
        name = 'Main_IndivFr__%s' % frame
        label = 'Nuke : Render : %s :: %s' % (frame, name)
        task = Task(name, label)

        cmd = task.addRemoteCmd()
        cmd.addExecutable('nuke')
        cmd.tags = ['nuke']
        cmd.service = 'NukeRender'
        cmd.addOption('-x')

        if 'quiet' in self.command:
            if self.command['quiet'] == True:
                cmd.addOption('-q')

        if self.command['fullsize'] == True:
            cmd.addOption('-f')

        if 'threads' in self.command:
            cmd.addOption('-m', self.command['threads'])

        cmd.addOption('-F', frame)
        cmd.addOption(self.command['file'])

        if self.job['progress']:
            cmd.addPipe(self.job['progress'])

        return task
Exemple #13
0
class MRfMaya(Render):
    """Simple command line render of a maya scene. Breaks the render up in (n) number of chunks
	based on n = number of frames / chunk size."""

    #init needs to set threads and layers

    def __init__(self, jobargs, cmdargs):

        super(MRfMaya, self).__init__(jobargs, cmdargs)

        self.job['title'] = 'MRfMaya Job'
        self.job['projectpath'] = None
        self.job['layers'] = None
        self.command['threads'] = 8

        if 'title' in jobargs: self.job['title'] = jobargs['title']
        if 'projectpath' in jobargs:
            self.job['projectpath'] = jobargs['projectpath']
        if 'threads' in cmdargs: self.command['threads'] = cmdargs['threads']
        if 'layers' in jobargs: self.job['layers'] = jobargs['layers']

    def buildTaskTree(self):

        self.JobObj = Job(self.job['title'])

        maintask = self.mainTask()

        self.JobObj.addTask(maintask)

    def multiFrameTask(self, f_range):
        name = 'Main_MultiFr__%s_%s' % (
            f_range['first'], f_range['last']
        )  #Main will be replaced with LAYERNAME in layer based renders
        label = 'Maya : Render : %s-%s' % (f_range['first'], f_range['last'])

        task = Task(name, label)
        cmd = task.addRemoteCmd()

        #cmd.addShell( '/bin/bash -c' )

        cmd.addExecutable('maya-render')
        cmd.service = 'MRfMRender'
        cmd.tags = ['maya']

        cmd.addOption('-r', "mr")
        cmd.addOption('-v', 5)
        cmd.addOption('-im', self.job['imagename'])

        if self.job['projectpath']:
            cmd.addOption('-rd', ('%s/images') % self.job['projectpath'])

        if 'threads' in self.command:
            cmd.addOption('-rt', self.command['threads'])

        cmd.addOption('-s', "%s" % f_range['first'])
        cmd.addOption('-e', "%s" % f_range['last'])

        if 'step' in f_range:
            cmd.addOption('-b', "%s" % f_range['step'])

        if self.job['layers']:
            cmd.addOption('-rl', self.job['layers'])

        cmd.addOption(self.command['file'])

        if self.job['progress']:
            cmd.addPipe(self.job['progress'])

        return task

    def singleFrameTask(self, frame):
        """
		Single frame render task. Takes a single frame as argument and adds other options from self.cmdargs
		Options are written to the cmdline in the order they are added to the cmd obj.
		"""
        name = 'Main_IndivFr__%s' % frame
        label = 'Maya : Render : %s :: %s' % (frame, name)
        task = Task(name, label)

        cmd = task.addRemoteCmd()

        #cmd.addShell( '/bin/bash -c' )

        cmd.addExecutable('maya-render')
        cmd.service = 'MRfMRender'
        cmd.tags = ['maya']

        cmd.addOption('-r', "mr")
        cmd.addOption('-v', 5)
        cmd.addOption('-im', self.job['imagename'])

        if self.job['projectpath']:
            cmd.addOption('-rd', ('%s/images') % self.job['projectpath'])

        if 'threads' in self.command:
            cmd.addOption('-rt', self.command['threads'])

        cmd.addOption('-s', frame)
        cmd.addOption('-e', frame)

        if self.job['layers']:
            cmd.addOption('-rl', self.job['layers'])

        cmd.addOption(self.command['file'])

        if self.job['progress']:
            cmd.addPipe(self.job['progress'])

        return task