UILayout(bpy_struct)

base class — bpy_struct

class bpy.types.UILayout(bpy_struct)

User interface layout in a panel or header

activate_init

When true, buttons defined in popups will be activated on first display (use so you can type into a field without having to click on it first) (default False)

Type:

bool

active

(default False)

Type:

bool

active_default

When true, an operator button defined after this will be activated when pressing return(use with popup dialogs) (default False)

Type:

bool

alert

(default False)

Type:

bool

alignment

(default 'EXPAND')

Type:

Literal[‘EXPAND’, ‘LEFT’, ‘CENTER’, ‘RIGHT’]

direction

(default 'HORIZONTAL', readonly)

Type:

Literal[‘HORIZONTAL’, ‘VERTICAL’]

emboss

(default 'NORMAL')

  • NORMAL Regular – Draw standard button emboss style.

  • NONE None – Draw only text and icons.

  • PULLDOWN_MENU Pull-down Menu – Draw pull-down menu style.

  • PIE_MENU Pie Menu – Draw radial menu style.

  • NONE_OR_STATUS None or Status – Draw with no emboss unless the button has a coloring status like an animation state.

Type:

Literal[‘NORMAL’, ‘NONE’, ‘PULLDOWN_MENU’, ‘PIE_MENU’, ‘NONE_OR_STATUS’]

enabled

When false, this (sub)layout is grayed out (default False)

Type:

bool

operator_context

Typically set to ‘INVOKE_REGION_WIN’, except some cases in bpy.types.Menu when it’s set to ‘EXEC_REGION_WIN’. (default 'INVOKE_DEFAULT')

Type:

Literal[Operator Context Items]

scale_x

Scale factor along the X for items in this (sub)layout (in [0, inf], default 0.0)

Type:

float

scale_y

Scale factor along the Y for items in this (sub)layout (in [0, inf], default 0.0)

Type:

float

ui_units_x

Fixed size along the X for items in this (sub)layout (in [0, inf], default 0.0)

Type:

float

ui_units_y

Fixed size along the Y for items in this (sub)layout (in [0, inf], default 0.0)

Type:

float

use_property_decorate

(default False)

Type:

bool

use_property_split

(default False)

Type:

bool

row(*, align=False, heading='', heading_ctxt='', translate=True)

Sub-layout. Items placed in this sublayout are placed next to each other in a row.

Parameters:
  • align (bool) – Align buttons to each other (optional)

  • heading (str) – Heading, Label to insert into the layout for this sub-layout (optional, never None)

  • heading_ctxt (str) – Override automatic translation context of the given heading (optional, never None)

  • translate (bool) – Translate the given heading, when UI translation is enabled (optional)

Returns:

Sub-layout to put items in

Return type:

UILayout

column(*, align=False, heading='', heading_ctxt='', translate=True)

Sub-layout. Items placed in this sublayout are placed under each other in a column.

Parameters:
  • align (bool) – Align buttons to each other (optional)

  • heading (str) – Heading, Label to insert into the layout for this sub-layout (optional, never None)

  • heading_ctxt (str) – Override automatic translation context of the given heading (optional, never None)

  • translate (bool) – Translate the given heading, when UI translation is enabled (optional)

Returns:

Sub-layout to put items in

Return type:

UILayout

panel(idname, *, default_closed=False)

Creates a collapsible panel. Whether it is open or closed is stored in the region using the given idname. This can only be used when the panel has the full width of the panel region available to it. So it can’t be used in e.g. in a box or columns.

Parameters:
  • idname (str) – Identifier of the panel (never None)

  • default_closed (bool) – Open by Default, When true, the panel will be open the first time it is shown (optional)

Returns:

layout_header, Sub-layout to put items in, UILayout

layout_body, Sub-layout to put items in. Will be none if the panel is collapsed., UILayout

Return type:

tuple[UILayout, UILayout]

panel_prop(data, property)

Similar to .panel(...) but instead of storing whether it is open or closed in the region, it is stored in the provided boolean property. This should be used when multiple instances of the same panel can exist. For example one for every item in a collection property or list. This can only be used when the panel has the full width of the panel region available to it. So it can’t be used in e.g. in a box or columns.

Parameters:
  • data (AnyType) – Data from which to take the open-state property (never None)

  • property (str) – Identifier of the boolean property that determines whether the panel is open or closed (never None)

Returns:

layout_header, Sub-layout to put items in, UILayout

