コード例 #1
0
def main():
    args = parse_arguments()
    if args.scene is not None:
        scene = Scene.create_from_file(args.scene)
    elif args.mesh is not None:
        scene = Scene.create_basic_scene(args.mesh)
    else:
        raise RuntimeError("Please specify either a mesh or a scene.")
    win = GUIFrontEnd(scene)
コード例 #2
0
def create_scene_from_arguments(args):
    assert(args.mesh is not None);
    path, name = os.path.split(args.mesh);
    if args.scalar_field is None:
        scene = Scene.create_basic_scene(args.mesh);
    else:
        scene = Scene.create_basic_scalar_scene(
                args.mesh, args.scalar_field, args.color_map,
                args.bounds, args.discrete, args.normalize);
    view = scene.views[0];
    view.name = name;
    return scene;
コード例 #3
0
ファイル: render.py プロジェクト: tommaoer/PyRenderer
def create_scene_from_arguments(args):
    assert (args.mesh is not None)
    path, name = os.path.split(args.mesh)
    if args.with_texture:
        scene = Scene.create_texture_scene(args.mesh, args.uv_scale,
                                           args.uv_offset)
    elif args.scalar_field is None:
        scene = Scene.create_basic_scene(args.mesh)
    else:
        scene = Scene.create_basic_scalar_scene(args.mesh, args.scalar_field,
                                                args.color_map, args.bounds,
                                                args.discrete, args.normalize)
    view = scene.views[0]
    view.name = name
    return scene
コード例 #4
0
ファイル: render.py プロジェクト: tommaoer/PyRenderer
def main():
    args = parse_arguments()
    if args.scene is not None:
        scene = Scene.create_from_file(args.scene)
    else:
        scene = create_scene_from_arguments(args)
    scene = update_scene_with_arguments(scene, args)

    if args.output is not None:
        scene.output_dir = args.output
    for i in range(len(scene.views)):
        scene.activate_view(i)
        assert (scene.active_view == scene.views[i])

        if args.renderer == "opengl":
            render_with_opengl(scene)
        elif args.renderer == "povray":
            render_with_povray(scene)
        elif args.renderer == "mitsuba":
            render_with_mitsuba(scene)