This commit is contained in:
Andrew Scobie 2018-06-25 12:04:59 +12:00
Родитель 7cafee0c1c
Коммит a0321862b5
3 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -112,7 +112,6 @@
},
"outputs": {
"type": "string",
"defaultValue": "fgrp-outputs",
"metadata": {
"description": "The file group where outputs will be stored",
"advancedType": "file-group"

Просмотреть файл

@ -127,14 +127,12 @@ def create_task(frame, task_id, job_id, tile_num, current_x, current_y):
blend_file = os.environ["BLEND_FILE"]
output_sas = os.environ["OUTPUT_CONTAINER_SAS"]
optionalParams = os.environ["OPTIONAL_PARAMS"]
output_format = os.environ["OUTPUT_FORMAT"]
# generate the blender command line
command_line = "blender -b \"{}/{}\" -P \"{}/python-task-manager.py\" -y -t 0 -F {} -E CYCLES {}".format(
command_line = "blender -b \"{}/{}\" -P \"{}/scripts/python-task-manager.py\" -y -t 0 {}".format(
os_env("AZ_BATCH_JOB_PREP_WORKING_DIR"),
blend_file,
os_env("AZ_BATCH_TASK_WORKING_DIR"),
output_format,
optionalParams
)
@ -150,6 +148,7 @@ def create_task(frame, task_id, job_id, tile_num, current_x, current_y):
models.EnvironmentSetting("X_TILES", os.environ["X_TILES"]),
models.EnvironmentSetting("Y_TILES", os.environ["Y_TILES"]),
models.EnvironmentSetting("CROP_TO_BORDER", os.environ["CROP_TO_BORDER"]),
models.EnvironmentSetting("OUTPUT_FORMAT", os.environ["OUTPUT_FORMAT"]),
models.EnvironmentSetting("BLEND_FILE", os.environ["BLEND_FILE"]),
models.EnvironmentSetting("CURRENT_FRAME", str(frame)),
models.EnvironmentSetting("CURRENT_TILE", str(tile_num)),

Просмотреть файл

@ -30,6 +30,7 @@ def render_tile(current_tile):
current_y = int(os.environ["CURRENT_Y"])
print("x_tiles: {}, y_tiles: {}, current_x: {}, current_y: {}, tile: {}".format(x_tiles, y_tiles, current_x, current_y, current_tile))
# Set current frame
current_frame = int(os.environ["CURRENT_FRAME"])
print("setting current frame to: {}".format(current_frame))
bpy.context.scene.frame_current = current_frame
@ -38,12 +39,21 @@ def render_tile(current_tile):
color_mode = bpy.context.scene.render.image_settings.color_mode
print("color_mode: {}".format(color_mode))
# Output format
output_format = os.environ["OUTPUT_FORMAT"]
print("current file format: {}".format(bpy.context.scene.render.image_settings.file_format))
bpy.context.scene.render.image_settings.file_format = output_format
file_format = bpy.context.scene.render.image_settings.file_format
if file_format in ("OPEN_EXR", "OPEN_EXR_MULTILAYER"):
file_format = "exr"
print("file format: {}".format(file_format))
print("file format prior to render: {}".format(file_format))
# Render engine, maybe add this to job teamplate
# Options - BLENDER_RENDER, BLENDER_GAME, CYCLES
print("render engine: {}".format(bpy.context.scene.render.engine))
# Compute the tiles border
total_tiles = x_tiles * y_tiles
min_x = current_x / x_tiles
max_x = (current_x + 1) / x_tiles