-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
34 lines (27 loc) · 992 Bytes
/
utils.py
File metadata and controls
34 lines (27 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
import shutil
def delete_directory(directory_path):
"""
删除指定目录及其所有内容。
参数:
directory_path (str): 要删除的目录路径。
"""
if os.path.exists(directory_path) and os.path.isdir(directory_path):
shutil.rmtree(directory_path)
print(f"目录 {directory_path} 已成功删除")
else:
print(f"目录 {directory_path} 不存在")
def get_model_files(directory):
model_files = []
for root, dirs, files in os.walk(directory):
for file in files:
if file.lower().endswith('.glb') or file.lower().endswith('.fbx'):
model_files.append(os.path.join(root, file))
return model_files
def get_glb_model_files(directory):
model_files = []
for root, dirs, files in os.walk(directory):
for file in files:
if file.lower().endswith('.glb'):
model_files.append(os.path.join(root, file))
return model_files