コード例 #1
0
def test_long():
    """This test shows how a two task job can be built with many more
    statements.
    """
    job = author.Job()
    job.title = "two layer job"
    job.priority = 10
    job.after = datetime.datetime(2012, 12, 14, 16, 24, 5)

    fgTask = author.Task()
    fgTask.title = "render fg"
    fgCommand = author.Command()
    fgCommand.argv = "prman foreground.rib"
    fgTask.addCommand(fgCommand)

    bgTask = author.Task()
    bgTask.title = "render bg"
    bgCommand = author.Command()
    bgCommand.argv = "prman background.rib"
    bgTask.addCommand(bgCommand)

    compTask = author.Task()
    compTask.title = "render comp"
    compCommand = author.Command()
    compCommand.argv = "comp fg.tif bg.tif final.tif"
    compCommand.argv = ["comp"]
    compTask.addCommand(compCommand)

    compTask.addChild(fgTask)
    compTask.addChild(bgTask)
    job.addChild(compTask)

    print job.asTcl()
コード例 #2
0
    def to_tractor(self, start_frame, end_frame, file_type):

        version = cmds.about(version=1)
        if version == "2022":
            sys.path.append(
                "/westworld/inhouse/tool/rez-packages/tractor/2.2.0/platform-linux/arch-x86_64/lib/python3.6/site-packages"
            )
        else:
            sys.path.append(
                "/westworld/inhouse/tool/rez-packages/tractor/2.2.0/platform-linux/arch-x86_64/lib/python2.7/site-packages"
            )

        import tractor.api.author as author

        job = author.Job()
        job.service = "convert"
        job.priority = 50

        file_title = cmds.file(query=True,
                               sn=True).split(".")[0].split("/")[-1]
        project_name = self.item.context.project['name']
        user_name = self.item.context.user['name']
        user_id = os.environ['USER']

        temp = "] ["
        title = []
        title.append(user_name)
        title.append(project_name)
        title.append(file_title)
        title.append(self.item.properties['name'])
        title.append("%d - %d" % (start_frame, end_frame))
        title.append(file_type)
        title = temp.join(title)
        title = "[" + title + "]"
        job.title = str(title)

        master_command = self._get_default_command()
        command = master_command[:] + ['--', 'mayapy']

        command.append(self._temp_file)
        command = author.Command(argv=command)

        task = author.Task(title=str(self.item.properties['name']))
        task.addCommand(command)

        rm_command = ['/bin/rm', '-f']
        rm_command.append(self._temp_file)
        rm_command = author.Command(argv=rm_command)
        rm_task = author.Task(title="rm tmp")
        rm_task.addCommand(rm_command)

        rm_task.addChild(task)

        job.addChild(rm_task)

        job.spool(hostname="10.0.20.83", owner=user_id)
コード例 #3
0
    def add_prman_render_task(self, parentTask, title, threads, rib, img):
        rm = self.bl_scene.renderman
        out_dir = '<OUT>'

        task = author.Task()
        task.title = title
        if img:
            task.preview = 'sho %s' % str(img)

        command = author.Command(local=False, service="PixarRender")
        command.argv = ["prman"]
        self._add_additional_prman_args(command.argv)

        proj = string_utils.expand_string(out_dir, asFilePath=True)

        command.argv.append('-Progress')
        command.argv.append('-t:%d' % threads)
        command.argv.append('-cwd')
        command.argv.append("%%D(%s)" % proj)

        # rib file
        command.argv.append("%%D(%s)" % rib)

        task.addCommand(command)
        parentTask.addChild(task)
コード例 #4
0
def add_prman_render_task(parentTask, title, threads, rib, img, args=[]):
    """Create a single prman task for a Tractor job.

    Args:
    - parentTask (Task) - parent task that this prman task belongs to.
    - title (str) - title to use for this task.
    - threads (int) - number of threads to use for this prman task.
    - rib (str) - full path to the RIB file to render.
    - img (str) - full path to the image file that will be generated by the
                  prman task. This is used to create the preview/chaser task.
    - args (list) - other args to pass to prman
    """

    task = author.Task()
    task.title = title
    if img:
        task.preview = 'sho %s' % str(img)

    command = author.Command(local=False, service="PixarRender")
    command.argv = ["prman"]
    for arg in args:
        command.argv.append(arg)

    for arg in ["-Progress", "-t:%d" % threads, "%%D(%s)" % rib]:
        command.argv.append(arg)

    task.addCommand(command)
    parentTask.addChild(task)
コード例 #5
0
def test_mayahandler():
    """This test shows how a two task job can be built with many more
    statements.
    """
    job = author.Job()
    job.title = "Simple maya job and handler"
    job.priority = 10
    job.comment = "This is a test job"
    job.projects = ["admin"]
    job.tier = "batch"
    job.tags = ["theWholeFarm"]
    job.envkey = ["maya2017"]

    mayaTask = author.Task()
    mayaTask.title = "Maya Job"
    #mayaTask.service = "Maya"

    mayaCommand = author.Command()
    mayaCommand.argv = "maya -batch -version"
    mayaCommand.service = "Maya"
    # mayaCommand.type = "RC"
    mayaTask.addCommand(mayaCommand)

    job.addChild(mayaTask)
    print job.asTcl()
コード例 #6
0
ファイル: job_examples.py プロジェクト: utsdab/sww
def job_upload_project():
    """This job could be to upload a maya project to dabrender
    """

    job = author.Job()
    job.title = "Upload Project Job"
    job.priority = 10
    job.after = then

    dabrender = "source"
    project = "project"

    job.newDirMap(src="/Volumes/dabrender", dst="dabrender/", zone="LINUX")
    job.newDirMap(src="/dabrender", dst="/Volumes/dabrender", zone="OSX")

    job.newAssignment(dabrender, "/Volumes/dabrender")
    job.newAssignment(project, "/Volumes/dabrender")

    job.comment = "Uploader to render place"
    job.metadata = "user=mattg project=dotty"
    job.editpolicy = "undergraduate"

    fgTask = author.Task()
    fgTask.title = "render fg"
    fgCommand = author.Command()
    fgCommand.argv = "prman foreground.rib"
    fgTask.addCommand(fgCommand)

    bgTask = author.Task()
    bgTask.title = "render bg"
    bgCommand = author.Command()
    bgCommand.argv = "prman background.rib"
    bgTask.addCommand(bgCommand)

    compTask = author.Task()
    compTask.title = "render comp"
    compCommand = author.Command()
    compCommand.argv = "comp fg.tif bg.tif final.tif"
    compCommand.argv = ["comp"]
    compTask.addCommand(compCommand)

    compTask.addChild(fgTask)
    compTask.addChild(bgTask)
    job.addChild(compTask)

    print job.asTcl()
