Add support of overriding scenes list

This commit is contained in:
2017-11-15 12:25:34 +01:00
parent ff072b505f
commit c557f0bdec

View File

@@ -32,10 +32,10 @@ def configureArgumentParser():
parser.add_argument("-d", "--scenes-dir", parser.add_argument("-d", "--scenes-dir",
help="Directory with scenes", help="Directory with scenes",
default="") default="")
# parser.add_argument('-s', '--scenes', parser.add_argument('-c', '--scenes',
# nargs='+', nargs='+',
# help='Scenes to be rendered', help='Scenes to be rendered',
# default=[]) default=[])
parser.add_argument('-t', '--device-type', parser.add_argument('-t', '--device-type',
help="Type of the device to render on", help="Type of the device to render on",
default="") default="")
@@ -68,6 +68,7 @@ def injectDefaultConfiguration(config):
""" """
root_dir = util.getBundleRootDirectory() root_dir = util.getBundleRootDirectory()
section = { section = {
"scenes": "",
"scenes_dir": os.path.join(root_dir, "scenes"), "scenes_dir": os.path.join(root_dir, "scenes"),
"device_name": "", "device_name": "",
"device_single": "False", "device_single": "False",
@@ -82,6 +83,8 @@ def injectArgparseConfiguration(config, args):
section = config['farm'] section = config['farm']
if args.blender: if args.blender:
section['blender'] = args.blender section['blender'] = args.blender
if args.scenes:
section['scenes'] = ",".join(args.scenes)
if args.scenes_dir: if args.scenes_dir:
section['scenes_dir'] = args.scenes_dir section['scenes_dir'] = args.scenes_dir
if args.device_type: if args.device_type:
@@ -339,7 +342,10 @@ def main():
if args.system_info: if args.system_info:
ctx.scenes = [] ctx.scenes = []
else: else:
ctx.scenes = ctx.listAllScenes(ctx.scenes_dir) if farm_config['scenes']:
ctx.scenes = farm_config['scenes'].split(",")
else:
ctx.scenes = ctx.listAllScenes(ctx.scenes_dir)
# Print prelmiinary information. # Print prelmiinary information.
blender_dvice_info = benchrunner.benchmarkGetDeviceInfo(ctx) blender_dvice_info = benchrunner.benchmarkGetDeviceInfo(ctx)
if not blender_dvice_info['device_type']: if not blender_dvice_info['device_type']: