Forum

Author Topic: python script differences between 1.7.3 and 1.7.4 releases  (Read 2363 times)

GGR

  • Newbie
  • *
  • Posts: 30
    • View Profile
python script differences between 1.7.3 and 1.7.4 releases
« on: August 31, 2021, 02:55:53 PM »
Hey there,

I've been using on the 1.7.3 release a python script to orient cameras based on a csv containing EO. Here is this script (by the way, thanks to Alexey and Paulo) :
Code: [Select]
import Metashape

chunk = Metashape.app.document.chunk
crs = chunk.crs
T = chunk.transform.matrix

origin = None
for camera in chunk.cameras:
if not camera.type == Metashape.Camera.Type.Regular:
continue
if not camera.reference.location:
continue
if not camera.reference.rotation:
continue

pos = crs.unproject(camera.reference.location)
m = crs.localframe(pos)
rot = Metashape.utils.opk2mat(camera.reference.rotation) * Metashape.Matrix().Diag([1, -1, -1])
R = Metashape.Matrix().Translation(pos) * Metashape.Matrix().Rotation(m.rotation().t() * rot)

if not origin:
origin = pos
chunk.transform.matrix = Metashape.Matrix().Translation(origin)
T = chunk.transform.matrix

camera.transform = T.inv() * R
chunk.updateTransform()

The problem is, since I moved from 1.7.3 to 1.7.4, this script don't works any longer.

Is there any change in the way to script python commands ?
Best regards
Gabriel

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Re: python script differences between 1.7.3 and 1.7.4 releases
« Reply #1 on: August 31, 2021, 04:27:30 PM »
Hello GGR,

Which problem you are observing with this script in 1.7.4 version? Any error message in the Console or any unexpected behavior?
Best regards,
Alexey Pasumansky,
Agisoft LLC

GGR

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: python script differences between 1.7.3 and 1.7.4 releases
« Reply #2 on: September 01, 2021, 03:32:49 PM »
Hey Alexey,

The problem is solved. This wasn't a python scripting issue but a stupid mistake in my workflow.

Nevertheless, thanks !
Best regards
Gabriel

3D_Scan_Fan

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
Re: python script differences between 1.7.3 and 1.7.4 releases
« Reply #3 on: October 03, 2021, 01:23:54 AM »
Are there script changes between 1.6.3 and 1.7.3?

Everytime I do a BuildDepthMap it takes WAY too long and the depth maps come out incomplete :(

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Re: python script differences between 1.7.3 and 1.7.4 releases
« Reply #4 on: October 04, 2021, 12:04:32 PM »
Hello 3D_Scan_Fan,

Do you have GPU enabled for the processing? If so, please specify the GPU model and GPU driver version installed. Additionally, if possible, please provide the depth maps generation log.
Best regards,
Alexey Pasumansky,
Agisoft LLC