kopia lustrzana https://github.com/OpenDroneMap/WebODM
Silent failure + Bump Version
rodzic
299d67b1c5
commit
275fae846a
|
@ -22,7 +22,7 @@ from rest_framework import status
|
|||
from rest_framework import serializers
|
||||
|
||||
from .globals import PROJECT_NAME, ION_API_URL
|
||||
from .model_tools import to_ion_texture_model
|
||||
from .model_tools import to_ion_texture_model, IonInvalidZip
|
||||
|
||||
pluck = lambda dic, *keys: [dic[k] if k in dic else None for k in keys]
|
||||
|
||||
|
@ -387,10 +387,11 @@ def upload_to_ion(
|
|||
try:
|
||||
asset_path, del_directory = to_ion_texture_model(asset_path)
|
||||
logger.info("Created ion texture model!")
|
||||
except IonInvalidZip as e:
|
||||
logger.info("Non geo-referenced texture model, using default file.")
|
||||
except Exception as e:
|
||||
logger.warning("Failed to convert to ion texture model")
|
||||
logger.warning(e)
|
||||
pass
|
||||
|
||||
headers = {"Authorization": f"Bearer {token}"}
|
||||
data = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "Cesium ion",
|
||||
"webodmMinVersion": "0.6.0",
|
||||
"description": "Upload and tile ODM assets with Cesium ion.",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"author": "Cesium GS, Inc",
|
||||
"email": "hello@cesium.com",
|
||||
"repository": "",
|
||||
|
|
|
@ -9,6 +9,10 @@ OBJ_FILE_EXTENSION = ".obj"
|
|||
MTL_FILE_EXTENSION = ".mtl"
|
||||
|
||||
|
||||
class IonInvalidZip(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def file_walk(directory):
|
||||
for root, _, file_names in walk(directory):
|
||||
for file_name in file_names:
|
||||
|
@ -41,8 +45,8 @@ def to_ion_texture_model(texture_model_path, dest_directory=None, minimize_space
|
|||
for file_name in file_walk(unzip_dir):
|
||||
if file_name.endswith(DELETE_EXTENSIONS):
|
||||
files_to_delete.add(file_name)
|
||||
if file_name.endswith(".obj"):
|
||||
if "_geo" in file_name:
|
||||
elif file_name.endswith(".obj"):
|
||||
if "_geo" in path.basename(file_name):
|
||||
found_geo = True
|
||||
else:
|
||||
file_name = path.splitext(file_name)[0]
|
||||
|
@ -50,7 +54,7 @@ def to_ion_texture_model(texture_model_path, dest_directory=None, minimize_space
|
|||
files_to_delete.add(file_name + MTL_FILE_EXTENSION)
|
||||
|
||||
if not found_geo:
|
||||
raise Exception("Unable to find geo file")
|
||||
raise IonInvalidZip("Unable to find geo file")
|
||||
|
||||
for file_name in files_to_delete:
|
||||
if not path.isfile(file_name):
|
||||
|
|
Ładowanie…
Reference in New Issue