Author Topic: Script runs differently if I place or take out a call in the middle  (Read 1762 times)


  • Newbie
  • *
  • Posts: 19
    • View Profile

I would appreciate your help. I wrote two scripts:
(1) one orients the model and sets the bounding box
(2) the other resets the viewpoint to something nice with the z-axis up (see below)

I found that if I run these consecutively as separate scripts, then both objectives are reached! Unfortunately when I call them from within the same script the second one doesn't happen. The viewpoint stays the same as if (2) never even ran. However, if I include a save function in between the two scripts, then both steps are successfully completed.

I'm including a minimal example below. In place of my script (1) I am doing chunk.updateTransform() which produces the same inconsistency. Please try running the code below on a project with a completed model in a chunk. Then uncomment the line. Hopefully you will also see the resulting view depends on

Why do I need the command for the script to carry out the rotate() function afterwards?

I am using Agisoft PhotoScan Professional Version 1.3.3 build 4827 (64 bit)

Code: [Select]
import PhotoScan

def rotate():
    doc =
    chunk = doc.chunks[-1]

    T = chunk.transform.matrix = T.mulp(PhotoScan.Vector([0,0,0])) = chunk.transform.rotation = 1000
if __name__ == "__main__":

    doc =
    chunk = doc.chunks[-1]