I am running code from
http://www.agisoft.com/pdf/photoscan_python_api_1_1_0.pdf which is the pdf explaining the PhotoScan class that is read by the 'run 'script' button in agisoft. However, while some of the functions seem to work while attempting to automate exporting I have ran into a few problems:
I have tried using:
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.chunk
as well as:
import PhotoScan
# Below are what is needed for the main processing steps on a project
doc = PhotoScan.app.document
chunk = doc.chunk
chunk.matchPhotos(accuracy=PhotoScan.MediumAccuracy, preselection=PhotoScan.GenericPreselection)
chunk.alignCameras()
chunk.optimizeCameras(fit_f=True, fit_cxcy=True, fit_aspect=True, fit_skew=True, fit_k1k2k3=True, fit_p1p2=True, fit_k4=False)
chunk.buildDenseCloud(quality=PhotoScan.MediumQuality)
chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.EnabledInterpolation)
chunk.buildUV(mapping=PhotoScan.GenericMapping)
chunk.buildTexture(blending=PhotoScan.MosaicBlending, size=4096)
followed by:
# chunk.exportModel(r"C:\Users\(rest of path I want...)", binary=False, precision=6, texture_format='tif', normals=False, colors=False, cameras=True['']['ply']['NAD83(HARN) / UTM zone 12N (EPSG::3742)'][0,0,0])
# error that string indices must be intergers (this error shows up in other locations as well)
PhotoScan.PointCloud.export(r"C:\Users\(rest of path I want...)", format='ply'['EPSG::3742'])
# comes back as unscriptable 'bool'=False
chunk.exportPoints(r'C:\Users\(rest of path I want...)', binary=False, precision=6, normals=True, colors=False ['']['']['ply']['NAD83(HARN) / UTM zone 12N (EPSG::3742)'][0,0,0])
Unless there is some easy fix, I was thinking that access to a help function or running the python without opening agisoft and using the run script button would help.
Thanks for the Help!