[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19955] trunk/blender/source/gameengine/ PyDoc: - Updated BGE docs to match the game engines class inheritance more closely .

Campbell Barton ideasman42 at gmail.com
Tue Apr 28 15:02:49 CEST 2009


Revision: 19955
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19955
Author:   campbellbarton
Date:     2009-04-28 15:02:49 +0200 (Tue, 28 Apr 2009)

Log Message:
-----------
- Updated BGE docs to match the game engines class inheritance more closely.
- Grouped deprecated functions for KX_Camera, KX_GameObject, SCA_ISensor, SCA_ILogicBrick, KX_Scene

Modified Paths:
--------------
    trunk/blender/source/gameengine/PyDoc/BL_Shader.py
    trunk/blender/source/gameengine/PyDoc/CListValue.py
    trunk/blender/source/gameengine/PyDoc/KX_BlenderMaterial.py
    trunk/blender/source/gameengine/PyDoc/KX_Camera.py
    trunk/blender/source/gameengine/PyDoc/KX_GameObject.py
    trunk/blender/source/gameengine/PyDoc/KX_MeshProxy.py
    trunk/blender/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py
    trunk/blender/source/gameengine/PyDoc/KX_PolyProxy.py
    trunk/blender/source/gameengine/PyDoc/KX_Scene.py
    trunk/blender/source/gameengine/PyDoc/KX_VehicleWrapper.py
    trunk/blender/source/gameengine/PyDoc/KX_VertexProxy.py
    trunk/blender/source/gameengine/PyDoc/SCA_ILogicBrick.py
    trunk/blender/source/gameengine/PyDoc/SCA_ISensor.py

Added Paths:
-----------
    trunk/blender/source/gameengine/PyDoc/CPropValue.py
    trunk/blender/source/gameengine/PyDoc/CValue.py
    trunk/blender/source/gameengine/PyDoc/PyObjectPlus.py
    trunk/blender/source/gameengine/PyDoc/SCA_IObject.py

Modified: trunk/blender/source/gameengine/PyDoc/BL_Shader.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/BL_Shader.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/BL_Shader.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,4 +1,7 @@
-class BL_Shader: # (PyObjectPlus)
+
+from PyObjectPlus import *
+
+class BL_Shader(PyObjectPlus):
 	"""
 	BL_Shader GLSL shaders.
 	

Modified: trunk/blender/source/gameengine/PyDoc/CListValue.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/CListValue.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/CListValue.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,4 +1,6 @@
-class CListValue: # (PyObjectPlus)
+from CPropValue import *
+
+class CListValue(CPropValue):
 	"""
 	CListValue
 	

Added: trunk/blender/source/gameengine/PyDoc/CPropValue.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/CPropValue.py	                        (rev 0)
+++ trunk/blender/source/gameengine/PyDoc/CPropValue.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -0,0 +1,8 @@
+# 
+# Documentation for CValue class
+from CValue import *
+class CPropValue(CValue):
+	"""
+	This class has no python functions
+	"""
+	pass

Added: trunk/blender/source/gameengine/PyDoc/CValue.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/CValue.py	                        (rev 0)
+++ trunk/blender/source/gameengine/PyDoc/CValue.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -0,0 +1,8 @@
+# 
+# Documentation for CValue class
+from PyObjectPlus import *
+class CValue(PyObjectPlus):
+	"""
+	This class has no python functions
+	"""
+	pass

Modified: trunk/blender/source/gameengine/PyDoc/KX_BlenderMaterial.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_BlenderMaterial.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_BlenderMaterial.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,4 +1,7 @@
-class KX_BlenderMaterial: # (PyObjectPlus)
+
+from PyObjectPlus import *
+
+class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial)
 	"""
 	KX_BlenderMaterial
 	

Modified: trunk/blender/source/gameengine/PyDoc/KX_Camera.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_Camera.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_Camera.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -40,6 +40,8 @@
 	                       Regenerated every frame from the camera's position and orientation.
 	                       This is camera_to_world inverted.
 	@type world_to_camera: 4x4 Matrix [[float]]
+	
+	@group Deprecated: enableViewport
 	"""
 	
 	def sphereInsideFrustum(centre, radius):
@@ -187,6 +189,7 @@
 
 	def enableViewport(viewport):
 		"""
+		DEPRECATED: use the isViewport property
 		Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}.
 		
 		@type viewport: bool

Modified: trunk/blender/source/gameengine/PyDoc/KX_GameObject.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_GameObject.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_GameObject.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,18 +1,18 @@
 # $Id$
 # Documentation for game objects
 
-# from SCA_IObject import *
+from SCA_IObject import *
 # from SCA_ISensor import *
 # from SCA_IController import *
 # from SCA_IActuator import *
 
 
-class KX_GameObject: # (SCA_IObject)
+class KX_GameObject(SCA_IObject):
 	"""
 	All game objects are derived from this class.
 	
 	Properties assigned to game objects are accessible as attributes of this class.
-		- note: Calling ANY method or attribute on an object that has been removed from a scene will raise a RuntimeError, if an object may have been removed since last accessing it use the L{isValid} attribute to check.
+		- note: Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the L{invalid} attribute to check.
 
 	@ivar name: The object's name. (Read only)
 		- note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5.
