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
diff options
context:
space:
mode:
Diffstat (limited to 'doc/python_api')
-rw-r--r--doc/python_api/examples/bpy.ops.1.py27
-rw-r--r--doc/python_api/examples/bpy.ops.2.py27
-rw-r--r--doc/python_api/examples/bpy.ops.py22
-rw-r--r--doc/python_api/examples/bpy.types.Mesh.py2
-rw-r--r--doc/python_api/rst/bge.types.rst40
5 files changed, 63 insertions, 55 deletions
diff --git a/doc/python_api/examples/bpy.ops.1.py b/doc/python_api/examples/bpy.ops.1.py
index f43be2b0f63..a00dbdafb90 100644
--- a/doc/python_api/examples/bpy.ops.1.py
+++ b/doc/python_api/examples/bpy.ops.1.py
@@ -1,22 +1,17 @@
"""
-Execution Context
-+++++++++++++++++
+Overriding Context
+------------------
-When calling an operator you may want to pass the execution context.
+It is possible to override context members that the operator sees, so that they
+act on specified rather than the selected or active data, or to execute an
+operator in the different part of the user interface.
-This determines the context thats given to the operator to run in, and weather
-invoke() is called or execute().
-
-'EXEC_DEFAULT' is used by default but you may want the operator to take user
-interaction with 'INVOKE_DEFAULT'.
-
-The execution context is as a non keyword, string argument in:
-('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
-'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
-'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',
-'EXEC_SCREEN')
+The context overrides are passed as a dictionary, with keys matching the context
+member names in bpy.context. For example to override bpy.context.active_object,
+you would pass {'active_object': object}.
"""
-# group add popup
+# remove all objects in scene rather than the selected ones
import bpy
-bpy.ops.object.group_instance_add('INVOKE_DEFAULT')
+override = {'selected_bases': list(bpy.context.scene.object_bases)}
+bpy.ops.object.delete(override)
diff --git a/doc/python_api/examples/bpy.ops.2.py b/doc/python_api/examples/bpy.ops.2.py
index 575d020a5a0..01e7dc1902e 100644
--- a/doc/python_api/examples/bpy.ops.2.py
+++ b/doc/python_api/examples/bpy.ops.2.py
@@ -1,17 +1,22 @@
"""
-Overriding Context
-++++++++++++++++++
+Execution Context
+-----------------
-It is possible to override context members that the operator sees, so that they
-act on specified rather than the selected or active data, or to execute an
-operator in the different part of the user interface.
+When calling an operator you may want to pass the execution context.
-The context overrides are passed as a dictionary, with keys matching the context
-member names in bpy.context. For example to override bpy.context.active_object,
-you would pass {'active_object': object}.
+This determines the context thats given to the operator to run in, and weather
+invoke() is called or execute().
+
+'EXEC_DEFAULT' is used by default but you may want the operator to take user
+interaction with 'INVOKE_DEFAULT'.
+
+The execution context is as a non keyword, string argument in:
+('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
+'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
+'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',
+'EXEC_SCREEN')
"""
-# remove all objects in scene rather than the selected ones
+# group add popup
import bpy
-override = {'selected_bases': list(bpy.context.scene.object_bases)}
-bpy.ops.object.delete(override)
+bpy.ops.object.group_instance_add('INVOKE_DEFAULT') \ No newline at end of file
diff --git a/doc/python_api/examples/bpy.ops.py b/doc/python_api/examples/bpy.ops.py
index 20e8773652d..9964ad915bf 100644
--- a/doc/python_api/examples/bpy.ops.py
+++ b/doc/python_api/examples/bpy.ops.py
@@ -1,6 +1,6 @@
"""
Calling Operators
-+++++++++++++++++
+-----------------
Provides python access to calling operators, this includes operators written in
C, Python or Macros.
@@ -18,6 +18,26 @@ there is a poll() method to avoid this problem.
Note that the operator ID (bl_idname) in this example is 'mesh.subdivide',
'bpy.ops' is just the access path for python.
+
+
+Keywords and Positional Arguments
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+For calling operators keywords are used for operator properties and
+positional arguments are used to define how the operator is called.
+
+There are 3 optional positional arguments (documented in detail below).
+
+.. code-block:: python
+
+ bpy.ops.test.operator(override_context, execution_context, undo)
+
+* override_context - dict type
+* execution_context - string (enum)
+* undo - boolean
+
+
+Each of these arguments is optional, but must be given in the order above.
"""
import bpy
diff --git a/doc/python_api/examples/bpy.types.Mesh.py b/doc/python_api/examples/bpy.types.Mesh.py
index d30303f3b05..19ccd177d64 100644
--- a/doc/python_api/examples/bpy.types.Mesh.py
+++ b/doc/python_api/examples/bpy.types.Mesh.py
@@ -17,7 +17,7 @@ Each polygon reference a slice in the loop array, this way, polygons do not stor
only a reference to loops that the polygon uses.
:class:`Mesh.loops`, :class:`Mesh.uv_layers` :class:`Mesh.vertex_colors` are all aligned so the same polygon loop
-indicies can be used to find the UV's and vertex colors as with as the vertices.
+indices can be used to find the UV's and vertex colors as with as the vertices.
To compare mesh API options see: :ref:`NGons and Tessellation Faces <info_gotcha_mesh_faces>`
diff --git a/doc/python_api/rst/bge.types.rst b/doc/python_api/rst/bge.types.rst
index ff85df1f68b..f7bdb06e58c 100644
--- a/doc/python_api/rst/bge.types.rst
+++ b/doc/python_api/rst/bge.types.rst
@@ -72,6 +72,20 @@ Game Types (bge.types)
:type: dictionary {:ref:`keycode<keyboard-keys>`::ref:`status<input-status>`, ...}
+
+ .. function:: getClipboard()
+
+ Gets the clipboard text.
+
+ :rtype: string
+
+ .. function:: setClipboard(text)
+
+ Sets the clipboard text.
+
+ :arg text: New clipboard text
+ :type text: string
+
.. class:: SCA_PythonMouse(PyObjectPlus)
The current mouse.
@@ -242,12 +256,6 @@ Game Types (bge.types)
:type: string
- .. attribute:: channelNames
-
- A list of channel names that may be used with :data:`setChannel` and :data:`getChannel`.
-
- :type: list of strings
-
.. attribute:: frameStart
Specifies the starting frame of the animation.
@@ -308,26 +316,6 @@ Game Types (bge.types)
:type: string
- .. method:: setChannel(channel, matrix)
-
- Alternative to the 2 arguments, 4 arguments (channel, matrix, loc, size, quat) are also supported.
-
- :arg channel: A string specifying the name of the bone channel, error raised if not in :data:`channelNames`.
- :type channel: string
- :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.
-
- .. method:: getChannel(channel)
-
- :arg channel: A string specifying the name of the bone channel. error raised if not in :data:`channelNames`.
- :type channel: string
- :return: (loc, size, quat)
- :rtype: tuple
-
.. class:: BL_Shader(PyObjectPlus)
BL_Shader GLSL shaders.