Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: PierreB on June 03, 2022, 06:34:48 PM
-
Hi. My workflow is the following:
- python script #1: create project, create chunk, add photos, photo matching and save
- open the project in the GUI and manually add GCP points and save
- python script #2: re-open the project and build the dense cloud
How do I re-open the project with the chunk already created?
Thanks
-
I would like to support my interest PierreB's question!
What I have tried to do:
doc = Metashape.Document()
doc.open(project_name)
chunk=doc.findChunk(0)
I know the project has four control points, but when I run the following I get nothing.
for point in chunk.markers:
print(point.read)
It is pretty clear I am not reading/loading the chunk correctly.
Thanks
-
Hello!
If you need to open the existing project in the currently opened Metashape instance, you should do the following:
doc = Metashape.app.document #currently opened document in actual Metashape window
doc.open(project_name)
-
And what about the chunk? How do I open the existing chunk in the project?
-
Hello Pierre,
Each project always has an active chunk (if there is at least one chunk), which is opened by default, when you load the project.
If you need to change the active chunk, call:
doc.chunk = doc.chunks[N] #N - chunk's index in the Workspace pane, starting from 0
-
Thank you Alexey.