04-02-2025, 02:04 PM
A quick question about the direct api, from the docs how do you tell when a tuple is expected.
I wanted to get the offsets for a layer so I tried calling 'layer.get_offsets()' like
This resulted in an error. I checked the docs for get_offsets and it listed return value as boolean, so I thought maybe wrong function and at the time I was tired so I just used the old way using pdb.
Today I took the time to look at the type hints and see it returns a tuple of success,x,y, so I fixed things. So when using the api docs can I assume that if the description says it returns x and the return value is boolean, that the function will return a tuple of boolean,x ?
Thanks
I wanted to get the offsets for a layer so I tried calling 'layer.get_offsets()' like
Code:
x,y = layer.get_offset()
This resulted in an error. I checked the docs for get_offsets and it listed return value as boolean, so I thought maybe wrong function and at the time I was tired so I just used the old way using pdb.
Today I took the time to look at the type hints and see it returns a tuple of success,x,y, so I fixed things. So when using the api docs can I assume that if the description says it returns x and the return value is boolean, that the function will return a tuple of boolean,x ?
Thanks