コード例 #7
0
def add_maya_batch_render_task(parentTask,
                               title,
                               stash_scene_name,
                               img,
                               is_anim,
                               start,
                               end,
                               by,
                               args=[]):
    """Create a single Maya Render task for a Tractor job.

    Args:
    - parentTask (Task) - parent task that this Maya Render task belongs to.
    - title (str) - title to use for this task.
    - stash_scene_name (str) - full path to the scene file name.
    - img (str) - full path to the image file to create the preview/chaser task.
                  Only used if start==end i.e.: a single frame render.
    - is_anim (bool) - emit start, end, by args to the batch render command
    - start (int) - the start frame for an animation sequence.
    - end (int) - the end frame for an animation sequence.
    - by (int) - by frame (or step) for an animation sequence.
    - args (list) - other args to pass to maya batch
    """

    task = author.Task()
    task.title = title
    if start == end:
        if img:
            task.preview = 'sho %s' % str(img)

    command = author.Command(local=False, service="PixarRender")
    proj = mc.workspace(q=True, rd=True)

    rendercmd = "Render"
    command.argv = [rendercmd, "-r", "renderman", "-proj", "%%D(%s)" % proj]
    for arg in args:
        command.argv.append(arg)

    if is_anim:
        command.argv.append("-s")
        command.argv.append(start)
        command.argv.append("-e")
        command.argv.append(end)
        command.argv.append("-b")
        command.argv.append(by)

    command.argv.append("%%D(%s)" % stash_scene_name)

    task.addCommand(command)
    parentTask.addChild(task)
コード例 #8
0
ファイル: simpleBatchSubmitUI.py プロジェクト: utsdab/sww
    def build(self):
        '''
        build the job
        :return:
        '''

        self.job = author.Job(title="Simple Command Job",
                              priority=100,
                              envkey=["maya2015"],
                              service="PixarRender")

        #############################
        task = author.Task(title="Single Command", service="PixarRender")
        command1 = author.Command(argv=[os.path.join(self.command)])
        task.addCommand(command1)
        self.job.addChild(task)

        print "\n{}".format(self.job.asTcl())
コード例 #9
0
def add_txmake_task(parentTask, title, args):
    """Create a single txmake task for Tractor job.

    Args:
    - parentTask (Task) - parent task that this txmake task belongs to.
    - title (str) - title to use for this task.
    - args (list) - txmake args including input and output name

    """
    task = author.Task()
    task.title = title

    command = author.Command(local=False, service="PixarRender")
    argv = ['txmake'] + args
    command.argv = argv

    task.addCommand(command)
    parentTask.addChild(task)
コード例 #10
0
    def add_blender_render_task(self, frame, parentTask, title, bl_filename,
                                img):
        rm = self.bl_scene.renderman
        out_dir = '<OUT>'

        task = author.Task()
        task.title = title
        if img:
            task.preview = 'sho %s' % str(img)

        command = author.Command(local=False, service="PixarRender")
        bl_blender_path = bpy.app.binary_path
        command.argv = [bl_blender_path]

        command.argv.append('-b')
        command.argv.append('%%D(%s)' % bl_filename)
        command.argv.append('-f')
        command.argv.append(str(frame))

        task.addCommand(command)
        parentTask.addChild(task)
コード例 #11
0
def add_denoise_task(parentTask,
                     title,
                     args,
                     imgs,
                     preview_imgs=[],
                     variance_files=[]):
    """Create a single denoise task for Tractor job.

    Args:
    - parentTask (Task) - parent task that this denoise task belongs to.
    - title (str) - title to use for this task.
    - args (list) - arguments to denoiser
    - imgs (list) - list of images to be denoised
    - preview_imgs (list) - list of images to generate preview tasks
    - variance_files (list) - list of variance files

    """
    task = author.Task()
    task.title = title

    command = author.Command(local=False, service="PixarRender")
    command.argv = ["denoise"]
    for arg in args:
        command.argv.append(arg)
    for f in variance_files:
        command.argv.append("%%D(%s)" % f)

    for f in imgs:
        command.argv.append("%%D(%s)" % f)

    if preview_imgs:
        imgs = " ".join(str(x) for x in preview_imgs)
        task.preview = 'sho %s' % str(imgs)

    task.addCommand(command)
    parentTask.addChild(task)
コード例 #12
0
ファイル: TractorDispatcher.py プロジェクト: yarwelp/gaffer
    def __acquireTask(self, batch, dispatchData):

        # If we've already created a task for this batch, then
        # just return it. The Tractor API will take care of turning
        # it into an Instance if we add it as a subtask of more than
        # one parent.

        task = dispatchData["batchesToTasks"].get(batch)
        if task is not None:
            return task

        # Make a task.

        nodeName = batch.node().relativeName(dispatchData["scriptNode"])
        frames = str(IECore.frameListFromList([int(x)
                                               for x in batch.frames()]))
        task = author.Task(title=nodeName + " " + frames)

        # Generate a `gaffer execute` command line suitable for
        # executing the batch.

        args = [
            "gaffer",
            "execute",
            "-script",
            dispatchData["scriptFile"],
            "-nodes",
            nodeName,
            "-frames",
            frames,
        ]

        scriptContext = dispatchData["scriptNode"].context()
        contextArgs = []
        for entry in [
                k for k in batch.context().keys()
                if k != "frame" and not k.startswith("ui:")
        ]:
            if entry not in scriptContext.keys(
            ) or batch.context()[entry] != scriptContext[entry]:
                contextArgs.extend(["-" + entry, repr(batch.context()[entry])])

        if contextArgs:
            args.extend(["-context"] + contextArgs)

        # Create a Tractor command to execute that command line, and add
        # it to the task.

        command = author.Command(argv=args)
        task.addCommand(command)

        # Apply any custom dispatch settings to the command.

        tractorPlug = batch.node()["dispatcher"].getChild("tractor")
        if tractorPlug is not None:
            ## \todo Remove these manual substitutions once #887 is resolved.
            # Note though that we will need to use `with batch.context()` to
            # ensure the substitutions occur in the right context.
            command.service = batch.context().substitute(
                tractorPlug["service"].getValue())
            command.tags = batch.context().substitute(
                tractorPlug["tags"].getValue()).split()

        # Remember the task for next time, and return it.

        dispatchData["batchesToTasks"][batch] = task
        return task
