def setup():
    """ Main setup routine """

    print("-" * 79)
    print("\nRender Pipeline Setup 1.2\n")
    print("-" * 79)

    print_step("Checking Panda3D Modules")
    # Make sure this python build is using panda3D
    try:
        from panda3d.core import NodePath
    except __HOLE__:
        print("\n")
        print("Could not import Panda3D modules! Please make sure they are ")
        print("on your path, and you are using the correct python version!")
        error("Failed to import Panda3D modules")

    check_panda_version()

    if not CMD_ARGS.skip_native:
        query = ("The C++ modules of the pipeline are faster and produce better \n"
                 "results, but we will have to compile them. As alternative, \n"
                 "a Python fallback is used, which is slower and produces worse \n"
                 "results. Also some plugins only partially work with the python \n"
                 "fallback (e.g. PSSM). Do you want to compile the C++ modules? (y/n):")

        # Dont install the c++ modules when using travis
        if get_user_choice(query):
            check_cmake()

            write_flag("rpcore/native/use_cxx.flag", True)

            if not CMD_ARGS.skip_update:
                print_step("Downloading the module builder ...")
                exec_python_file("rpcore/native/update_module_builder.py")

            print_step("Building the native code .. (This might take a while!)")
            exec_python_file("rpcore/native/build.py", ["--clean"] if CMD_ARGS.clean else [])

        else:
            write_flag("rpcore/native/use_cxx.flag", False)

    print_step("Extracting .gz files ...")
    extract_gz_files(os.path.join(SETUP_DIR, "data/"))

    print_step("Generating .txo files ...")
    exec_python_file("data/generate_txo_files.py")

    print_step("Filtering default cubemap ..")
    exec_python_file("data/default_cubemap/filter.py")

    print_step("Precomputing film grain .. ")
    exec_python_file("data/film_grain/generate.py")

    print_step("Running shader scripts .. ")
    exec_python_file("rpplugins/env_probes/shader/generate_mip_shaders.py")

    print_step("Precomputing clouds ..")
    exec_python_file("rpplugins/clouds/resources/precompute.py")

    write_flag("data/install.flag", True)

    # -- Further setup code follows here --

    print(color("\n\n-- Setup finished sucessfully! --", Fore.GREEN + Style.BRIGHT))

    ask_download_samples()
dataset/ETHPy150Open tobspr/RenderPipeline/setup.py/setup