From b662fda437f5e3eaec34a9ed0d90d85c5f9c3b0d Mon Sep 17 00:00:00 2001 From: youwater Date: Wed, 11 Oct 2023 11:39:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AExmps=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=A1=AE=E5=AE=9A=E6=98=AF=E5=90=A6=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=9B=B4=E6=96=B0=EF=BC=8C=E6=9C=AA=E6=94=B9=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/downxmps.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/downxmps.py b/tools/downxmps.py index 24cda78..5686ec4 100644 --- a/tools/downxmps.py +++ b/tools/downxmps.py @@ -65,17 +65,29 @@ if __name__ == '__main__': exit(1) for pid in pids.split(','): - input_path = os.path.join('d:\\', pid) + input_path = os.path.join(config.workdir, pid) ImagesGeometry = os.path.join(input_path, "photo1") ImagesTexture = os.path.join(input_path, "photo2") psid = libs.getPSid(pid) - config_path = f'D:\\apps\\config\\' - xmps_mesh_path = config_path + f'xmps\\{psid}\\mesh\\' - xmps_texture_path = config_path + f'xmps\\{psid}\\texture\\' + config_path = os.path.join(config.sharedir, 'libs') + xmps_mesh_path = os.path.join(config_path, 'xmps', psid, 'mesh') + xmps_texture_path = os.path.join(config_path, 'xmps', psid, 'texture') down_xmps_from_oss(psid) + # 根据坐标文件时间戳判断是否需要更新 + remotefile = os.path.join(xmps_mesh_path, '11_1.xmp') + localfile = os.path.join(ImagesGeometry, '11_1.xmp') + print(f'remotefile: {remotefile}, localfile: {localfile}') + if os.path.exists(localfile): + remotefile_last_modified = os.path.getmtime(remotefile) + localfile_last_modified = os.path.getmtime(localfile) + if remotefile_last_modified <= localfile_last_modified: + print(f'本地{localfile}文件已是最新, 不需要更新') + continue + + print(f'正在更新{pid}号影棚坐标文件') os.system('xcopy /y /q ' + xmps_mesh_path + '*.* ' + ImagesGeometry) os.system('xcopy /y /q ' + xmps_texture_path + '*.* ' + ImagesTexture)