Corrected color in normal map to standard color but zero alpha, file access call in POSIX systems revised to clear _cache folder. Changes in defines.py to reflect my project folder on Linux
This commit is contained in:
parent
85352308be
commit
2b30e1241f
@ -13,7 +13,10 @@
|
|||||||
# Your data folder - meaning where the cache is stored, and where the finished
|
# Your data folder - meaning where the cache is stored, and where the finished
|
||||||
# tiles will go. This is also the folder where the image generation sources are
|
# tiles will go. This is also the folder where the image generation sources are
|
||||||
# stored.
|
# stored.
|
||||||
mstr_datafolder = "M:/Developer/Projects/orthographic/"
|
#mstr_datafolder = "M:/Developer/Projects/orthographic/"
|
||||||
|
mstr_datafolder = "/home/marcus/Data/Developer/Projects/orthographic/"
|
||||||
|
# Switched to Linux, so path is amended
|
||||||
|
|
||||||
|
|
||||||
# API endpoint to acquire OSM data (bonus: I have my own)
|
# API endpoint to acquire OSM data (bonus: I have my own)
|
||||||
mstr_osm_endpoint = "https://marstr.online/osm/v1/"
|
mstr_osm_endpoint = "https://marstr.online/osm/v1/"
|
||||||
|
@ -53,19 +53,10 @@ class mstr_orthographic:
|
|||||||
|
|
||||||
# Need a same call for POSIX
|
# Need a same call for POSIX
|
||||||
def _isFileAccessiblePosix(self, src):
|
def _isFileAccessiblePosix(self, src):
|
||||||
wildcard = "/proc/*/fd/*"
|
a = True
|
||||||
lfds = glob.glob(wildcard)
|
if os.access(src, os.W_OK) == False:
|
||||||
for fds in lfds:
|
a = False
|
||||||
try:
|
return a
|
||||||
file = os.readlink(fds)
|
|
||||||
if file == src:
|
|
||||||
return True
|
|
||||||
except OSError as err:
|
|
||||||
if err.errno == 2:
|
|
||||||
file = None
|
|
||||||
else:
|
|
||||||
raise(err)
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
# This will determine the vertical stepping in degrees in order to generate
|
# This will determine the vertical stepping in degrees in order to generate
|
||||||
@ -171,7 +162,7 @@ class mstr_orthographic:
|
|||||||
mstr_msg("orthographic", "Adjusted bounding box for XML object")
|
mstr_msg("orthographic", "Adjusted bounding box for XML object")
|
||||||
|
|
||||||
# Determine what to do... maybe work was interrupted
|
# Determine what to do... maybe work was interrupted
|
||||||
if os.path.isfile(mstr_datafolder + "Tiles/" + self._latlngfld + "/orthos/" + str(cur_tile_y) + "_" + str(cur_tile_x) + ".dds") == False:
|
if os.path.isfile(mstr_datafolder + "Tiles/z_orthographic_" + self._latlngfld + "/orthos/" + str(cur_tile_y) + "_" + str(cur_tile_x) + ".dds") == False:
|
||||||
|
|
||||||
# Let the user know
|
# Let the user know
|
||||||
mstr_msg("orthographic", "Generating missing orthophoto " + str(cur_tile_y) + "-" + str(cur_tile_x))
|
mstr_msg("orthographic", "Generating missing orthophoto " + str(cur_tile_y) + "-" + str(cur_tile_x))
|
||||||
|
@ -84,8 +84,8 @@ class mstr_xp_normalmap:
|
|||||||
# The Big Mac. Generate the normal map
|
# The Big Mac. Generate the normal map
|
||||||
def generate_normal_map_for_layer(self, image):
|
def generate_normal_map_for_layer(self, image):
|
||||||
mstr_msg("xp_normalmap", "[X-Plane] Beginning normal map generation")
|
mstr_msg("xp_normalmap", "[X-Plane] Beginning normal map generation")
|
||||||
#nmp = Image.new("RGBA", (image.width, image.height), (128,128,255,255))
|
nmp = Image.new("RGBA", (image.width, image.height), (128,128,255,0)) # no specularity, but default color
|
||||||
nmp = Image.new("RGBA", (image.width, image.height), (0,0,0,0))
|
#nmp = Image.new("RGBA", (image.width, image.height), (0,0,0,0))
|
||||||
org = image.load()
|
org = image.load()
|
||||||
nmp_pix = nmp.load()
|
nmp_pix = nmp.load()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user