|
|
|
|
@ -43,6 +43,8 @@ def find_pid_objname(pid):
@@ -43,6 +43,8 @@ def find_pid_objname(pid):
|
|
|
|
|
if obj.name.startswith(str(pid)): |
|
|
|
|
return obj.name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#加载obj文件 |
|
|
|
|
def reload_obj(pid): |
|
|
|
|
|
|
|
|
|
@ -50,18 +52,18 @@ def reload_obj(pid):
@@ -50,18 +52,18 @@ def reload_obj(pid):
|
|
|
|
|
libs.down_obj_from_oss(config.workdir, pid, "print") |
|
|
|
|
# obj = reload_obj(pid, action) |
|
|
|
|
#执行获取obj缩略图 |
|
|
|
|
print("执行获取obj全身缩略图脚本") |
|
|
|
|
os.system(f'python d:\\make2\\tools\pic_for_obj\image_rander_small.py -pid {pid} -i D://print/{pid} -o D://print/{pid}') |
|
|
|
|
#判断文件是否存在,存在则上传到oss, 更新数据库内容 |
|
|
|
|
if os.path.exists(f'D://print/{pid}/{pid}_pic.png'): |
|
|
|
|
#获取拍照订单的信息,从中得到拍照订单的信息 |
|
|
|
|
imagePathT = get_p3d_info(str(pid)) |
|
|
|
|
if imagePathT != 0: |
|
|
|
|
print("imagePathT",imagePathT) |
|
|
|
|
config.oss_bucket_website.put_object_from_file(f'{imagePathT}', f'D://print/{pid}/{pid}_pic.png') |
|
|
|
|
#请求接口 |
|
|
|
|
res = requests.post("https://mp.api.suwa3d.com/api/printOrder/updateCoverByPidForExternalOrder", data={'pid': pid, 'image_path': 'https://www.suwa3d.com/'+imagePathT}) |
|
|
|
|
print("res",res) |
|
|
|
|
# print("执行获取obj全身缩略图脚本") |
|
|
|
|
# os.system(f'python d:\\make2\\tools\pic_for_obj\image_rander_small.py -pid {pid} -i D://print/{pid} -o D://print/{pid}') |
|
|
|
|
# #判断文件是否存在,存在则上传到oss, 更新数据库内容 |
|
|
|
|
# if os.path.exists(f'D://print/{pid}/{pid}_pic.png'): |
|
|
|
|
# #获取拍照订单的信息,从中得到拍照订单的信息 |
|
|
|
|
# imagePathT = get_p3d_info(str(pid)) |
|
|
|
|
# if imagePathT != 0: |
|
|
|
|
# print("imagePathT",imagePathT) |
|
|
|
|
# config.oss_bucket_website.put_object_from_file(f'{imagePathT}', f'D://print/{pid}/{pid}_pic.png') |
|
|
|
|
# #请求接口 |
|
|
|
|
# res = requests.post("https://mp.api.suwa3d.com/api/printOrder/updateCoverByPidForExternalOrder", data={'pid': pid, 'image_path': 'https://www.suwa3d.com/'+imagePathT}) |
|
|
|
|
# print("res",res) |
|
|
|
|
|
|
|
|
|
obj_filename = os.path.join(config.workdir,'print',pid,f'{pid}.obj') |
|
|
|
|
bpy.ops.wm.read_homefile() |
|
|
|
|
|