コード例 #13
0
    def publish(self, settings, item):
        """
        Executes the publish logic for the given item and settings.

        :param settings: Dictionary of Settings. The keys are strings, matching
            the keys returned in the settings property. The values are `Setting`
            instances.
        :param item: Item to process
        """

        publisher = self.parent

        # get the path to create and publish
        publish_path = item.properties["path"]

        # ensure the publish folder exists:
        publish_folder = os.path.dirname(publish_path)
        self.parent.ensure_folder_exists(publish_folder)

        # set the alembic args that make the most sense when working with Mari.
        # These flags will ensure the export of an USD file that contains
        # all visible geometry from the current scene together with UV's and
        # face sets for use in Mari.

        usd_args = [
            '-shd "none"', '-dms "none"', '-uvs 1', '-cls 0', '-vis 1',
            '-mt 0', '-sl', '-sn 1',
            '-fs %f' % item.properties['sub_frame'],
            '-ft %f' % item.properties['sub_frame']
        ]

        # find the animated frame range to use:
        start_frame, end_frame = _find_scene_animation_range()
        if start_frame and end_frame:
            usd_args.append("-fr %d %d" % (start_frame, end_frame))

        # Set the output path:
        # Note: The AbcExport command expects forward slashes!

        sub_components = [
            x for x in cmds.ls(allPaths=1, ca=0, transforms=1, l=1)
            if cmds.listRelatives(x, p=1)
            and cmds.attributeQuery("Meshtype", node=x, exists=1)
            and cmds.getAttr(x + ".Meshtype", asString=True) == "component"
        ]

        if not sub_components:

            usd_args.append('-f "%s"' % publish_path.replace("\\", "/"))
            usd_export_cmd = ("usdExport %s" % " ".join(usd_args))

        else:

            asset_usd_path = self._get_sub_component_path(
                item.properties['name'], item)
            usd_args.append('-f "%s"' % asset_usd_path.replace("\\", "/"))
            usd_export_cmd = ("usdExport %s" % " ".join(usd_args))

        script = ''
        script += 'import maya.standalone\n'
        script += 'maya.standalone.initialize()\n'
        script += 'import maya.cmds as cmds\n'
        script += 'import maya.mel as mel\n'

        script += '\n'
        script += '\n'

        script += 'cmds.file("{}",open=1,force=1,iv=1)\n'.format(
            cmds.file(query=True, sn=True))
        script += 'cmds.select("{}")\n'.format(item.properties['name'])
        script += 'cmds.loadPlugin("pxrUsd.so")\n'
        script += 'mel.eval(\'{}\')\n'.format(usd_export_cmd)

        tmp_path = os.path.splitext(item.properties["path"])[0] + ".py"

        with open(tmp_path, 'w') as f:
            f.write(script)

        import sys
        sys.path.append(
            "/westworld/inhouse/tool/rez-packages/tractor/2.2.0/platform-linux/arch-x86_64/lib/python2.7/site-packages"
        )

        import tractor.api.author as author

        job = author.Job()
        job.service = "convert"
        job.priority = 50

        file_title = cmds.file(query=True,
                               sn=True).split(".")[0].split("/")[-1]
        project_name = item.context.project['name']
        user_name = item.context.user['name']
        user_id = os.environ['USER']

        temp = "] ["
        title = []
        title.append(user_name)
        title.append(project_name)
        title.append(file_title)
        title.append(item.properties['name'])
        title.append("%d - %d" % (start_frame, end_frame))
        title = temp.join(title)
        title = "[" + title + "]"
        job.title = str(title)

        command = ['rez-env', 'maya-2019vfarm', 'usd-19.03', '--', 'mayapy']
        command.append(tmp_path)
        command = author.Command(argv=command)

        task = author.Task(title=str(item.properties['name']))
        task.addCommand(command)

        rm_command = ['/bin/rm', '-f']
        rm_command.append(tmp_path)
        rm_command = author.Command(argv=rm_command)
        rm_task = author.Task(title="rm tmp")
        rm_task.addCommand(rm_command)

        rm_task.addChild(task)

        job.addChild(rm_task)

        job.spool(hostname="10.0.20.82", owner=user_id)

        return
コード例 #14
0
ファイル: job_examples.py プロジェクト: utsdab/sww
def test_all():
    """This test covers setting all possible attributes of the Job, Task,
    Command, and Iterate objects.
    """
    job = author.Job()
    job.title = "all attributes job"
    job.after = datetime.datetime(2012, 12, 14, 16, 24, 5)
    job.afterjids = [1234, 5678]
    job.paused = True
    job.tier = "express"
    job.projects = ["animation"]
    job.atleast = 2
    job.atmost = 4
    job.newAssignment("tempdir", "/tmp")
    job.newDirMap(src="X:/", dst="//fileserver/projects", zone="UNC")
    job.newDirMap(src="X:/", dst="/fileserver/projects", zone="NFS")
    job.etalevel = 5
    job.tags = ["tag1", "tag2", "tag3"]
    job.priority = 10
    job.service = "linux||mac"
    job.envkey = ["ej1", "ej2"]
    job.comment = "this is a great job"
    job.metadata = "show=rat shot=food"
    job.editpolicy = "canadians"
    job.addCleanup(author.Command(argv="/utils/cleanup this"))
    job.newCleanup(argv=["/utils/cleanup", "that"])
    job.addPostscript(author.Command(argv=["/utils/post", "this"]))
    job.newPostscript(argv="/utils/post that")

    compTask = author.Task()
    compTask.title = "render comp"
    compTask.resumeblock = True
    compCommand = author.Command()
    compCommand.argv = "comp /tmp/*"
    compTask.addCommand(compCommand)

    job.addChild(compTask)

    for i in range(2):
        task = author.Task()
        task.title = "render layer %d" % i
        task.id = "id%d" % i
        task.chaser = "chase file%i" % i
        task.preview = "preview file%i" % i
        task.service = "services&&more"
        task.atleast = 7
        task.atmost = 8
        task.serialsubtasks = 0
        task.addCleanup(author.Command(argv="/utils/cleanup file%i" % i))

        command = author.Command()
        command.argv = "prman layer%d.rib" % i
        command.msg = "command message"
        command.service = "cmdservice&&more"
        command.tags = ["tagA", "tagB"]
        command.metrics = "metrics string"
        command.id = "cmdid%i" % i
        command.refersto = "refersto%i" % i
        command.expand = 0
        command.atleast = 1
        command.atmost = 5
        command.samehost = 1
        command.envkey = ["e1", "e2"]
        command.retryrc = [1, 3, 5, 7, 9]
        command.resumewhile = [
            "/usr/utils/grep", "-q", "Checkpoint",
            "file.%d.exr" % i
        ]
        command.resumepin = bool(i)

        task.addCommand(command)
        compTask.addChild(task)

    iterate = author.Iterate()
    iterate.varname = "i"
    iterate.frm = 1
    iterate.to = 10
    iterate.addToTemplate(
        author.Task(title="process task", argv="process command"))
    iterate.addChild(author.Task(title="process task", argv="ls -l"))
    job.addChild(iterate)

    instance = author.Instance(title="id1")
    job.addChild(instance)

    print job.asTcl()
