1
This commit is contained in:
1 parent
93a3ac67bd
commit
a9516b6e25
2 files changed
+19
-2
No files matched your search
+18
-1
@@ -1,5 +1,7 @@
|
|||||||
import os, sys, time, bpy, math, requests, bmesh, json, shutil
|
import os, sys, time, bpy, math, requests, bmesh, json, shutil
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
import secrets
|
||||||
|
import string
|
||||||
import platform
|
import platform
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
sys.path.append('e:\\libs\\')
|
sys.path.append('e:\\libs\\')
|
||||||
@@ -227,8 +229,16 @@ def step3(pid,task_distributed_id=""):
|
|||||||
#return
|
#return
|
||||||
|
|
||||||
#执行获取obj缩略图
|
#执行获取obj缩略图
|
||||||
print("AAAAAAAA")
|
print("执行获取obj全身缩略图脚本")
|
||||||
os.system(f'python d:\\make2\\tools\pic_for_obj\image_rander_small.py -pid {pid} -i D://{pid}/output -o D://{pid}/output')
|
os.system(f'python d:\\make2\\tools\pic_for_obj\image_rander_small.py -pid {pid} -i D://{pid}/output -o D://{pid}/output')
|
||||||
|
#判断文件是否存在,存在则上传到oss, 更新数据库内容
|
||||||
|
if os.path.exists(f'D://{pid}/output/{pid}_pic.png'):
|
||||||
|
#获取拍照订单的信息,从中得到拍照订单的信息
|
||||||
|
uuid = get_p3d_info(pid)["data"]["uuid"]
|
||||||
|
print("uuid",uuid)
|
||||||
|
#config.oss_bucket.put_object_from_file(f'objs/auto/{pid}/{pid}_pic.png', f'D://{pid}/output/{pid}_pic.png')
|
||||||
|
# #更新数据库
|
||||||
|
# main_service_db.update_task_distributed({"id":task_distributed_id,"pic_url":f'{pid}_pic.png'})
|
||||||
|
|
||||||
|
|
||||||
#移除文件夹
|
#移除文件夹
|
||||||
@@ -238,6 +248,13 @@ def step3(pid,task_distributed_id=""):
|
|||||||
#执行模型优化,异步调用,再ai_repair 服务区上执行
|
#执行模型优化,异步调用,再ai_repair 服务区上执行
|
||||||
os.system(f"python D://make2/tools/optimize_model/main.py {pid}")
|
os.system(f"python D://make2/tools/optimize_model/main.py {pid}")
|
||||||
|
|
||||||
|
def get_p3d_info(pid):
|
||||||
|
url = "https://mp.api.suwa3d.com/api/customerP3dLog/info?id="+pid
|
||||||
|
res = requests.get(url)
|
||||||
|
res = res.json()
|
||||||
|
print("获取拍照订单数据",res)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
def main(pid):
|
def main(pid):
|
||||||
if pid == '0':
|
if pid == '0':
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ def rander_image_and_check(args):
|
|||||||
# 导入模型文件
|
# 导入模型文件
|
||||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())}: import pid: {pid}')
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())}: import pid: {pid}')
|
||||||
start_import = time.time()
|
start_import = time.time()
|
||||||
print("===============", os.path.join(args.input, pid, obj_file))
|
print("===============", os.path.join(args.input, obj_file))
|
||||||
with stdout_redirected(to=os.devnull):
|
with stdout_redirected(to=os.devnull):
|
||||||
bpy.ops.import_scene.obj(filepath=os.path.join(args.input,obj_file))
|
bpy.ops.import_scene.obj(filepath=os.path.join(args.input,obj_file))
|
||||||
print(
|
print(
|
||||||
|
|||||||
Reference in new issue
Block a user