コード例 #1
0
ファイル: Submission.py プロジェクト: yazici/OpenCue
def buildLayer(layerData, command, lastLayer=None):
    """Create a PyOutline Layer for the given layerData.
    @type layerData: ui.Layer.LayerData
    @param layerData: layer data from the ui
    @type command: str
    @param command: command to run
    @type lastLayer: outline.layer.Layer
    @param lastLayer: layer that this new layer should be dependent on if dependType is set.
    """
    if float(layerData.cores) >= 2:
        threadable = True
    else:
        threadable = False
    layer = Shell(layerData.name,
                  command=command.split(),
                  chunk=layerData.chunk,
                  threads=float(layerData.cores),
                  range=str(layerData.layerRange),
                  threadable=threadable)
    if layerData.services:
        layer.set_service(layerData.services[0])
    if layerData.dependType and lastLayer:
        if layerData.dependType == 'Layer':
            layer.depend_all(lastLayer)
        else:
            layer.depend_on(lastLayer)
    return layer
コード例 #2
0
for layer in layers:
        if layer_count > 0:
            if layerData[layer_count].dependType == 'Layer':
                if 'arnold_lentil_fix' in str(layer):
                    layer.depend_all(layers[1])
                    print(str(layer) + ' is layer')
                elif 'arnold_denoise' in str(layer):
                    layer.depend_all(layers[layer_count-1])
                    print(str(layer) + ' is layer')
                else:
                    layer.depend_all(layers[layer_count - 1])
                    print(str(layer) + ' is layer')

            if layerData[layer_count].dependType == 'Frame':
                if 'arnold_render_ass_files_crypto' in str(layer):
                    layer.depend_on(layers[layer_count - 1])
                    print(str(layer) + ' is FRAME')
                else:
                    layer.depend_on(layers[layer_count - 1])
                    print(str(layer) + ' is FRAME')
        layer_count += 1
        outline.add_layer(layer)
jobs = cuerun.launch(outline, use_pycuerun=False, pause=True)
for job in jobs:
    print(job.name())
    job.setPriority(priority)
    job.setMaxCores(1500)
    job.setMaxRetries(10)
print('')
print(colored('Shot successfully submitted to opencue', 'green'))
print('*' * 80 + '\n')