Hello all,
I am trying to write a camera and marker exporter for Maya from PhotoScan, and I am having some issues.
-When trying to get the location of cameras or markers with reference data applied to them the location returned is incorrect.
Ex case:
*Chunk has some markers without reference data.
*Original camera position in 3D returned by camera.transform.col(3) is (say) (10,10,10)
*Update markers by inserting some reference data.
*Try to get marker position after updating marker with reference data by calling marker.position, it's the ORIGINAL position.
*Try to get marker position by calling marker.reference.location, it's the new position (makes sense because these are the values that I entered)
*Try to get another marker -that has no reference data- position by calling marker.position, it's the old position (although it has been moved in 3D space in response to another marker reference data update!)
*Try to get the camera position again, it's wrong!
*Try to get the camera position by using camera.reference.location, "location" property is None (makes sense as no reference data for the camera has been entered)
Now this is very weird, because I expect the python API marker.position to return the new position of the marker even if that marker has no reference data because it's position is already updated using another marker reference data after clicking the "update" button. And the same is expected for Cameras!
After some digging I discovered that PhotoScan gives other markers/cameras an estimated location (which makes sense as they move in accordance to other markers/cameras), and these data can be found in the "Reference" tap when clicking the "Export" button to save it in a CSV file.
Now question is:
I can't find anything in the python API that gives me access to these estimated data except "loadReference" and "saveReference" functions in "Chunk" type which only write files to HDD.
I don't want to parse the CSV file written on the hard disk just to get the correct location for markers and cameras.
I want to get these values from memory like any other values in PhotoScan, is this is possible ?
Thanks in advance.