Forum

Author Topic: Run Batch on multiple Psx files  (Read 1554 times)

_danny_

  • Newbie
  • *
  • Posts: 16
    • View Profile
Run Batch on multiple Psx files
« on: October 01, 2021, 02:19:57 AM »
I have 80 .psx files, each containing multiple chunks. Instead of opening each file individually and running a batch job, is there a way to automatically do this via a python script?

I'm thinking that it would be as simple as iterating over all of the psx files in a folder and initiating the batch, but I can't seem to find the correct function in the API to do this. I can see resume batch and pause batch, but not start batch.. I'm sure I'm just missing a basic detail. 

Code: [Select]
import os, MetaShape

dir_projects = 'E:/...//' #Directory folders with pictures

foldernames = os.listdir(dir_projects)


for i in range (0,len(foldernames)):
   
   doc=PhotoScan.app.document
   
   chunk = doc.addChunk()

  # Implement Batch Here
 
   doc.save()
   
   doc.clear()

Zeying

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Run Batch on multiple Psx files
« Reply #1 on: February 15, 2023, 08:50:24 AM »
I've managed to make it work by
Code: [Select]
doc=PhotoScan.app.document
chunk = doc.addChunk()
doc.open("path")