diff --git a/.github/workflows/publish-windows.yml b/.github/workflows/publish-windows.yml index f09a846c8..57cd39e6a 100644 --- a/.github/workflows/publish-windows.yml +++ b/.github/workflows/publish-windows.yml @@ -49,7 +49,7 @@ jobs: run: | python configure.py dist --code-sign-cert-path $env:CODE_SIGN_CERT_PATH - name: Upload Setup File - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Setup path: dist\*.exe diff --git a/.github/workflows/test-build-prs.yaml b/.github/workflows/test-build-prs.yaml index 092c34466..ddc127620 100644 --- a/.github/workflows/test-build-prs.yaml +++ b/.github/workflows/test-build-prs.yaml @@ -81,7 +81,7 @@ jobs: run: | python configure.py dist - name: Upload Setup File - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Setup path: dist\*.exe diff --git a/VERSION b/VERSION index 444877d48..65afb3b88 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.3 +3.5.4 diff --git a/opendm/shots.py b/opendm/shots.py index 2d8ae23fb..b6eeeb302 100644 --- a/opendm/shots.py +++ b/opendm/shots.py @@ -148,3 +148,16 @@ def merge_geojson_shots(geojson_shots_files, output_geojson_file): with open(output_geojson_file, "w") as f: f.write(json.dumps(result)) + +def merge_cameras(cameras_json_files, output_cameras_file): + result = {} + for cameras_file in cameras_json_files: + with open(cameras_file, "r") as f: + cameras = json.loads(f.read()) + + for cam_id in cameras: + if not cam_id in result: + result[cam_id] = cameras[cam_id] + + with open(output_cameras_file, "w") as f: + f.write(json.dumps(result)) diff --git a/stages/splitmerge.py b/stages/splitmerge.py index 80e130978..944a6052a 100644 --- a/stages/splitmerge.py +++ b/stages/splitmerge.py @@ -15,7 +15,7 @@ from opendm.cropper import Cropper from opendm.concurrency import get_max_memory from opendm.remote import LocalRemoteExecutor -from opendm.shots import merge_geojson_shots +from opendm.shots import merge_geojson_shots, merge_cameras from opendm import point_cloud from opendm.utils import double_quote from opendm.tiles.tiler import generate_dem_tiles @@ -337,6 +337,15 @@ def merge_dems(dem_filename, human_name): else: log.ODM_WARNING("Found merged shots.geojson in %s" % tree.odm_report) + # Merge cameras + cameras_json = tree.path("cameras.json") + if not io.file_exists(cameras_json) or self.rerun(): + cameras_json_files = get_submodel_paths(tree.submodels_path, "cameras.json") + log.ODM_INFO("Merging %s cameras.json files" % len(cameras_json_files)) + merge_cameras(cameras_json_files, cameras_json) + else: + log.ODM_WARNING("Found merged cameras.json in %s" % tree.root_path) + # Stop the pipeline short by skipping to the postprocess stage. # Afterwards, we're done. self.next_stage = self.last_stage()