diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-26 08:57:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-26 09:38:04 +0300 |
commit | 28b2f1c30504ce0e437b21f7964282fcd6894421 (patch) | |
tree | 8653eeeb0edb90cf41a93bc2b196ac55739f2a32 /doc | |
parent | c9e33b36de25d272a9896ad0a85dcc69ee0692ba (diff) |
Manipulator: Python API
Initial support for Python/Manipulator integration
from 'custom-manipulators' branch.
Supports:
- Registering custom manipulators & manipulator-groups.
- Modifying RNA properties, custom values via get/set callbacks,
or invoking an operator.
- Drawing shape presets for Python defined manipulators (arrow, circle, face-maps)
Limitations:
- Only float properties supported.
- Drawing only supported via shape presets.
(we'll likely want a way to define custom geometry or draw directly).
- When to refresh, recalculate manipulators will likely need
integration with notifier system.
Development will be continued in the 2.8 branch
Diffstat (limited to 'doc')
-rw-r--r-- | doc/python_api/examples/bpy.types.ManipulatorGroup.py | 29 | ||||
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 3 |
2 files changed, 32 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.types.ManipulatorGroup.py b/doc/python_api/examples/bpy.types.ManipulatorGroup.py new file mode 100644 index 00000000000..fa431bc5a88 --- /dev/null +++ b/doc/python_api/examples/bpy.types.ManipulatorGroup.py @@ -0,0 +1,29 @@ +""" +Manipulator Overview +-------------------- + +Manipulators are created using two classes. + +- :class:`bpy.types.ManipulatorGroup` - stores a list of manipulators. + + The manipulator group is associated with a space and region type. +- :class:`bpy.types.Manipulator` - a single item which can be used. + + Each manipulator group has a collection of manipulators which it manages. + +The following example shows a manipulator group with a single, +manipulator used to control a lamp objects energy. + +.. literalinclude:: __/__/__/release/scripts/templates_py/manipulator_simple.py + + +It's also possible to use a manipulator to run an operator. + +.. literalinclude:: __/__/__/release/scripts/templates_py/manipulator_operator_target.py + +This more comprehensive example shows how an operator can create a temporary manipulator group to adjust its settings. + +.. literalinclude:: __/__/__/release/scripts/templates_py/manipulator_operator.py + +""" + diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index a6ae89ffd6a..b3aebcf6188 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -332,6 +332,9 @@ except ImportError: # to avoid having to match Blender's source tree. EXTRA_SOURCE_FILES = ( "../../../release/scripts/templates_py/bmesh_simple.py", + "../../../release/scripts/templates_py/manipulator_operator.py", + "../../../release/scripts/templates_py/manipulator_operator_target.py", + "../../../release/scripts/templates_py/manipulator_simple.py", "../../../release/scripts/templates_py/operator_simple.py", "../../../release/scripts/templates_py/ui_panel_simple.py", "../../../release/scripts/templates_py/ui_previews_custom_icon.py", |