コード例 #15
0
    def _render_to_farm(self):

        import tractor.api.author as author

        start_frame = int(self.ui.start_frame.text())
        end_frame = int(self.ui.end_frame.text())
        file_name = FarmAPI.GetKatanaFileName()

        temp_file = self._get_temp_file(str(file_name))
        if not os.path.exists(os.path.dirname(temp_file)):
            os.makedirs(os.path.dirname(temp_file))
        status = shutil.copyfile(file_name, temp_file)

        for node in self.selected_nodes:
            job = author.Job()
            #job.title = '[Katana]' + file_name.split(".")[0].split("/")
            job.service = "Linux64"
            job.priority = 50

            file_title = file_name.split(".")[0].split("/")[-1]
            project_name = self._app.context.project['name']
            user_name = self._app.context.user['name']
            user_id = os.environ['USER']
            select_node = str(node.getName())

            temp = "] ["
            title = []
            title.append(user_name)
            title.append(project_name)
            title.append(file_title)
            title.append(select_node)
            title.append("%d - %d" % (start_frame, end_frame))
            title = temp.join(title)
            title = "[" + title + "]"
            job.title = str(title)

            for frame in range(start_frame, end_frame + 1):
                task = author.Task(title=str(frame))

                if os.environ['REZ_KATANA_VERSION'] == "3.1v2":
                    command = [
                        'rez-env', 'katana-3.1v2', 'renderman-22', 'usd-19.03',
                        'yeti', '--', 'katana'
                    ]
                else:
                    command = [
                        'rez-env', 'katana-2.6v4', 'renderman-21.8',
                        'usd-19.03', 'yeti-2.2.9', '--', 'katana'
                    ]
                command.append("--batch")
                command.append("--katana-file=%s" % temp_file)
                command.append("--render-node=%s" % node.getName())
                command.append(str("--t=%d-%d" % (frame, frame)))
                command = author.Command(argv=command)
                task.addCommand(command)
                job.addChild(task)

            job.spool(hostname="10.0.20.82", owner=user_id)

        self.close()
        return
コード例 #16
0
ファイル: mayaBatchSubmitUI.py プロジェクト: utsdab/sww
    def build(self):
        self.__mayascenefullpath = "%s/%s" % (self.mayaprojectpath,
                                              self.mayascene)
        self.__mayascenebase = os.path.splitext(self.mayascene)[0]

        self.job = author.Job(title="MayaBatch Render Job",
                              priority=100,
                              envkey=["maya%s" % self.mayaversion],
                              service="PixarRender")

        ############### task 1 ##############
        task = author.Task(title="Make output directory",
                           service="PixarRender")
        makediectory = author.Command(
            argv=["mkdir",
                  os.path.join(self.mayaprojectpath, "images")])
        task.addCommand(makediectory)
        self.job.addChild(task)

        ############### task 2 ###########
        task = author.Task(title="Copy Project Locally", service="PixarRender")
        copyin = author.Command(argv=[
            "scp",
            "%s:%s" % (self.centralworkarea, self.mayaprojectpath),
            "%s:%s" % (self.localhost, self.localworkarea)
        ])
        task.addCommand(copyin)
        self.job.addChild(task)

        ############### task 3 ##############
        task = author.Task(title="Rendering", service="PixarRender")

        if ((self.endframe - self.startframe) < self.framechunks):
            self.framechunks = 1
            chunkend = self.endframe
        else:
            chunkend = self.startframe + self.framechunks

        chunkstart = self.startframe

        while (self.endframe >= chunkstart):

            if chunkend >= self.endframe:
                chunkend = self.endframe

            render = author.Command(argv=[
                "mayabatch", self.options, "-proj", self.mayaprojectpath,
                "-start",
                "%s" % (chunkstart), "-end",
                "%s" % (chunkend), "-by", self.byframe, "-rd",
                self.renderdirectory, "-im", self.imagetemplate, "-r",
                self.renderer, self.options, self.__mayascenefullpath
            ])

            task.addCommand(render)
            chunkstart = chunkend + 1
            chunkend = chunkend + self.framechunks

        self.job.addChild(task)

        ############### task 4 ###############
        task = author.Task(title="Copy Project Back", service="PixarRender")
        copyout = author.Command(argv=[
            "scp",
            "%s:%s" % (self.localhost, self.localworkarea),
            "%s:%s" % (self.centralworkarea, self.mayaprojectpath)
        ])
        task.addCommand(copyout)
        self.job.addChild(task)

        print "\n{}".format(self.job.asTcl())
