Forum

Author Topic: I have problem. I scripting with python Reference Release 1.0.0  (Read 3195 times)

lgs777

  • Newbie
  • *
  • Posts: 13
    • View Profile
I have problem. I scripting with python Reference Release 1.0.0
« on: December 02, 2014, 10:31:11 AM »


error occurred when scripting on photoscan console.
help me :p


>>> import PhotoScan
>>> doc = PhotoScan.app.document
>>> doc.activeChunk.matchPhotos(accuracy="high", preselection="generic")

  File "<console>", line 1
    doc.activeChunk.matchPhotos(accuracy="high", preselection="generic")
                                                                       
^
SyntaxError: invalid character in identifier

>>>

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14010
    • View Profile
Re: I have problem. I scripting with python Reference Release 1.0.0
« Reply #1 on: December 02, 2014, 12:41:38 PM »
Hello lgs777,

In the version 1.1.0 there were some major changes in Python API, so please check updated API Reference document.

In your code you need to replace doc.activeChunk by doc.chunk at first. And then change function arguments from string to enum:

doc.chunk.matchPhotos(accuracy = PhotoScan.HighAccuracy, preselection = PhotoScan.Preselection.GenericPreselection)

Note that you can always use autocomplete feature (Ctrl + Space) to see the description of the function in the Console pane.
Best regards,
Alexey Pasumansky,
Agisoft LLC