|
|
|
@ -36,13 +36,13 @@ def down_obj_fromoss(pid,order_id): |
|
|
|
print("AAAAAAAAA",ossPath) |
|
|
|
print("AAAAAAAAA",ossPath) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
path = os.path.join(workdir, 'print', pid) |
|
|
|
path = os.path.join(workdir, 'print', pid,order_id) |
|
|
|
if not os.path.exists(path): os.makedirs(path) |
|
|
|
if not os.path.exists(path): os.makedirs(path) |
|
|
|
|
|
|
|
|
|
|
|
# 根据前缀获取文件列表 |
|
|
|
# 根据前缀获取文件列表 |
|
|
|
prefix = f'objs/print/{pid}/' |
|
|
|
prefix = f'objs/print/{pid}/' |
|
|
|
if ossPath != "": |
|
|
|
if ossPath != "": |
|
|
|
prefix = os.path.join("objs","print",pid,ossPath,order_id) |
|
|
|
prefix = os.path.join("objs","print",pid,ossPath) |
|
|
|
if "base/" in ossPath: |
|
|
|
if "base/" in ossPath: |
|
|
|
prefix = os.path.join("objs","print",pid,ossPath) |
|
|
|
prefix = os.path.join("objs","print",pid,ossPath) |
|
|
|
prefix = prefix.replace("\\","/") |
|
|
|
prefix = prefix.replace("\\","/") |
|
|
|
@ -122,34 +122,34 @@ def team_check(r): |
|
|
|
pid = str(pid) |
|
|
|
pid = str(pid) |
|
|
|
orderId = str(orderId) |
|
|
|
orderId = str(orderId) |
|
|
|
|
|
|
|
|
|
|
|
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), f'pid:{pid} repair_id:{repair_id} 生成团队审核模型 start model:IndependentRepairTeamcheckGLBQueue', ) |
|
|
|
#print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), f'pid:{pid} repair_id:{repair_id} 生成团队审核模型 start model:IndependentRepairTeamcheckGLBQueue', ) |
|
|
|
ossPath = down_obj_fromoss(pid,orderId) |
|
|
|
ossPath = down_obj_fromoss(pid,orderId) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
obj_filename = f'{pid}.obj' |
|
|
|
obj_filename = f'{pid}.obj' |
|
|
|
glb_filename = f'{orderId}.glb' |
|
|
|
glb_filename = f'{orderId}.glb' |
|
|
|
print('开始转换obj文件为glb文件...') |
|
|
|
print('开始转换obj文件为glb文件...') |
|
|
|
os.system(f'gltfpack -c -i {os.path.join(workdir, "print", pid, obj_filename)} -o {os.path.join(workdir, "print", pid, glb_filename)} -vt 16 -vc 16') |
|
|
|
os.system(f'gltfpack -c -i {os.path.join(workdir, "print", pid,orderId, obj_filename)} -o {os.path.join(workdir, "print", pid,orderId, glb_filename)} -vt 16 -vc 16') |
|
|
|
|
|
|
|
|
|
|
|
#处理封面图 |
|
|
|
#处理封面图 |
|
|
|
#执行获取obj缩略图 |
|
|
|
#执行获取obj缩略图 |
|
|
|
print("执行获取obj全身缩略图脚本1111111111") |
|
|
|
print("执行获取obj全身缩略图脚本1111111111") |
|
|
|
os.system(f'python d:\\make2\\tools\pic_for_obj\image_rander_small.py -pid {pid} -i D://print/{pid} -o D://print/{pid}') |
|
|
|
os.system(f'python d:\\make2\\tools\pic_for_obj\image_rander_small.py -pid {pid} -i D://print/{pid}/{orderId} -o D://print/{pid}/{orderId}') |
|
|
|
print("判断是否存在封面图") |
|
|
|
print("判断是否存在封面图") |
|
|
|
#判断文件是否存在,存在则上传到oss, 更新数据库内容 |
|
|
|
#判断文件是否存在,存在则上传到oss, 更新数据库内容 |
|
|
|
if os.path.exists(f'D://print/{pid}/{pid}_pic.png'): |
|
|
|
if os.path.exists(f'D://print/{pid}/{orderId}/{pid}_pic.png'): |
|
|
|
#获取拍照订单的信息,从中得到拍照订单的信息 |
|
|
|
#获取拍照订单的信息,从中得到拍照订单的信息 |
|
|
|
uuid = get_p3d_info(str(pid)) |
|
|
|
uuid = get_p3d_info(str(pid)) |
|
|
|
if uuid != 0 and uuid != None and uuid != "": |
|
|
|
if uuid != 0 and uuid != None and uuid != "": |
|
|
|
print("uuid",uuid) |
|
|
|
print("uuid",uuid) |
|
|
|
config.oss_bucket_3d_view.put_object_from_file(f'{uuid}/3d_view.png', f'D://print/{pid}/{pid}_pic.png') |
|
|
|
config.oss_bucket_3d_view.put_object_from_file(f'{uuid}/3d_view.png', f'D://print/{pid}/{orderId}/{pid}_pic.png') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
oss_client.put_object_from_file(f'glbs/print/order_id/{glb_filename}', os.path.join(workdir, "print", pid, glb_filename)) |
|
|
|
oss_client.put_object_from_file(f'glbs/print/order_id/{glb_filename}', os.path.join(workdir, "print", pid,orderId, glb_filename)) |
|
|
|
|
|
|
|
|
|
|
|
#对文件进行白色提纯处理 |
|
|
|
#对文件进行白色提纯处理 |
|
|
|
imagePath = os.path.join(workdir, 'print', pid,pid+"Tex1.jpg") |
|
|
|
imagePath = os.path.join(workdir, 'print', pid,orderId,pid+"Tex1.jpg") |
|
|
|
print("开始处理白色提纯") |
|
|
|
print("开始处理白色提纯") |
|
|
|
#white_purification.white_purification_utils(imagePath) |
|
|
|
#white_purification.white_purification_utils(imagePath) |
|
|
|
os.system(f'python D:\\make2\\apps\white_purification_v4.py -i {imagePath}') |
|
|
|
os.system(f'python D:\\make2\\apps\white_purification_v4.py -i {imagePath}') |
|
|
|
@ -165,7 +165,7 @@ def team_check(r): |
|
|
|
print(f'{update_repair_status_url}?id={repair_id}') |
|
|
|
print(f'{update_repair_status_url}?id={repair_id}') |
|
|
|
res = requests.get(f'{update_repair_status_url}?id={repair_id}') |
|
|
|
res = requests.get(f'{update_repair_status_url}?id={repair_id}') |
|
|
|
print('更新团队审核状态:', res.text) |
|
|
|
print('更新团队审核状态:', res.text) |
|
|
|
shutil.rmtree(os.path.join(workdir, 'print', pid), ignore_errors=True) |
|
|
|
#shutil.rmtree(os.path.join(workdir, 'print', pid,orderId), ignore_errors=True) |
|
|
|
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), f'pid:{pid} 生成团队审核模型 end') |
|
|
|
print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), f'pid:{pid} 生成团队审核模型 end') |
|
|
|
|
|
|
|
|
|
|
|
def get_p3d_info(pid): |
|
|
|
def get_p3d_info(pid): |
|
|
|
|