コード例 #17
0
ファイル: render_prman_factory.py プロジェクト: utsdab/sww
    def build(self):
        '''
        Main method to build the job
        :return:
        '''
        # ################ 0 JOB ################
        self.job = self.farmjob.author.Job(title="RM: {} {} {}-{}".format(
              self.renderusername,self.scenename,self.startframe,self.endframe),
              priority=10,
              envkey=[self.envkey_rfm,"ProjectX",
                    "TYPE={}".format(self.envtype),
                    "SHOW={}".format(self.envshow),
                    "PROJECT={}".format(self.envproject),
                    "SCENE={}".format(self.envscene),
                    "SCENENAME={}".format(self.scenebasename)],
              metadata="user={} username={} usernumber={}".format( self.user, self.renderusername,self.renderusernumber),
              comment="LocalUser is {} {} {}".format(self.user,self.renderusername,self.renderusernumber),
              projects=[str(self.projectgroup)],
              tier=str(self.farmjob.getdefault("renderjob","rendertier")),
              tags=["theWholeFarm", ],
              service="")


        # ############## 0 ThisJob #################
        task_thisjob = self.farmjob.author.Task(title="Renderman Job")
        task_thisjob.serialsubtasks = 1

        # ############## 1 PREFLIGHT ##############
        task_preflight = self.farmjob.author.Task(title="Preflight")
        task_preflight.serialsubtasks = 1
        task_thisjob.addChild(task_preflight)
        task_generate_rib_preflight = self.farmjob.author.Task(title="Generate RIB Preflight")
        command_ribgen = self.farmjob.author.Command(argv=["maya","-batch","-proj", self.mayaprojectpath,
                                              "-command",
                                              "renderManBatchGenRibForLayer {layerid} {start} {end} {phase}".format(
                                                  layerid=0, start=self.startframe, end=self.endframe, phase=1),
                                              "-file", self.mayascenefilefullpath],
                                              tags=["maya", "theWholeFarm"],
                                              atleast=int(self.threads),
                                              atmost=int(self.threads),
                                              service="RfMRibGen")
        task_generate_rib_preflight.addCommand(command_ribgen)
        task_preflight.addChild(task_generate_rib_preflight)
        task_render_preflight = author.Task(title="Render Preflight")

        command_render_preflight = author.Command(argv=[
                "prman","-t:{}".format(self.threads), "-Progress", "-recover", "%r", "-checkpoint", "5m",
                "-cwd", self.mayaprojectpath,
                "renderman/{}/rib/job/job.rib".format(self.scenebasename)],
                tags=["prman", "theWholeFarm"],
                atleast=int(self.threads),
                atmost=int(self.threads),
                service="PixarRender")

        task_render_preflight.addCommand(command_render_preflight)
        task_preflight.addChild(task_render_preflight)

        # ############## 3 RIBGEN ##############
        task_render_allframes = self.farmjob.author.Task(title="ALL FRAMES {}-{}".format(self.startframe, self.endframe))
        task_render_allframes.serialsubtasks = 1
        task_ribgen_allframes = self.farmjob.author.Task(title="RIB GEN {}-{}".format(self.startframe, self.endframe))

        # divide the frame range up into chunks
        _totalframes=int(self.endframe-self.startframe+1)
        _chunks = int(self.ribgenchunks)
        _framesperchunk=_totalframes
        if _chunks < _totalframes:
            _framesperchunk=int(_totalframes/_chunks)
        else:
            _chunks=1

        # loop thru chunks
        for i,chunk in enumerate(range(1,_chunks+1)):
            _offset=i*_framesperchunk
            _chunkstart=(self.startframe+_offset)
            _chunkend=(_offset+_framesperchunk)
            logger.info("Chunk {} is frames {}-{}".format(chunk, _chunkstart, _chunkend))

            if chunk == _chunks:
                _chunkend = self.endframe

            task_generate_rib = author.Task(title="RIB GEN chunk {} frames {}-{}".format(
                    chunk, _chunkstart, _chunkend ))
            command_generate_rib = author.Command(argv=[
                    "maya", "-batch", "-proj", self.mayaprojectpath, "-command",
                    "renderManBatchGenRibForLayer {layerid} {start} {end} {phase}".format(
                            layerid=0, start=_chunkstart, end=_chunkend, phase=2),
                            "-file", self.mayascenefilefullpath],
                    tags=["maya", "theWholeFarm"],
                    atleast=int(self.threads),
                    atmost=int(self.threads),
                    service="RfMRibGen")
            task_generate_rib.addCommand(command_generate_rib)
            task_ribgen_allframes.addChild(task_generate_rib)

        task_render_allframes.addChild(task_ribgen_allframes)


        # ############### 4 RENDER ##############
        task_render_frames = self.farmjob.author.Task(title="RENDER Frames {}-{}".format(self.startframe, self.endframe))
        task_render_frames.serialsubtasks = 0

        for frame in range(self.startframe, (self.endframe + 1), self.byframe):
            _imgfile = "{proj}/{scenebase}.{frame:04d}.{ext}".format(
                proj=self.renderdirectory, scenebase=self.scenebasename, frame=frame, ext=self.outformat)
            _statsfile = "{proj}/rib/{frame:04d}/{frame:04d}.xml".format(
                proj=self.rendermanpath, frame=frame)
            _ribfile = "{proj}/rib/{frame:04d}/{frame:04d}.rib".format(
                proj=self.rendermanpath, frame=frame)

            task_render_rib = self.farmjob.author.Task(title="RENDER Frame {}".format(frame),
                                          preview="sho {}".format(_imgfile),
                                          metadata="statsfile={} imgfile={}".format(_statsfile, _imgfile))
            commonargs = ["prman", "-cwd", self.mayaprojectpath]

            rendererspecificargs = []

            # ################ handle image resolution formats ###########
            if self.resolution == "720p":
                self.xres, self.yres = 1280, 720
                rendererspecificargs.extend(["-res", "%s" % self.xres, "%s" % self.yres])
            elif self.resolution == "1080p":
                self.xres, self.yres = 1920, 1080
                rendererspecificargs.extend(["-res", "%s" % self.xres, "%s" % self.yres])
            elif self.resolution == "540p":
                self.xres, self.yres = 960, 540
                rendererspecificargs.extend(["-res", "%s" % self.xres, "%s" % self.yres])
            elif self.resolution == "108p":
                self.xres, self.yres = 192, 108
                rendererspecificargs.extend(["-res", "%s" % self.xres, "%s" % self.yres])

            if self.rendermaxsamples != "FROMFILE":
                rendererspecificargs.extend([ "-maxsamples", "{}".format(self.rendermaxsamples) ])

            # if self.threadmemory != "FROMFILE":
            #     rendererspecificargs.extend([ "-memorylimit", "{}".format(self.threadmemory) ])

            rendererspecificargs.extend([
                # "-pad", "4",
                # "-memorylimit", self.threadmemory,  # mb
                "-t:{}".format(self.threads),
                "-Progress",
                "-recover", "%r",
                "-checkpoint", "5m",
                "-statslevel", "2",
                #"-maxsamples", "{}".format(self.rendermaxsamples)  # override RIB ray trace hider maxsamples
                # "-pixelvariance","3"      # override RIB PixelVariance
                # "-d", ""                  # dispType
                #                 -version          : print the version
                # "-progress    ",     : print percent complete while rendering
                # -recover [0|1]    : resuming rendering partial frames
                # -t:X              : render using 'X' threads
                # -woff msgid,...   : suppress error messages from provided list
                # -catrib file      : write RIB to 'file' without rendering
                # -ascii            : write RIB to ASCII format file
                # -binary           : write RIB to Binary format file
                # -gzip             : compress output file
                # -capture file     : write RIB to 'file' while rendering
                # -nobake           : disallow re-render baking
                # -res x y[:par]    : override RIB Format
                # -crop xmin xmax ymin ymax
                #                   : override RIB CropWindow
                # -maxsamples i     : override RIB ray trace hider maxsamples
                # -pixelvariance f  : override RIB PixelVariance
                # -d dispType       : override RIB Display type
                # -statsfile f      : override RIB stats file & level (1)
                # -statslevel i     : override RIB stats level
                # -memorylimit f    : override RIB to set memory limit ratio
                # -checkpoint t[,t] : checkpoint interval and optional exit time
            ])
            userspecificargs = [ utils.expandargumentstring(self.options),"{}".format(_ribfile)]
            finalargs = commonargs + rendererspecificargs + userspecificargs
            command_render = self.farmjob.author.Command(argv=finalargs,
                                            #envkey=[self.envkey_prman],
                                            tags=["prman", "theWholeFarm"],
                                            atleast=int(self.threads),
                                            atmost=int(self.threads),
                                            service="PixarRender")

            task_render_rib.addCommand(command_render)
            task_render_frames.addChild(task_render_rib)

        task_render_allframes.addChild(task_render_frames)
        task_thisjob.addChild(task_render_allframes)


        # ############## 5 PROXY ###############
        if self.makeproxy:

            '''
            rvio cameraShape1/StillLife.####.exr  -v -fps 25
            -rthreads 4
            -outres 1280 720 -out8
            -leader simpleslate "UTS" "Artist=Anthony" "Show=Still_Life" "Shot=Testing"
            -overlay frameburn .4 1.0 30.0  -overlay matte 2.35 0.3 -overlay watermark "UTS 3D LAB" .2
            -outgamma 2.2
            -o cameraShape1_StillLife.mov
            '''

            #### making proxys with rvio
            _outmov = "{}/movies/{}.mov".format(self.mayaprojectpath, self.scenebasename,utils.getnow())
            _inseq = "{}.####.exr".format(self.scenebasename)    #cameraShape1/StillLife.####.exr"
            _directory = "{}/renderman/{}/images".format(self.mayaprojectpath, self.scenebasename)
            _seq = os.path.join(_directory, _inseq)


            try:
                utils.makedirectoriesinpath(os.path.dirname(_outmov))
            except Exception, err:
                logger.warn(err)

            try:
                _option1 = "-v -fps 25 -rthreads {threads} -outres {xres} {yres} -t {start}-{end}".format(
                           threads="4",
                           xres="1280",
                           yres = "720",
                           start=self.startframe,
                           end=self.endframe)
                _option2 = "-out8 -outgamma 2.2"
                _option3 = "-overlay frameburn 0.5 1.0 30 -leader simpleslate UTS_BDES_ANIMATION Type={} Show={} Project={} File={} Student={}-{} Group={} Date={}".format(
                                                                      self.envtype,
                                                                      self.envshow,
                                                                      self.envproject,
                                                                      self.scenebasename,
                                                                      self.user,
                                                                      self.renderusername,
                                                                      self.projectgroup,
                                                                      self.thedate)


                _output = "-o %s" % _outmov

                _rvio_cmd = [ utils.expandargumentstring("rvio %s %s %s %s %s" % (_seq, _option1, _option2, _option3, _output)) ]

                task_proxy = self.farmjob.author.Task(title="Proxy Generation")
                proxycommand = author.Command(argv=_rvio_cmd,
                                      service="Transcoding",
                                      tags=["rvio", "theWholeFarm"],
                                      envkey=["rvio"])
                task_proxy.addCommand(proxycommand)
                task_thisjob.addChild(task_proxy)

            except Exception, proxyerror:
                logger.warn("Cant make a proxy {}".format(proxyerror))
