新的信息

This commit is contained in:
dongchangxi committed 2024-09-02 16:52:37 +08:00
1 parent c66fc76e10
commit 345790cb05
51 files changed
+5187 -61

No files matched your search

+49 -1
View File
@@ -330,4 +330,52 @@ def down_obj_from_oss_for_fix(workdir, pid, action):
# print('正在下载:', file.key)
localfile = os.path.join(workdir, action, pid, filename)
config.oss_bucket.get_object_to_file(file.key, localfile)
return obj_filename
return obj_filename
def down_obj_from_oss_for_repeat_texture(workdir, pid, action):
print(os.path.join(workdir, pid))
if not os.path.exists(os.path.join(workdir, pid)):
print("目录不存在,无法处理")
return "error"
#判断是否有专门新建的目录用来重新贴图
newPath = os.path.join(workdir, pid,'repeat_texture','completion_cloud')
if not os.path.exists(newPath):
os.makedirs(newPath)
# 根据前缀获取文件列表
prefix = f'objs/{action}/{pid}/ai/repeat_texture/completion_cloud'
filelist = oss2.ObjectIteratorV2(config.oss_bucket, prefix=prefix)
print('正在下载:', prefix)
for file in filelist:
filename = file.key.split('/')[-1]
if filename == "":
continue
localfile = os.path.join(newPath, filename)
config.oss_bucket.get_object_to_file(file.key, localfile)
return newPath
def down_obj_from_oss_auto(pid,action,pathStr):
#pathStr = os.path.join(workdir, str(pid)+"_ai")
if not os.path.exists(pathStr):
os.makedirs(pathStr)
# 根据前缀获取文件列表
prefix = f'objs/{action}/{pid}'
filelist = oss2.ObjectIteratorV2(config.oss_bucket, prefix=prefix)
print('正在下载:', prefix)
for file in filelist:
filename = file.key.split('/')[-1]
if filename == "":
continue
if filename != f"{pid}.jpg" and filename != f"{pid}.obj" and filename != f"{pid}.mtl":
continue
print(filename)
localfile = os.path.join(pathStr, filename)
config.oss_bucket.get_object_to_file(file.key, localfile)