I am using a C++ SDK where there is a function like (it has a python wrapper, but not docs):
getPos ( int uvId, float & u, float & v ) const
How do I specify in Python so that the passed variables are changed?
I tried this example to see if I could modify floats inside a function, but it didn’t work, so printed 12.0:
def change ( a ) : a = 35.0 b = 12.0 change ( b ) print b
So how do I call this function that I can change 2 external floats in Python?
Related:
As far I know, Python doesn’t support call-by-reference, so the exact code you are suggesting doesn’t work (obviously).
The tool (or person) that generated the Python wrapper for the C++ function must have done something special to support this function (hopefully, or you won’t be able to use it). Do you know what tool was used to generate the wrapper?
Usually tools like this will generate some sort of container data type: