Bladeren bron

Check for nona and add command line argument

Checks for a nona executable and adds a command line argument to specify
an executable. The argument is required from the user in case nona
cannot be found on the path.
pull/8/head
Johannes Wienke 10 jaren geleden
bovenliggende
commit
35dd023509
1 gewijzigde bestanden met toevoegingen van 8 en 1 verwijderingen
  1. +8
    -1
      utils/multires/generate.py

+ 8
- 1
utils/multires/generate.py Bestand weergeven

@@ -27,6 +27,10 @@ import argparse
from PIL import Image
import os
import math
from distutils.spawn import find_executable

# find external programs
nona = find_executable('nona')

# Parse input
parser = argparse.ArgumentParser(description='Generate a Pannellum multires tile set from an equirectangular panorama.')
@@ -38,6 +42,9 @@ parser.add_argument('-s', '--tilesize', dest='tileSize', default=512, type=int,
help='tile size in pixels (default: 512)')
parser.add_argument('--png', action='store_true',
help='output PNG tiles instead of JPEG tiles')
parser.add_argument('-n', '--nona', default=nona, required=nona is None,
metavar='EXECUTABLE',
help='location of the nona executable to use')
args = parser.parse_args()

# Create output directory
@@ -75,7 +82,7 @@ with open(os.path.join(args.output, 'cubic.pto'), 'w') as f:

# Create cube faces
print('Generating cube faces...')
os.system('nona -o ' + os.path.join(args.output, 'face') + ' ' + os.path.join(args.output, 'cubic.pto'))
os.system(args.nona + ' -o ' + os.path.join(args.output, 'face') + ' ' + os.path.join(args.output, 'cubic.pto'))
faces = ['face0000.tif', 'face0001.tif', 'face0002.tif', 'face0003.tif', 'face0004.tif', 'face0005.tif']

# Generate tiles


Laden…
Annuleren
Opslaan