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:
authorAaron Carlisle <carlisle.b3d@gmail.com>2021-01-07 03:34:21 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2021-01-07 03:34:21 +0300
commitb138c8f5b3a63b0cf10b20e874f6a16b8393485b (patch)
tree855545d9d6975e4e137c1bcb979cf67f0793cb33 /doc
parenta9c607e60ebfbb669694bda132af31734da9b709 (diff)
PyAPI Docs: Update Indirect Data Access docs
Fixes T84432
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/rst/info_api_reference.rst16
1 files changed, 4 insertions, 12 deletions
diff --git a/doc/python_api/rst/info_api_reference.rst b/doc/python_api/rst/info_api_reference.rst
index 0de977aaaa7..e39dc6e2c3e 100644
--- a/doc/python_api/rst/info_api_reference.rst
+++ b/doc/python_api/rst/info_api_reference.rst
@@ -194,34 +194,26 @@ For example, if you want to access the texture of a brush via Python to adjust i
This takes you to ``bpy.types.Texture.contrast``. Now you can see that ``contrast`` is a property of texture.
#. To find out how to access the texture from the brush check on the references at the bottom of the page.
Sometimes there are many references, and it may take some guesswork to find the right one,
- but in this case it's ``Brush.texture``.
+ but in this case it's ``tool_settings.sculpt.brush.texture``.
#. Now you know that the texture can be accessed from ``bpy.data.brushes["BrushName"].texture``
but normally you *won't* want to access the brush by name, instead you want to access the active brush.
So the next step is to check on where brushes are accessed from via the references.
- In this case there it is simply ``bpy.context.brush``.
Now you can use the Python console to form the nested properties needed to access brush textures contrast:
-*Context -> Brush -> Texture -> Contrast*.
+*Context -> Tool Settings --> Sculpt --> Brush -> Texture -> Contrast*.
Since the attribute for each is given along the way you can compose the data path in the Python console:
.. code-block:: python
- bpy.context.brush.texture.contrast
-
-There can be multiple ways to access the same data, which you choose often depends on the task.
-An alternate path to access the same setting is:
-
-.. code-block:: python
-
- bpy.context.sculpt.brush.texture.contrast
+ bpy.context.tool_settings.sculpt.brush.texture.contrast
Or access the brush directly:
.. code-block:: python
- bpy.data.brushes["BrushName"].texture.contrast
+ bpy.data.textures["Texture"].contrast
If you are writing a user tool normally you want to use the :mod:`bpy.context` since the user normally expects