layout_body, Sub-layout to put items in. Will be none if the panel is collapsed., UILayout

Return type:

tuple[UILayout, UILayout]

column_flow(*, columns=0, align=False)

column_flow

Parameters:
  • columns (int) – Number of columns, 0 is automatic (in [0, inf], optional)

  • align (bool) – Align buttons to each other (optional)

Returns:

Sub-layout to put items in

Return type:

UILayout

grid_flow(*, row_major=False, columns=0, even_columns=False, even_rows=False, align=False)

grid_flow

Parameters:
  • row_major (bool) – Fill row by row, instead of column by column (optional)

  • columns (int) – Number of columns, positive are absolute fixed numbers, 0 is automatic, negative are automatic multiple numbers along major axis (e.g. -2 will only produce 2, 4, 6 etc. columns for row major layout, and 2, 4, 6 etc. rows for column major layout). (in [-inf, inf], optional)

  • even_columns (bool) – All columns will have the same width (optional)

  • even_rows (bool) – All rows will have the same height (optional)

  • align (bool) – Align buttons to each other (optional)

Returns:

Sub-layout to put items in

Return type:

UILayout

box()

Sublayout (items placed in this sublayout are placed under each other in a column and are surrounded by a box)

Returns:

Sub-layout to put items in

Return type:

UILayout

split(*, factor=0.0, align=False)

split

Parameters:
  • factor (float) – Percentage, Percentage of width to split at (leave unset for automatic calculation) (in [0, 1], optional)

  • align (bool) – Align buttons to each other (optional)

Returns:

Sub-layout to put items in

Return type:

UILayout

menu_pie()

Sublayout. Items placed in this sublayout are placed in a radial fashion around the menu center).

Returns:

Sub-layout to put items in

Return type:

UILayout

classmethod icon(data)

Return the custom icon for this data, use it e.g. to get materials or texture icons.

Parameters:

data (AnyType) – Data from which to take the icon (never None)

Returns:

Icon identifier (in [0, inf])

Return type:

int

classmethod enum_item_name(data, property, identifier)

Return the UI name for this enum item

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • identifier (str) – Identifier of the enum item (never None)

Returns:

UI name of the enum item (never None)

Return type:

str

classmethod enum_item_description(data, property, identifier)

Return the UI description for this enum item

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • identifier (str) – Identifier of the enum item (never None)

Returns:

UI description of the enum item (never None)

Return type:

str

classmethod enum_item_icon(data, property, identifier)

Return the icon for this enum item

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • identifier (str) – Identifier of the enum item (never None)

Returns:

Icon identifier (in [0, inf])

Return type:

int

prop(data, property, *, text='', text_ctxt='', translate=True, icon='NONE', placeholder='', expand=False, slider=False, toggle=-1, icon_only=False, event=False, full_event=False, emboss=True, index=-1, icon_value=0, invert_checkbox=False)

Item. Exposes an RNA item and places it into the layout.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • placeholder (str) – Hint describing the expected value when empty (optional)

  • expand (bool) – Expand button to show more detail (optional)

  • slider (bool) – Use slider widget for numeric values (optional)

  • toggle (int) – Use toggle widget for boolean values, or a checkbox when disabled (the default is -1 which uses toggle only when an icon is displayed) (in [-1, 1], optional)

  • icon_only (bool) – Draw only icons in buttons, no text (optional)

  • event (bool) – Use button to input key events (optional)

  • full_event (bool) – Use button to input full events including modifiers (optional)

  • emboss (bool) – Draw the button itself, not just the icon/text. When false, corresponds to the ‘NONE_OR_STATUS’ layout emboss type. (optional)

  • index (int) – The index of this button, when set a single member of an array can be accessed, when set to -1 all array members are used (in [-2, inf], optional)

  • icon_value (int) – Icon Value, Override automatic icon of the item (in [0, inf], optional)

  • invert_checkbox (bool) – Draw checkbox value inverted (optional)

props_enum(data, property)

props_enum

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

prop_menu_enum(data, property, *, text='', text_ctxt='', translate=True, icon='NONE')

prop_menu_enum

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

prop_with_popover(data, property, *, text='', text_ctxt='', translate=True, icon='NONE', icon_only=False, panel)

prop_with_popover

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • icon_only (bool) – Draw only icons in tabs, no text (optional)

  • panel (str) – Identifier of the panel (never None)

prop_with_menu(data, property, *, text='', text_ctxt='', translate=True, icon='NONE', icon_only=False, menu)

