|
|
|
@ -152,7 +152,7 @@ def get_obj_max_foot(): |
|
|
|
res = requests.get(f'https://mp.api.suwa3d.com/api/footCode/deleteByPid?pid={pid}') |
|
|
|
res = requests.get(f'https://mp.api.suwa3d.com/api/footCode/deleteByPid?pid={pid}') |
|
|
|
os.system(f'blender -b -P fill_dm_code.py') |
|
|
|
os.system(f'blender -b -P fill_dm_code.py') |
|
|
|
return |
|
|
|
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']) |
|
|
|
active_object(bpy.data.objects['foot']) |
|
|
|
foot_points = get_plane_points(bpy.data.objects['foot']) |
|
|
|
foot_points = get_plane_points(bpy.data.objects['foot']) |
|
|
|
# plot(get_plane_points(bpy.data.objects['foot']), 'blue') |
|
|
|
# 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)) |
|
|
|
# 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}") |
|
|
|
# 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']) |
|
|
|
active_object(bpy.data.objects['qr']) |
|
|
|
bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_MASS', center='MEDIAN') |
|
|
|
bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_MASS', center='MEDIAN') |
|
|
|
bpy.data.objects['qr'].rotation_euler[0] = 0 |
|
|
|
bpy.data.objects['qr'].rotation_euler[0] = 0 |
|
|
|
|