mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 07:22:12 -05:00
Cleanup: correct RST syntax, spelling & adjust quotes
This commit is contained in:
parent
5614d2543b
commit
18783c5699
7 changed files with 18 additions and 17 deletions
|
@ -16,13 +16,13 @@ class CustomHydraRenderEngine(bpy.types.HydraRenderEngine):
|
|||
# Name of the render plugin.
|
||||
bl_delegate_id = "HdCustomRendererPlugin"
|
||||
|
||||
# Use MaterialX instead of UsdPreviewSurface for materials.
|
||||
# Use MaterialX instead of `UsdPreviewSurface` for materials.
|
||||
bl_use_materialx = True
|
||||
|
||||
# Register path to plugin.
|
||||
@classmethod
|
||||
def register(cls):
|
||||
# Make pxr module available, for running as bpy pip package.
|
||||
# Make `pxr` module available, for running as `bpy` PIP package.
|
||||
bpy.utils.expose_bundled_modules()
|
||||
|
||||
import pxr.Plug
|
||||
|
|
|
@ -187,7 +187,7 @@ import bpy
|
|||
import bpy.types
|
||||
import textwrap
|
||||
|
||||
# Make pxr module available, for running as bpy pip package.
|
||||
# Make `pxr` module available, for running as `bpy` PIP package.
|
||||
bpy.utils.expose_bundled_modules()
|
||||
|
||||
import pxr.Gf as Gf
|
||||
|
|
|
@ -213,7 +213,7 @@ otherwise Blender's internal initialization won't happen properly:
|
|||
|
||||
.. note::
|
||||
|
||||
In case you are using complex/multi-inheritance, `super()` may not work. It is best then to
|
||||
In case you are using complex/multi-inheritance, ``super()`` may not work. It is best then to
|
||||
explicitly invoke the Blender-defined parent class constructor. For example:
|
||||
|
||||
.. code-block:: python
|
||||
|
@ -239,7 +239,7 @@ otherwise Blender's internal initialization won't happen properly:
|
|||
C++-defined Blender types do not define or use a ``__del__()`` (aka ``tp_finalize()``) destructor
|
||||
currently.
|
||||
As this function
|
||||
`does not exist if not explicitely defined <https://stackoverflow.com/questions/36722390/python-3-super-del>`__,
|
||||
`does not exist if not explicitly defined <https://stackoverflow.com/questions/36722390/python-3-super-del>`__,
|
||||
that means that calling ``super().__del__()`` in the ``__del__()`` function of a sub-class will
|
||||
fail with the following error:
|
||||
``AttributeError: 'super' object has no attribute '__del__'``.
|
||||
|
@ -439,17 +439,18 @@ and it may be useful to define them as types and remove them on the fly.
|
|||
.. code-block:: python
|
||||
|
||||
for i in range(10):
|
||||
idname = "object.operator_%d" % i
|
||||
idname = "object.operator_{:d}".format(i)
|
||||
|
||||
def func(self, context):
|
||||
print("Hello World", self.bl_idname)
|
||||
return {'FINISHED'}
|
||||
|
||||
opclass = type("DynOp%d" % i,
|
||||
(bpy.types.Operator, ),
|
||||
{"bl_idname": idname, "bl_label": "Test", "execute": func},
|
||||
)
|
||||
bpy.utils.register_class(opclass)
|
||||
op_class = type(
|
||||
"DynOp{:d}".format(i),
|
||||
(bpy.types.Operator, ),
|
||||
{"bl_idname": idname, "bl_label": "Test", "execute": func},
|
||||
)
|
||||
bpy.utils.register_class(op_class)
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static CLG_LogRef LOG = {"rna.define"};
|
|||
|
||||
/**
|
||||
* Several types cannot use all their bytes to store a bit-set (bit-shift operations on negative
|
||||
* numbers are 'arithmetic", i.e. preserve the sign, i.e. are not 'pure' binary shifting).
|
||||
* numbers are "arithmetic", i.e. preserve the sign, i.e. are not "pure" binary shifting).
|
||||
*
|
||||
* Currently, all signed types and `uint64_t` cannot use their left-most bit (i.e. sign bit).
|
||||
*/
|
||||
|
|
|
@ -122,7 +122,7 @@ std::string NodeGraph::unique_node_name(const bNode *node,
|
|||
return *existing_name;
|
||||
}
|
||||
|
||||
/* Generate name based on noode, socket, to type and node groups. */
|
||||
/* Generate name based on node, socket, to type and node groups. */
|
||||
std::string name = node->name;
|
||||
|
||||
if (!socket_out_name.is_empty() && node->output_sockets().size() > 1) {
|
||||
|
@ -134,7 +134,7 @@ std::string NodeGraph::unique_node_name(const bNode *node,
|
|||
|
||||
name = node_name_prefix_ + valid_name(name);
|
||||
|
||||
/* Avoid conflicts with anonymouse node names. */
|
||||
/* Avoid conflicts with anonymous node names. */
|
||||
if (StringRef(name).startswith(ANONYMOUS_NODE_NAME_PREFIX)) {
|
||||
name = "b" + name;
|
||||
}
|
||||
|
|
|
@ -408,7 +408,7 @@ static PyObject *bpy_file_path_map(PyObject * /*self*/, PyObject *args, PyObject
|
|||
|
||||
bpath_data.bmain = bmain;
|
||||
bpath_data.callback_function = foreach_id_file_path_map_callback;
|
||||
/* TODO: needs to be controlable from caller (add more options to the API). */
|
||||
/* TODO: needs to be controllable from caller (add more options to the API). */
|
||||
bpath_data.flag = BKE_BPATH_FOREACH_PATH_SKIP_PACKED | BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES;
|
||||
bpath_data.user_data = &filepathmap_data;
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
import sys
|
||||
sys.path.append(sys.argv[1])
|
||||
|
||||
# Just import bpy and see if there are any dynamic loader errors.
|
||||
# Just import `bpy` and see if there are any dynamic loader errors.
|
||||
import bpy
|
||||
|
||||
# Try bundled libraries
|
||||
# Try bundled libraries.
|
||||
bpy.utils.expose_bundled_modules()
|
||||
|
||||
from pxr import Usd
|
||||
|
|
Loading…
Reference in a new issue