2015-05-17 07:17:31 +00:00
|
|
|
"""
|
2015-04-24 13:08:31 +00:00
|
|
|
.. _operator-execution_context:
|
|
|
|
|
2012-06-28 08:17:28 +00:00
|
|
|
Execution Context
|
|
|
|
-----------------
|
2012-05-02 13:28:13 +00:00
|
|
|
|
2012-06-28 08:17:28 +00:00
|
|
|
When calling an operator you may want to pass the execution context.
|
2012-05-02 13:28:13 +00:00
|
|
|
|
2015-04-24 13:08:31 +00:00
|
|
|
This determines the context that is given for the operator to run in, and whether
|
|
|
|
invoke() is called or only execute().
|
2012-06-28 08:17:28 +00:00
|
|
|
|
2015-04-24 13:08:31 +00:00
|
|
|
'EXEC_DEFAULT' is used by default, running only the execute() method, but you may
|
|
|
|
want the operator to take user interaction with 'INVOKE_DEFAULT' which will also
|
|
|
|
call invoke() if existing.
|
2012-06-28 08:17:28 +00:00
|
|
|
|
2015-04-24 13:08:31 +00:00
|
|
|
The execution context is one of:
|
2012-06-28 08:17:28 +00:00
|
|
|
('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
|
|
|
|
'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
|
|
|
|
'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',
|
|
|
|
'EXEC_SCREEN')
|
2012-05-02 13:28:13 +00:00
|
|
|
"""
|
|
|
|
|
2012-06-28 08:17:28 +00:00
|
|
|
# group add popup
|
2012-05-02 13:28:13 +00:00
|
|
|
import bpy
|
2012-07-29 14:07:57 +00:00
|
|
|
bpy.ops.object.group_instance_add('INVOKE_DEFAULT')
|