Cleanup: replace references to "C" to C++ or the C-API
Also capitalize Blender, Python & API in docs & code-comments.
This commit is contained in:
@@ -9,7 +9,7 @@ Introduction
|
||||
and the :func:`register`/:func:`unregister` functions! The :func:`pgettext` family of functions
|
||||
should only be used in rare, specific cases (like e.g. complex "composited" UI strings...).
|
||||
|
||||
To add translations to your python script, you must define a dictionary formatted like that:
|
||||
To add translations to your Python script, you must define a dictionary formatted like that:
|
||||
``{locale: {msg_key: msg_translation, ...}, ...}`` where:
|
||||
|
||||
- locale is either a lang iso code (e.g. ``fr``), a lang+country code (e.g. ``pt_BR``),
|
||||
@@ -21,7 +21,7 @@ Then, call ``bpy.app.translations.register(__name__, your_dict)`` in your ``regi
|
||||
``bpy.app.translations.unregister(__name__)`` in your ``unregister()`` one.
|
||||
|
||||
The ``Manage UI translations`` add-on has several functions to help you collect strings to translate, and
|
||||
generate the needed python code (the translation dictionary), as well as optional intermediary po files
|
||||
generate the needed Python code (the translation dictionary), as well as optional intermediary po files
|
||||
if you want some... See
|
||||
`How to Translate Blender <https://developer.blender.org/docs/handbook/translating/translator_guide/>`_ and
|
||||
`Using i18n in Blender Code <https://developer.blender.org/docs/handbook/translating/developer_guide/>`_
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
Calling Operators
|
||||
-----------------
|
||||
|
||||
Provides python access to calling operators, this includes operators written in
|
||||
C, Python or macros.
|
||||
Provides Python access to calling operators, this includes operators written in
|
||||
C++, Python or macros.
|
||||
|
||||
Only keyword arguments can be used to pass operator properties.
|
||||
|
||||
@@ -22,7 +22,7 @@ Calling an operator in the wrong context will raise a ``RuntimeError``,
|
||||
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.
|
||||
``bpy.ops`` is just the access path for Python.
|
||||
|
||||
|
||||
Keywords and Positional Arguments
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Operator Example
|
||||
++++++++++++++++
|
||||
|
||||
A common use of custom properties is for python based :class:`Operator`
|
||||
A common use of custom properties is for Python based :class:`Operator`
|
||||
classes. Test this code by running it in the text editor, or by clicking the
|
||||
button in the 3D View-port's Tools panel. The latter will show the properties
|
||||
in the Redo panel and allow you to change them.
|
||||
|
||||
@@ -5,7 +5,7 @@ Assigning to Existing Classes
|
||||
Custom properties can be added to any subclass of an :class:`ID`,
|
||||
:class:`Bone` and :class:`PoseBone`.
|
||||
|
||||
These properties can be animated, accessed by the user interface and python
|
||||
These properties can be animated, accessed by the user interface and Python
|
||||
like Blender's existing properties.
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -19,7 +19,7 @@ from bpy.props import StringProperty, IntProperty, BoolProperty
|
||||
|
||||
class ExampleAddonPreferences(AddonPreferences):
|
||||
# This must match the add-on name, use `__package__`
|
||||
# when defining this for add-on extensions or a sub-module of a python package.
|
||||
# when defining this for add-on extensions or a sub-module of a Python package.
|
||||
bl_idname = __name__
|
||||
|
||||
filepath: StringProperty(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"""
|
||||
This function is for advanced use only, misuse can crash blender since the user
|
||||
This function is for advanced use only, misuse can crash Blender since the user
|
||||
count is used to prevent data being removed when it is used.
|
||||
"""
|
||||
|
||||
# This example shows what _not_ to do, and will crash blender.
|
||||
# This example shows what _not_ to do, and will crash Blender.
|
||||
import bpy
|
||||
|
||||
# object which is in the scene.
|
||||
|
||||
@@ -10,7 +10,7 @@ convention for menus.
|
||||
|
||||
.. note::
|
||||
|
||||
Menu subclasses must be registered before referencing them from blender.
|
||||
Menu subclasses must be registered before referencing them from Blender.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Mesh Data
|
||||
+++++++++
|
||||
|
||||
The mesh data is accessed in object mode and intended for compact storage,
|
||||
for more flexible mesh editing from python see :mod:`bmesh`.
|
||||
for more flexible mesh editing from Python see :mod:`bmesh`.
|
||||
|
||||
Blender stores 4 main arrays to define mesh geometry.
|
||||
|
||||
@@ -13,7 +13,8 @@ Blender stores 4 main arrays to define mesh geometry.
|
||||
- :class:`Mesh.polygons`: (reference a range of loops)
|
||||
|
||||
|
||||
Each polygon references a slice in the loop array, this way, polygons do not store vertices or corner data such as UVs directly,
|
||||
Each polygon references a slice in the loop array, this way,
|
||||
polygons do not store vertices or corner data such as UVs directly,
|
||||
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
|
||||
|
||||
@@ -18,10 +18,10 @@ and this behavior cannot be changed.
|
||||
|
||||
This example shows how to define an operator which gets mouse input to
|
||||
execute a function and that this operator can be invoked or executed from
|
||||
the python api.
|
||||
the Python API.
|
||||
|
||||
Also notice this operator defines its own properties, these are different
|
||||
to typical class properties because blender registers them with the
|
||||
to typical class properties because Blender registers them with the
|
||||
operator, to use as arguments when called, saved for operator undo/redo and
|
||||
automatically added into the user interface.
|
||||
"""
|
||||
|
||||
@@ -20,7 +20,7 @@ Notice ``__init__()`` and ``__del__()`` are declared.
|
||||
For other operator types they are not useful but for modal operators they will
|
||||
be called before the :class:`Operator.invoke` and after the operator finishes.
|
||||
Also see the
|
||||
:ref:`class construction and destruction section <info_overview_class_construction_destruction>`
|
||||
:ref:`class construction and destruction section <info_overview_class_construction_destruction>`.
|
||||
"""
|
||||
import bpy
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ that no undo step will created (see next example for more info about undo).
|
||||
|
||||
.. note::
|
||||
|
||||
Operator subclasses must be registered before accessing them from blender.
|
||||
Operator subclasses must be registered before accessing them from Blender.
|
||||
|
||||
"""
|
||||
import bpy
|
||||
|
||||
@@ -10,7 +10,7 @@ convention for panels.
|
||||
|
||||
.. note::
|
||||
|
||||
Panel subclasses must be registered for blender to use them.
|
||||
Panel subclasses must be registered for Blender to use them.
|
||||
"""
|
||||
import bpy
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ Custom Properties
|
||||
|
||||
PropertyGroups are the base class for dynamically defined sets of properties.
|
||||
|
||||
They can be used to extend existing blender data with your own types which can
|
||||
be animated, accessed from the user interface and from python.
|
||||
They can be used to extend existing Blender data with your own types which can
|
||||
be animated, accessed from the user interface and from Python.
|
||||
|
||||
.. note::
|
||||
|
||||
The values assigned to blender data are saved to disk but the class
|
||||
definitions are not, this means whenever you load blender the class needs
|
||||
The values assigned to Blender data are saved to disk but the class
|
||||
definitions are not, this means whenever you load Blender the class needs
|
||||
to be registered too.
|
||||
|
||||
This is best done by creating an add-on which loads on startup and registers
|
||||
@@ -18,7 +18,7 @@ be animated, accessed from the user interface and from python.
|
||||
|
||||
.. note::
|
||||
|
||||
PropertyGroups must be registered before assigning them to blender data.
|
||||
PropertyGroups must be registered before assigning them to Blender data.
|
||||
|
||||
.. seealso::
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import array
|
||||
|
||||
|
||||
class CustomRenderEngine(bpy.types.RenderEngine):
|
||||
# These three members are used by blender to set up the
|
||||
# These three members are used by Blender to set up the
|
||||
# RenderEngine; define its internal name, visible name and capabilities.
|
||||
bl_idname = "CUSTOM"
|
||||
bl_label = "Custom"
|
||||
|
||||
@@ -8,7 +8,7 @@ Notice the name of the class, this naming convention is similar as the one for p
|
||||
|
||||
.. note::
|
||||
|
||||
UIList subclasses must be registered for blender to use them.
|
||||
UIList subclasses must be registered for Blender to use them.
|
||||
"""
|
||||
import bpy
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class MESH_UL_vgroups_slow(bpy.types.UIList):
|
||||
def filter_items_empty_vgroups(self, context, vgroups):
|
||||
# This helper function checks vgroups to find out whether they are empty, and what's their average weights.
|
||||
# TODO: This should be RNA helper actually (a vgroup prop like "raw_data: ((vidx, vweight), etc.)").
|
||||
# Too slow for python!
|
||||
# Too slow for Python!
|
||||
obj_data = context.active_object.data
|
||||
ret = {vg.index: [True, 0.0] for vg in vgroups}
|
||||
if hasattr(obj_data, "vertices"): # Mesh data
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
This is the most simple example of inserting a keyframe from python.
|
||||
This is the most simple example of inserting a keyframe from Python.
|
||||
"""
|
||||
|
||||
import bpy
|
||||
|
||||
Reference in New Issue
Block a user