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

Luca Bonavita mindrones at gmail.com
Wed Jun 2 23:28:17 CEST 2010


Revision: 29169
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29169
Author:   mindrones
Date:     2010-06-02 23:28:17 +0200 (Wed, 02 Jun 2010)

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

*  source/blender/python/doc/sphinx_doc_gen.py
	
	changed syntax for declating attributes type to use :type: instead of *type* os it

* source/gameengine/Ketsji/KX_PythonInit.cpp

	While documenting I've found that we have two naming conventions for constraints in BGE python api,
	example: KX_CONSTRAINTACT_DIRPZ and KX_ACT_CONSTRAINT_FHPX: the right convention is KX_CONSTRAINTACT_xxx
	After talking with dalai and cambpell we agreed that this kind of change is better suited for NExyon GSoC
	so I marked as TODO
	
	Also, found 2 duplicate rows, fixed after askin nexyon

* source/gameengine/PyDoc/bge.logic.rst

	there were 2 blocks for constraints, I've put them together in docs and fixed some other lines
	
* source/gameengine/PyDoc/bge.types.rst

	first cleanup: mainly started using ":type:", it was mixed usage of *type* and **type**
	started cleaning some bullet list in a way that varibles link to the constant in appropriate page
	I'll continue later
	

Modified Paths:
--------------
    trunk/blender/source/blender/python/doc/sphinx_doc_gen.py
    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
    trunk/blender/source/gameengine/PyDoc/bge.logic.rst
    trunk/blender/source/gameengine/PyDoc/bge.types.rst

Modified: trunk/blender/source/blender/python/doc/sphinx_doc_gen.py
===================================================================
--- trunk/blender/source/blender/python/doc/sphinx_doc_gen.py	2010-06-02 20:32:07 UTC (rev 29168)
+++ trunk/blender/source/blender/python/doc/sphinx_doc_gen.py	2010-06-02 21:28:17 UTC (rev 29169)
@@ -511,7 +511,7 @@
             if prop.description:
                 fw("      %s\n\n" % prop.description)
             type_descr = prop.get_type_description(class_fmt=":class:`%s`")
-            fw("      *type* %s\n\n" % type_descr)
+            fw("      :type: %s\n\n" % type_descr)
         
         # python attributes
         py_properties = struct.get_py_properties()

Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp	2010-06-02 20:32:07 UTC (rev 29168)
+++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp	2010-06-02 21:28:17 UTC (rev 29169)
@@ -1310,6 +1310,7 @@
 	KX_MACRO_addTypesToDict(d, KX_PROPSENSOR_EXPRESSION, SCA_PropertySensor::KX_PROPSENSOR_EXPRESSION);
 
 	/* 3. Constraint actuator                                                  */
+	/* XXX, TODO NXBGE, move constants names from KX_ACT_CONSTRAINT_foo to KX_CONSTRAINTACT_foo */
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCX);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCY);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_LOCZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCZ);
@@ -1318,10 +1319,10 @@
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ROTZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPX);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY);
-	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPY);
+	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRPZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRPZ);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNX);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY);
-	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNY);
+	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_DIRNZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DIRNZ);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIX, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIY, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIY);
 	KX_MACRO_addTypesToDict(d, KX_CONSTRAINTACT_ORIZ, KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIZ);

Modified: trunk/blender/source/gameengine/PyDoc/bge.logic.rst
===================================================================
--- trunk/blender/source/gameengine/PyDoc/bge.logic.rst	2010-06-02 20:32:07 UTC (rev 29168)
+++ trunk/blender/source/gameengine/PyDoc/bge.logic.rst	2010-06-02 21:28:17 UTC (rev 29169)
@@ -305,9 +305,14 @@
 Constants
 =========
 
-.. data:: KX_TRUE: True value used by some modules.
-.. data:: KX_FALSE: False value used by some modules.
+.. data:: KX_TRUE
 
+   True value used by some modules.
+
+.. data:: KX_FALSE
+
+   False value used by some modules.
+
 ---------------
 Property Sensor
 ---------------
@@ -339,19 +344,97 @@
 See :class:`bge.types.KX_ConstraintActuator`
 
 .. data:: KX_CONSTRAINTACT_LOCX
