Forum

Author Topic: AttributeError: 'getset_descriptor' object has no attribute  (Read 11203 times)

BFE38

  • Newbie
  • *
  • Posts: 5
    • View Profile
AttributeError: 'getset_descriptor' object has no attribute
« on: March 23, 2015, 11:11:53 PM »
Hi,

Every time Photoscan opens from my script to process images I get this error:

Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Agisoft\PhotoScan Pro/scripts/MenuSetup.py", line 21, in <module>
doc.chunks.add(new_chunk)
AttributeError: 'getset_descriptor' object has no attribute 'chunks'

Most of the time my images will proceed and be processed with no problem.  Sometimes this causes a problem and keep Photoscan open for me which causes a problem. Any help would be appreciated.

Here is my script up to line 21,

Code: [Select]
import PhotoScan
import os
from os import listdir
from os.path import isfile, join
imageryPath = "Z:\\inbound\\"
onlyfiles = [ f for f in listdir(imageryPath) if isfile(join(imageryPath,f)) ]

crs=PhotoScan.GeoProjection()
crs.init("EPSG::3857")

doc = PhotoScan.app.document

new_chunk = PhotoScan.Chunk()
new_chunk.label = "New Chunk"

for f in onlyfiles:
path = imageryPath + f
new_chunk.photos.add(path)
new_chunk.enabled = True

doc.chunks.add(new_chunk)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15635
    • View Profile
Re: AttributeError: 'getset_descriptor' object has no attribute
« Reply #1 on: March 23, 2015, 11:30:13 PM »
Hello BFE38,

I suggest to use doc.addChunk(new_chunk) line.

Also for the coordinate system definition I recommend to use:
Code: [Select]
crs = PhotoScan.CoordinateSystem("EPSG::3857")
Another note on PhotoScan 1.1: for image load you cah use chunk.addPhotos(paths) function, where paths is a list of paths to the image files.
Best regards,
Alexey Pasumansky,
Agisoft LLC

BFE38

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AttributeError: 'getset_descriptor' object has no attribute
« Reply #2 on: March 24, 2015, 09:40:39 PM »
Hello BFE38,

I suggest to use doc.addChunk(new_chunk) line.

Also for the coordinate system definition I recommend to use:
Code: [Select]
crs = PhotoScan.CoordinateSystem("EPSG::3857")
Another note on PhotoScan 1.1: for image load you cah use chunk.addPhotos(paths) function, where paths is a list of paths to the image files.

Thanks for the quick response.  If I'm currently using version 1.0.4 would I still be able to use doc.addChunk(new_chunk),  I can't find that in the documentation.  If not, do you know of another alternative?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15635
    • View Profile
Re: AttributeError: 'getset_descriptor' object has no attribute
« Reply #3 on: March 25, 2015, 11:23:48 AM »
Hello BFE38,

In case this is an autorun script, it wouldn't work, but if run from GUI or from a custom menu item your original script will work in the version 1.0.4.
Best regards,
Alexey Pasumansky,
Agisoft LLC