added try except block

This commit is contained in:
Navan Chauhan 2020-08-31 13:51:05 +05:30
parent 68439cc764
commit 1086f53538
1 changed files with 4 additions and 1 deletions

View File

@ -245,7 +245,10 @@ with tempfile.TemporaryDirectory() as directory:
os.system("collada2gltf -i model.dae -o model.gltf") os.system("collada2gltf -i model.dae -o model.gltf")
copyfile("model.gltf",os.path.join(modelDirectory,(str(jobID)+".gltf"))) copyfile("model.gltf",os.path.join(modelDirectory,(str(jobID)+".gltf")))
os.system("docker run -it --rm -v $(pwd):/usr/app leon/usd-from-gltf:latest model.gltf model.usdz") os.system("docker run -it --rm -v $(pwd):/usr/app leon/usd-from-gltf:latest model.gltf model.usdz")
try:
copyfile("model.usdz",os.path.join(modelDirectory,(str(jobID)+".usdz"))) copyfile("model.usdz",os.path.join(modelDirectory,(str(jobID)+".usdz")))
except:
print("Could not generate USDZ file")
#copy(("Curie_Web_Result_"+str(jobID)),f) #copy(("Curie_Web_Result_"+str(jobID)),f)
email(zi) email(zi)
#print((str(zi) + ".zip")) #print((str(zi) + ".zip"))