Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-18 01:49:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-18 01:49:46 +0300
commit35dae4f0b59809d45ec451d78e5561e27e4e8062 (patch)
tree9ed04c5a314ba3af5e25c5ed7c06e55280e9c5b6 /doc
parenta84e43c48b149593c4abfed8ad1b507f20526cc9 (diff)
add sphinx api reference note that menu's layout.operator_context defaults to EXEC_REGION_WIN rather then INVOKE_DEFAULT.
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/examples/bpy.types.Menu.py6
-rw-r--r--doc/python_api/examples/bpy.types.Operator.2.py1
2 files changed, 7 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.types.Menu.py b/doc/python_api/examples/bpy.types.Menu.py
index 3fbc0f6a8f0..e8c4a2aa072 100644
--- a/doc/python_api/examples/bpy.types.Menu.py
+++ b/doc/python_api/examples/bpy.types.Menu.py
@@ -10,6 +10,12 @@ convention for menus.
.. note::
Menu subclasses must be registered before referencing them from blender.
+
+.. note::
+ Menu's have their :class:`Layout.operator_context` initialized as
+ 'EXEC_REGION_WIN' rather then 'INVOKE_DEFAULT', so if the operator context
+ needs to initialize inputs from the :class:`Operator.invoke` function
+ then this needs to be explicitly set.
"""
import bpy
diff --git a/doc/python_api/examples/bpy.types.Operator.2.py b/doc/python_api/examples/bpy.types.Operator.2.py
index 54bd481b339..39ff5caae8a 100644
--- a/doc/python_api/examples/bpy.types.Operator.2.py
+++ b/doc/python_api/examples/bpy.types.Operator.2.py
@@ -39,6 +39,7 @@ class ExportSomeData(bpy.types.Operator):
# Only needed if you want to add into a dynamic menu
def menu_func(self, context):
+ self.layout.operator_context = 'INVOKE_DEFAULT'
self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")
# Register and add to the file selector