1
This commit is contained in:
1 parent
c5dbd09ad1
commit
62f5ede4ba
3 files changed
+9
-3
No files matched your search
@@ -206,6 +206,7 @@ def main():
|
||||
bpy.ops.export_scene.obj(filepath=os.path.join(path, f'{pid}_decimate.obj'))
|
||||
bpy.ops.export_scene.gltf(filepath=os.path.join(path, f'{pid}_decimate.glb'), export_format='GLB', export_apply=True, export_jpeg_quality=100)
|
||||
config.oss_bucket.put_object_from_file(f'glbs/3d/{pid}.glb', os.path.join(path, f'{pid}_decimate.glb'))
|
||||
config.oss_bucket.put_object_from_file(f'glbs/3d/order_id/{orderId}.glb', os.path.join(path, f'{pid}_decimate.glb'))
|
||||
bpy.ops.wm.quit_blender()
|
||||
|
||||
|
||||
|
||||
@@ -83,9 +83,12 @@ def down_obj_fromoss(pid, print_type=1, order_id=None):
|
||||
path = os.path.join(workdir, pid)
|
||||
if os.path.exists(path):
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid: {pid} 已存在模型文件,删除后重新下载')
|
||||
print("AAAAAAAAAAAA")
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
print("BBBBBBBBBBBBBBB")
|
||||
os.makedirs(path)
|
||||
|
||||
print("准备下载,获取ossPath")
|
||||
prefix = f'objs/print/{pid}'
|
||||
#根据order_id 获取文件在 oss 上的存储路径
|
||||
if order_id is not None:
|
||||
@@ -525,7 +528,9 @@ def main(workdir, r, print_id):
|
||||
order_id = arrResText['data']['order_id'] # order_id
|
||||
|
||||
#文件路劲
|
||||
filename = os.path.join(workdir, f'{pid}_{order_id}', find_obj(pid, order_id))
|
||||
tempName = find_obj(pid, order_id)
|
||||
print("tempName",tempName)
|
||||
filename = os.path.join(workdir, f'{pid}_{order_id}', tempName)
|
||||
print('导入obj文件:', filename)
|
||||
|
||||
#获取该笔订单的坐标
|
||||
|
||||
+2
-2
@@ -228,8 +228,8 @@ def make3d4print_task(r):
|
||||
return
|
||||
|
||||
#根据 buy_type 判断 是否是冰箱贴 或者徽章
|
||||
buyType = str(res['buy_type'])
|
||||
if buyType == "2" or buyType == "3": #or buyType == "4" 小尺寸需要缩放
|
||||
noresize = str(res['noresize'])
|
||||
if noresize == "1":
|
||||
#塞入到no_resize 队列
|
||||
r.lpush("model:noresize", orderId)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user