Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-09-18 09:20:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-09-18 09:20:43 +0400
commitb6631b8be74070562b4eb2c4230c7b6ffab92f4b (patch)
treef4158695369100f72999d383cc860df9603245ac /doc
parentdc4cded2c22656828499831f13471506ed59fc0a (diff)
fixes for python api docs.
also move foreach_get/set examples into their own py example files (prefer not to have example code built into blenders binary).
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/examples/bpy.props.5.py2
-rw-r--r--doc/python_api/examples/bpy.types.UIList.1.py7
-rw-r--r--doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py11
-rw-r--r--doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_set.py11
-rw-r--r--doc/python_api/rst/bge.logic.rst4
-rw-r--r--doc/python_api/sphinx_doc_gen.py4
6 files changed, 34 insertions, 5 deletions
diff --git a/doc/python_api/examples/bpy.props.5.py b/doc/python_api/examples/bpy.props.5.py
index 1f61e33c30f..d2ace54de27 100644
--- a/doc/python_api/examples/bpy.props.5.py
+++ b/doc/python_api/examples/bpy.props.5.py
@@ -1,6 +1,6 @@
"""
Get/Set Example
-++++++++++++++
++++++++++++++++
Get/Set functions can be used for boolean, int, float, string and enum properties.
If these callbacks are defined the property will not be stored in the ID properties
diff --git a/doc/python_api/examples/bpy.types.UIList.1.py b/doc/python_api/examples/bpy.types.UIList.1.py
index 97c9bb40480..88f6b0999cd 100644
--- a/doc/python_api/examples/bpy.types.UIList.1.py
+++ b/doc/python_api/examples/bpy.types.UIList.1.py
@@ -1,6 +1,7 @@
"""
Basic UIList Example
-+++++++++++++++++++
+++++++++++++++++++++
+
This script is the UIList subclass used to show material slots, with a bunch of additional commentaries.
Notice the name of the class, this naming convention is similar as the one for panels or menus.
@@ -73,8 +74,8 @@ class UIListPanelExample(bpy.types.Panel):
# with no custom draw code, use "UI_UL_list").
layout.template_list("MATERIAL_UL_matslots_example", "", obj, "material_slots", obj, "active_material_index")
- # The second one can usually be left as an empty string. It's an additional ID used to distinguish lists in case you
- # use the same list several times in a given area.
+ # The second one can usually be left as an empty string.
+ # It's an additional ID used to distinguish lists in case you use the same list several times in a given area.
layout.template_list("MATERIAL_UL_matslots_example", "compact", obj, "material_slots",
obj, "active_material_index", type='COMPACT')
diff --git a/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py
new file mode 100644
index 00000000000..05163b332a9
--- /dev/null
+++ b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py
@@ -0,0 +1,11 @@
+"""
+Only works for 'basic type' properties (bool, int and float)!
+Multi-dimensional arrays (like array of vectors) will be flattened into seq.
+"""
+
+collection.foreach_get(attr, some_seq)
+
+# Python equivalent
+for i in range(len(seq)):
+ some_seq[i] = getattr(collection[i], attr)
+
diff --git a/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_set.py b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_set.py
new file mode 100644
index 00000000000..06ed4840b24
--- /dev/null
+++ b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_set.py
@@ -0,0 +1,11 @@
+"""
+Only works for 'basic type' properties (bool, int and float)!
+seq must be uni-dimensional, multi-dimensional arrays (like array of vectors) will be re-created from it.
+"""
+
+collection.foreach_set(attr, some_seq)
+
+# Python equivalent
+for i in range(len(some_seq)):
+ setattr(collection[i], attr, some_seq[i])
+
diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst
index 3a79d32d917..0ddae476e08 100644
--- a/doc/python_api/rst/bge.logic.rst
+++ b/doc/python_api/rst/bge.logic.rst
@@ -127,7 +127,9 @@ Variables
.. data:: joysticks
- A list of attached :class:`~bge.types.SCA_PythonJoystick`s. The list size is the maximum number of supported joysticks. If no joystick is available for a given slot, the slot is set to None.
+ A list of attached :class:`~bge.types.SCA_PythonJoystick`.
+ The list size is the maximum number of supported joysticks.
+ If no joystick is available for a given slot, the slot is set to None.
*****************
General functions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 3152685485a..e661bb01e60 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -482,6 +482,9 @@ def is_struct_seq(value):
def undocumented_message(module_name, type_name, identifier):
+ return "Undocumented"
+
+ """
if str(type_name).startswith('<module'):
preloadtitle = '%s.%s' % (module_name, identifier)
else:
@@ -494,6 +497,7 @@ def undocumented_message(module_name, type_name, identifier):
"&preload=Dev:2.5/Py/API/Generating_API_Reference/Contribute/Howto-message"
"&preloadtitle=%s>`_)\n\n" % preloadtitle)
return message
+ """
def range_str(val):