user: Describe Bpy.Types.Context from the Blender manual or Python API, including usage steps and snippets.

assistant: temp_override ( window = window ): bpy . ops . mesh . primitive_uv_sphere_add () # The context override is needed so it&#39;s possible to set edit-mode. bpy . ops . object . mode_set ( mode = &#39;EDIT&#39; ) This example shows how it’s possible to add an object to the scene in another window. import bpy from bpy import context win_active = context . window win_other = None for win_iter in context . window_manager . windows : if win_iter != win_active : win_other = win_iter break # Add cube in the other window. with context . temp_override ( window = win_other ): bpy . ops . mesh . primitive_cube_add () Logging Context Member Access Context members can be logged by calling logging_set(True) on the “with” target of a temporary override. This will log the members that are being accessed during the operation and may assist in debugging when it is unclear which members need to be overridden. In the event an operator fails to execute because of a missing context member, logging may help identify which member is required. This example shows how to log which context members are being accessed. Log statements are printed to your system’s console. Important Not all operators rely on Context Members and therefore will not be affected by bpy.types.Context.temp_override , use logging to what members if any are accessed. import bpy from bpy import context my_objects = [ context . scene . camera ] with context . temp_override ( selected_objects = my_objects ) as override : override . logging_set ( True ) # Enable logging. bpy . ops . object . delete () Inherited Properties ¶ bpy_struct.id_data Inherited Functions ¶ bpy_struct.as_pointer bpy_struct.driver_add bpy_struct.driver_remove bpy_struct.get bpy_struct.id_properties_clear bpy_struct.id_properties_ensure bpy_struct.id_properties_ui bpy_struct.is_property_hidden bpy_struct.is_property_overridable_library bpy_struct.is_property_readonly bpy_struct.is_property_set bpy_struct.items bpy_struct.keyframe_delete bpy_struct.keyframe_insert bpy_struct.keys bpy_struct.path_from_id bpy_struct.path_from_module bpy_struct.path_resolve bpy_struct.pop bpy_struct.property_overridable_library_set bpy_struct.property_unset bpy_struct.rna_ancestors bpy_struct.type_recast bpy_struct.values References ¶ AssetShelf.draw_context_menu AssetShelf.poll FileHandler.poll_drop Gizmo.draw Gizmo.draw_select Gizmo.exit Gizmo.invoke Gizmo.modal Gizmo.test_select GizmoGroup.draw_prepare GizmoGroup.invoke_prepare GizmoGroup.poll GizmoGroup.refresh GizmoGroup.setup Header.draw KeyingSetInfo.generate KeyingSetInfo.iterator KeyingSetInfo.poll Macro.draw Macro.poll Menu.draw Menu.poll Node.draw_buttons Node.draw_buttons_ext Node.init Node.socket_value_update NodeInternal.draw_buttons NodeInternal.draw_buttons_ext NodeSocket.draw NodeSocket.draw_color NodeSocketStandard.draw NodeSocketStandard.draw_color NodeTree.get_from_context NodeTree.interface_update NodeTree.poll NodeTreeInterfaceSocket.draw NodeTreeInterfaceSocketBool.draw NodeTreeInterfaceSocketBundle.draw NodeTreeInterfaceSocketClosure.draw NodeTreeInterfaceSocketCollection.draw NodeTreeInterfaceSocketColor.draw NodeTreeInterfaceSocketFloat.draw NodeTreeInterfaceSocketFloatAngle.draw NodeTreeInterfaceSocketFloatColorTemperature.draw NodeTreeInterfaceSocketFloatDistance.draw NodeTreeInterfaceSocketFloatFactor.draw NodeTreeInterfaceSocketFloatFrequency.draw NodeTreeInterfaceSocketFloatPercentage.draw NodeTreeInterfaceSocketFloatTime.draw NodeTreeInterfaceSocketFloatTimeAbsolute.draw NodeTreeInterfaceSocketFloatUnsigned.draw NodeTreeInterfaceSocketFloatWavelength.draw NodeTreeInterfaceSocketGeometry.draw NodeTreeInterfaceSocketImage.draw NodeTreeInterfaceSocketInt.draw NodeTreeInterfaceSocketIntFactor.draw NodeTreeInterfaceSocketIntPercentage.draw NodeTreeInterfaceSocketIntUnsigned.draw NodeTreeInterfaceSocketMaterial.draw NodeTreeInterfaceSocketMatrix.draw NodeTreeInterfaceSocketMenu.draw NodeTreeInterfaceSocketObject.draw NodeTreeInterfaceSocketRotation.draw NodeTreeInterfaceSocketShader.draw NodeTreeInterfaceSocketString.draw NodeTreeInterfaceSocketStringFilePath.draw NodeTreeInterfaceSocketTexture.draw NodeTreeInterfaceSocketVector.draw NodeTreeInterfaceSocketVector2D.draw NodeTreeInterfaceSocketVector4D.draw NodeTreeInterfaceSocketVectorAcceleration.draw NodeTreeInterfaceSocketVectorAcceleration2D.draw NodeTreeInterfaceSocketVectorAcceleration4D.draw NodeTreeInterfaceSocketVectorDirection.draw NodeTreeInterfaceSocketVectorDirection2D.draw NodeTreeInterfaceSocketVectorDirection4D.draw NodeTreeInterfaceSocketVectorEuler.draw NodeTreeInterfaceSocketVectorEuler2D.draw NodeTreeInterfaceSocketVectorEuler4D.draw NodeTreeInterfaceSocketVectorFactor.draw NodeTreeInterfaceSocketVectorFactor2D.draw NodeTreeInterfaceSocketVectorFactor4D.draw NodeTreeInterfaceSocketVectorPercentage.draw NodeTreeInterfaceSocketVectorPercentage2D.draw NodeTreeInterfaceSocketVectorPercentage4D.draw NodeTreeInterfaceSocketVectorTranslation.draw NodeTreeInterfaceSocketVectorTranslation2D.draw NodeTreeInterfaceSocketVectorTranslation4D.draw NodeTreeInterfaceSocketVectorVelocity.draw NodeTreeInterfaceSocketVectorVelocity2D.draw NodeTreeInterfaceSocketVectorVelocity4D.draw NodeTreeInterfaceSocketVectorXYZ.draw NodeTreeInterfaceSocketVectorXYZ2D.draw NodeTreeInterfaceSocketVectorXYZ4D.draw Operator.cancel Operator.check Operator.description Operator.draw Operator.execute Operator.invoke Operator.modal Operator.poll Panel.draw Panel.draw_header Panel.draw_header_preset Panel.poll RenderEngine.draw RenderEngine.view_draw RenderEngine.view_update UIList.draw_filter UIList.draw_item UIList.filter_items XrSessionState.action_binding_create XrSessionState.action_create XrSessionState.action_set_create XrSessionState.action_state_get XrSessionState.active_action_set_set XrSessionState.controller_aim_location_get XrSessionState.controller_aim_rotation_get XrSessionState.controller_grip_location_get XrSessionState.controller_grip_rotation_get XrSessionState.controller_pose_actions_set XrSessionState.haptic_action_apply XrSessionState.haptic_action_stop XrSessionState.is_running XrSessionState.reset_to_base_pose Next CopyLocationConstraint(Constraint) Previous ConstraintTargetBone(bpy_struct) Copyright &#169; Blender Authors Made with Furo Report issue on this page On this page Context(bpy_struct) Context Context.area Context.asset Context.blend_data Context.collection Context.engine Context.gizmo_group Context.layer_collection Context.mode Context.preferences Context.region Context.region_data Context.region_popup Context.scene Context.screen Context.space_data Context.tool_settings Context.view_layer Context.window Context.window_manager Context.workspace Context.evaluated_depsgraph_get() Context.copy() Context.path_resolve() Context.bl_rna_get_subclass() Context.bl_rna_get_subclass_py() Context.temp_override() Inherited Properties Inherited Functions References