From 7c803e468ac696b1e28c53ec6b5277d6ab7ddd0e Mon Sep 17 00:00:00 2001 From: buttle Date: Fri, 18 Jun 2021 20:44:14 +0200 Subject: [PATCH] fixes object path --- utils/utils.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 6ded0ef..c25d33f 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -72,12 +72,12 @@ def get_object(file_path, result={}): if extension == "gltf": result['type']="gltf" object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") return result if extension == "obj": result['type']="obj" object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") mtl_file = find_file_with_extension(file_dir, 'mtl') if mtl_file: result = get_object(mtl_file.replace(OBJECT_DIR, ""), result) @@ -86,36 +86,36 @@ def get_object(file_path, result={}): if extension == 'stl': result['type'] = "stl" object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") return result if extension == 'mtl': object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") return result if extension == 'fbx': result['type'] = "fbx" object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") return result if extension == 'dae': result['type'] = "dae" object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") return result if extension == 'glb': result['type'] = "glb" object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") return result if extension == 'json': result['type'] = "json" object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") return result if extension == 'ply': result['type'] = "ply" object_path = str(file_path).replace(OBJECT_DIR, "") - result['urls'].append(f"/objects{object_path}") + result['urls'].append(f"/objects/{object_path}") return result return None