コード例 #18
0
    def batch_render(self):

        scene = self.bl_scene
        rm = scene.renderman
        frame_begin = self.bl_scene.frame_start
        frame_end = self.bl_scene.frame_end
        by = self.bl_scene.frame_step

        if not rm.external_animation:
            frame_begin = self.bl_scene.frame_current
            frame_end = frame_begin

        job = author.Job()

        scene_name = self.bl_scene.name
        bl_view_layer = self.depsgraph.view_layer.name
        job_title = 'untitled' if not bpy.data.filepath else \
            os.path.splitext(os.path.split(bpy.data.filepath)[1])[0]
        job_title += ' %s ' % bl_view_layer
        job_title += " frames %d-%d" % (frame_begin, frame_end) if frame_end \
            else " frame %d" % frame_begin

        job.title = str(job_title)

        job.serialsubtasks = True
        job.service = 'PixarRender'
        self.add_job_level_attrs(job)

        threads = self.bl_scene.renderman.batch_threads
        anim = (frame_begin != frame_end)

        tasktitle = "Render %s" % (str(scene_name))
        parent_task = author.Task()
        parent_task.title = tasktitle

        self.generate_rib_render_tasks(anim, parent_task, tasktitle,
                                       frame_begin, frame_end, by, threads)
        job.addChild(parent_task)

        # Don't denoise if we're baking
        if rm.hider_type == 'RAYTRACE':
            parent_task = self.generate_denoise_tasks(frame_begin, frame_end,
                                                      by)
            job.addChild(parent_task)

        bl_filename = bpy.data.filepath
        if bl_filename == '':
            jobfile = string_utils.expand_string('<OUT>/<scene>.<layer>.alf',
                                                 asFilePath=True)
        else:
            jobfile = os.path.splitext(
                bl_filename)[0] + '.%s.alf' % bl_view_layer.replace(' ', '_')

        jobFileCleanup = author.Command(local=False)
        jobFileCleanup.argv = [
            "TractorBuiltIn", "File", "delete",
            "%%D(%s)" % jobfile
        ]
        job.addCleanup(jobFileCleanup)

        try:
            f = open(jobfile, 'w')
            as_tcl = job.asTcl()
            f.write(as_tcl)
            f.close()
        except IOError as ioe:
            rfb_log().error('IO Exception when writing job file %s: %s' %
                            (jobfile, str(ioe)))
            return
        except Exception as e:
            rfb_log().error('Could not write job file %s: %s' %
                            (jobfile, str(e)))
            return

        self.spool(job, jobfile)
