List integration as argument (beginner)
<p>I am writing a script in python, but I am a beginner (started yesterday).</p>

<p>Basically, I just create chunks that I fill with ~10 pictures, align them, build the model, and build the texture. Now I have my chunks and I want to align them... </p>

<p>From the <a href="http://downloads.agisoft.ru/pdf/photoscan_python_api.pdf" rel="nofollow">manual</a>:</p>

<blockquote>
  <p><code>PhotoScan.alignChunks(chunks, reference, method=’points’, accuracy=’high’, preselection=False)</code></p>
  
  <p>Aligns speciﬁed set of chunks.  </p>
  
  <p><strong>Parameters</strong></p>
  
  <ul>
  <li>chunks (list) – List of chunks to be aligned.</li>
  <li>reference (Chunk) – Chunk to be used as a reference.</li>
  <li>method (string) – Alignment method in [’points’, ‘markers’].</li>
  <li>accuracy (string) – Alignment accuracy in [’high’, ‘medium’, ‘low’].</li>
  <li>preselection (boolean) – Enables image pair preselection.</li>
  </ul>
  
  <p>Returns Success of operation.</p>
  
  <p>Return type <code>boolean</code></p>
</blockquote>

<p>I tried to align the chunks, but the script throws an error at line 26:</p>

<blockquote>
  <p>TypeError: expected a list of chunks as an argument</p>
</blockquote>

<p>Do you have any idea how I can make it work?</p>

<p>This is my current code:</p>

<pre class="lang-python prettyprint-override"><code>import PhotoScan
doc = PhotoScan.app.document
main_doc = PhotoScan.app.document
chunk = PhotoScan.Chunk()
proj = PhotoScan.GeoProjection()
proj.init("EPSG::32641")
gc = chunk.ground_control
gc.projection = proj
working_path = "x:\\New_agisoft\\ok\\Optical\\"
for i in range (1,3):
    new_chunk = PhotoScan.Chunk()
    new_chunk.label = str(i)
    loop = i*10 
    loo = (i-1)*10
    doc.chunks.add(new_chunk)
    for j in range (loo,loop):
        file_path = working_path + str(j) + ".jpg"
        new_chunk.photos.add(file_path)
    gc = new_chunk.ground_control
    gc.loadExif()
    gc.apply()
    main_doc.active = len(main_doc.chunks) - 1
    doc.activeChunk.alignPhotos(accuracy="low", preselection="ground control")
    doc.activeChunk.buildModel(quality="lowest", object="height field", geometry="smooth", faces=50000)
    doc.activeChunk.buildTexture(mapping="generic", blending="average", width=2048, height=2048)
PhotoScan.alignChunks(,1,method="points",accuracy='low', preselection=True)
</code></pre>