prop_with_menu

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • icon_only (bool) – Draw only icons in tabs, no text (optional)

  • menu (str) – Identifier of the menu (never None)

prop_tabs_enum(data, property, *, data_highlight=None, property_highlight='', icon_only=False, expand_as='DEFAULT')

prop_tabs_enum

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • data_highlight (AnyType) – Data from which to take highlight property (optional, never None)

  • property_highlight (str) – Identifier of highlight property in data (optional, never None)

  • icon_only (bool) – Draw only icons in tabs, no text (optional)

  • expand_as (Literal['DEFAULT', 'ROW']) – (optional)

prop_enum(data, property, value, *, text='', text_ctxt='', translate=True, icon='NONE')

prop_enum

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • value (str) – Enum property value (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

prop_search

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • search_data (AnyType) – Data from which to take collection to search in (never None)

  • search_property (str) – Identifier of search collection property (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • results_are_suggestions (bool) – Accept inputs that do not match any item (optional)

  • item_search_property (str) – Identifier of the string property in each collection’s items to use for searching (defaults to the items’ type ‘name property’) (optional, never None)

prop_decorator(data, property, *, index=-1)

prop_decorator

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • index (int) – The index of this button, when set a single member of an array can be accessed, when set to -1 all array members are used (in [-2, inf], optional)

operator(operator, *, text='', text_ctxt='', translate=True, icon='NONE', emboss=True, depress=False, icon_value=0, search_weight=0.0)

Item. Places a button into the layout to call an Operator.

Parameters:
  • operator (str) – Identifier of the operator (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • emboss (bool) – Draw the button itself, not just the icon/text (optional)

  • depress (bool) – Draw pressed in (optional)

  • icon_value (int) – Icon Value, Override automatic icon of the item (in [0, inf], optional)

  • search_weight (float) – Search Weight, Influences the sorting when using menu-seach (in [-inf, inf], optional)

Returns:

Operator properties to fill in

Return type:

OperatorProperties

operator_menu_hold(operator, *, text='', text_ctxt='', translate=True, icon='NONE', emboss=True, depress=False, icon_value=0, menu)

Item. Places a button into the layout to call an Operator.

Parameters:
  • operator (str) – Identifier of the operator (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • emboss (bool) – Draw the button itself, not just the icon/text (optional)

  • depress (bool) – Draw pressed in (optional)

  • icon_value (int) – Icon Value, Override automatic icon of the item (in [0, inf], optional)

  • menu (str) – Identifier of the menu (never None)

Returns:

Operator properties to fill in

Return type:

OperatorProperties

operator_enum(operator, property, *, icon_only=False)

operator_enum

Parameters:
  • operator (str) – Identifier of the operator (never None)

  • property (str) – Identifier of property in operator (never None)

  • icon_only (bool) – Draw only icons in buttons, no text (optional)

operator_menu_enum(operator, property, *, text='', text_ctxt='', translate=True, icon='NONE')

operator_menu_enum

Parameters:
  • operator (str) – Identifier of the operator (never None)

  • property (str) – Identifier of property in operator (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

Returns:

Operator properties to fill in

Return type:

OperatorProperties

label(*, text='', text_ctxt='', translate=True, icon='NONE', icon_value=0)

Item. Displays text and/or icon in the layout.

Parameters:
  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • icon_value (int) – Icon Value, Override automatic icon of the item (in [0, inf], optional)

menu(menu, *, text='', text_ctxt='', translate=True, icon='NONE', icon_value=0)

menu

Parameters:
  • menu (str) – Identifier of the menu (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • icon_value (int) – Icon Value, Override automatic icon of the item (in [0, inf], optional)

menu_contents(menu)

menu_contents

Parameters:

menu (str) – Identifier of the menu (never None)

popover(panel, *, text='', text_ctxt='', translate=True, icon='NONE', icon_value=0, direction='VERTICAL')

popover

Parameters:
  • panel (str) – Identifier of the panel (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • icon_value (int) – Icon Value, Override automatic icon of the item (in [0, inf], optional)

  • direction (Literal['VERTICAL', 'HORIZONTAL']) –

    Popup Direction, The direction in which the popup panel is drawn relative to button position (optional)

    • VERTICAL Vertical – Draw popup panel above or below the button.

    • HORIZONTAL Horizontal – Draw popup panel to the side of the button.

popover_group(space_type, region_type, context, category)

popover_group

Parameters:
  • space_type (Literal[Space Type Items]) – Space Type

  • region_type (Literal[Region Type Items]) – Region Type

  • context (str) – panel type context (never None)

  • category (str) – panel type category (never None)

separator(*, factor=1.0, type='AUTO')

Item. Inserts empty space into the layout between items.

Parameters:
  • factor (float) – Percentage, Percentage of width to space (leave unset for default space) (in [0, inf], optional)

  • type (Literal['AUTO', 'SPACE', 'LINE']) –

    Type, The type of the separator (optional)

    • AUTO Auto – Best guess at what type of separator is needed..

    • SPACE Empty space – Horizontal or Vertical empty space, depending on layout direction..

    • LINE Line – Horizontal or Vertical line, depending on layout direction..

separator_spacer()

Item. Inserts horizontal spacing empty space into the layout between items.

progress(*, text='', text_ctxt='', translate=True, factor=0.0, type='BAR')

Progress indicator

Parameters:
  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • factor (float) – Factor, Amount of progress from 0.0f to 1.0f (in [0, 1], optional)

  • type (Literal['BAR', 'RING']) – Type, The type of progress indicator (optional)

context_pointer_set(name, data)

context_pointer_set

Parameters:
  • name (str) – Name, Name of entry in the context (never None)

  • data (AnyType) – Pointer to put in context

context_string_set(name, value)

context_string_set

Parameters:
  • name (str) – Name, Name of entry in the context (never None)

  • value (str) – Value, String to put in context (never None)

template_header()

Inserts common Space header UI (editor type selector)

template_ID(data, property, *, new='', open='', unlink='', filter='ALL', live_icon=False, text='', text_ctxt='', translate=True)

template_ID

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • new (str) – Operator identifier to create a new ID block (optional, never None)

  • open (str) – Operator identifier to open a file for creating a new ID block (optional, never None)

  • unlink (str) – Operator identifier to unlink the ID block (optional, never None)

  • filter (Literal['ALL', 'AVAILABLE']) – Optionally limit the items which can be selected (optional)

  • live_icon (bool) – Show preview instead of fixed icon (optional)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

template_ID_session_uid(data, property, id_type)

Template ID search menu button for session_uid Int properties

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_ID_preview(data, property, *, new='', open='', unlink='', rows=0, cols=0, filter='ALL', hide_buttons=False)

template_ID_preview

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • new (str) – Operator identifier to create a new ID block (optional, never None)

  • open (str) – Operator identifier to open a file for creating a new ID block (optional, never None)

  • unlink (str) – Operator identifier to unlink the ID block (optional, never None)

  • rows (int) – Number of thumbnail preview rows to display, (in [0, inf], optional)

  • cols (int) – Number of thumbnail preview columns to display, (in [0, inf], optional)

  • filter (Literal['ALL', 'AVAILABLE']) – Optionally limit the items which can be selected (optional)

  • hide_buttons (bool) – Show only list, no buttons (optional)

template_matrix(data, property)

Insert a readonly Matrix UI. The UI displays the matrix components - translation, rotation and scale. The property argument must be the identifier of an existing 4x4 float vector property of subtype ‘MATRIX’.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_any_ID(data, property, type_property, *, text='', text_ctxt='', translate=True)

template_any_ID

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • type_property (str) – Identifier of property in data giving the type of the ID-blocks to use (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

template_ID_tabs(data, property, *, new='', menu='', filter='ALL')

template_ID_tabs

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • new (str) – Operator identifier to create a new ID block (optional, never None)

  • menu (str) – Context menu identifier (optional, never None)

  • filter (Literal['ALL', 'AVAILABLE']) – Optionally limit the items which can be selected (optional)

template_action(id, *, new='', unlink='', text='', text_ctxt='', translate=True)

template_action

Parameters:
  • id (ID) – The data-block for which to select an Action (never None)

  • new (str) – Operator identifier to create a new ID block (optional, never None)

  • unlink (str) – Operator identifier to unlink the ID block (optional, never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

template_search

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • search_data (AnyType) – Data from which to take collection to search in (never None)

  • search_property (str) – Identifier of search collection property (never None)

  • new (str) – Operator identifier to create a new item for the collection (optional, never None)

  • unlink (str) – Operator identifier to unlink or delete the active item from the collection (optional, never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

template_search_preview(data, property, search_data, search_property, *, new='', unlink='', text='', text_ctxt='', translate=True, rows=0, cols=0)

template_search_preview

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • search_data (AnyType) – Data from which to take collection to search in (never None)

  • search_property (str) – Identifier of search collection property (never None)

  • new (str) – Operator identifier to create a new item for the collection (optional, never None)

  • unlink (str) – Operator identifier to unlink or delete the active item from the collection (optional, never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • rows (int) – Number of thumbnail preview rows to display, (in [0, inf], optional)

  • cols (int) – Number of thumbnail preview columns to display, (in [0, inf], optional)

template_path_builder(data, property, root, *, text='', text_ctxt='', translate=True)

template_path_builder

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • root (ID) – ID-block from which path is evaluated from

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

template_modifiers()

Generates the UI layout for the modifier stack

template_strip_modifiers()

Generates the UI layout for the strip modifier stack

template_collection_exporters()

Generates the UI layout for collection exporters

template_constraints(*, use_bone_constraints=True)

Generates the panels for the constraint stack

Parameters:

use_bone_constraints (bool) – Add panels for bone constraints instead of object constraints (optional)

template_shaderfx()

Generates the panels for the shader effect stack

template_greasepencil_color(data, property, *, rows=0, cols=0, scale=1.0, filter='ALL')

template_greasepencil_color

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • rows (int) – Number of thumbnail preview rows to display, (in [0, inf], optional)

  • cols (int) – Number of thumbnail preview columns to display, (in [0, inf], optional)

  • scale (float) – Scale of the image thumbnails, (in [0.1, 1.5], optional)

  • filter (Literal['ALL', 'AVAILABLE']) – Optionally limit the items which can be selected (optional)

template_constraint_header(data)

Generates the header for constraint panels

Parameters:

data (Constraint) – Constraint data (never None)

template_preview(id, *, show_buttons=True, parent=None, slot=None, preview_id='')

Item. A preview window for materials, textures, lights or worlds.

Parameters:
  • id (ID) – ID data-block

  • show_buttons (bool) – Show preview buttons? (optional)

  • parent (ID) – ID data-block (optional)

  • slot (TextureSlot) – Texture slot (optional)

  • preview_id (str) – Identifier of this preview widget, if not set the ID type will be used (i.e. all previews of materials without explicit ID will have the same size…). (optional, never None)

template_curve_mapping(data, property, *, type='NONE', levels=False, brush=False, use_negative_slope=False, show_tone=False, show_presets=False)

Item. A curve mapping widget used for e.g falloff curves for lights.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • type (Literal['NONE', 'VECTOR', 'COLOR', 'HUE']) – Type, Type of curves to display (optional)

  • levels (bool) – Show black/white levels (optional)

  • brush (bool) – Show brush options (optional)

  • use_negative_slope (bool) – Use a negative slope by default (optional)

  • show_tone (bool) – Show tone options (optional)

  • show_presets (bool) – Show preset options (optional)

template_curveprofile(data, property)

A profile path editor used for custom profiles

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_color_ramp(data, property, *, expand=False)

Item. A color ramp widget.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • expand (bool) – Expand button to show more detail (optional)

template_icon(icon_value, *, scale=1.0)

Display a large icon

Parameters:
  • icon_value (int) – Icon to display, (in [0, inf])

  • scale (float) – Scale, Scale the icon size (by the button size) (in [1, 100], optional)

template_icon_view(data, property, *, show_labels=False, scale=6.0, scale_popup=5.0)

Enum. Large widget showing Icon previews.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • show_labels (bool) – Show enum label in preview buttons (optional)

  • scale (float) – UI Units, Scale the button icon size (by the button size) (in [1, 100], optional)

  • scale_popup (float) – Scale, Scale the popup icon size (by the button size) (in [1, 100], optional)

template_histogram(data, property)

Item. A histogramm widget to analyze imaga data.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_waveform(data, property)

Item. A waveform widget to analyze imaga data.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_vectorscope(data, property)

Item. A vectorscope widget to analyze imaga data.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_layers(data, property, used_layers_data, used_layers_property, active_layer)

template_layers

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • used_layers_data (AnyType) – Data from which to take property

  • used_layers_property (str) – Identifier of property in data (never None)

  • active_layer (int) – Active Layer, (in [0, inf])

template_color_picker(data, property, *, value_slider=False, lock=False, lock_luminosity=False, cubic=False)

Item. A color wheel widget to pick colors.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • value_slider (bool) – Display the value slider to the right of the color wheel (optional)

  • lock (bool) – Lock the color wheel display to value 1.0 regardless of actual color (optional)

  • lock_luminosity (bool) – Keep the color at its original vector length (optional)

  • cubic (bool) – Cubic saturation for picking values close to white (optional)

template_palette(data, property, *, color=False)

Item. A palette used to pick colors.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • color (bool) – Display the colors as colors or values (optional)

template_image_layers(image, image_user)

template_image_layers

template_image(data, property, image_user, *, compact=False, multiview=False)

Item(s). User interface for selecting images and their source paths.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • image_user (ImageUser) – (never None)

  • compact (bool) – Use more compact layout (optional)

  • multiview (bool) – Expose Multi-View options (optional)

template_image_settings(image_settings, *, color_management=False)

User interface for setting image format options

Parameters:
  • image_settings (ImageFormatSettings) – (never None)

  • color_management (bool) – Show color management settings (optional)

template_image_stereo_3d(stereo_3d_format)

User interface for setting image stereo 3d options

Parameters:

stereo_3d_format (Stereo3dFormat) – (never None)

template_image_views(image_settings)

User interface for setting image views output options

Parameters:

image_settings (ImageFormatSettings) – (never None)

template_movieclip(data, property, *, compact=False)

Item(s). User interface for selecting movie clips and their source paths.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • compact (bool) – Use more compact layout (optional)

template_track(data, property)

Item. A movie-track widget to preview tracking image.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_marker(data, property, clip_user, track, *, compact=False)

Item. A widget to control single marker settings.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • clip_user (MovieClipUser) – (never None)

  • track (MovieTrackingTrack) – (never None)

  • compact (bool) – Use more compact layout (optional)

template_movieclip_information(data, property, clip_user)

Item. Movie clip information data.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

  • clip_user (MovieClipUser) – (never None)

template_list(listtype_name, list_id, dataptr, propname, active_dataptr, active_propname, *, item_dyntip_propname='', rows=5, maxrows=5, type='DEFAULT', columns=9, sort_reverse=False, sort_lock=False)

Item. A list widget to display data, e.g. vertexgroups.

Parameters:
  • listtype_name (str) – Identifier of the list type to use (never None)

  • list_id (str) – Identifier of this list widget. Necessary to tell apart different list widgets. Mandatory when using default “UI_UL_list” class. If this not an empty string, the uilist gets a custom ID, otherwise it takes the name of the class used to define the uilist (for example, if the class name is “OBJECT_UL_vgroups”, and list_id is not set by the script, then bl_idname = “OBJECT_UL_vgroups”) (never None)

  • dataptr (AnyType) – Data from which to take the Collection property

  • propname (str) – Identifier of the Collection property in data (never None)

  • active_dataptr (AnyType) – Data from which to take the integer property, index of the active item (never None)

  • active_propname (str) – Identifier of the integer property in active_data, index of the active item (never None)

  • item_dyntip_propname (str) – Identifier of a string property in items, to use as tooltip content (optional, never None)

  • rows (int) – Default and minimum number of rows to display (in [0, inf], optional)

  • maxrows (int) – Default maximum number of rows to display (in [0, inf], optional)

  • type (Literal[Uilist Layout Type Items]) – Type, Type of layout to use (optional)

  • columns (int) – Number of items to display per row, for GRID layout (in [0, inf], optional)

  • sort_reverse (bool) – Display items in reverse order by default (optional)

  • sort_lock (bool) – Lock display order to default value (optional)

template_running_jobs()

template_running_jobs

template_operator_search

template_menu_search

template_header_3D_mode()
template_edit_mode_selection()

Inserts common 3DView Edit modes header UI (selector for selection mode)

template_reports_banner()

template_reports_banner

template_input_status()

template_input_status

template_status_info()

template_status_info

template_node_link

template_node_view(ntree, node, socket)

template_node_view

template_node_operator_registration_errors(*, idname='')

template_node_operator_registration_errors

Parameters:

idname (str) – (optional, never None)

template_node_asset_menu_items(*, catalog_path='', operator='ADD')

template_node_asset_menu_items

Parameters:
  • catalog_path (str) – (optional, never None)

  • operator (Literal['ADD', 'SWAP']) –

    Operator, The operator the asset menu will use (optional)

    • ADD Add Node – Add a node to the active tree..

    • SWAP Swap Node – Replace the selected nodes with the specified type..

template_modifier_asset_menu_items(*, catalog_path='', skip_essentials=False)

template_modifier_asset_menu_items

Parameters:
  • catalog_path (str) – (optional, never None)

  • skip_essentials (bool) – (optional)

template_node_operator_asset_menu_items(*, catalog_path='')

template_node_operator_asset_menu_items

Parameters:

catalog_path (str) – (optional, never None)

template_node_operator_asset_root_items()

template_node_operator_asset_root_items

template_texture_user()

template_texture_user

template_keymap_item_properties(item)

template_keymap_item_properties

Parameters:

item (KeyMapItem) – (never None)

template_component_menu(data, property, *, name='')

Item. Display expanded property in a popup menu

Parameters:
  • data (AnyType) – Data from which to take property

  • property (str) – Identifier of property in data (never None)

  • name (str) – (optional, never None)

template_colorspace_settings(data, property)

Item. A widget to control input color space settings.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_colormanaged_view_settings(data, property)

Item. A widget to control color managed view settings.

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_node_socket(*, color=(0.0, 0.0, 0.0, 1.0))

Node Socket Icon

Parameters:

color (Sequence[float]) – Color, (array of 4 items, in [0, 1], optional)

template_cache_file(data, property)

Item(s). User interface for selecting cache files and their source paths

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_cache_file_velocity(data, property)

Show cache files velocity properties

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_cache_file_time_settings(data, property)

Show cache files time settings

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_cache_file_layers(data, property)

Show cache files override layers properties

Parameters:
  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_recent_files(*, rows=6)

Show list of recently saved .blend files

Parameters:

rows (int) – Maximum number of items to show (in [1, inf], optional)

Returns:

Number of items drawn (in [0, inf])

Return type:

int

template_file_select_path(params)

Item. A text button to set the active file browser path.

template_event_from_keymap_item(item, *, text='', text_ctxt='', translate=True)

Display keymap item as icons/text

Parameters:
  • item (KeyMapItem) – Item, (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

template_light_linking_collection(context_layout, data, property)

Visualization of a content of a light linking collection

Parameters:
  • context_layout (UILayout) – Layout to set active list element as context properties (never None)

  • data (AnyType) – Data from which to take property (never None)

  • property (str) – Identifier of property in data (never None)

template_bone_collection_tree()

Show bone collections tree

template_grease_pencil_layer_tree()

View of the active Grease Pencil layer tree

template_node_tree_interface(interface)

Show a node tree interface

Parameters:

interface (NodeTreeInterface) – Node Tree Interface, Interface of a node tree to display (never None)

template_node_inputs(node)

Show a node settings and input socket values

Parameters:

node (Node) – Node, Display inputs of this node (never None)

template_asset_shelf_popover(asset_shelf, *, name='', icon='NONE', icon_value=0)

Create a button to open an asset shelf in a popover

Parameters:
  • asset_shelf (str) – Identifier of the asset shelf to display (bl_idname) (never None)

  • name (str) – Optional name to indicate the active asset (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • icon_value (int) – Icon Value, Override automatic icon of the item (in [0, inf], optional)

template_popup_confirm(operator, *, text='', text_ctxt='', translate=True, icon='NONE', cancel_text='', cancel_default=False)

Add confirm & cancel buttons into a popup which will close the popup when pressed

Parameters:
  • operator (str) – Identifier of the operator (never None)

  • text (str) – Override automatic text of the item (optional)

  • text_ctxt (str) – Override automatic translation context of the given text (optional)

  • translate (bool) – Translate the given text, when UI translation is enabled (optional)

  • icon (Literal[Icon Items]) – Icon, Override automatic icon of the item (optional)

  • cancel_text (str) – Optional text to use for the cancel, not shown when an empty string (optional, never None)

  • cancel_default (bool) – Cancel button by default (optional)

Returns:

Operator properties to fill in

Return type:

OperatorProperties

template_shape_key_tree()

Shape Key tree view

classmethod bl_rna_get_subclass(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (bpy.types.Struct | None) – The value to return when not found.

Returns:

The RNA type or default when not found.

Return type:

bpy.types.Struct

classmethod bl_rna_get_subclass_py(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (type | None) – The value to return when not found.

Returns:

The class or default when not found.

Return type:

type

introspect()

Return a list of dictionaries containing a textual representation of the UI layout.

Return type:

list[dict[str, Any]]

Inherited Properties

Inherited Functions

References