I'm trying to script the removal of markers that have been placed on selected photos. I can get them to go from green to blue, and I've seen other scripts for removing blue markers, so I thought it should be simple to combine the two concepts. But it isn't working. The following shifts them to blue but does not remove them. Any suggestions?
def cameraMarkerClear():
print("Clearing markers from selected cameras...", flush=True)
chunk = doc.chunk
countCams = 0
countMarks = 0
for camera in chunk.cameras:
if camera.selected:
countCams = countCams + 1
for marker in chunk.markers:
proj = marker.projections[camera]
if proj is not None:
if proj.pinned:
countMarks = countMarks + 1
proj.pinned = False ### this turns them from green to blue
proj = None ### this should be what other scripts use to remove blue markers
print("removing " + marker.label + " from " + camera.label, flush = True)
print("Removed " + str(countMarks) + " markers from " + str(countCams) + " cameras.")
app.addMenuItem("Testing/Clear Markers From Selected Cameras", cameraMarkerClear)
Thanks!