blender/source/gameengine
Campbell Barton 8d2cb5bea4 BGE Python API
This changes how the BGE classes and Python work together, which hasnt changed since blender went opensource.
The main difference is PyObjectPlus - the base class for most game engine classes, no longer inherit from PyObject, and cannot be cast to a PyObject.

This has the advantage that the BGE does not have to keep 2 reference counts valid for C++ and Python.

Previously C++ classes would never be freed while python held a reference, however this reference could be problematic eg: a GameObject that isnt in a scene anymore should not be used by python, doing so could even crash blender in some cases.

Instead PyObjectPlus has a member "PyObject *m_proxy" which is lazily initialized when python needs it. m_proxy reference counts are managed by python, though it should never be freed while the C++ class exists since it holds a reference to avoid making and freeing it all the time.
When the C++ class is free'd it sets the m_proxy reference to NULL, If python accesses this variable it will raise a RuntimeError, (check the isValid attribute to see if its valid without raising an error).
- This replaces the m_zombie bool and IsZombie() tests added recently.

In python return values that used to be..
 return value->AddRef();
Are now
 return value->GetProxy();
or...
 return value->NewProxy(true); // true means python owns this C++ value which will be deleted when the PyObject is freed
2009-04-19 12:46:39 +00:00
..
BlenderRoutines BGE Bugfix 2009-04-09 22:15:26 +00:00
Converter BGE Python API 2009-04-19 12:46:39 +00:00
Expressions BGE Python API 2009-04-19 12:46:39 +00:00
GameLogic BGE Python API 2009-04-19 12:46:39 +00:00
GamePlayer This is patch [#18408] Build issues with make on Cygwin hosted MinGW (2.48.1) 2009-04-15 16:23:13 +00:00
Ketsji BGE Python API 2009-04-19 12:46:39 +00:00
Network BGE patch #18350: Add sendMessage() to GameLogic. Added sendMessage to both GameLogic and KX_GameObject. 2009-04-08 16:57:08 +00:00
Physics Fixing SND_Scene.h missing include problems with cmake + bullet 2009-04-17 13:42:40 +00:00
PyDoc BGE bug #18168: Get local orientation of object using game engine python script system. Added localOrientation and worldOrientation. orientation attribute deprecated. Same for position and scaling. World attributes are read-only except for worldPosition. Add systematic check on NULL SGNode in all python functions. This is necessary to handle zombie objects (deleted by the game but kept alive by a reference in a list). 2009-04-15 21:17:08 +00:00
Rasterizer BGE: restore a feature that was lost in 2.48: sharing of display lists between duplicated objects. 2009-04-18 09:14:51 +00:00
SceneGraph BGE Scenegraph and View frustrum culling improvement. 2009-04-07 22:14:06 +00:00
VideoTexture BGE Python API 2009-04-19 12:46:39 +00:00
CMakeLists.txt VideoTexture module. 2008-10-31 22:35:52 +00:00
Makefile Makefile fixes for compiling with new videotexture code. 2008-11-02 18:12:45 +00:00
SConscript Building the game engine with Solid/Sumo is now optional for scons using WITH_BF_SOLID. 2009-02-25 12:07:51 +00:00