blender/source
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
..
blender BPy 2009-04-19 00:09:47 +00:00
creator SCons 2009-04-18 17:16:08 +00:00
darwin [#18477] Prevent .svn directories being included in OS X app bundles 2009-04-02 06:46:56 +00:00
gameengine BGE Python API 2009-04-19 12:46:39 +00:00
icons Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
kernel Merge from trunk 2008-09-19 14:15:36 +00:00
CMakeLists.txt Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
Makefile [#18260] FMOD Removal 2009-03-24 09:09:10 +00:00
nan_compile.mk Added BF_PROFILE (same name as in scons files) option. 2009-03-23 19:52:49 +00:00
nan_definitions.mk This is patch [#18408] Build issues with make on Cygwin hosted MinGW (2.48.1) 2009-04-15 16:23:13 +00:00
nan_link.mk patch #8583: Add support for gcc on irix 2008-11-24 14:15:05 +00:00
nan_subdirs.mk Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
nan_warn.mk Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
SConscript * Minor cleanup of SCons files 2008-10-22 11:28:10 +00:00