dongchangxi 8 months ago
parent
commit
b9beee7f5f
  1. 13
      tools/cal_weight.py

13
tools/cal_weight.py

@ -122,9 +122,18 @@ def down_obj_from_oss(workdir, pid, action):
def main(action, pid, sizes,orderId=0): def main(action, pid, sizes,orderId=0):
down_obj_from_oss(config.workdir, pid, action)
obj = reload_obj(pid, action) isExist = False
if action == "print":
#判断文件是否存在
if os.path.exists(os.path.join(config.workdir, action, pid,"{pid}.obj")):
isExist = True
if isExist != True:
down_obj_from_oss(config.workdir, pid, action)
obj = reload_obj(pid, action)
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True) bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
print(f'模型{pid}的体积与克重估算信息:') print(f'模型{pid}的体积与克重估算信息:')
arrData = {} arrData = {}

Loading…
Cancel
Save