2011-02-18 08:47:37 +00:00
|
|
|
"""
|
2012-06-28 08:17:28 +00:00
|
|
|
Overriding Context
|
|
|
|
------------------
|
2011-02-18 08:47:37 +00:00
|
|
|
|
2012-06-28 08:17:28 +00:00
|
|
|
It is possible to override context members that the operator sees, so that they
|
|
|
|
act on specified rather than the selected or active data, or to execute an
|
|
|
|
operator in the different part of the user interface.
|
2011-02-18 08:47:37 +00:00
|
|
|
|
2012-06-28 08:17:28 +00:00
|
|
|
The context overrides are passed as a dictionary, with keys matching the context
|
|
|
|
member names in bpy.context. For example to override bpy.context.active_object,
|
|
|
|
you would pass {'active_object': object}.
|
2011-02-18 08:47:37 +00:00
|
|
|
"""
|
|
|
|
|
2012-06-28 08:17:28 +00:00
|
|
|
# remove all objects in scene rather than the selected ones
|
2011-02-18 08:47:37 +00:00
|
|
|
import bpy
|
2012-06-28 08:17:28 +00:00
|
|
|
override = {'selected_bases': list(bpy.context.scene.object_bases)}
|
|
|
|
bpy.ops.object.delete(override)
|