Forum

Author Topic: getString with default value?  (Read 7546 times)

7eicher

  • Newbie
  • *
  • Posts: 42
    • View Profile
getString with default value?
« on: September 10, 2013, 12:53:34 PM »
Der folks,

I am working on a script to auto-mask images and I get the tolerance value from the user using PS.Application.getString("Tolerance:"). Is there a way to put a default value in the form, to set it, e.g. to 10? Otherwise, this would be a feature request :)

Tkae care,

Markus

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: getString with default value?
« Reply #1 on: September 24, 2013, 10:07:15 PM »
Hello Markus,

Will consider this feature in future. Currently you can perform similar action using PySide:
Code: [Select]
from PySide import QtGui
(x, status) = QtGui.QInputDialog.getInt(None, "input", "title", 10)

None - here's parent, "input" - message hint, "title" - dialog caption and "10" - default value.
Best regards,
Alexey Pasumansky,
Agisoft LLC

frnx

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: getString with default value?
« Reply #2 on: October 21, 2013, 04:44:38 PM »
Alexey,

I just tried running the sample code you posted, since it would really help us to be able to create small business-specific UIs running directly in PhotoScan, and PySide is a great tool for that.

However, I can't import PySide at all :

Code: [Select]
>>> from PySide import QtGui
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: libshiboken.cpython-33m.so.1.1: Ne peut ouvrir le fichier d'objet partag?: Aucun fichier ou dossier de ce type

I was under the impression that PhotoScan bundled its own Python modules, but do we have to install some additional dependencies?

Thanks!
Fran?ois-Xavier

(PhotoScan version: 0.9.1 build 1703, running on Ubuntu 12.04 LTS)
« Last Edit: October 21, 2013, 04:49:25 PM by frnx »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: getString with default value?
« Reply #3 on: October 21, 2013, 04:50:18 PM »
Hello Francois-Xavier,

Please check the latest build (1748), probably you are using older version.
Best regards,
Alexey Pasumansky,
Agisoft LLC

frnx

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: getString with default value?
« Reply #4 on: October 21, 2013, 05:01:46 PM »
Ha, thanks a lot, I hadn't noticed the forum announcement! Works like a charm now ;)