@@ -79,8 +79,7 @@
 		- note: This attribute is experemental and may be removed (but probably wont be).
 		- note: Changes to this list will not update the KX_GameObject.
 	@type actuators: list
-	@ivar isValid: Retuerns fails when the object has been removed from the scene and can no longer be used.
-	@type isValid: bool
+	@group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh
 	"""
 	def endObject():
 		"""

Modified: trunk/blender/source/gameengine/PyDoc/KX_MeshProxy.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_MeshProxy.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_MeshProxy.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,7 +1,9 @@
 # $Id$
 # Documentation for KX_MeshProxy
 
-class KX_MeshProxy:
+from SCA_IObject import *
+
+class KX_MeshProxy(SCA_IObject):
 	"""
 	A mesh object.
 	

Modified: trunk/blender/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,4 +1,6 @@
-class KX_PhysicsObjectWrapper: # (PyObjectPlus)
+from PyObjectPlus import *
+
+class KX_PhysicsObjectWrapper(PyObjectPlus):
 	"""
 	KX_PhysicsObjectWrapper
 	

Modified: trunk/blender/source/gameengine/PyDoc/KX_PolyProxy.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_PolyProxy.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_PolyProxy.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,7 +1,8 @@
 # $Id$
 # Documentation for the polygon proxy class
+from SCA_IObject import *
 
-class KX_PolyProxy:
+class KX_PolyProxy(SCA_IObject):
 	"""
 	A polygon holds the index of the vertex forming the poylgon.
 

Modified: trunk/blender/source/gameengine/PyDoc/KX_Scene.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_Scene.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_Scene.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,7 +1,9 @@
 # $Id$
 # Documentation for KX_Scene.py
 
-class KX_Scene:
+from PyObjectPlus import *
+
+class KX_Scene(PyObjectPlus):
 	"""
 	Scene.
 	
@@ -41,6 +43,12 @@
 	@type name: string
 	@ivar objects: A list of objects in the scene.
 	@type objects: L{CListValue<CListValue.CListValue>} of L{KX_GameObject<KX_GameObject.KX_GameObject>}
+	@ivar objects_inactive: A list of objects on background layers (used for the addObject actuator).
+	@type objects_inactive: L{CListValue<CListValue.CListValue>} of L{KX_GameObject<KX_GameObject.KX_GameObject>}
+	@ivar lights: A list of lights in the scene.
+	@type lights: L{CListValue<CListValue.CListValue>} of L{KX_GameObject<KX_LightObject.KX_LightObject>}
+	@ivar cameras: A list of cameras in the scene.
+	@type cameras: L{CListValue<CListValue.CListValue>} of L{KX_GameObject<KX_Camera.KX_Camera>}
 	@ivar active_camera: The current active camera
 	@type active_camera: L{KX_Camera}
 	@ivar suspended: True if the scene is suspended.
@@ -49,22 +57,26 @@
 	@type activity_culling: boolean
 	@ivar activity_culling_radius: The distance outside which to do activity culling.  Measured in manhattan distance.
 	@type activity_culling_radius: float
+	@group Deprecated: getLightList, getObjectList, getName
 	"""
 	
 	def getLightList():
 		"""
+		DEPRECATED: use the 'lights' property.
 		Returns the list of lights in the scene.
 		
 		@rtype: list [L{KX_LightObject}]
 		"""
 	def getObjectList():
 		"""
+		DEPRECATED: use the 'objects' property.
 		Returns the list of objects in the scene.
 		
 		@rtype: list [L{KX_GameObject}]
 		"""
 	def getName():
 		"""
+		DEPRECATED: use the 'name' property.
 		Returns the name of the scene.
 		
 		@rtype: string

Modified: trunk/blender/source/gameengine/PyDoc/KX_VehicleWrapper.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_VehicleWrapper.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_VehicleWrapper.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,4 +1,6 @@
-class KX_VehicleWrapper: # (PyObjectPlus)
+from PyObjectPlus import *
+
+class KX_VehicleWrapper(PyObjectPlus):
 	"""
 	KX_VehicleWrapper
 	

Modified: trunk/blender/source/gameengine/PyDoc/KX_VertexProxy.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/KX_VertexProxy.py	2009-04-28 11:47:27 UTC (rev 19954)
+++ trunk/blender/source/gameengine/PyDoc/KX_VertexProxy.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -1,7 +1,9 @@
 # $Id$
 # Documentation for the vertex proxy class
 
-class KX_VertexProxy:
+from SCA_IObject import *
+
+class KX_VertexProxy(SCA_IObject):
 	"""
 	A vertex holds position, UV, colour and normal information.
 	

Added: trunk/blender/source/gameengine/PyDoc/PyObjectPlus.py
===================================================================
--- trunk/blender/source/gameengine/PyDoc/PyObjectPlus.py	                        (rev 0)
+++ trunk/blender/source/gameengine/PyDoc/PyObjectPlus.py	2009-04-28 13:02:49 UTC (rev 19955)
@@ -0,0 +1,26 @@
+#
+# Documentation for PyObjectPlus base class
+
+class PyObjectPlus:
+	"""
+	PyObjectPlus base class of most other types in the Game Engine.
+	
+	@ivar invalid:	Test if the object has been freed by the game engine and is no longer valid.
+					
+					Normally this is not a problem but when storing game engine data in the GameLogic module,

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list