Context Access (bpy.context)¶
The context members available depend on the area of Blender which is currently being accessed.
Note that all context values are readonly, but may be modified through the data api or by running operators
Global Context¶
These properties are available in any contexts.
-
bpy.context.
area
¶ - Type
bpy.types.Area
, (readonly)
-
bpy.context.
blend_data
¶ - Type
bpy.types.BlendData
, (readonly)
-
bpy.context.
collection
¶ - Type
bpy.types.Collection
, (readonly)
-
bpy.context.
engine
¶ - Type
string, default “”, (readonly, never None)
-
bpy.context.
gizmo_group
¶ - Type
bpy.types.GizmoGroup
, (readonly)
-
bpy.context.
layer_collection
¶ - Type
bpy.types.LayerCollection
, (readonly)
-
bpy.context.
mode
¶ - Type
enum in [‘EDIT_MESH’, ‘EDIT_CURVE’, ‘EDIT_SURFACE’, ‘EDIT_TEXT’, ‘EDIT_ARMATURE’, ‘EDIT_METABALL’, ‘EDIT_LATTICE’, ‘POSE’, ‘SCULPT’, ‘PAINT_WEIGHT’, ‘PAINT_VERTEX’, ‘PAINT_TEXTURE’, ‘PARTICLE’, ‘OBJECT’, ‘PAINT_GPENCIL’, ‘EDIT_GPENCIL’, ‘SCULPT_GPENCIL’, ‘WEIGHT_GPENCIL’, ‘VERTEX_GPENCIL’], default ‘EDIT_MESH’, (readonly)
-
bpy.context.
preferences
¶ - Type
bpy.types.Preferences
, (readonly)
-
bpy.context.
region
¶ - Type
bpy.types.Region
, (readonly)
-
bpy.context.
region_data
¶ - Type
bpy.types.RegionView3D
, (readonly)
-
bpy.context.
scene
¶ - Type
bpy.types.Scene
, (readonly)
-
bpy.context.
screen
¶ - Type
bpy.types.Screen
, (readonly)
-
bpy.context.
space_data
¶ - Type
bpy.types.Space
, (readonly)
-
bpy.context.
tool_settings
¶ - Type
bpy.types.ToolSettings
, (readonly)
-
bpy.context.
view_layer
¶ - Type
bpy.types.ViewLayer
, (readonly)
-
bpy.context.
window
¶ - Type
bpy.types.Window
, (readonly)
-
bpy.context.
window_manager
¶ - Type
bpy.types.WindowManager
, (readonly)
-
bpy.context.
workspace
¶ - Type
bpy.types.WorkSpace
, (readonly)
Screen Context¶
-
bpy.context.
scene
¶ - Type
-
bpy.context.
view_layer
¶ - Type
-
bpy.context.
visible_objects
¶ - Type
sequence of
bpy.types.Object
-
bpy.context.
selectable_objects
¶ - Type
sequence of
bpy.types.Object
-
bpy.context.
selected_objects
¶ - Type
sequence of
bpy.types.Object
-
bpy.context.
editable_objects
¶ - Type
sequence of
bpy.types.Object
-
bpy.context.
selected_editable_objects
¶ - Type
sequence of
bpy.types.Object
-
bpy.context.
objects_in_mode
¶ - Type
sequence of
bpy.types.Object
-
bpy.context.
objects_in_mode_unique_data
¶ - Type
sequence of
bpy.types.Object
-
bpy.context.
visible_bones
¶ - Type
sequence of
bpy.types.EditBone
-
bpy.context.
editable_bones
¶ - Type
sequence of
bpy.types.EditBone
-
bpy.context.
selected_bones
¶ - Type
sequence of
bpy.types.EditBone
-
bpy.context.
selected_editable_bones
¶ - Type
sequence of
bpy.types.EditBone
-
bpy.context.
visible_pose_bones
¶ - Type
sequence of
bpy.types.PoseBone
-
bpy.context.
selected_pose_bones
¶ - Type
sequence of
bpy.types.PoseBone
-
bpy.context.
selected_pose_bones_from_active_object
¶ - Type
sequence of
bpy.types.PoseBone
-
bpy.context.
active_bone
¶ - Type
-
bpy.context.
active_pose_bone
¶ - Type
-
bpy.context.
active_object
¶ - Type
-
bpy.context.
object
¶ - Type
-
bpy.context.
edit_object
¶ - Type
-
bpy.context.
sculpt_object
¶ - Type
-
bpy.context.
vertex_paint_object
¶ - Type
-
bpy.context.
weight_paint_object
¶ - Type
-
bpy.context.
image_paint_object
¶ - Type
-
bpy.context.
particle_edit_object
¶ - Type
-
bpy.context.
pose_object
¶ - Type
-
bpy.context.
sequences
¶ - Type
sequence of
bpy.types.Sequence
-
bpy.context.
selected_sequences
¶ - Type
sequence of
bpy.types.Sequence
-
bpy.context.
selected_editable_sequences
¶ - Type
sequence of
bpy.types.Sequence
-
bpy.context.
selected_nla_strips
¶ - Type
sequence of
bpy.types.NlaStrip
-
bpy.context.
gpencil_data
¶
-
bpy.context.
gpencil_data_owner
¶ - Type
-
bpy.context.
annotation_data
¶
-
bpy.context.
annotation_data_owner
¶ - Type
-
bpy.context.
visible_gpencil_layers
¶ - Type
sequence of
bpy.types.GPencilLayer
-
bpy.context.
editable_gpencil_layers
¶ - Type
sequence of
bpy.types.GPencilLayer
-
bpy.context.
editable_gpencil_strokes
¶ - Type
sequence of
bpy.types.GPencilStroke
-
bpy.context.
active_gpencil_layer
¶ - Type
sequence of
bpy.types.GPencilLayer
-
bpy.context.
active_gpencil_frame
¶ - Type
sequence of
bpy.types.GreasePencilLayer
-
bpy.context.
active_annotation_layer
¶
-
bpy.context.
active_operator
¶ - Type
-
bpy.context.
visible_fcurves
¶ - Type
sequence of
bpy.types.FCurve
-
bpy.context.
editable_fcurves
¶ - Type
sequence of
bpy.types.FCurve
-
bpy.context.
selected_visible_fcurves
¶ - Type
sequence of
bpy.types.FCurve
-
bpy.context.
selected_editable_fcurves
¶ - Type
sequence of
bpy.types.FCurve
-
bpy.context.
active_editable_fcurve
¶ - Type
Buttons Context¶
-
bpy.context.
texture_slot
¶ - Type
bpy.types.MaterialTextureSlot
-
bpy.context.
scene
¶ - Type
-
bpy.context.
world
¶ - Type
-
bpy.context.
object
¶ - Type
-
bpy.context.
mesh
¶ - Type
-
bpy.context.
armature
¶ - Type
-
bpy.context.
lattice
¶ - Type
-
bpy.context.
curve
¶ - Type
-
bpy.context.
meta_ball
¶ - Type
-
bpy.context.
light
¶ - Type
-
bpy.context.
speaker
¶ - Type
-
bpy.context.
lightprobe
¶ - Type
-
bpy.context.
camera
¶ - Type
-
bpy.context.
material
¶ - Type
-
bpy.context.
material_slot
¶
-
bpy.context.
texture
¶ - Type
-
bpy.context.
texture_user
¶ - Type
-
bpy.context.
texture_user_property
¶ - Type
-
bpy.context.
bone
¶ - Type
-
bpy.context.
edit_bone
¶ - Type
-
bpy.context.
pose_bone
¶ - Type
-
bpy.context.
particle_system
¶
-
bpy.context.
particle_system_editable
¶
-
bpy.context.
particle_settings
¶
-
bpy.context.
cloth
¶
-
bpy.context.
soft_body
¶
-
bpy.context.
fluid
¶ - Type
bpy.types.FluidSimulationModifier
-
bpy.context.
collision
¶
-
bpy.context.
brush
¶ - Type
-
bpy.context.
dynamic_paint
¶
-
bpy.context.
line_style
¶
-
bpy.context.
collection
¶
-
bpy.context.
gpencil
¶
-
bpy.context.
hair
¶ - Type
-
bpy.context.
pointcloud
¶ - Type
-
bpy.context.
volume
¶ - Type
Node Context¶
-
bpy.context.
selected_nodes
¶ - Type
sequence of
bpy.types.Node
-
bpy.context.
active_node
¶ - Type
-
bpy.context.
light
¶ - Type
-
bpy.context.
material
¶ - Type
-
bpy.context.
world
¶ - Type