Python script and vec2 struct

Korwin

New Member
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
 
Top