thank you,
I think I saw it before, really advanced script for me, thinking what it would be good for :-) . I tried to butcher it a bit and came up with this, which works. So I might use it. Interesting. I realized also I could also use collections.namedtuple lib, not sure how I would implement it yet. But your VaporMagik seams to be fun:
Code:
import ctypes
import builtins
class PyObject(ctypes.Structure):
pass
PyObject._fields_ = [
('ob_refcnt', ctypes.c_ssize_t),
('ob_type', ctypes.POINTER(PyObject)),
]
class NativeMappingProxy(PyObject):
_fields_ = [('UnderlyingDictionary', ctypes.POINTER(PyObject))]
def Dereference(Pointer):
ObjectHolder = []
ctypes.pythonapi.PyList_Append(ctypes.py_object(ObjectHolder), Pointer)
return ObjectHolder[0]
def ExposeAttributeDictionary(Type):
AttributeMaps = Type.__dict__
TransparentAttributeMaps = NativeMappingProxy.from_address(id(AttributeMaps))
return Dereference(TransparentAttributeMaps.UnderlyingDictionary)
def SetTypeAttribute(Type, Name, Attribute):
AttributeDictionary = ExposeAttributeDictionary(Type)
AttributeDictionary[Name] = Attribute
ctypes.pythonapi.PyType_Modified(ctypes.py_object(Type))
@property
def rgb(self):
return self.resize.Bicubic(format=vs.RGB24)
SetTypeAttribute(vs.VideoNode, 'rgb', rgb)
clip = core.avisource.AVISource(file.avi)
print(clip)
print(clip.rgb)