[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29184] trunk/blender/source/gameengine/ PyDoc: == python api docs ==

Luca Bonavita mindrones at gmail.com
Thu Jun 3 16:26:38 CEST 2010


Revision: 29184
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29184
Author:   mindrones
Date:     2010-06-03 16:26:38 +0200 (Thu, 03 Jun 2010)

Log Message:
-----------
== python api docs ==

some more cleanup:

  - made structure in source/gameengine/PyDoc/bge.events.rst to be able to crosslink properly
  - cleaned notes and warnings syntax, and also now they are always the last elements after all the other tags
  - substituted some lists of possible values of a parameter with links to lists of values (not finished)
    like in bge.types.html#bge.types.SCA_PythonKeyboard
  - uncertain about some values, like in http://www.blender.org/documentation/250PythonDoc/bge.types.html#bge.types.SCA_ISensor.status 
    (list of KX_SENSOR_INACTIVE,... etc aren't documented or non-existant, will investigate)

Modified Paths:
--------------
    trunk/blender/source/gameengine/PyDoc/bge.events.rst
    trunk/blender/source/gameengine/PyDoc/bge.render.rst
    trunk/blender/source/gameengine/PyDoc/bge.types.rst

Modified: trunk/blender/source/gameengine/PyDoc/bge.events.rst
===================================================================
--- trunk/blender/source/gameengine/PyDoc/bge.events.rst	2010-06-03 14:22:07 UTC (rev 29183)
+++ trunk/blender/source/gameengine/PyDoc/bge.events.rst	2010-06-03 14:26:38 UTC (rev 29184)
@@ -2,6 +2,10 @@
 Game Engine bge.events module
 =============================
 
+*****
+Intro
+*****
+
 This module holds key constants for the SCA_KeyboardSensor.
 
 .. module:: bge.events
@@ -37,6 +41,10 @@
 			if key == bge.keys.DKEY:
 				# Activate Right!
 
+*********
+Functions
+*********
+
 .. function:: EventToString(event)
 
    Return the string name of a key event. Will raise a ValueError error if its invalid.
@@ -55,9 +63,32 @@
    :arg shift: set to true if shift is held.
    :rtype: string
 
+****************
+Keys (Constants)
+****************
 
-**Alphabet keys**
+.. _mouse-keys:
 
+==========
+Mouse Keys
+==========
+
+.. data:: LEFTMOUSE
+.. data:: MIDDLEMOUSE
+.. data:: RIGHTMOUSE
+.. data:: WHEELUPMOUSE
+.. data:: WHEELDOWNMOUSE
+.. data:: MOUSEX
+.. data:: MOUSEY
+
+=============
+Keyboard Keys
+=============
+
+-------------
+Alphabet keys
+-------------
+
 .. data:: AKEY
 .. data:: BKEY
 .. data:: CKEY
@@ -85,7 +116,9 @@
 .. data:: YKEY
 .. data:: ZKEY
 
-**Number keys**
+-----------
+Number keys
+-----------
 
 .. data:: ZEROKEY
 .. data:: ONEKEY
@@ -98,7 +131,9 @@
 .. data:: EIGHTKEY
 .. data:: NINEKEY
 
-**Modifiers**
+--------------
+Modifiers Keys
+--------------
 
 .. data:: CAPSLOCKKEY
 .. data:: LEFTCTRLKEY
@@ -108,14 +143,18 @@
 .. data:: RIGHTSHIFTKEY
 .. data:: LEFTSHIFTKEY
 
-**Arrow Keys**
+----------
+Arrow Keys
+----------
 
 .. data:: LEFTARROWKEY
 .. data:: DOWNARROWKEY
 .. data:: RIGHTARROWKEY
 .. data:: UPARROWKEY
 
-**Numberpad Keys**
+--------------
+Numberpad Keys
+--------------
 
 .. data:: PAD0
 .. data:: PAD1
@@ -134,7 +173,9 @@
 .. data:: PADENTER
 .. data:: PADPLUSKEY
 
-**Function Keys**
+-------------
+Function Keys
+-------------
 
 .. data:: F1KEY
 .. data:: F2KEY
@@ -156,7 +197,9 @@
 .. data:: F18KEY
 .. data:: F19KEY
 
-**Other Keys**
+----------
+Other Keys
+----------
 
 .. data:: ACCENTGRAVEKEY
 .. data:: BACKSLASHKEY
@@ -182,13 +225,3 @@
 .. data:: SLASHKEY
 .. data:: SPACEKEY
 .. data:: TABKEY
-
-**Mouse Events**
-
-.. data:: LEFTMOUSE
-.. data:: MIDDLEMOUSE
-.. data:: RIGHTMOUSE
-.. data:: WHEELUPMOUSE
-.. data:: WHEELDOWNMOUSE
-.. data:: MOUSEX
-.. data:: MOUSEY

Modified: trunk/blender/source/gameengine/PyDoc/bge.render.rst
===================================================================
--- trunk/blender/source/gameengine/PyDoc/bge.render.rst	2010-06-03 14:22:07 UTC (rev 29183)
+++ trunk/blender/source/gameengine/PyDoc/bge.render.rst	2010-06-03 14:26:38 UTC (rev 29184)
@@ -2,6 +2,10 @@
 Game Engine bge.render Module
 =============================
 
+*****
+Intro
+*****
+
 .. module:: bge.render
 
 .. code-block:: python
@@ -41,6 +45,9 @@
    # Centre the mouse
    bge.render.setMousePosition(bge.render.getWindowWidth()/2, bge.render.getWindowHeight()/2)
 
+*********
+Constants
+*********
 
 .. data:: KX_TEXFACE_MATERIAL
 
@@ -54,6 +61,10 @@
 
    Materials approximating blender materials with GLSL.
 
+*********
+Functions
+*********
+
 .. function:: getWindowWidth()
 
    Gets the width of the window (in pixels)

Modified: trunk/blender/source/gameengine/PyDoc/bge.types.rst
===================================================================
--- trunk/blender/source/gameengine/PyDoc/bge.types.rst	2010-06-03 14:22:07 UTC (rev 29183)
+++ trunk/blender/source/gameengine/PyDoc/bge.types.rst	2010-06-03 14:26:38 UTC (rev 29184)
@@ -73,15 +73,8 @@
 
       A list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only).
 