+
+   Limit X coord.
+   
 .. data:: KX_CONSTRAINTACT_LOCY
+
+   Limit Y coord
+
 .. data:: KX_CONSTRAINTACT_LOCZ
+
+   Limit Z coord
+   
 .. data:: KX_CONSTRAINTACT_ROTX
+
+   Limit X rotation
+
 .. data:: KX_CONSTRAINTACT_ROTY
+
+   Limit Y rotation
+   
 .. data:: KX_CONSTRAINTACT_ROTZ
+
+   Limit Z rotation
+   
 .. data:: KX_CONSTRAINTACT_DIRNX
+
+   Set distance along negative X axis
+
 .. data:: KX_CONSTRAINTACT_DIRNY
+
+   Set distance along negative Y axis
+   
+.. data:: KX_CONSTRAINTACT_DIRNZ
+
+   Set distance along negative Z axis
+   
 .. data:: KX_CONSTRAINTACT_DIRPX
+
+   Set distance along positive X axis
+
 .. data:: KX_CONSTRAINTACT_DIRPY
+
+   Set distance along positive Y axis
+   
+.. data:: KX_CONSTRAINTACT_DIRPZ
+
+   Set distance along positive Z axis
+   
 .. data:: KX_CONSTRAINTACT_ORIX
+
+   Set orientation of X axis
+   
 .. data:: KX_CONSTRAINTACT_ORIY
+
+   Set orientation of Y axis
+   
 .. data:: KX_CONSTRAINTACT_ORIZ
 
+   Set orientation of Z axis
+   
+.. data:: KX_ACT_CONSTRAINT_FHNX
+
+   Set force field along negative X axis
+   
+.. data:: KX_ACT_CONSTRAINT_FHNY
+
+   Set force field along negative Y axis
+   
+.. data:: KX_ACT_CONSTRAINT_FHNZ
+
+   Set force field along negative Z axis
+   
+.. data:: KX_ACT_CONSTRAINT_FHPX
+
+   Set force field along positive X axis
+
+.. data:: KX_ACT_CONSTRAINT_FHPY
+
+   Set force field along positive Y axis
+   
+.. data:: KX_ACT_CONSTRAINT_FHPZ
+
+   Set force field along positive Z axis
+   
+.. data:: KX_ACT_CONSTRAINT_DISTANCE
+.. data:: KX_ACT_CONSTRAINT_DOROTFH
+.. data:: KX_ACT_CONSTRAINT_LOCAL
+.. data:: KX_ACT_CONSTRAINT_MATERIAL
+.. data:: KX_ACT_CONSTRAINT_NORMAL
+.. data:: KX_ACT_CONSTRAINT_PERMANENT
+
+
 ------------
 IPO Actuator
 ------------
@@ -555,23 +638,6 @@
 .. data:: RAS_2DFILTER_SHARPEN
 .. data:: RAS_2DFILTER_SOBEL
 
--------------------
-Constraint Actuator
--------------------
-
-.. data:: KX_ACT_CONSTRAINT_DISTANCE
-.. data:: KX_ACT_CONSTRAINT_DOROTFH
-.. data:: KX_ACT_CONSTRAINT_FHNX
-.. data:: KX_ACT_CONSTRAINT_FHNY
-.. data:: KX_ACT_CONSTRAINT_FHNZ
-.. data:: KX_ACT_CONSTRAINT_FHPX
-.. data:: KX_ACT_CONSTRAINT_FHPY
-.. data:: KX_ACT_CONSTRAINT_FHPZ
-.. data:: KX_ACT_CONSTRAINT_LOCAL
-.. data:: KX_ACT_CONSTRAINT_MATERIAL
-.. data:: KX_ACT_CONSTRAINT_NORMAL
-.. data:: KX_ACT_CONSTRAINT_PERMANENT
-
 ---------------
 Parent Actuator
 ---------------

