orthographic/og.py

70 lines
1.9 KiB
Python
Raw Normal View History

# -------------------------------------------------------------------
# ORTHOGRAPHIC
# Your personal aerial satellite. Always on. At any altitude.*
# Developed by MarStrMind
# License: Open Software License 3.0
# Up to date version always on marstr.online
# -------------------------------------------------------------------
# og.py
# Main file to call to generate an ortho tile; entry point to tool.
# -------------------------------------------------------------------
import sys
import os
from orthographic import *
from log import *
from defines import *
# Print a welcome message
print(" ")
print(" ---------------------------------------------------------------- ")
print(" ORTHOGRAPHIC: An ortho-photo generator, using real world data.")
print(" Developed by MarStr - Code available on marstr.online")
print(" ---------------------------------------------------------------- ")
print(" ")
# Evaluate CLI arguments and process tile.
cli = False
pbf = False
prep = False
if len(sys.argv) == 4:
cli = True
# Only if we find enough arguments, proceed.
if cli:
lat = int(sys.argv[1])
lng = int(sys.argv[2])
mstr_msg("_main", "Beginning tile generation process.")
# Create the class and init values
og = mstr_orthographic(lat, lng, mstr_datafolder, os.getcwd(), prep)
# Prepare a tile
if sys.argv[3] == "prepare":
og._prepareTile()
# Generate orthos
if sys.argv[3] != "prepare" and sys.argv[3] != "xpscenery":
og._generateOrthos_mt(int(sys.argv[3]))
# Build the terrain mesh and assign ground textures
if sys.argv[3] == "xpscenery":
og.generate_xp_scenery()
if cli == False and pbf == False:
mstr_msg("_main", "Please provide Latitude and Longitude. Exiting.")
print ("")
# * No Space Shuttle or SpaceShipOne needed to deploy.