-      * 'keycode' matches the values in :mod:`bge.keys`.
-      * 'status' uses...
-         * :mod:`bge.logic.KX_INPUT_NONE`
-         * :mod:`bge.logic.KX_INPUT_JUST_ACTIVATED`
-         * :mod:`bge.logic.KX_INPUT_ACTIVE`
-         * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
+      :type: list [[:ref:`keycode<keyboard-keys>`, :ref:`status<input-status>`], ...]
 
-      :type: list [[keycode, status], ...]
-
 .. class:: SCA_PythonMouse(PyObjectPlus)
 
    The current mouse.
@@ -90,15 +83,8 @@
 
       a list of pressed buttons that have either been pressed, or just released, or are active this frame. (read-only).
 
-      * 'keycode' matches the values in :mod:`bge.keys`.
-      * 'status' uses...
-         * :mod:`bge.logic.KX_INPUT_NONE`
-         * :mod:`bge.logic.KX_INPUT_JUST_ACTIVATED`
-         * :mod:`bge.logic.KX_INPUT_ACTIVE`
-         * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
-
-      :type: list [[keycode, status], ...]
-
+      :type: list [[:ref:`keycode<mouse-keys>`, :ref:`status<input-status>`], ...]
+      
    .. attribute:: position
 
       The normalized x and y position of the mouse cursor.
@@ -186,7 +172,9 @@
       * KX_SENSOR_ACTIVE
       * KX_SENSOR_JUST_DEACTIVATED
 
-      .. note:: this convenient attribute combines the values of triggered and positive attributes.
+      .. note::
+      
+         This convenient attribute combines the values of triggered and positive attributes.
 
    .. method:: reset()
 
@@ -210,25 +198,37 @@
       
       :type: sequence supporting index/string lookups and iteration.
 
-      .. note:: The sensors are not necessarily owned by the same object.
-      .. note:: When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+      .. note::
 
+         The sensors are not necessarily owned by the same object.
+
+      .. note::
+         
+         When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+
    .. attribute:: actuators
 
       A list of actuators linked to this controller.
       
       :type: sequence supporting index/string lookups and iteration.
 
