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)