コード例 #19
0
    def generate_denoise_tasks(self, start, last, by):

        tasktitle = "Denoiser Renders"
        parent_task = author.Task()
        parent_task.title = tasktitle
        rm = self.bl_scene.renderman
        denoise_options = []
        if rm.denoise_cmd != '':
            denoise_options.append(rm.denoise_cmd)
        if rm.denoise_gpu:
            denoise_options.append('--override gpuIndex 0 --')

        # any cross frame?
        do_cross_frame = False
        dspys_dict = display_utils.get_dspy_dict(self.rman_scene,
                                                 expandTokens=False)
        for dspy, params in dspys_dict['displays'].items():
            if not params['denoise']:
                continue
            if params['denoise_mode'] == 'crossframe':
                do_cross_frame = True
                break

        if start == last:
            do_cross_frame = False

        if do_cross_frame:
            # for crossframe, do it all in one task
            cur_frame = self.rman_scene.bl_frame_current
            task = author.Task()
            task.title = 'Denoise Cross Frame'
            command = author.Command(local=False, service="PixarRender")

            command.argv = ["denoise"]
            command.argv.extend(denoise_options)
            command.argv.append('--crossframe')
            command.argv.append('-v')
            command.argv.append('variance')

            for frame_num in range(start, last + 1, by):
                self.rman_render.bl_frame_current = frame_num

                variance_file = string_utils.expand_string(
                    dspys_dict['displays']['beauty']['filePath'],
                    frame=frame_num,
                    asFilePath=True)

                for dspy, params in dspys_dict['displays'].items():
                    if not params['denoise']:
                        continue

                    if dspy == 'beauty':
                        command.argv.append(variance_file)
                    else:
                        command.argv.append(variance_file)
                        aov_file = string_utils.expand_string(
                            params['filePath'],
                            frame=frame_num,
                            asFilePath=True)
                        command.argv.append(aov_file)

            task.addCommand(command)
            parent_task.addChild(task)

        else:
            # singlframe
            cur_frame = self.rman_scene.bl_frame_current
            for frame_num in range(start, last + 1, by):
                self.rman_render.bl_frame_current = frame_num

                variance_file = string_utils.expand_string(
                    dspys_dict['displays']['beauty']['filePath'],
                    frame=frame_num,
                    asFilePath=True)

                for dspy, params in dspys_dict['displays'].items():
                    if not params['denoise']:
                        continue

                    if params['denoise_mode'] != 'singleframe':
                        continue

                    task = author.Task()
                    task.title = 'Denoise Frame %d' % frame_num
                    command = author.Command(local=False,
                                             service="PixarRender")

                    command.argv = ["denoise"]
                    command.argv.extend(denoise_options)
                    if dspy == 'beauty':
                        command.argv.append(variance_file)
                    else:
                        command.argv.append(variance_file)
                        aov_file = string_utils.expand_string(
                            params['filePath'],
                            frame=frame_num,
                            asFilePath=True)
                        command.argv.append(aov_file)

                    task.addCommand(command)
                    parent_task.addChild(task)

        self.rman_render.bl_frame_current = cur_frame
        return parent_task
コード例 #20
0
    def build(self):
        """
        main build of job
        :return:
        """
        self.__mayascenefullpath = "%s/%s" % (self.mayaprojectpath,
                                              self.mayascene)
        self.__mayascenebase = os.path.splitext(self.mayascene)[0]

        env = self.fj.author.Command(argv=["printenv"])
        pwd = self.fj.author.Command(argv=["pwd"])

        task1 = author.Task(title="Make output directory",
                            service="PixarRender")
        makediectory = author.Command(
            argv=["mkdir",
                  os.path.join(self.mayaprojectpath, "images")])
        task1.addCommand(makediectory)
        self.job.addChild(task1)

        task2 = author.Task(title="Copy Project Locally",
                            service="PixarRender")
        copyin = author.Command(argv=[
            "scp",
            "%s:%s" % (self.centralworkarea, self.mayaprojectpath),
            "%s:%s" % (self.localhost, self.localworkarea)
        ])
        task2.addCommand(copyin)
        self.job.addChild(task2)

        if self.renderer == "mr":
            pass
        elif self.renderer == "rman":
            pass
        elif self.renderer == "maya":
            pass

        task3 = author.Task(title="Rendering", service="PixarRender")

        if (self.endframe - self.startframe) < self.framechunks:
            self.framechunks = 1
            chunkend = self.endframe
        else:
            chunkend = self.startframe + self.framechunks

        chunkstart = self.startframe
        while self.endframe >= chunkstart:
            if chunkend >= self.endframe:
                chunkend = self.endframe

            commonargs = [
                "Render", "-r", self.renderer, "-proj", self.mayaprojectpath,
                "-start",
                "%s" % chunkstart, "-end",
                "%s" % chunkend, "-by", self.byframe, "-rd",
                self.renderdirectory, "-im", self.imagetemplate
            ]

            rendererspecificargs = [
                self.expandArgumentString(self.options),
                self.__mayascenefullpath
            ]
            finalargs = commonargs + rendererspecificargs
            render = author.Command(argv=finalargs)
            task3.addCommand(render)
            chunkstart = chunkend + 1
            chunkend += self.framechunks

        self.job.addChild(task3)

        # ############## task 4 ###############
        task4 = author.Task(title="Copy Project Back", service="PixarRender")
        copyout = author.Command(argv=[
            "scp",
            "%s:%s" % (self.localhost, self.localworkarea),
            "%s:%s" % (self.centralworkarea, self.mayaprojectpath)
        ])
        task4.addCommand(copyout)
        self.job.addChild(task4)

        print "\n{}".format(self.job.asTcl())
コード例 #21
0
ファイル: render_prman_factory.py プロジェクト: utsdab/sww
 def mail(self, level="Level", trigger="Trigger", body="Render Progress Body"):
     bodystring = "Prman Render Progress: \nLevel: {}\nTrigger: {}\n\n{}".format(level, trigger, body)
     subjectstring = "FARM JOB: %s %s" % (str(self.scenebasename), self.renderusername)
     mailcmd = author.Command(argv=["sendmail.py", "-t", "*****@*****.**" % self.user,
                                    "-b", bodystring, "-s", subjectstring], service="ShellServices")
     return mailcmd
