Forum

Author Topic: Adding and Assigning Markers to Marker Group (v1.3.0)  (Read 2796 times)

Nick Durston

  • Newbie
  • *
  • Posts: 4
    • View Profile
Adding and Assigning Markers to Marker Group (v1.3.0)
« on: March 15, 2017, 02:26:39 PM »
I'm currently trying to create a marker group and then assign markers to the group using Python.

I can create a marker group using:

mGroup = PhotoScan.MarkerGroup

I then try assigning a marker to the group from my list of markers:

chunk.markers[0].group = mGroup

and the following error is returned:

TypeError: expected  PhotoScan.MarkerGroup object

But mGroup IS a marker group object!

To try and work out what was wrong, I manually created a marker group in the GUI. I then was able to identify that group using:

grp = chunk.marker_groups[0].

And then using:

chunk.markers[0].group = grp

works as expected, and the marker is added to the marker group folder.

I think the issue is that when you run

mGroup = PhotoScan.MarkerGroup

it is then unclear how you then go on to make use of mGroup. For example, how do you assign the marker group to a chunk - as you can do easily in the GUI? Because if you can do that, the next step should then work fine.

Any help much appreciated.


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: Adding and Assigning Markers to Marker Group (v1.3.0)
« Reply #1 on: March 15, 2017, 03:36:25 PM »
Hello Nick,

 PhotoScan.MarkerGroup - is a class name.

If you need to create a new group and assign it to some marker, then you need to do the following:
Code: [Select]
grp = chunk.addMarkerGroup()
grp.label =  "New Group"
chunk.markers[0].group = grp
Best regards,
Alexey Pasumansky,
Agisoft LLC

Nick Durston

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Adding and Assigning Markers to Marker Group (v1.3.0)
« Reply #2 on: March 15, 2017, 05:09:10 PM »
Dear Alexey,

Thanks for the quick response. The first line of the code yields:

AttributeError: 'PhotoScan.Chunk' object has no attribute 'addMarkerGroup'

The Python reference manual for v1.3.0 is consistent with this as there is no such command 'addMarkerGroup'.

I can confirm I am definitely using Photoscan v1.3.0 and not an earlier version.

Thanks again,
Nick


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14927
    • View Profile
Re: Adding and Assigning Markers to Marker Group (v1.3.0)
« Reply #3 on: March 15, 2017, 05:19:08 PM »
Hello Nick,

Well, it seems that this functionality is not yet available in public 1.3.0 release, but would be definitely included in the next update.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Nick Durston

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Adding and Assigning Markers to Marker Group (v1.3.0)
« Reply #4 on: March 15, 2017, 05:58:38 PM »
Ok no worries. Will look out for next release! At least I now know it wasn't me doing something silly :)