예제 #1
0

args = parse_custom_args()

common.ensure_addons()

if args.blend:
    common.open_scene(args.blend)
    version.save_new(args.id)
    meta.write_media_info()
else:
    run_updates = True

    if args.min_interval:
        meta = meta.get()
        if "lastUpdate" in meta:
            run_updates = time() - meta["lastUpdate"] < args.min_interval

    if run_updates:
        version.open_latest(args.id)

        # TODO: Find problem: Why does it update although hash stayed the same?
        #       (Happened on update form external sources manually)
        #       (Note 06/03/2016 - not sure if still applies)

        if update.update_models():
            version.save_new(args.id)
            meta.write_media_info()
    else:
        meta.write({"lastUpdate": time()})
args = parse_custom_args()


common.ensure_addons()

if args.blend:
    common.open_scene(args.blend)
    version.save_new(args.id)
    meta.write_media_info()
else:
    run_updates = True

    if args.min_interval:
        meta = meta.get()
        if "lastUpdate" in meta:
            run_updates = time() - meta["lastUpdate"] < args.min_interval

    if run_updates:
        version.open_latest(args.id)

        # TODO: Find problem: Why does it update although hash stayed the same?
        #       (Happened on update form external sources manually)
        #       (Note 06/03/2016 - not sure if still applies)

        if update.update_models():
            version.save_new(args.id)
            meta.write_media_info()
    else:
        meta.write({"lastUpdate": time()})
예제 #3
0
# Manually add elmyra's directory to sys.path because
# the params.py script runs from blender context

current_dir = path.dirname(path.realpath(__file__))
sys.path.append(current_dir)

# Own module imports

import export
import render
import version

DEFAULT_RENDER_TIME = 60

def options_from_args(args):
    parser = ArgumentParser(prog="Elmyra Render Params")
    parser.add_argument("--id", required=True)
    parser.add_argument("--device", default="GPU")

    custom_args = args[sys.argv.index('--') + 1:]

    return parser.parse_args(custom_args)


options = options_from_args(sys.argv)

version.open_latest(options.id)
render.render(DEFAULT_RENDER_TIME, options.device)
export.export(options)
예제 #4
0
def render_visualization(id):
    if version.open_latest(id):
        render.render(args.target_time, args.device)
        export.export()