blender/source/gameengine/Ketsji
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
..
KXNetwork BGE Python API 2009-04-19 12:46:39 +00:00
BL_BlenderShader.cpp Fix for bug #18423: BGE lights in overlay scene also affected 2009-03-24 15:45:08 +00:00
BL_BlenderShader.h Merge of first part of changes from the apricot branch, especially 2008-09-04 20:51:28 +00:00
BL_Material.cpp Sync with Apricot Game Engine 2008-07-10 12:47:20 +00:00
BL_Material.h Merge of first part of changes from the apricot branch, especially 2008-09-04 20:51:28 +00:00
BL_Shader.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
BL_Shader.h Python ref-counting fixes 2009-04-06 08:17:04 +00:00
BL_Texture.cpp BGE Python API 2009-02-19 13:42:07 +00:00
BL_Texture.h Preparation to VideoTexture: everything but the VideoTexture module itself. 2008-10-31 21:06:48 +00:00
CMakeLists.txt BGE Py API 2009-04-07 18:55:35 +00:00
KX_BlenderMaterial.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_BlenderMaterial.h BGE Bugfixes (mostly in the py api) 2009-04-05 14:01:49 +00:00
KX_BulletPhysicsController.cpp BGE Physics 2009-04-14 12:34:39 +00:00
KX_BulletPhysicsController.h BGE Physics 2009-04-14 12:34:39 +00:00
KX_Camera.cpp Added m_zombie to the base python class (PyObjectPlus), when this is set all the subclasses will raise an error on access to their members. 2009-04-17 20:06:06 +00:00
KX_Camera.h BGE Scenegraph and View frustrum culling improvement. 2009-04-07 22:14:06 +00:00
KX_CameraActuator.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_CameraActuator.h moved more attributes from getattr into PyAttributeDef's 2009-04-04 02:57:35 +00:00
KX_CameraIpoSGController.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_CameraIpoSGController.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_CDActuator.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_CDActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_ClientObjectInfo.h Building the game engine with Solid/Sumo is now optional for scons using WITH_BF_SOLID. 2009-02-25 12:07:51 +00:00
KX_ConstraintActuator.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_ConstraintActuator.h BGE API cleanup: ConstraintActuator. 2009-04-09 23:10:12 +00:00
KX_ConstraintWrapper.cpp BGE Python API 2009-04-12 09:56:30 +00:00
KX_ConstraintWrapper.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_ConvertPhysicsObject.h Add support to lock individual axis during rigid body simulation, for translation and rotation. This makes it easier to do 1D or 2D physics (tetris, blockout) 2009-03-09 07:12:16 +00:00
KX_ConvertPhysicsObjects.cpp BGE Physics 2009-04-14 12:34:39 +00:00
KX_Dome.cpp Remove redundant include GL/glu.h in KX_Dome.cpp. 2009-04-09 10:29:07 +00:00
KX_Dome.h Patch #18462: Fisheye (Dome) and Spherical Panoramic mode in BGE. 2009-04-08 15:06:20 +00:00
KX_EmptyObject.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_EmptyObject.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_GameActuator.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_GameActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_GameObject.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_GameObject.h BGE Python API 2009-04-19 12:46:39 +00:00
KX_IInterpolator.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_IPhysicsController.cpp BGE patch: dynamically update the coumpound parent shape when parenting to a compound object. 2009-01-13 22:59:18 +00:00
KX_IPhysicsController.h BGE Physics 2009-04-14 12:34:39 +00:00
KX_IPO_SGController.cpp remove warnings for the BGE 2009-02-25 03:26:02 +00:00
KX_IPO_SGController.h BGE bug #17657 fixed: dRotY doesn't work properly after 90 degrees rotation. 2008-09-23 20:07:15 +00:00
KX_IpoActuator.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_IpoActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_IPOTransform.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_IScalarInterpolator.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_ISceneConverter.h Merge of first part of changes from the apricot branch, especially 2008-09-04 20:51:28 +00:00
KX_ISystem.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_KetsjiEngine.cpp BGE: Occlusion culling and other performance improvements. 2009-04-13 20:08:33 +00:00
KX_KetsjiEngine.h Patch #18462: Fisheye (Dome) and Spherical Panoramic mode in BGE. 2009-04-08 15:06:20 +00:00
KX_Light.cpp Added m_zombie to the base python class (PyObjectPlus), when this is set all the subclasses will raise an error on access to their members. 2009-04-17 20:06:06 +00:00
KX_Light.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_LightIpoSGController.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_LightIpoSGController.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_MaterialIpoController.cpp Win64: please check my changes if you ran across them ;) But should be fine since no additional crashes were reported! 2008-08-17 17:08:00 +00:00
KX_MaterialIpoController.h BGE patch: approve patch #17312: Multiple material IPOs per mesh in BGE. 2008-07-25 13:45:57 +00:00
KX_MeshProxy.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_MeshProxy.h mesh proxy attributes from andrecastelo 2009-04-13 03:43:16 +00:00
KX_MotionState.cpp gcc wouldn't compile using a reference 2009-04-07 23:21:30 +00:00
KX_MotionState.h BGE Scenegraph and View frustrum culling improvement. 2009-04-07 22:14:06 +00:00
KX_MouseFocusSensor.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_MouseFocusSensor.h BGE MouseFocusSensor 2009-04-15 13:50:56 +00:00
KX_NearSensor.cpp BGE Scenegraph and View frustrum culling improvement. 2009-04-07 22:14:06 +00:00
KX_NearSensor.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_ObColorIpoSGController.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_ObColorIpoSGController.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_ObjectActuator.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_ObjectActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_OdePhysicsController.cpp BGE patch: dynamically update the coumpound parent shape when parenting to a compound object. 2009-01-13 22:59:18 +00:00
KX_OdePhysicsController.h BGE: Keep Sumo and ODE in sync with Bullet at API level, fix a compilation problem in MSVC. 2009-04-14 17:22:14 +00:00
KX_OrientationInterpolator.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_OrientationInterpolator.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_ParentActuator.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_ParentActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_PhysicsEngineEnums.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_PhysicsObjectWrapper.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_PhysicsObjectWrapper.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_PhysicsPropertiesobsolete.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_PolygonMaterial.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_PolygonMaterial.h BGE Bugfixes (mostly in the py api) 2009-04-05 14:01:49 +00:00
KX_PolyProxy.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_PolyProxy.h use long long rather then int for storing game logic properties. 2009-04-12 06:41:01 +00:00
KX_PositionInterpolator.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_PositionInterpolator.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_PyConstraintBinding.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_PyConstraintBinding.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_PyMath.cpp BGE Python API 2009-04-05 06:08:41 +00:00
KX_PyMath.h BGE Python API 2009-02-23 06:41:10 +00:00
KX_PythonInit.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_PythonInit.h BGE Py API 2009-04-07 18:55:35 +00:00
KX_PythonInitTypes.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_PythonInitTypes.h SVN maintenance. 2009-04-13 19:33:22 +00:00
KX_RadarSensor.cpp BGE Scenegraph and View frustrum culling improvement. 2009-04-07 22:14:06 +00:00
KX_RadarSensor.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_RayCast.cpp BGE Bugfixes (mostly in the py api) 2009-04-05 14:01:49 +00:00
KX_RayCast.h BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return true face normal and hit polygon information. 2008-08-27 19:34:19 +00:00
KX_RayEventManager.cpp BGE patch: logic optimization part 2: remove inactive sensors from logic manager. 2008-07-30 17:41:47 +00:00
KX_RayEventManager.h BGE patch: logic optimization part 2: remove inactive sensors from logic manager. 2008-07-30 17:41:47 +00:00
KX_RaySensor.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_RaySensor.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_SCA_AddObjectActuator.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_SCA_AddObjectActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_SCA_DynamicActuator.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_SCA_DynamicActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_SCA_EndObjectActuator.cpp Python BGE API 2009-04-03 14:51:06 +00:00
KX_SCA_EndObjectActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_SCA_ReplaceMeshActuator.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_SCA_ReplaceMeshActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_ScalarInterpolator.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_ScalarInterpolator.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_ScalingInterpolator.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_ScalingInterpolator.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_Scene.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_Scene.h Added m_zombie to the base python class (PyObjectPlus), when this is set all the subclasses will raise an error on access to their members. 2009-04-17 20:06:06 +00:00
KX_SceneActuator.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_SceneActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_SG_BoneParentNodeRelationship.cpp BGE Scenegraph and View frustrum culling improvement. 2009-04-07 22:14:06 +00:00
KX_SG_BoneParentNodeRelationship.h BGE Scenegraph and View frustrum culling improvement. 2009-04-07 22:14:06 +00:00
KX_SG_NodeRelationships.cpp BGE: slow parent was causing scaling distortion, now use correct quaternion interpolation. 2009-04-16 20:13:13 +00:00
KX_SG_NodeRelationships.h BGE Scenegraph and View frustrum culling improvement. 2009-04-07 22:14:06 +00:00
KX_SoundActuator.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_SoundActuator.h BGE API cleanup: sound actuator. 2009-04-09 20:40:12 +00:00
KX_StateActuator.cpp Added function name to many of the PyArg_ParseTuple calls in gameengine 2009-04-10 16:45:19 +00:00
KX_StateActuator.h BGE API cleanup: StateActuator. 2009-04-09 21:15:44 +00:00
KX_SumoPhysicsController.cpp BGE patch #18051: add localInertia attribute to GameObject. 2009-04-08 16:25:00 +00:00
KX_SumoPhysicsController.h BGE: Keep Sumo and ODE in sync with Bullet at API level, fix a compilation problem in MSVC. 2009-04-14 17:22:14 +00:00
KX_TimeCategoryLogger.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_TimeCategoryLogger.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_TimeLogger.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_TimeLogger.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_TouchEventManager.cpp BGE fix bug #17430: BGE Collide/Touch Sensor interfearing with other unrelated sensor states. The bug was introduced in the recent logic optimization patch. It only affects collision and touch sensors. The bug is fixed by keeping track of registration count. 2008-08-05 16:23:33 +00:00
KX_TouchEventManager.h BGE patch: logic optimization part 2: remove inactive sensors from logic manager. 2008-07-30 17:41:47 +00:00
KX_TouchSensor.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_TouchSensor.h moved more attributes from getattr into PyAttributeDef's 2009-04-04 02:57:35 +00:00
KX_TrackToActuator.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_TrackToActuator.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_VehicleWrapper.cpp BGE Python API 2009-04-19 12:46:39 +00:00
KX_VehicleWrapper.h Python BGE API 2009-04-03 14:51:06 +00:00
KX_VertexProxy.cpp BGE Python API 2009-04-12 09:56:30 +00:00
KX_VertexProxy.h use long long rather then int for storing game logic properties. 2009-04-12 06:41:01 +00:00
KX_VisibilityActuator.cpp BGE: Occlusion culling and other performance improvements. 2009-04-13 20:08:33 +00:00
KX_VisibilityActuator.h BGE: Occlusion culling and other performance improvements. 2009-04-13 20:08:33 +00:00
KX_WorldInfo.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_WorldInfo.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_WorldIpoController.cpp Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
KX_WorldIpoController.h Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
Makefile Merge of first part of changes from the apricot branch, especially 2008-09-04 20:51:28 +00:00
SConscript BGE Py API 2009-04-07 18:55:35 +00:00