From 277766ffca3637e9372eab744f8037d0721695d0 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Fri, 10 Jan 2025 20:34:56 +0800 Subject: [PATCH] 1 --- yj_local_build/main_step1.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/yj_local_build/main_step1.py b/yj_local_build/main_step1.py index c499f69..f7ac059 100644 --- a/yj_local_build/main_step1.py +++ b/yj_local_build/main_step1.py @@ -165,6 +165,24 @@ def step2(pid,headsCount): print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} pid:{pid} - 建模完成状态变更失败 - {e}') +#做xmps的坐标 +def getXmps(pid): + + #从共享盘上下载对齐信息,判断是否有 + print(f"判断是否存在 {os.path.join(config.sharedir, 'xmps_rate','texture')} -- {os.path.exists(os.path.join(config.sharedir, 'xmps_rate','texture'))}") + if os.path.exists(os.path.join(config.workdir, 'xmps','texture')) == False or os.path.exists(os.path.join(config.workdir, 'xmps','mesh')) == False: + print(f"检测不到对齐坐标,请先人工建一次模进行对齐,创建坐标,创建制定的坐标到 {os.path.join(config.workdir, 'xmps_rate','mesh')} 和 os.path.join(config.workdir, 'xmps_rate','texture')") + return False + else: + #将共享盘的对齐信息复制到工作目录,photo1 和 photo2 + shutil.copytree(os.path.join(config.workdir, 'xmps_rate','mesh'), os.path.join(config.workdir, pid, 'photo1'),dirs_exist_ok=True) + shutil.copytree(os.path.join(config.workdir, 'xmps_rate','texture'), os.path.join(config.workdir, pid, 'photo2'),dirs_exist_ok=True) + + return True + + + + def main(pid,headsCount): step1(pid, headsCount) @@ -212,6 +230,11 @@ if __name__ == '__main__': print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 建模任务循环开始,{needBuildDir}') for pid in os.listdir(needBuildDir): print("pid=",pid) + + res = getXmps(pid) + if res == False: + break + if not os.path.isdir(os.path.join(needBuildDir,pid)): continue