示例#1
0
    scene.frame_current = task['frame']

print('INFO: Disable denoising and use progressive refine')
# TODO: Enable the required channels to apply denoise after merge
bpy.context.view_layer.cycles['use_denoising'] = False
scene.cycles.use_progressive_refine = True

try:
    import _cycles
    _cycles.enable_print_stats(
    )  # Show detailed render statistics after the render
except:
    pass

print('INFO: Checking existance of the dependencies')
blend_file.getDependencies()


class Commands:
    def savePreview():
        scene.render.image_settings.file_format = 'OPEN_EXR'
        scene.render.image_settings.color_mode = 'RGB'
        scene.render.image_settings.color_depth = '32'
        scene.render.image_settings.exr_codec = 'DWAA'
        bpy.data.images['Render Result'].save_render('_preview.exr')
        os.rename('_preview.exr', 'preview.exr')

    def saveRender():
        scene.render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
        scene.render.image_settings.color_mode = 'RGBA'
        scene.render.image_settings.color_depth = '32'
    task = json.load(f)

exitcode = 0

import bpy

print("INFO: Preparing composing of:", bpy.data.filepath)

scene = bpy.context.scene

# Set frame if provided
if 'frame' in task:
    scene.frame_current = task['frame']

print('INFO: Checking existance of the dependencies')
goods, bads = blend_file.getDependencies()
print('DEBUG: Goods:', goods)
print('DEBUG: Bads:', bads)

if scene.render.is_movie_format:
    print('WARN: Unable to save still image to movie format, so use single-layer exr for compose')
    exitcode = 1
    scene.render.image_settings.file_format = 'OPEN_EXR'
    scene.render.image_settings.color_mode = 'RGBA'
    scene.render.image_settings.color_depth = '32'
    scene.render.image_settings.exr_codec = 'ZIP'

# Return the compose_filepath variable
compose_filepath = scene.render.frame_path()
if scene.render.filepath.startswith('//'):
    # It's relative to blend project path
示例#3
0
    task = json.load(f)

exitcode = 0

import bpy

print("INFO: Preparing composing of:", bpy.data.filepath)

scene = bpy.context.scene

# Set frame if provided
if 'frame' in task:
    scene.frame_current = task['frame']

print('INFO: Checking existance of the dependencies')
goods, bads = blend_file.getDependencies(task.get('project_path'),
                                         task.get('cwd_path'), True)
print('DEBUG: Goods:', goods)
print('DEBUG: Bads:', bads)

if scene.render.is_movie_format:
    print(
        'WARN: Unable to save still image to movie format, so use single-layer exr for compose'
    )
    exitcode = 1
    scene.render.image_settings.file_format = 'OPEN_EXR'
    scene.render.image_settings.color_mode = 'RGBA'
    scene.render.image_settings.color_depth = '32'
    scene.render.image_settings.exr_codec = 'ZIP'

# Set the output file
filename = bpy.path.basename(scene.render.frame_path())