-      .. note:: The sensors are not necessarily owned by the same object.
-      .. note:: When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+      .. note::
 
+         The sensors are not necessarily owned by the same object.
+
+      .. note::
+         
+         When objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
+
    .. attribute:: useHighPriority
 
       When set the controller executes always before all other controllers that dont have this set.
       
       :type: boolen
 
-      .. note:: Order of execution between high priority controllers is not guaranteed.
+      .. note::
+         
+         Order of execution between high priority controllers is not guaranteed.
 
 .. class:: SCA_IActuator(SCA_ILogicBrick)
 
@@ -319,7 +319,9 @@
       :arg matrix: A 4x4 matrix specifying the overriding transformation as an offset from the bone's rest position.
       :arg  matrix: list [[float]]
 
-      .. note:: These values are relative to the bones rest position, currently the api has no way to get this info (which is annoying), but can be worked around by using bones with a rest pose that has no translation.
+      .. note::
+         
+         These values are relative to the bones rest position, currently the api has no way to get this info (which is annoying), but can be worked around by using bones with a rest pose that has no translation.
 
    .. method:: getChannel(channel)
 
@@ -607,23 +609,19 @@
 
 .. class:: CListValue(CPropValue)
 
-   CListValue
-
    This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
 
-   As well as the normal index lookup.
-   ``val= clist[i]``
+   As well as the normal index lookup (``val= clist[i]``), CListValue supports string lookups (``val= scene.objects["Cube"]``)
 
-   CListValue supports string lookups.
-   ``val= scene.objects["Cube"]``
+   Other operations such as ``len(clist)``, ``list(clist)``, ``clist[0:10]`` are also supported.
 
-   Other operations such as ``len(clist), list(clist), clist[0:10]`` are also supported.
-
    .. method:: append(val)
 
       Add an item to the list (like pythons append)
 
-      .. warning:: Appending values to the list can cause crashes when the list is used internally by the game engine.
+      .. warning::
+      
+         Appending values to the list can cause crashes when the list is used internally by the game engine.
 
    .. method:: count(val)
 
@@ -664,8 +662,10 @@
 
       This has the advantage that you can store the id in places you could not store a gameObject.
 
-      .. warning:: the id is derived from a memory location and will be different each time the game engine starts.
+      .. warning::
 
+         The id is derived from a memory location and will be different each time the game engine starts.
+
 .. class:: KX_BlenderMaterial(PyObjectPlus)
 
    KX_BlenderMaterial
@@ -845,7 +845,7 @@
       :data:`~bge.logic.KX_ACT_CONSTRAINT_FHPX`, :data:`~bge.logic.KX_ACT_CONSTRAINT_FHPY`, 
       :data:`~bge.logic.KX_ACT_CONSTRAINT_FHPZ`, :data:`~bge.logic.KX_ACT_CONSTRAINT_FHNX`, 
       :data:`~bge.logic.KX_ACT_CONSTRAINT_FHNY`, :data:`~bge.logic.KX_ACT_CONSTRAINT_FHNZ`, 
-      :data:`~bge.logic.KX_ACT_CONSTRAINT_DISTANCE`, :data:`~bge.logic.KX_ACT_CONSTRAINT_DOROTFH`,
+      :data:`~bge.logic.KX_ACT_CONSTRAINT_DISTANCE`, :data:`~bge.logic.KX_ACT_CONSTRAINT_DOROTFH`, 
       :data:`~bge.logic.KX_ACT_CONSTRAINT_LOCAL`, :data:`~bge.logic.KX_ACT_CONSTRAINT_MATERIAL`, 
       :data:`~bge.logic.KX_ACT_CONSTRAINT_NORMAL`, :data:`~bge.logic.KX_ACT_CONSTRAINT_PERMANENT`
 
@@ -889,7 +889,9 @@
 
    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 SystemError, if an object may have been removed since last accessing it use the :data:`invalid` 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 :data:`invalid` attribute to check.
 
    .. attribute:: name
 
@@ -901,29 +903,44 @@
 
       The object's mass
 
-      .. note:: The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
-
       :type: float
 
+      .. note::
+         

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list