Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - janalbertschenk

Pages: [1]
1
Python and Java API / Re: Update view and bounding box for each chunk
« on: January 30, 2019, 07:20:13 PM »
He Alexey

It is solved, after restarting the computer and the program it worked. Sorry I didn't try this first but i was a little too focused on the problem.

Thanks for the fast support

2
Python and Java API / Re: Update view and bounding box for each chunk
« on: January 30, 2019, 05:57:51 PM »
Hello Alexey

Ok i did line for line in the console, the result of the print was 5, the error messages stays the same

>>> import Metashape as PhotoScan
>>> chunk = PhotoScan.app.document.chunk
>>> T = chunk.transform.matrix
>>> viewpoint = PhotoScan.app.viewpoint
>>> print(viewpoint)
2019-01-30 15:52:15 5
>>> cx = viewpoint.width
2019-01-30 15:52:29 Traceback (most recent call last):
2019-01-30 15:52:29   File "<console>", line 1, in <module>
2019-01-30 15:52:29 AttributeError: 'int' object has no attribute 'width'
>>> cy = viewpoint.height
2019-01-30 15:52:51 Traceback (most recent call last):
2019-01-30 15:52:51   File "<console>", line 1, in <module>
2019-01-30 15:52:51 AttributeError: 'int' object has no attribute 'height'
>>>

3
Python and Java API / Re: Update view and bounding box for each chunk
« on: January 30, 2019, 05:34:14 PM »
That is fast  :), I used your code as in reaction to Pablorov
But here it is (after a doublecheck if the error is still there):


import PhotoScan

chunk = PhotoScan.app.document.chunk
T = chunk.transform.matrix
viewpoint = PhotoScan.app.viewpoint
cx = viewpoint.width
cy = viewpoint.height


4
Python and Java API / Re: Update view and bounding box for each chunk
« on: January 30, 2019, 04:56:43 PM »
Hello,


I tried this in Metashape 1.5.0, but it doesn't work. Replaced PhotoScan with MetaShape (doesn't make any difference luckely) but i gives an error on line 6

>>>cx = vp.width

Error:
2019-01-30 14:48:26 Traceback (most recent call last):
2019-01-30 14:48:26   File "C:/test2ps.py", line 6, in <module>
2019-01-30 14:48:26     cx = viewpoint.width
2019-01-30 14:48:26 AttributeError: 'int' object has no attribute 'width'
2019-01-30 14:48:26 Error: 'int' object has no attribute 'width'
>>>

I tried different things but no luck. Can you help?
I am a noob in Python, so if its clear what the error is > sorry

Pages: [1]