# Python script and vec2 struct



## Korwin (Mar 27, 2019)

Hello, 

I'm tring to write python script that would move one of the sources somehow. For this I'm tring to utilize obs.obs_sceneitem_set_pos
The problem is that it require "const struct vec2_ *pos_ " as a second parameter.  I tried to pass tuples, arrays, classes and always get: 
--------------
TypeError: in method 'obs_sceneitem_set_pos', argument 2 of type 'struct vec2 const *'
--------------
Googling around I end up with ctype library and something like that:
-------------------
class POINT(ct.Structure):
    _fields_ = [ ("x", ct.c_float), 
               ("y", ct.c_float), 
               ("ptr", ct.POINTER(ct.c_float * 2 )) ]

xy2 = POINT()
        xy2.x = 0
        xy2.y = 0

 obs.obs_sceneitem_set_pos(sceneItem, xy2)
----------------
But still get the same error.

Can someone, please, help to find out what is the right way to pass this into function


----------



## garex (Mar 28, 2019)

Anybody?


----------



## dodgepong (Mar 28, 2019)

Try this:


```
pos = obs.vec2()
pos.x = 0
pos.y = 0
```


----------



## paioniu (Aug 24, 2020)

dodgepong said:


> Try this:
> 
> 
> ```
> ...



Hi. You saved me. Thanks!


----------