Modified: trunk/blender/source/gameengine/PyDoc/bge.types.rst
===================================================================
--- trunk/blender/source/gameengine/PyDoc/bge.types.rst	2010-06-02 20:32:07 UTC (rev 29168)
+++ trunk/blender/source/gameengine/PyDoc/bge.types.rst	2010-06-02 21:28:17 UTC (rev 29169)
@@ -11,14 +11,14 @@
    .. attribute:: 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, 
       KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data.
       Calling an attribute or method on an invalid object will raise a SystemError.
-
+       
       The invalid attribute allows testing for this case without exception handling.
 
-      *type* bool
+      :type: boolean
 
    .. method:: isA(game_type)
 
@@ -27,7 +27,7 @@
       :arg game_type: the name of the type or the type its self from the :mod:`bge.types` module.
       :type game_type: string or type
       :return: True if this object is a type or a subtype of game_type.
-      :rtype: bool
+      :rtype: boolean
 
 .. class:: CValue(PyObjectPlus)
 
@@ -35,8 +35,10 @@
 
    .. attribute:: name
 
-      The name of this CValue derived object (read-only). **type** string
+      The name of this CValue derived object (read-only).
 
+      :type: string
+      
 .. class:: CPropValue(CValue)
 
    This class has no python functions
@@ -49,15 +51,19 @@
 
       This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
 
-      *type* executePriority: int
+      :type: executePriority: int
 
    .. attribute:: owner
 
-      The game object this logic brick is attached to (read-only). **type** :class:`KX_GameObject` or None in exceptional cases.
+      The game object this logic brick is attached to (read-only).
+      
+      :type: :class:`KX_GameObject` or None in exceptional cases.
 
    .. attribute:: name
 
-      The name of this logic brick (read-only). **type** string
+      The name of this logic brick (read-only).
+      
+      :type: string
 
 .. class:: SCA_PythonKeyboard(PyObjectPlus)
 
@@ -74,7 +80,7 @@
          * :mod:`bge.logic.KX_INPUT_ACTIVE`
          * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
 
-      *type* list [[keycode, status], ...]
+      :type: list [[keycode, status], ...]
 
 .. class:: SCA_PythonMouse(PyObjectPlus)
 
@@ -91,15 +97,19 @@
          * :mod:`bge.logic.KX_INPUT_ACTIVE`
          * :mod:`bge.logic.KX_INPUT_JUST_RELEASED`
 
-      *type* list [[keycode, status], ...]
+      :type: list [[keycode, status], ...]
 
    .. attribute:: position
 
-      The normalized x and y position of the mouse cursor. **type** list [x, y]
+      The normalized x and y position of the mouse cursor.
 
+      :type: list [x, y]
+
    .. attribute:: visible
 
-      The visibility of the mouse cursor. **type** boolean
+      The visibility of the mouse cursor.
+      
+      :type: boolean
 
 .. class:: SCA_IObject(CValue)
 
@@ -111,15 +121,21 @@
 
    .. attribute:: usePosPulseMode
 
-      Flag to turn positive pulse mode on and off. **type** boolean
+      Flag to turn positive pulse mode on and off.
+      
+      :type: boolean
 
    .. attribute:: useNegPulseMode
 
-      Flag to turn negative pulse mode on and off. **type** boolean
+      Flag to turn negative pulse mode on and off.
+      
+      :type: boolean
 
    .. attribute:: frequency
 
-      The frequency for pulse mode sensors. **type** integer
+      The frequency for pulse mode sensors.
+      
+      :type: integer
 
    .. attribute:: level
 
@@ -130,7 +146,7 @@
       A edge detector will wait for a state change before generating a pulse.
       note: mutually exclusive with :data:`tap`, enabling will disable :data:`tap`.
 
-      *type* boolean
+      :type: boolean
 
    .. attribute:: tap
 
@@ -139,23 +155,31 @@
       This will make a key thats held act as if its only tapped for an instant.
       note: mutually exclusive with :data:`level`, enabling will disable :data:`level`.
 
-      *type* boolean
+      :type: boolean
 
    .. attribute:: invert
 
-      Flag to set if this sensor activates on positive or negative events. **type** boolean
+      Flag to set if this sensor activates on positive or negative events.
+      
+      :type: boolean
 
    .. attribute:: triggered
 
-      True if this sensor brick is in a positive state. (read-only). **type** boolean

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list