Ver a proveniência

made generate.py strict again on existing output directory, printing descriptive error message

pull/570/head
David von Oheimb há 6 anos
ascendente
cometimento
25b1c46c0f
1 ficheiros alterados com 6 adições e 4 eliminações
  1. +6
    -4
      utils/multires/generate.py

+ 6
- 4
utils/multires/generate.py Ver ficheiro

@@ -86,6 +86,12 @@ parser.add_argument('-d', '--debug', action='store_true',
help='debug mode (print status info and keep intermediate files)')
args = parser.parse_args()

# Create output directory
if os.path.exists(args.output):
print('Output directory "' + args.output + '" already exists')
sys.exit(1)
os.makedirs(args.output)

# Process input image information
print('Processing input image information...')
origWidth, origHeight = Image.open(args.inputFile).size
@@ -125,10 +131,6 @@ if args.debug:
print('tileResolution: '+ str(tileSize))
print('cubeResolution: '+ str(cubeSize))

# Create output directory
if not os.path.exists(args.output):
os.makedirs(args.output)

# Generate PTO file for nona to generate cube faces
# Face order: front, back, up, down, left, right
faceLetters = ['f', 'b', 'u', 'd', 'l', 'r']


Carregando…
Cancelar
Guardar