Exemple #1
0
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_COMPOSITION
    global DRQUEUE_PROJECTDIR
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME, DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "aerender"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(DRQUEUE_SCENEFILE, 'n:')
	      DRQUEUE_COMPOSITION = helper.replace_stdpath_with_driveletter(DRQUEUE_COMPOSITION, 'n:')
	      DRQUEUE_PROJECTDIR = helper.replace_stdpath_with_driveletter(DRQUEUE_PROJECTDIR, 'n:')
Exemple #2
0
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_RENDERTYPE
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME,
                              DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "blender"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(
            DRQUEUE_SCENEFILE, 'n:')

    # distinguish between animation and distributed single frame rendering
    if DRQUEUE_RENDERTYPE == "animation":
        os.putenv("startframe", str(DRQUEUE_FRAME))
        os.putenv("endframe", str(block))
        command = engine_path + " -noaudio -b \"" + DRQUEUE_SCENEFILE + "\" -P " + os.path.join(
            DRQUEUE_ETC, "blender_same_directory.py")
    else:
        os.putenv("curpart", str(DRQUEUE_FRAME))
        os.outenv("maxparts", str(DRQUEUE_ENDFRAME))
        command = engine_path + " -noaudio -b \"" + DRQUEUE_SCENEFILE + "\" -P " + os.path.join(
            DRQUEUE_ETC, "blender_region_rendering.py")

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)
Exemple #3
0
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_CONFIGDIR
    global DRQUEUE_PROJECTDIR
    global DRQUEUE_STEPFRAME
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME,
                              DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "lwsn"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(
            DRQUEUE_SCENEFILE, 'n:')
        DRQUEUE_PROJECTDIR = helper.replace_stdpath_with_driveletter(
            DRQUEUE_PROJECTDIR, 'n:')
        DRQUEUE_CONFIGDIR = helper.replace_stdpath_with_driveletter(
            DRQUEUE_CONFIGDIR, 'n:')

    command = engine_path + " -3 -c " + DRQUEUE_CONFIGDIR + " -d " + DRQUEUE_PROJECTDIR + " -q " + DRQUEUE_SCENEFILE + " " + str(
        DRQUEUE_FRAME) + " " + str(block) + " " + str(DRQUEUE_STEPFRAME)

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_IMAGE
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME, DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "3dsmaxcmd.exe"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(DRQUEUE_SCENEFILE, 'n:')

    if ("DRQUEUE_IMAGE" in globals()) and (DRQUEUE_IMAGE != ""):
        cimage = "-o " + DRQUEUE_IMAGE
    else:
        cimage = ""

    command = engine_path + " -rfw:0 -frames: " + str(DRQUEUE_FRAME) + " " + cimage + " " + DRQUEUE_SCENEFILE

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME,
                              DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "vray"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(
            DRQUEUE_SCENEFILE, 'n:')

    command = engine_path + " -scenefile=" + DRQUEUE_SCENEFILE + " -numThreads=0 -autoClose=1 -frames=" + str(
        DRQUEUE_FRAME) + " -display=0"

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_CUSTOM_BUCKET
    global DRQUEUE_BUCKETSIZE
    global DRQUEUE_CUSTOM_LOD
    global DRQUEUE_LOD
    global DRQUEUE_CUSTOM_VARYAA
    global DRQUEUE_VARYAA
    global DRQUEUE_RAYTRACE
    global DRQUEUE_ANTIALIAS
    global DRQUEUE_CUSTOM_BDEPTH
    global DRQUEUE_BDEPTH
    global DRQUEUE_CUSTOM_ZDEPTH
    global DRQUEUE_ZDEPTH
    global DRQUEUE_CUSTOM_CRACKS
    global DRQUEUE_CRACKS
    global DRQUEUE_CUSTOM_QUALITY
    global DRQUEUE_QUALITY
    global DRQUEUE_CUSTOM_QFINER
    global DRQUEUE_QFINER
    global DRQUEUE_CUSTOM_SMULTIPLIER
    global DRQUEUE_SMULTIPLIER
    global DRQUEUE_CUSTOM_MPCACHE
    global DRQUEUE_MPCACHE
    global DRQUEUE_CUSTOM_SMPOLYGON
    global DRQUEUE_SMPOLYGON
    global DRQUEUE_CUSTOM_WH
    global DRQUEUE_RESX
    global DRQUEUE_RESY
    global DRQUEUE_CUSTOM_TYPE
    global DRQUEUE_CTYPE
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME,
                              DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "mantra"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(
            DRQUEUE_SCENEFILE, 'n:')

    if ("DRQUEUE_CUSTOM_BUCKET" in globals()) and (DRQUEUE_CUSTOM_BUCKET
                                                   == "yes"):
        bucket_args = "-B " + DRQUEUE_BUCKETSIZE
    else:
        bucket_args = ""

    if ("DRQUEUE_CUSTOM_LOD" in globals()) and (DRQUEUE_CUSTOM_LOD == "yes"):
        lod_args = "-L " + DRQUEUE_LOD
    else:
        lod_args = ""

    if ("DRQUEUE_CUSTOM_VARYAA" in globals()) and (DRQUEUE_CUSTOM_VARYAA
                                                   == "yes"):
        varyaa_args = "-v " + DRQUEUE_VARYAA
    else:
        varyaa_args = ""

    if ("DRQUEUE_RAYTRACE" in globals()) and (DRQUEUE_RAYTRACE == "yes"):
        raytrace_args = "-r"
    else:
        raytrace_args = ""

    if ("DRQUEUE_ANTIALIAS" in globals()) and (DRQUEUE_ANTIALIAS == "yes"):
        antialias_args = "-A"
    else:
        antialias_args = ""

    if ("DRQUEUE_CUSTOM_BDEPTH" in globals()) and (DRQUEUE_CUSTOM_BDEPTH
                                                   == "yes"):
        bdepth_args = "-b " + DRQUEUE_BDEPTH
    else:
        bdepth_args = ""

    if ("DRQUEUE_CUSTOM_ZDEPTH" in globals()) and (DRQUEUE_CUSTOM_ZDEPTH
                                                   == "yes"):
        if DRQUEUE_ZDEPTH == "average":
            zdepth_args = "-z"
        else:
            zdepth_args = "-Z"
    else:
        zdepth_args = ""

    if ("DRQUEUE_CUSTOM_CRACKS" in globals()) and (DRQUEUE_CUSTOM_CRACKS
                                                   == "yes"):
        cracks_args = "-c " + DRQUEUE_CRACKS
    else:
        cracks_args = ""

    if ("DRQUEUE_CUSTOM_QUALITY" in globals()) and (DRQUEUE_CUSTOM_QUALITY
                                                    == "yes"):
        quality_args = "-q " + DRQUEUE_QUALITY
    else:
        quality_args = ""

    if ("DRQUEUE_CUSTOM_QFINER" in globals()) and (DRQUEUE_CUSTOM_QFINER
                                                   == "yes"):
        qfiner_args = "-Q " + DRQUEUE_QFINER
    else:
        qfiner_args = ""

    if ("DRQUEUE_CUSTOM_SMULTIPLIER"
            in globals()) and (DRQUEUE_CUSTOM_SMULTIPLIER == "yes"):
        smultiplier_args = "-s " + DRQUEUE_SMULTIPLIER
    else:
        smultiplier_args = ""

    if ("DRQUEUE_CUSTOM_MPCACHE" in globals()) and (DRQUEUE_CUSTOM_MPCACHE
                                                    == "yes"):
        mpcache_args = "-G " + DRQUEUE_MPCACHE
    else:
        mpcache_args = ""

    if ("DRQUEUE_CUSTOM_MCACHE" in globals()) and (DRQUEUE_CUSTOM_MCACHE
                                                   == "yes"):
        mcache_args = "-G " + DRQUEUE_MCACHE
    else:
        mcache_args = ""

    if ("DRQUEUE_CUSTOM_SMPOLYGON" in globals()) and (DRQUEUE_CUSTOM_SMPOLYGON
                                                      == "yes"):
        smpolygon_args = "-S " + DRQUEUE_SMPOLYGON
    else:
        smpolygon_args = ""

    if ("DRQUEUE_CUSTOM_WH" in globals()) and (DRQUEUE_CUSTOM_WH == "yes"):
        width_args = "-w " + DRQUEUE_RESX
        height_args = "-w " + DRQUEUE_RESY
    else:
        width_args = ""
        height_args = ""

    if ("DRQUEUE_CUSTOM_TYPE" in globals()) and (DRQUEUE_CUSTOM_TYPE == "yes"):
        type_args = "." + DRQUEUE_CTYPE
    else:
        type_args = ""

    command = engine_path + " -f " + str(
        DRQUEUE_SCENEFILE + DRQUEUE_PADFRAME
    ) + ".ifd " + antialias_args + " " + raytrace_args + " " + bucket_args + " " + lod_args + "  " + varyaa_args + " " + bdepth_args + " " + zdepth_args + " " + cracks_args + " " + quality_args + " " + qfiner_args + " " + smultiplier_args + " " + mpcache_args + " " + mcache_args + " " + smpolygon_args + " " + width_args + " " + height_args + " " + DRQUEUE_RENDERDIR + str(
        DRQUEUE_PADFRAME) + type_args

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_RENDERDIR
    global DRQUEUE_PROJECTDIR
    global DRQUEUE_IMAGEFILE
    global DRQUEUE_CAMERA
    global DRQUEUE_RESX
    global DRQUEUE_RESY
    global DRQUEUE_FILEFORMAT
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME, DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "Turtle70"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(DRQUEUE_SCENEFILE, 'n:')
        DRQUEUE_RENDERDIR = helper.replace_stdpath_with_driveletter(DRQUEUE_RENDERDIR, 'n:')
        DRQUEUE_PROJECTDIR = helper.replace_stdpath_with_driveletter(DRQUEUE_PROJECTDIR, 'n:')

    if ("DRQUEUE_IMAGEFILE" in globals()) and (DRQUEUE_IMAGEFILE != ""):
        image_args = "-imageName " + DRQUEUE_IMAGEFILE
    else:
        image_args = ""

    if ("DRQUEUE_CAMERA" in globals()) and (DRQUEUE_CAMERA != ""):
        camera_args = "-camera " + DRQUEUE_CAMERA
    else:
        camera_args=""

    if ("DRQUEUE_RESX" in globals()) and ("DRQUEUE_RESX" in globals()) and (int(DRQUEUE_RESX) > 0) and (int(DRQUEUE_RESY) > 0):
        res_args = "-resolution " + DRQUEUE_RESX + " " + DRQUEUE_RESY
    else:
        res_args = ""

    if ("DRQUEUE_FILEFORMAT" in globals()) and (DRQUEUE_FILEFORMAT != ""):
        format_args = "-of " + DRQUEUE_FILEFORMAT
    else:
        format_args = ""

    command = engine_path + " -geometry " + DRQUEUE_SCENEFILE + " -imageOutputPath " + DRQUEUE_RENDERDIR + " -projectPath " + DRQUEUE_PROJECTDIR + " -renderThreads 2 -display off -startframe " + str(DRQUEUE_FRAME) + " -endframe " + str(block) + " " + image_args + " " + camera_args + " " + res_args

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_RENDERDIR
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME, DRQUEUE_BLOCKSIZE)

    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(DRQUEUE_SCENEFILE, 'n:')
        # renderer path/executable
      	engine_path = "C:\Program\ Files\MAXON\CINEMA\ 4D\ R12\CINEMA\ 4D.exe"

    elif DRQUEUE_OS in ["Mac OSX", "Darwin"]:
        # renderer path/executable
      	engine_path = "/Applications/MAXON/CINEMA\ 4D\ R12/CINEMA\ 4D.app/Contents/MacOS/CINEMA\ 4D"

    elif DRQUEUE_OS == "Linux":
      	# we use wine on linux (this is a hack, but works)
      	# there is a tightvnc server running on display :1
      	# see wine bug #8069
      	# the user running DrQueue slave process needs to have wine and Cinema4D installed

      	# convert to windows path with drive letter
      	DRQUEUE_SCENEFILE = subprocess.Popen(["winepath", "-w "+DRQUEUE_SCENEFILE], stdout=subprocess.PIPE).communicate()[0]
      	DRQUEUE_RENDERDIR = subprocess.Popen(["winepath", "-w "+DRQUEUE_RENDERDIR], stdout=subprocess.PIPE).communicate()[0]

      	workdir = "~/.wine/drive_c/Program\ Files/MAXON/CINEMA\ 4D\ R12"
      	# renderer path/executable
      	engine_path = "wine CINEMA\ 4D.exe"

      	# change into workdir, better for wine startup
      	os.chdir(workdir)

      	# set env variable, so wine can access the xserver even though we are rendering headless
      	os.environ["DISPLAY"] = ":1"

    else:
        helper.log_write('ERROR: Unsupported operating system ' + str(DRQUEUE_OS))
        return helper.return_to_ipython(1)

    command = engine_path + " -nogui -render " + DRQUEUE_SCENEFILE + " -oimage " + DRQUEUE_RENDERDIR + " -frame " + str(DRQUEUE_FRAME) + " -omultipass " + DRQUEUE_RENDERDIR + " -threads 0"

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_IMAGEFILE
    global DRQUEUE_CAMERA
    global DRQUEUE_RESX
    global DRQUEUE_RESY
    global DRQUEUE_FILEFORMAT
    global DRQUEUE_RENDERER
    global DRQUEUE_PRECOMMAND
    global DRQUEUE_POSTCOMMAND
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME,
                              DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "Render"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(
            DRQUEUE_SCENEFILE, 'n:')
        DRQUEUE_RENDERDIR = helper.replace_stdpath_with_driveletter(
            DRQUEUE_RENDERDIR, 'n:')
        DRQUEUE_PROJECTDIR = helper.replace_stdpath_with_driveletter(
            DRQUEUE_PROJECTDIR, 'n:')

    if ("DRQUEUE_IMAGEFILE" in globals()) and (DRQUEUE_IMAGEFILE != ""):
        image_args = "-im " + DRQUEUE_IMAGEFILE
    else:
        image_args = ""

    if ("DRQUEUE_CAMERA" in globals()) and (DRQUEUE_CAMERA != ""):
        camera_args = "-cam " + DRQUEUE_CAMERA
    else:
        camera_args = ""

    if ("DRQUEUE_RESX" in globals()) and ("DRQUEUE_RESX" in globals()) and (
            int(DRQUEUE_RESX) > 0) and (int(DRQUEUE_RESY) > 0):
        res_args = "-x " + DRQUEUE_RESX + " -y " + DRQUEUE_RESY
    else:
        res_args = ""

    if ("DRQUEUE_FILEFORMAT" in globals()) and (DRQUEUE_FILEFORMAT != ""):
        format_args = "-of " + DRQUEUE_FILEFORMAT
    else:
        format_args = ""

    if ("DRQUEUE_RENDERER" in globals()) and (DRQUEUE_RENDERER == "mr"):
        ## number of processors/cores to use
        #proc_args = "-rt 2"

        ## use Maya's automatic detection
        proc_args = "-art"
    elif ("DRQUEUE_RENDERER" in globals()) and (DRQUEUE_RENDERER == "sw"):
        ## number of processors/cores to use
        #proc_args = "-n 2"

        ## use Maya's automatic detection
        proc_args = "-n 0"
    else:
        ## don't add something
        proc_args = ""

    if ("DRQUEUE_PRECOMMAND" in globals()) and (DRQUEUE_PRECOMMAND != ""):
        pre_args = "-preRender \"" + DRQUEUE_PRECOMMAND + "\""
    else:
        pre_args = ""

    if ("DRQUEUE_POSTCOMMAND" in globals()) and (DRQUEUE_POSTCOMMAND != ""):
        post_args = "-postRender \"" + DRQUEUE_POSTCOMMAND + "\""
    else:
        post_args = ""

    command = engine_path + " " + pre_args + " " + post_args + " " + proc_args + " -s " + str(
        DRQUEUE_FRAME
    ) + " -e " + str(
        block
    ) + " " + res_args + " " + format_args + " -rd " + DRQUEUE_RENDERDIR + " -proj " + DRQUEUE_PROJECTDIR + " -r " + DRQUEUE_RENDERER + " " + image_args + " " + camera_args + " " + DRQUEUE_SCENEFILE

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)
Exemple #10
0
def run_renderer(env_dict):

    # define external variables as global
    globals().update(env_dict)
    global DRQUEUE_OS
    global DRQUEUE_ETC
    global DRQUEUE_SCENEFILE
    global DRQUEUE_FRAME
    global DRQUEUE_BLOCKSIZE
    global DRQUEUE_ENDFRAME
    global DRQUEUE_RESX
    global DRQUEUE_RESY
    global DRQUEUE_RENDERDIR
    global DRQUEUE_SKIPFRAMES
    global DRQUEUE_RENDERPASS
    global DRQUEUE_LOGFILE

    # initialize helper object
    helper = engine_helpers.Helper(env_dict['DRQUEUE_LOGFILE'])

    # range to render
    block = helper.calc_block(DRQUEUE_FRAME, DRQUEUE_ENDFRAME,
                              DRQUEUE_BLOCKSIZE)

    # renderer path/executable
    engine_path = "xsibatch"

    # replace paths on Windows
    if DRQUEUE_OS in ["Windows", "Win32"]:
        DRQUEUE_SCENEFILE = helper.replace_stdpath_with_driveletter(
            DRQUEUE_SCENEFILE, 'n:')
        DRQUEUE_RENDERDIR = helper.replace_stdpath_with_driveletter(
            DRQUEUE_RENDERDIR, 'n:')

    if ("DRQUEUE_RESX" in globals()) and ("DRQUEUE_RESX" in globals()) and (
            int(DRQUEUE_RESX) > 0) and (int(DRQUEUE_RESY) > 0):
        res_args = "-resolutionX " + DRQUEUE_RESX + " -resolutionY " + DRQUEUE_RESY
    else:
        res_args = ""

    if ("DRQUEUE_RENDERPASS" in globals()) and (DRQUEUE_RENDERPASS != ""):
        pass_args = "-pass " + DRQUEUE_RENDERPASS
    else:
        pass_args = ""

    os.chdir(DRQUEUE_RENDERDIR)

    command = engine_path + " -r -scene " + DRQUEUE_SCENEFILE + " -verbose prog -startframe " + str(
        DRQUEUE_FRAME) + " -endframe " + str(
            block) + " " + pass_args + " " + res_args + " -skip " + str(
                DRQUEUE_SKIPFRAMES)

    # log command line
    helper.log_write(command + "\n")

    # check scenefile
    helper.check_scenefile(DRQUEUE_SCENEFILE)

    # run renderer and wait for finish
    ret = helper.run_command(command)

    # return exit status to IPython
    return helper.return_to_ipython(ret)