From 344bab6448f40f6908e5340d432646c35669de93 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Fri, 24 Jan 2025 11:16:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E7=81=B0=E7=A8=8B=E5=BA=8F=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blender/cal_foot_position.py | 8 ++++++-- blender/fill_dm_code.py | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/blender/cal_foot_position.py b/blender/cal_foot_position.py index 3933564..27204f8 100644 --- a/blender/cal_foot_position.py +++ b/blender/cal_foot_position.py @@ -152,7 +152,7 @@ def get_obj_max_foot(): res = requests.get(f'https://mp.api.suwa3d.com/api/footCode/deleteByPid?pid={pid}') os.system(f'blender -b -P fill_dm_code.py') return - # bpy.ops.wm.save_as_mainfile(filepath=os.path.join(workdir, f'{pid}_{order_id}', f'{pid}_{order_id}.blend')) + # bpy.ops.wm.save_as_mainfile(filepath=os.path.join(workdir, f'{pid}_{order_id}', f'{pid}_{order_id}.blend')) active_object(bpy.data.objects['foot']) foot_points = get_plane_points(bpy.data.objects['foot']) # plot(get_plane_points(bpy.data.objects['foot']), 'blue') @@ -163,7 +163,11 @@ def get_obj_max_foot(): # bpy.ops.mesh.primitive_plane_add(size=1, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1)) # print(f"new_location: {bpy.data.objects['foot'].location}") - + + #判断 bpy.data.objects['qr'] 是否存在 + if 'qr' not in bpy.data.objects: + return + active_object(bpy.data.objects['qr']) bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_MASS', center='MEDIAN') bpy.data.objects['qr'].rotation_euler[0] = 0 diff --git a/blender/fill_dm_code.py b/blender/fill_dm_code.py index 20f7d85..b36742f 100644 --- a/blender/fill_dm_code.py +++ b/blender/fill_dm_code.py @@ -589,6 +589,8 @@ def main(workdir, r, print_id): # 加入去灰、锐化 remove_gray_and_sharpening(jpg_path) + + shutil.copyfile(jpg_path, os.path.join(workdir,f'{pid}_{order_id}', f"{pid}Tex1_qr.jpg")) #上传脚底板文件 -》 修改为移动脚底板文件 upload_jpg_mtl(pid, order_id, print_id)