Forum

Author Topic: Load existing project and run script  (Read 2897 times)

Zeying

  • Newbie
  • *
  • Posts: 20
    • View Profile
Load existing project and run script
« on: February 15, 2023, 07:15:53 AM »
Dear Concerned
I've developed an workflow process with multiple scripts designed for each stage of image process and saved the result of each stage as individual project file. (xxxx_01.psx, xxxx_02.psx, xxxx_03.psx, etc)
They are all done in agisoft GUI with "Tools->Run Script".
I'm wondering how to open each project file (such as xxxx_01.psx)using python with all processed results in there?
Namely how to use python to replace the action of double clicking on .psx to open project and run script

I've tried to run doc.open in a script within a new blank project under "Tools->Ru Script"but in the console it says the project is loaded but nothing is there.
Script:
Code: [Select]
doc = Metashape.Document()
doc.open(path="Y:/PierCrackDetection/03_Data/Scripts/Testing/ShekPik_20221206/Processing/ShekPik_03.psx")

Console:
2023-02-15 11:45:43 LoadProject: path = Y:/PierCrackDetection/03_Data/Scripts/Testing/ShekPik_20221206/Processing/ShekPik_03.psx
2023-02-15 11:45:43 Loading project...
2023-02-15 11:45:43 loaded project in 0.017 sec
2023-02-15 11:45:43 Finished processing in 0.018 sec (exit code 1)

Nothing of the "ShekPik_03.psx" is shown, chunk is blank.

I would really appreciate if someone can help here.
Thank you in advance!

Zeying

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Load existing project and run script
« Reply #1 on: February 15, 2023, 08:56:13 AM »
I've managed to restore all things from the project file using
Code: [Select]
doc=PhotoScan.app.document
chunk = doc.addChunk()

Now I'm wondering how to launch Agisoft GUI using python?

smiller

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Load existing project and run script
« Reply #2 on: August 03, 2023, 09:52:57 AM »
Any updates on this?