Forum

Author Topic: Newbie - error running a script.  (Read 3059 times)

SimonBrown

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • AccuPixel Ltd - Dealer and Training Centre
Newbie - error running a script.
« on: April 13, 2017, 08:01:55 PM »
Having recently upgraded to 1.3.1.4 I now find the following script:-

http://wiki.agisoft.com/w/index.php?title=Split_in_chunks.py&oldid=207

This script is really, really useful. Its a godsend for larger models such as this one:-

https://sketchfab.com/models/99d9f126ea0647f79e761d3cd2c1fca0

Created over 6 or 7 dives and now has nearly 10k images.

However, running the script triggers the following errors in the console:-

2017-04-13 17:47:31     class SplitDlg(QtWidgets.QDialog):
2017-04-13 17:47:31 NameError: name 'QtWidgets' is not defined

Can anyone suggest a fix for this one? its making me tear my hair out!
Agisoft endorsed online Metashape training - see: https://accupixel.co.uk/metashape-training-courses

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13211
    • View Profile
Re: Newbie - error running a script.
« Reply #1 on: April 16, 2017, 04:10:18 PM »
Hello SimonBrown,

That's very strange. Are you sure you've copied the full script including the following line:

Code: [Select]
from PySide2 import QtGui, QtCore, QtWidgets
Best regards,
Alexey Pasumansky,
Agisoft LLC

SimonBrown

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • AccuPixel Ltd - Dealer and Training Centre
Re: Newbie - error running a script.
« Reply #2 on: April 22, 2017, 09:32:43 PM »
Hi Alexey - yes the entire script including the line you mention.

The error occurs very soon on loading, triggered on the very line you refer to I believe.
Agisoft endorsed online Metashape training - see: https://accupixel.co.uk/metashape-training-courses

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13211
    • View Profile
Re: Newbie - error running a script.
« Reply #3 on: April 22, 2017, 09:37:12 PM »
Hello SimonBrown,

And could you input the following lines to the Console pane just for testing and provide the output:
Code: [Select]
from PySide2 import QtWidgets
QtWidgets.QDialog
Best regards,
Alexey Pasumansky,
Agisoft LLC

SimonBrown

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • AccuPixel Ltd - Dealer and Training Centre
Re: Newbie - error running a script.
« Reply #4 on: April 23, 2017, 12:01:21 PM »
Hi Alexey - here's the output:-

Out[1]: 2017-04-23 10:00:35 PySide2.QtWidgets.QDial
Agisoft endorsed online Metashape training - see: https://accupixel.co.uk/metashape-training-courses

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13211
    • View Profile
Re: Newbie - error running a script.
« Reply #5 on: April 23, 2017, 03:04:48 PM »
So it is supposed to be working. Can you then attache the script that you are usign to the post here?
Best regards,
Alexey Pasumansky,
Agisoft LLC

SimonBrown

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • AccuPixel Ltd - Dealer and Training Centre
Re: Newbie - error running a script.
« Reply #6 on: April 28, 2017, 02:45:49 PM »
Hi Alexey

Script file is attached/uploaded.
Agisoft endorsed online Metashape training - see: https://accupixel.co.uk/metashape-training-courses

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13211
    • View Profile
Re: Newbie - error running a script.
« Reply #7 on: April 28, 2017, 02:51:21 PM »
Hello Simon,

In the provided script there's line
Code: [Select]
from PyQt4 import QtGui, QtCoreinstead of
Code: [Select]
from PySide2 import QtGui, QtCore, QtWidgets
Best regards,
Alexey Pasumansky,
Agisoft LLC