Cleanup: correct RST syntax, spelling & adjust quotes
This commit is contained in:
@@ -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::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user