Skip to content

Commit b15d187

Browse files
authored
Merge pull request #8 from OSUrobotics/L-fp
mesh downloader update
2 parents 0dee37f + 943073e commit b15d187

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pybullet_tree_sim/utils/mesh_downloader.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ def get_filename_from_url(url: str) -> str:
1717

1818
def is_download_needed(target_file_path: str) -> bool:
1919
if not os.path.exists(meshes_path):
20+
print(f"Creating path {meshes_path}")
2021
os.mkdir(meshes_path)
2122
return True
23+
2224
if not os.path.exists(os.path.join(meshes_path, "trees")):
2325
if not os.path.isfile(os.path.join(meshes_path, "pybullet-tree-sim-meshes.zip")): # TODO: pass name into func
2426
return True
2527
else:
28+
print(f"File {os.path.join(meshes_path, "pybullet-tree-sim-meshes.zip")} already exists")
2629
return False
2730
else:
31+
print(f"Path {os.path.join(meshes_path, 'trees')} already exists.")
2832
return False
2933

3034

@@ -58,8 +62,13 @@ def download_file(url: str, target_file_path: str) -> bool:
5862

5963

6064
def unzip(zip_file: str):
65+
print(f"Extracting file {zip_file}")
6166
with zipfile.ZipFile(zip_file, "r") as zipper:
6267
zipper.extractall(os.path.dirname(zip_file))
68+
print(f"Files extracted")
69+
70+
if not os.path.exists(meshes_path):
71+
print(f"Cannot find path {meshes_path}, error with process. Try running the file directly.")
6372
return
6473

6574

0 commit comments

Comments
 (0)