From e1910ac6eda621f4f3670995779fa8a506331cf9 Mon Sep 17 00:00:00 2001 From: nBurn Date: Thu, 1 Jun 2017 21:59:51 -0400 Subject: [PATCH] PyAPI: update to bpy.types.Operator.5.py This is a minor update add more information on how Blender handles modal operators. The existing docs provide a good overview, but might not be as helpful to those unfamiliar with modal programming. This patch also corrects a few small grammar issues. --- doc/python_api/examples/bpy.types.Operator.5.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/python_api/examples/bpy.types.Operator.5.py b/doc/python_api/examples/bpy.types.Operator.5.py index 310eeceadf3..c1a49a756a0 100644 --- a/doc/python_api/examples/bpy.types.Operator.5.py +++ b/doc/python_api/examples/bpy.types.Operator.5.py @@ -2,13 +2,14 @@ Modal Execution +++++++++++++++ -This operator defines a :class:`Operator.modal` function which running, -handling events until it returns ``{'FINISHED'}`` or ``{'CANCELLED'}``. +This operator defines a :class:`Operator.modal` function that will keep being +run to handle events until it returns ``{'FINISHED'}`` or ``{'CANCELLED'}``. -Grab, Rotate, Scale and Fly-Mode are examples of modal operators. -They are especially useful for interactive tools, -your operator can have its own state where keys toggle options as the operator -runs. +Modal operators run every time a new event is detected, such as a mouse click +or key press. Conversely, when no new events are detected, the modal operator +will not run. Modal operators are especially useful for interactive tools, an +operator can have its own state where keys toggle options as the operator runs. +Grab, Rotate, Scale, and Fly-Mode are examples of modal operators. :class:`Operator.invoke` is used to initialize the operator as being by returning ``{'RUNNING_MODAL'}``, initializing the modal loop.