diff --git a/doc/python_api/rst/info_overview.rst b/doc/python_api/rst/info_overview.rst index 141363a97ff..59a9f43a948 100644 --- a/doc/python_api/rst/info_overview.rst +++ b/doc/python_api/rst/info_overview.rst @@ -202,8 +202,14 @@ otherwise Blender's internal initialization won't happen properly: class AwesomeRaytracer(bpy.types.RenderEngine): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self.my_var = 42 ... +.. warning:: + + The Blender-defined parent constructor must be called before any data access to the object, including + from other potential parent types ``__init__()`` functions. + .. warning:: Calling the parent's ``__init__()`` function is a hard requirement since Blender 4.4. @@ -223,8 +229,9 @@ 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 - explicitly invoke the Blender-defined parent class constructor. For example: + In case you are using complex/multi-inheritance, ``super()`` may not work (as the Blender-defined parent + may not be the first type in the MRO). It is best then to first explicitly invoke the Blender-defined + parent class constructor, before any other. For example: .. code-block:: python @@ -232,6 +239,8 @@ otherwise Blender's internal initialization won't happen properly: class FancyRaytracer(AwesomeRaytracer, bpy.types.RenderEngine): def __init__(self, *args, **kwargs): bpy.types.RenderEngine.__init__(self, *args, **kwargs) + AwesomeRaytracer.__init__(self, *args, **kwargs) + self.my_var = 42 ... .. note::