{"push_id":1315875609,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"ef7fbd8f44cdcba234feb2a270e17bc9f9ecd0b7","before":"1bb42eb7bf37530401431b8928c4a1e14161a82a","commits":[{"sha":"ef7fbd8f44cdcba234feb2a270e17bc9f9ecd0b7","author":{"name":"Porteries Tristan","email":"8ce4c25b091a0c6de8ea0946cf5bde3c90e21905@gmail.com"},"message":"UPBGE: Use CValue for VideoTexture Texture class.\n\nPreviously none of the classes with a python proxy in the VideoTexture\npart was using the PyObjectPlus or CValue classes. These both class are\na standard in the way to define a python proxy in the source of the\ngame engine.\nThe power of PyObjectPlus is to use a second proxy called PyObjectPlus_Proxy\nwhich can be invalidate when the target object is freed. For example\nwhen a game object is freed the python proxy is invalidated to avoid\nacces to any functions of the game object.\n\nThe problem solved by PyObjectPlus_Proxy is found in the VideoTexture\npart but in a more deeper way: None Texture object are freed when restarting\nthe game or a scene, worse when the module owning these instance is\nfreed at the end of the game the restore of the original bind code is\nmade too late because the RAS_Texture is a dangling pointer.\n\nTo solve this issue Texture now inherite of CValue. Texture python\nfunctions and attributes are converted to follow PyObjectPlus standard.\nBut as Texture is instatiated from python via a python constructor\nwe have to keep Texture_init and Texture_new because PyObjectPlus is not\nmanaging it.\n\nWhen Texture_new is called the create Texture instance is added in a\nglobal list name \"textures\". This list is used to track existing instance\nto freed at game or scene reload. When the game or the scene reload the\nglobal function Texture::FreeAllTextures is called with a scene as argument.\nThe function iterate on all instances and delete them if theirs game object\nscene match with the scene passed. At this time the python proxy is still\nexisting but invalidated.\nIn the case where the instacne is directly freed from python the function\nDestructFromPython is overrided in Texture and remove itself form the\ntextures list.\n\nAs Texture isntance are python owned and internally owned a little issue\nwas noticed in the function PyObjectPlus::InvalidateProxy: The python\nproxy is always deferenced even if it is python owned. In this case\nwe steal a reference from an other object. To solve this issue a simple\ncheck is made to avoid deferencing the python proxy.\n\nIn the same way inheriting Texture of CValue, the workaround of BlendType\ntemplate is replaced by function for game object, camera:\n\nConvertPythonToGameObject\nConvertPythonToCamera\n\nOnly scene is still using:\n\nPyObject_TypeCheck(scene, &KX_Scene::Type)","distinct":true,"url":"https://api.github.com/repos/UPBGE/blender/commits/ef7fbd8f44cdcba234feb2a270e17bc9f9ecd0b7"}]}
{"actor":{"display_login":"panzergame"}}