Yes, this is the script from the start to the scalebar point where it stops.
import sys
import operator
import os
import PhotoScan
import math
import glob
def main():
#Photoscan Python Full Process Automation
#PhotoScan version 1.1.5
# DEFINE PROCESSING SETTINGS
print("---Defining processing settings...")
#Photo Folder Directory
AgisoftPhotos = "/home/sam3d/Documents/AgisoftPhotos/"
#Import Environment Variables
filename = '/home/sam3d/Documents/AgisoftScannerConfig/Variable_File.txt'
fin=open(filename, 'r')
USER =fin.readline()
NAME =fin.readline()
AA =fin.readline()
DPQ =fin.readline()
MQ =fin.readline()
print("Variables transferred.")
print(USER)
print(NAME)
print(AA)
print(DPQ)
print(MQ)
NAME = NAME[:-1]
#Define: Camera calib file
#CalibFile = "/home/sam3d/Documents/AgisoftScannerConfig/CalibrationFile.xml"
#Define Cameras
CamerasFile = "/home/sam3d/Documents/AgisoftScannerConfig/ScannerCamerasCalibration.xml"
#Define: PhotoScan Project File
PhotoScanProjectFile = "/home/sam3d/Documents/Agisoft_Photoscan_Projects/"
#Model Directory
ModelDirec = ("/home/sam3d/Documents/AgisoftModels/"+NAME+"/")
#Define Photo_List
pdstring= ('/home/sam3d/Documents/AgisoftPhotos/' + NAME + "/*.jpg")
#pdstring = PhotoScan.app.getExistingDirectory("Choose desired scan folder")
#pdstring += "/"
photo_list = glob.glob(pdstring)
#Naming Script
label = NAME
#Script Start
#Get main app objects
doc = PhotoScan.app.document
app = PhotoScan.Application()
# create chunk
chunk = PhotoScan.Chunk()
chunk.label = "chunk"
doc.addChunk(chunk)
#Load Images
print("---Loading Images---")
print(photo_list)
chunk.addPhotos(photo_list)
# SAVE PROJECT
print("---Saving project...")
print("File: " + PhotoScanProjectFile + label + ".psz")
if not(doc.save(PhotoScanProjectFile + label + ".psz")):
app.messageBox("Saving project failed!")
#Marker Detection
#Detect Markers
print("---Detecting Markers---")
chunk.detectMarkers(PhotoScan.TargetType.CircularTarget12bit, 50)
ab = chunk.addScalebar(chunk.markers[1], chunk.markers[9])
ab.reference.distance = 0.4243
"""bc = chunk.addScalebar(chunk.markers[9], chunk.markers[4])
bc.reference.distance = 0.4243
cd = chunk.addScalebar(chunk.markers[4], chunk.markers[8])
cd.reference.distance = 0.4243
da = chunk.addScalebar(chunk.markers[8], chunk.markers[1])
da.reference.distance = 0.4243
ac = chunk.addScalebar(chunk.markers[1], chunk.markers[4])
ac.reference.distance = 0.60
bd = chunk.addScalebar(chunk.markers[9], chunk.markers[8])
bd.reference.distance = 0.60"""
"""chunk.markers[1].reference.location = PhotoScan.Vector((0,0,0.3))
chunk.markers[9].reference.location = PhotoScan.Vector((0.3,0,0))
chunk.markers[4].reference.location = PhotoScan.Vector((0,0,-0.3))
chunk.markers[8].reference.location = PhotoScan.Vector((-0.3,0,0))"""
I have put the other markers in comments in the script at present so I can just test creating one first.
This is the console pane output:
Agisoft PhotoScan Version: 1.1.5 build 2034 (64 bit)
OpenGL Vendor: X.Org
OpenGL Renderer: Gallium 0.4 on AMD OLAND
OpenGL Version: 3.0 Mesa 10.3.2
Maximum Texture Size: 16384
Quad Buffered Stereo: not enabled
ARB_vertex_buffer_object: supported
ARB_texture_non_power_of_two: supported
---Defining processing settings...
Variables transferred.
Chris
Chris_24_04_15
low
lowest
low
---Loading Images---
['/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.63.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.61.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.75.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.60.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.67.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.85.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.14.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.20.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.58.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.55.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.23.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.77.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.43.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.40.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.13.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.71.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.39.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.52.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.56.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.16.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.19.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.4.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.10.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.29.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.26.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.50.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.82.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.59.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.28.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.46.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.35.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.81.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.17.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.38.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.22.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.15.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.41.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.74.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.68.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.30.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.32.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.57.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.9.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.2.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.3.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.54.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.18.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.11.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.69.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.65.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.42.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.51.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.25.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.79.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.5.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.78.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.84.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.48.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.6.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.24.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.33.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.31.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.36.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.72.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.70.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.44.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.27.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.53.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.83.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.8.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.37.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.34.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.80.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.86.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.62.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.7.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.66.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.73.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.49.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.64.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.12.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.45.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.47.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.76.jpg', '/home/sam3d/Documents/AgisoftPhotos/Chris_24_04_15/192.168.0.21.jpg']
Loading photos...
Finished processing in 0.013952 sec (exit code 1)
---Saving project...
File: /home/sam3d/Documents/Agisoft_Photoscan_Projects/Chris_24_04_15.psz
Saving project...
saved project in 0.008013 sec
Finished processing in 0.008054 sec (exit code 1)
---Detecting Markers---
Detecting markers...
192.168.0.2.jpg: 0 markers
192.168.0.3.jpg: 0 markers
192.168.0.4.jpg: 0 markers
192.168.0.5.jpg: 0 markers
192.168.0.6.jpg: 0 markers
192.168.0.7.jpg: 0 markers
192.168.0.8.jpg: 2 markers
192.168.0.9.jpg: 0 markers
192.168.0.10.jpg: 0 markers
192.168.0.11.jpg: 0 markers
192.168.0.12.jpg: 0 markers
192.168.0.13.jpg: 0 markers
192.168.0.14.jpg: 0 markers
192.168.0.15.jpg: 0 markers
192.168.0.16.jpg: 0 markers
192.168.0.17.jpg: 0 markers
192.168.0.18.jpg: 0 markers
192.168.0.19.jpg: 0 markers
192.168.0.20.jpg: 0 markers
192.168.0.21.jpg: 0 markers
192.168.0.22.jpg: 0 markers
192.168.0.23.jpg: 0 markers
192.168.0.24.jpg: 0 markers
192.168.0.25.jpg: 0 markers
192.168.0.26.jpg: 0 markers
192.168.0.27.jpg: 0 markers
192.168.0.28.jpg: 1 markers
192.168.0.29.jpg: 0 markers
192.168.0.30.jpg: 0 markers
192.168.0.31.jpg: 0 markers
192.168.0.32.jpg: 0 markers
192.168.0.33.jpg: 0 markers
192.168.0.34.jpg: 0 markers
192.168.0.35.jpg: 0 markers
192.168.0.36.jpg: 0 markers
192.168.0.37.jpg: 0 markers
192.168.0.38.jpg: 0 markers
192.168.0.39.jpg: 0 markers
192.168.0.40.jpg: 0 markers
192.168.0.41.jpg: 0 markers
192.168.0.42.jpg: 0 markers
192.168.0.43.jpg: 0 markers
192.168.0.44.jpg: 3 markers
192.168.0.45.jpg: 0 markers
192.168.0.46.jpg: 0 markers
192.168.0.47.jpg: 0 markers
192.168.0.48.jpg: 1 markers
192.168.0.49.jpg: 0 markers
192.168.0.50.jpg: 0 markers
192.168.0.51.jpg: 0 markers
192.168.0.52.jpg: 0 markers
192.168.0.53.jpg: 0 markers
192.168.0.54.jpg: 0 markers
192.168.0.55.jpg: 0 markers
192.168.0.56.jpg: 0 markers
192.168.0.57.jpg: 0 markers
192.168.0.58.jpg: 1 markers
192.168.0.59.jpg: 0 markers
192.168.0.60.jpg: 0 markers
192.168.0.61.jpg: 0 markers
192.168.0.62.jpg: 1 markers
192.168.0.63.jpg: 0 markers
192.168.0.64.jpg: 2 markers
192.168.0.65.jpg: 0 markers
192.168.0.66.jpg: 0 markers
192.168.0.67.jpg: 0 markers
192.168.0.68.jpg: 0 markers
192.168.0.69.jpg: 0 markers
192.168.0.70.jpg: 0 markers
192.168.0.71.jpg: 0 markers
192.168.0.72.jpg: 0 markers
192.168.0.73.jpg: 2 markers
192.168.0.74.jpg: 0 markers
192.168.0.75.jpg: 0 markers
192.168.0.76.jpg: 0 markers
192.168.0.77.jpg: 0 markers
192.168.0.78.jpg: 1 markers
192.168.0.79.jpg: 0 markers
192.168.0.80.jpg: 3 markers
192.168.0.81.jpg: 0 markers
192.168.0.82.jpg: 0 markers
192.168.0.83.jpg: 1 markers
192.168.0.84.jpg: 0 markers
192.168.0.85.jpg: 0 markers
192.168.0.86.jpg: 0 markers
Finished processing in 7.78508 sec (exit code 1)
>>>
Regards
Sam