コード例 #22
0
def makeJob(entries):
    for entry in entries:
        field = entry[0]
        text = entry[1].get()
        print('%s: "%s"' % ( field, text))

    mayaversion = entries[0][1].get()
    mayaprojectpath = entries[1][1].get()
    mayascene = entries[2][1].get()
    mayascenefullpath = "%s/%s" % (mayaprojectpath, mayascene)

    mayascenebase = os.path.splitext(mayascene)[0]
    startframe = (entries[3][1].get())
    endframe = (entries[4][1].get())
    byframe = (entries[5][1].get())
    chunks = (entries[6][1].get())
    options = (entries[7][1].get())

    job = author.Job(title="MayaBatch Render Job",
                     priority=100,
                     envkey=["maya%s" % mayaversion],
                     service="PixarRender")

    task = author.Task(title="Copy Project Locally", service="PixarRender")
    copyin = author.Command(argv=["scp", "remote:%s" % (mayaprojectpath), "/Volume/localrender/"])
    task.addCommand(copyin)
    job.addChild(task)

    task = author.Task(title="Make output directory", service="PixarRender")
    makediectory = author.Command(argv=["mkdir", "%s/%s/%s" % (mayaprojectpath, "images", mayascenebase)])
    task.addCommand(makediectory)
    job.addChild(task)

    if ( int(chunks) > (int(endframe) - int(startframe)) ):
        chunk = 1
        framesperchunk = (int(endframe) - int(startframe) + 1)
        remainder = 0
    else:
        (framesperchunk, remainder) = divmod((int(endframe) - int(startframe) + 1), int(chunks))
        chunk = chunks

    # print int(startframe),int(endframe),int(chunk),int(chunks),int(remainder),int(framesperchunk)


    task = author.Task(title="Rendering", service="PixarRender")
    for i in range(0, int(chunk)):
        sf = (int(startframe) + (i * int(framesperchunk)) )
        ef = (int(startframe) + (i * int(framesperchunk)) + int(framesperchunk) - 1 )

        if (ef >= int(endframe) or (i == int(chunks) - 1)):
            ef = int(endframe)

        render = author.Command(argv=["mayabatch",
                                      options,
                                      "-proj", mayaprojectpath,
                                      "-start", "%s" % (sf),
                                      "-end", "%s" % (ef),
                                      "-by", byframe,
                                      mayascenefullpath])

        task.addCommand(render)
    job.addChild(task)

    task = author.Task(title="Copy Project Back", service="PixarRender")
    copyout = author.Command(argv=["scp", "/local/file.tif", "remote:/path/file.tif"])
    task.addCommand(copyout)
    job.addChild(task)

    print "\n{}".format(job.asTcl())
コード例 #23
0
    def export(self):
        self.close()

        # Get user, project, and time info so we can make a temp folder
        user = self.environment.get_current_username()
        projectName = self.project.get_name().lower()
        time_now = datetime.datetime.now()

        #Make a temp folder for the rib files based on the user and the current time
        ribDir = self.project.get_project_dir(
        ) + '/ribs/' + user + '_' + time_now.strftime('%m%d%y_%H%M%S')
        print 'ribDir', ribDir, ' renderNodes size: ', len(self.renderNodes)
        os.makedirs(ribDir)

        # Sanitize job title
        title = re.sub(r'[{}"\']', '',
                       str(self.jobName.text())).strip(' \t\n\r')
        if len(title) == 0:
            title = self.empty_text

        numCores = int(
            re.sub(r'[{}"\']', '', str(self.numCores.text())).strip(' \t\n\r'))
        if numCores < 1:
            numCores = 1

        # This job we send to tractor
        job = author.Job()
        job.title = title
        job.priority = self.priority.currentIndex()
        path = '/opt/pixar/RenderManProServer-21.5/bin/'
        job.envkey = [
            'setenv PATH=' + path +
            ' RMANTREE=/opt/pixar/RenderManProServer-21.5'
        ]
        job.service = 'PixarRender'
        job.comment = 'Spooled by ' + user

        # Loop through each frame of our nodes and create frame tasks and append it to the job script
        for index, node in enumerate(self.renderNodes):
            # Make sure this node was selected for export
            print node.name()
            if self.select.item(index).isSelected():
                name = node.name()
                validFrameRange = node.parm('trange').eval()
                if validFrameRange == 0:
                    start = int(hou.frame())
                    end = int(hou.frame())
                    step = 1
                else:
                    start = int(node.parm('f1').eval())
                    end = int(node.parm('f2').eval())
                    step = int(node.parm('f3').eval())
                task = author.Task()
                task.title = '%s [%d-%d]' % (name, start, end)

                oldOutputMode = node.parm('rib_outputmode').eval()
                try:
                    oldDiskFile = node.parm('soho_diskfile').expression()
                    useExpression = True
                    print 'We are getting rid of expressiion'
                except:
                    oldDiskFile = node.parm('soho_diskfile').eval()
                    useExpression = False
                    print 'we didn\'t get rid of them'
                # Activate rib output
                node.parm('rib_outputmode').set(True)
                node.parm('soho_diskfile').deleteAllKeyframes()
                node.parm('soho_diskfile').set(ribDir +
                                               ('/%s_$F04.rib' % name))

                print 'start rib making'
                script = os.path.join(self.project.get_project_dir(),
                                      'byu-pipeline-tools', 'houdini-tools',
                                      'parallelRibs', 'taskDistribution.sh')
                subprocess.call([
                    'sh', script,
                    str(start),
                    str(end),
                    str(node.path()),
                    str(saveHipRenderCopy()),
                    str(numCores)
                ])
                print 'finish rib making'

                # Loop through every frame in framerange
                for frame in range(start, end + 1, step):
                    subtask = author.Task()
                    subtask.title = 'Frame %04d' % (frame)
                    ribFile = '%s/%s_%04d.rib' % (ribDir, name, frame)
                    print 'Here is the rib file ', ribFile

                    # Commands for Debugging
                    cmdPATH = author.Command()
                    cmdPATH.argv = ['echo', '${PATH}']
                    cmdRMANTREE = author.Command()
                    cmdRMANTREE.argv = ['echo', '${RMANTREE}']
                    printenv = author.Command()
                    printenv.argv = ['printenv']
                    # subtask.addCommand(cmdPATH)
                    # subtask.addCommand(cmdRMANTREE)
                    # subtask.addCommand(printenv)

                    # Real Commands
                    command = author.Command()
                    command.argv = ['prman', '-progress', ribFile]
                    command.service = 'PixarRender'
                    subtask.addCommand(command)
                    task.addChild(subtask)
                job.addChild(task)

                # Restore rib output
                node.parm('soho_outputmode').set(oldOutputMode)
                if useExpression:
                    node.parm('soho_diskfile').setExpression(oldDiskFile)
                else:
                    node.parm('soho_diskfile').set(oldDiskFile)

        command = author.Command()
        command.argv = ['rm', '-rf', ribDir]
        job.addCleanup(command)

        # print 'This is the new job script \n', job.asTcl()

        # Attempt to spool job, with the option to keep trying
        choice = True
        while choice:
            try:
                job.spool()
                message_gui.info('Job sent to Tractor!')
                break
            except Exception as err:
                choice = message_gui.yes_or_no(
                    'We ran into this problem while spooling the job:\nWould you like to try again?',
                    details=str(err),
                    title='Continue?')
        #Cleanup ifd files, if they didn't want to retry
        if not choice:
            shutil.rmtree(ribDir)