Community Forum

Author Topic: Two Python scripting questions  (Read 809 times)

dobedobedo

  • Newbie
  • *
  • Posts: 16
    • View Profile
Two Python scripting questions
« on: November 14, 2017, 06:44:19 AM »
Hi,

I encountered some minor problems which I can't yet find a solution on the forum.

1. After running my script from tool > run script. My project file somehow will be locked by Python or something. After I close it, it will prompt me that the file is read only next time I open it. Although click "yes" to continue editing will solve the problem, it is still annoying.
2. From the Python API manual, I can't find a way to reorder my chunks. However, it can be achieved by dragging the chunk with mouse. Is there any way I can achieve the same task with Python?

If you're interested in the code I use, here's the link:
https://github.com/dobedobedo/PhotoScan-Workflow

The PhotoScan version I used is 1.3.4

Looking forward to hearing some comment from you!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 8694
    • View Profile
Re: Two Python scripting questions
« Reply #1 on: November 14, 2017, 09:02:17 AM »
Hello dobedobedo,

Which OS you are using?
Best regards,
Alexey Pasumansky,
AgiSoft LLC

dobedobedo

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Two Python scripting questions
« Reply #2 on: November 15, 2017, 08:23:39 AM »
Hi Alexey,

I use Windows 10 64-bit.
The script was written on Linux though, so the end of line character is different. However, I don't think it's a problem for Python on Windows.
« Last Edit: November 16, 2017, 09:48:58 AM by dobedobedo »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 8694
    • View Profile
Re: Two Python scripting questions
« Reply #3 on: November 17, 2017, 02:02:14 PM »
Hello dobedobedo,

Does the problem occur even if you use very basic script, like adding chunk to the document and saving?
Best regards,
Alexey Pasumansky,
AgiSoft LLC

dobedobedo

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Two Python scripting questions
« Reply #4 on: November 20, 2017, 03:03:41 AM »
Yes it is.
I tried using simple command in the Python console directly such as doc=PhotoScan.app.document. It also locks my project file after closing it.

dobedobedo

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Two Python scripting questions
« Reply #5 on: November 27, 2017, 02:24:20 AM »
Hi,
Just interested that whether there's any update of this issue?