WindowManager(ID)

base classes — bpy_struct, ID

class bpy.types.WindowManager(ID)

Window manager data-block defining open windows and other user interface data

addon_filter

Filter add-ons by category

Type

enum in [], default ‘’

Filter by add-on name, author & category

Type

string, default “”, (never None)

addon_support

Display support level

  • OFFICIAL Official – Officially supported.

  • COMMUNITY Community – Maintained by community developers.

Type

enum set in {‘OFFICIAL’, ‘COMMUNITY’}, default {‘COMMUNITY’, ‘OFFICIAL’}

asset_path_dummy

Full path to the Blender file containing the active asset

Type

string, default “”, (readonly, never None)

is_interface_locked

If true, the interface is currently locked by a running job and data shouldn’t be modified from application timers. Otherwise, the running job might conflict with the handler causing unexpected results or even crashes

Type

boolean, default False, (readonly)

keyconfigs

Registered key configurations

Type

KeyConfigurations bpy_prop_collection of KeyConfig, (readonly)

operators

Operator registry

Type

bpy_prop_collection of Operator, (readonly)

pose_assets
Type

bpy_prop_collection of AssetHandle, (readonly)

poselib_previous_action
Type

Action

preset_name

Name for new preset

Type

string, default “New Preset”, (never None)

windows

Open windows

Type

bpy_prop_collection of Window, (readonly)

xr_session_settings
Type

XrSessionSettings, (readonly, never None)

xr_session_state

Runtime state information about the VR session

Type

XrSessionState, (readonly)

clipboard

Clipboard text storage.

Type

string

classmethod fileselect_add(operator)

Opens a file selector with an operator. The string properties ‘filepath’, ‘filename’, ‘directory’ and a ‘files’ collection are assigned when present in the operator

Parameters

operator (Operator) – Operator to call

classmethod modal_handler_add(operator)

Add a modal handler to the window manager, for the given modal operator (called by invoke() with self, just before returning {‘RUNNING_MODAL’})

Parameters

operator (Operator) – Operator to call

Returns

Whether adding the handler was successful

Return type

boolean

event_timer_add(time_step, window=None)

Add a timer to the given window, to generate periodic ‘TIMER’ events

Parameters
  • time_step (float in [0, inf]) – Time Step, Interval in seconds between timer events

  • window (Window, (optional)) – Window to attach the timer to, or None

Return type

Timer

event_timer_remove(timer)

event_timer_remove

classmethod gizmo_group_type_ensure(identifier)

Activate an existing widget group (when the persistent option isn’t set)

Parameters

identifier (string, (never None)) – Gizmo group type name

Unlink a widget group (when the persistent option is set)

Parameters

identifier (string, (never None)) – Gizmo group type name

progress_begin(min, max)

Start progress report

Parameters
  • min (float in [-inf, inf]) – min, any value in range [0,9999]

  • max (float in [-inf, inf]) – max, any value in range [min+1,9998]

progress_update(value)

Update the progress feedback

Parameters

value (float in [-inf, inf]) – value, Any value between min and max as set in progress_begin()

progress_end()

Terminate progress report

classmethod invoke_props_popup(operator, event)

Operator popup invoke (show operator properties and execute it automatically on changes)

Parameters
  • operator (Operator) – Operator to call

  • event (Event) – Event

Returns

result

Return type

enum set in Operator Return Items

classmethod invoke_props_dialog(operator, width=300)

Operator dialog (non-autoexec popup) invoke (show operator properties and only execute it on click on OK button)

Parameters
  • operator (Operator) – Operator to call

  • width (int in [0, inf], (optional)) – Width of the popup

Returns

result

Return type

enum set in Operator Return Items

classmethod invoke_search_popup(operator)

Operator search popup invoke which searches values of the operator’s bpy.types.Operator.bl_property (which must be an EnumProperty), executing it on confirmation

Parameters

operator (Operator) – Operator to call

classmethod invoke_popup(operator, width=300)

Operator popup invoke (only shows operator’s properties, without executing it)

Parameters
  • operator (Operator) – Operator to call

  • width (int in [0, inf], (optional)) – Width of the popup

Returns

result

Return type

enum set in Operator Return Items

classmethod invoke_confirm(operator, event)

Operator confirmation popup (only to let user confirm the execution, no operator properties shown)

Parameters
  • operator (Operator) – Operator to call

  • event (Event) – Event

Returns

result

Return type

enum set in Operator Return Items

classmethod popmenu_begin__internal(title, icon='NONE')

popmenu_begin__internal

Parameters

icon (enum in Icon Items, (optional)) – icon

Return type

UIPopupMenu, (never None)

classmethod popmenu_end__internal(menu)

popmenu_end__internal

classmethod popover_begin__internal(ui_units_x=0, from_active_button=False)

popover_begin__internal

Parameters
  • ui_units_x (int in [0, inf], (optional)) – ui_units_x

  • from_active_button (boolean, (optional)) – Use Button, Use the active button for positioning

Return type

UIPopover, (never None)

classmethod popover_end__internal(menu, keymap=None)

popover_end__internal

Parameters

keymap (KeyMap, (optional)) – Key Map, Active key map

classmethod piemenu_begin__internal(title, icon='NONE', event=None)

piemenu_begin__internal

Parameters

icon (enum in Icon Items, (optional)) – icon

Return type

UIPieMenu, (never None)

classmethod piemenu_end__internal(menu)

piemenu_end__internal

classmethod operator_properties_last(operator)

operator_properties_last

Return type

OperatorProperties, (never None)

print_undo_steps()

print_undo_steps

classmethod tag_script_reload()

Tag for refreshing the interface after scripts have been reloaded

popover(draw_func, *, ui_units_x=0, keymap=None, from_active_button=False)
popup_menu(draw_func, *, title='', icon='NONE')

Popup menus can be useful for creating menus without having to register menu classes.

Note that they will not block the scripts execution, so the caller can’t wait for user input.

import bpy


def draw(self, context):
    self.layout.label(text="Hello World")


bpy.context.window_manager.popup_menu(draw, title="Greeting", icon='INFO')
popup_menu_pie(event, draw_func, *, title='', icon='NONE')
classmethod bl_rna_get_subclass(id, default=None)
Parameters

id (string) – The RNA type identifier.

Returns

The RNA type or default when not found.

Return type

bpy.types.Struct subclass

classmethod bl_rna_get_subclass_py(id, default=None)
Parameters

id (string) – The RNA type identifier.

Returns

The class or default when not found.

Return type

type

draw_cursor_add(callback, args, space_type, region_type)

Add a new draw cursor handler to this space type. It will be called every time the cursor for the specified region in the space type will be drawn. Note: All arguments are positional only for now.

Parameters
  • callback (function) – A function that will be called when the cursor is drawn. It gets the specified arguments as input with the mouse position (tuple) as last argument.

  • args (tuple) – Arguments that will be passed to the callback.

  • space_type (str) – The space type the callback draws in; for example VIEW_3D. (bpy.types.Space.type)

  • region_type (str) – The region type the callback draws in; usually WINDOW. (bpy.types.Region.type)

Returns

Handler that can be removed later on.

Return type

object

draw_cursor_remove(handler)

Remove a draw cursor handler that was added previously.

Parameters

handler (object) – The draw cursor handler that should be removed.

Inherited Properties

Inherited Functions

References