TA Python ChameleonData API

ChameleonData is the key communication channel between UI widget and python code. Python code can get and set widget content throught it.

if you want more Editor Python API, for instance open Confirm Dialog, pop up Notification. Use Extented PythonEditorLib.

For instance: In MinimalExample, change the text content

    self.data.set_text(self.ui_output, "Clicked {} times".format(self.clickCount))

ChameleonData

Function Name Description
set_visibility Set the widget's visibility
set_collapsed Set the widget's visibility collapsed or not.
set_image_data Set SImage's Image content with Raw data.(R, G, B, A:uint8)
set_image_pixels Set SImage's Image content with Linear Colors.
set_image_from_path Set SImage's Image content from local path the resource folder of this plug-in.
set_image_from Set SImage's Image content with Linear Colors.
set_text Set the text of widget:
get_text Get the text of widget.
set_text_read_only Set the text of widget Read Only or not.
set_int_value Set integer value to widget: SSpinBox.
get_int_value Get integer value from widget: SSpinBox.
set_float_value Set integer value to widget: SSpinBox.
get_float_value Get integer value from widget: SSpinBox.
set_color_and_opacity Set widget's color and opacity.
set_button_color_and_opacity Set SButton's color and opacity.
get_is_checked Get the Checked state of Specified SCheckBox
set_is_checked Set the Checked state of Specified SCheckBox
set_combo_box_items Set SComboBox's content list.
get_combo_box_items Get SComboBox's content list.
get_combo_box_selected_item Get the selection of SComboBox.
set_combo_box_selected_item Set the selection of SComboBox.
set_list_view_items Set items for specified SListView.
get_list_view_items Get items from specified SListView.
set_list_view_selections Set the selections of SListView.
set_list_view_multi_column_selections Set the selections of SListView.
get_list_view_multi_column_items Get the source items from specified MultiColumn SListView.
get_list_view_multi_column_selection None
set_list_view_multi_column_items Set the source items to specified MultiColumn SListView.
set_list_view_multi_column_line None
set_tree_view_items Set the source items of SListView.
get_tree_view_items Set the source items of SListView.
push_breadcrumb_string Set item to SBreadcrumbTrail.
pop_breadcrumb_string Pop a item from SBreadcrumbTrail.
clear_breadcrumbs_string Clear all items from SBreadcrumbTrail.
get_breadcrumbs_count_string Get items's count from SBreadcrumbTrail.
set_grid_panel_column_fill Set the ColumnFill value of SGridPanel.
add_column Add a column to SHeaderRow
set_column_lable Set the label of SHeaderRow
set_progress_bar_percent Set the Percent of SProgressBar
set_tool_tip_text Set the ToolTip Text of Widget
get_scroll_box_offsets Get the Offset, ScrollOffsetOfEnd, ViewFraction, ViewOffsetFraction values in Map.
set_scroll_box_offset Set the Offset Text of ScrollBox
request_close Request close specified chameleon tools.
launch_chameleon_tool Launch specified chameleon tools.
get_is_expanded Get the Expanded state of Specified SExpandableArea
set_is_expanded Set the Expanded state of Specified SExpandableArea
get_chameleon_window_size Get the window size of the Chameleon Tool
set_chameleon_window_size Set the window size of the Chameleon Tool
get_chameleon_window_position Get the window position of the Chameleon Tool
set_chameleon_window_position Set the window position of the Chameleon Tool
flash_chameleon_window Flash the Chameleon Tool
snapshot_chameleon_window Snapshot the chameleon Window, and save it to an image file. This function can save the whole UI, even it is bigger than the screen. or in a ScrollBox

set_visibility

Set the widget's visibility

data.set_visibility(aka_name, visibility_str) -> bool
    Set the widget's visibility

    Args:
        aka_name (Name): The aka name of the widget
        visibility_str (str): The Options: "Visible"/"Collapsed"/"Hidden"/"HitTestInvisible"/"SelfHitTestInvisible"

    Returns:
        bool:

set_collapsed

Set the widget's visibility collapsed or not.

data.set_collapsed(aka_name, collapsed) -> None
    Set the widget's visibility collapsed or not.

    Args:
        aka_name (Name): The aka name of the widget
        collapsed (bool): Collapsed or not, True for EVisibility::Collapsed, False for EVisibility::Visible

set_image_data

Set SImage's Image content with Raw data.(R, G, B, A:uint8)

data.set_image_data(aka_name, raw_data, width, height, channel_num=4, bgr=True) -> None
    Set SImage's Image content with Raw data.(R, G, B, A:uint8)
    note: The order of RawData is row first. Upper left corner is the first pixel, and lower right is the last. Which is different with RenderTexture2D

    Args:
        aka_name (Name): The aka name of the widget
        raw_data (Array(uint8)): The flatten raw data of image, len(RawDataIn) == Height * Width * ChannelNum
        width (int32): Width of Image.
        height (int32): Height of Image.
        channel_num (int32): Channel number of the RawData
        bgr (bool): The RawData Channel Order is Blue, Green, Red, (Alpha) or RGB(A)

set_image_pixels

Set SImage's Image content with Linear Colors.

data.set_image_pixels(aka_name, pixel_colors, width, height) -> None
    Set SImage's Image content with Linear Colors.

    Args:
        aka_name (Name): The aka name of the widget
        pixel_colors (Array(LinearColor)): The pixel list of image, len(PixelColors) == Height * Width
        width (int32): Width of Image.
        height (int32): Height of Image.

set_image_from_path

Set SImage's Image content from local path the resource folder of this plug-in.

data.set_image_from_path(aka_name, image_file_path, brush_width=256, brush_height=256) -> None
    Set SImage's Image content from local path the resource folder of this plug-in.
    note: The base folder is the Resources folder of this plug-in

    Args:
        aka_name (Name): The aka name of the widget
        image_file_path (str): The image path in resource folder.
        brush_width (int32): Brush's width.
        brush_height (int32): Brush's height.

set_image_from

Set SImage's Image content with Linear Colors.

data.set_image_from(aka_name, image_file_path, brush_width=256, brush_height=256) -> None
    Set SImage's Image content with Linear Colors.
    note: If the ImageFilePath is a relative path, it will combined with the folder of chameleon tools's JSON path.

    Args:
        aka_name (Name): The aka name of the widget
        image_file_path (str): The image path in resource folder.
        brush_width (int32): Brush's width.
        brush_height (int32): Brush's height.

set_text

Set the text of widget:

data.set_text(aka_name, text) -> None
    Set the text of widget:
    note: Supported widgets: SEditableText/SEditableTextBox/SMultiLineEditableText/SMultiLineEditableTextBox/SButton etc.

    Args:
        aka_name (Name): The aka name of the widget
        text (str): The text content.

get_text

Get the text of widget.

data.get_text(aka_name) -> str or None
    Get the text of widget.
    note: Supported widgets: SEditableText/SEditableTextBox/SMultiLineEditableText/SMultiLineEditableTextBox etc.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        str or None:

        out_text (str):

set_text_read_only

Set the text of widget Read Only or not.

data.set_text_read_only(aka_name, read_only) -> None
    Set the text of widget Read Only or not.
    note: Supported widgets: SEditableText/SEditableTextBox/SMultiLineEditableText/SMultiLineEditableTextBox etc.

    Args:
        aka_name (Name): The aka name of the widget
        read_only (bool): Is Read Only

set_int_value

Set integer value to widget: SSpinBox.

data.set_int_value(aka_name, value) -> None
    Set integer value to widget: SSpinBox<int32>.
    note: Supported widgets: SSpinBox<int32>.

    Args:
        aka_name (Name): The aka name of the widget
        value (int32): The value to set.

get_int_value

Get integer value from widget: SSpinBox.

data.get_int_value(aka_name) -> int32 or None
    Get integer value from widget: SSpinBox<int32>.
    note: Supported widgets: SSpinBox<int32>.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        int32 or None: The integer value of SSpinBox

        out_text (int32):

set_float_value

Set integer value to widget: SSpinBox.

data.set_float_value(aka_name, value) -> None
    Set integer value to widget: SSpinBox<float>.
    note: Supported widgets: SSpinBox<float>.

    Args:
        aka_name (Name): The aka name of the widget
        value (float): The value to set.

get_float_value

Get integer value from widget: SSpinBox.

data.get_float_value(aka_name) -> float or None
    Get integer value from widget: SSpinBox<int32>.
    note: Supported widgets: SSpinBox<float>.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        float or None: The float value of SSpinBox

        out_text (float):

set_color_and_opacity

Set widget's color and opacity.

data.set_color_and_opacity(aka_name, color) -> None
    Set widget's color and opacity.
    note: Supported widgets: SButton.

    Args:
        aka_name (Name): The aka name of the widget
        color (LinearColor): The FLinear Color value.

set_button_color_and_opacity

Set SButton's color and opacity.

data.set_button_color_and_opacity(aka_name, color) -> None
    Set SButton's color and opacity.
    note: Supported widgets: SButton.

    Args:
        aka_name (Name): The aka name of the widget
        color (LinearColor): The FLinear Color value.

get_is_checked

Get the Checked state of Specified SCheckBox

data.get_is_checked(aka_name) -> bool
    Get the Checked state of Specified SCheckBox
    note: Supported widgets: SCheckBox.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        bool: Is Checked or not.

set_is_checked

Set the Checked state of Specified SCheckBox

data.set_is_checked(aka_name, checked) -> None
    Set the Checked state of Specified SCheckBox
    note: Supported widgets: SCheckBox.

    Args:
        aka_name (Name): The aka name of the widget
        checked (bool): Is Checked or not.

set_combo_box_items

Set SComboBox's content list.

data.set_combo_box_items(aka_name, str_array) -> bool
    Set SComboBox's content list.
    note: Supported widgets: SComboBox.

    Args:
        aka_name (Name): The aka name of the widget
        str_array (Array(str)): The string list for SComboBox's content.

    Returns:
        bool:

get_combo_box_items

Get SComboBox's content list.

data.get_combo_box_items(aka_name) -> Array(str) or None
    Get SComboBox's content list.
    note: Supported widgets: SComboBox.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        Array(str) or None:

        out_str_array (Array(str)): The string list for SComboBox's content.

get_combo_box_selected_item

Get the selection of SComboBox.

data.get_combo_box_selected_item(aka_name) -> str or None
    Get the selection of SComboBox.
    note: Supported widgets: SComboBox.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        str or None:

        out_item (str): The current selection of SComboBox.

set_combo_box_selected_item

Set the selection of SComboBox.

data.set_combo_box_selected_item(aka_name, index) -> bool
    Set the selection of SComboBox.
    note: Supported widgets: SComboBox.

    Args:
        aka_name (Name): The aka name of the widget
        index (int32): The index of item for select.

    Returns:
        bool:

set_list_view_items

Set items for specified SListView.

data.set_list_view_items(aka_name, str_array) -> None
    Set items for specified SListView.
    note: Supported widgets: SListView.

    Args:
        aka_name (Name): The aka name of the widget
        str_array (Array(str)): The list of items.

get_list_view_items

Get items from specified SListView.

data.get_list_view_items(aka_name) -> (out_str_array=Array(str), out_item_stats=Array(int32))
    Get items from specified SListView.
    note: Supported widgets: SListView.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        tuple:

        out_str_array (Array(str)): The items source of SListView.

        out_item_stats (Array(int32)): The selection status of each items. (1 for selected)

set_list_view_selections

Set the selections of SListView.

data.set_list_view_selections(aka_name, indexes) -> None
    Set the selections of SListView.
    note: Supported widgets: SListView.

    Args:
        aka_name (Name): The aka name of the widget
        indexes (Array(int32)): The indexes of selected items.

set_list_view_multi_column_selections

Set the selections of SListView.

data.set_list_view_multi_column_selections(aka_name, indexes) -> None
    Set the selections of SListView.
    note: Supported widgets: SListView.

    Args:
        aka_name (Name): The aka name of the widget
        indexes (Array(int32)): The indexes of selected items.

get_list_view_multi_column_items

Get the source items from specified MultiColumn SListView.

data.get_list_view_multi_column_items(aka_name) -> (out_str_array=Array(str), column_count=int32)
    Get the source items from specified MultiColumn SListView.
    note: Supported widgets: SListView<MultiColumn>.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        tuple:

        out_str_array (Array(str)): The flatten items list from Multi column SListView.

        column_count (int32): The number of column.

get_list_view_multi_column_selection

data.get_list_view_multi_column_selection(aka_name) -> Array(int32) or None
    Get List View Multi Column Selection

    Args:
        aka_name (Name):

    Returns:
        Array(int32) or None:

        out_selected_indices (Array(int32)):

set_list_view_multi_column_items

Set the source items to specified MultiColumn SListView.

data.set_list_view_multi_column_items(aka_name, flattened_str_array, column_count) -> None
    Set the source items to specified MultiColumn SListView.
    note: Supported widgets: SListView<MultiColumn>.

    Args:
        aka_name (Name): The aka name of the widget
        flattened_str_array (Array(str)): The flatten items list for Multi column SListView.
        column_count (int32): The number of column.

set_list_view_multi_column_line

data.set_list_view_multi_column_line(aka_name, line_index, line_content_array, rebuild_list) -> None
    Set List View Multi Column Line

    Args:
        aka_name (Name):
        line_index (int32):
        line_content_array (Array(str)):
        rebuild_list (bool):

set_tree_view_items

Set the source items of SListView.

data.set_tree_view_items(aka_name, str_array, parent_indices) -> None
    Set the source items of SListView.
    note: Supported widgets: SListView.
    note: "TreeItemParentIndices" : [-1, 0, 0, 2, 1, 1].
    note: A
    note: |─B
    note: | └─E
    note: | └─F
    note: └─C
    note: └─D

    Args:
        aka_name (Name): The aka name of the widget
        str_array (Array(str)): Flatten list of items tree.
        parent_indices (Array(int32)): Each item's parent index

get_tree_view_items

Set the source items of SListView.

data.get_tree_view_items(aka_name) -> (out_str_array=Array(str), out_item_stats=Array(int32)) or None
    Set the source items of SListView.
    note: Supported widgets: SListView.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        tuple or None:

        out_str_array (Array(str)):

        out_item_stats (Array(int32)):

push_breadcrumb_string

Set item to SBreadcrumbTrail.

data.push_breadcrumb_string(aka_name, crumb_text, new_crumb_data) -> None
    Set item to SBreadcrumbTrail.
    note: Supported widgets: SBreadcrumbTrail.

    Args:
        aka_name (Name): The aka name of the widget
        crumb_text (str): New item for display .
        new_crumb_data (str): New item for push.

pop_breadcrumb_string

Pop a item from SBreadcrumbTrail.

data.pop_breadcrumb_string(aka_name) -> str
    Pop a item from SBreadcrumbTrail.
    note: Supported widgets: SBreadcrumbTrail.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        str: The Popped item.

clear_breadcrumbs_string

Clear all items from SBreadcrumbTrail.

data.clear_breadcrumbs_string(aka_name, pop_all_crumbs_to_clear=False) -> None
    Clear all items from SBreadcrumbTrail.
    note: Supported widgets: SBreadcrumbTrail.

    Args:
        aka_name (Name): The aka name of the widget
        pop_all_crumbs_to_clear (bool): Pop All Crumbs or not.

get_breadcrumbs_count_string

Get items's count from SBreadcrumbTrail.

data.get_breadcrumbs_count_string(aka_name) -> int32
    Get items's count from SBreadcrumbTrail.
    note: Supported widgets: SBreadcrumbTrail.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        int32: The number of crumbs.

set_grid_panel_column_fill

Set the ColumnFill value of SGridPanel.

data.set_grid_panel_column_fill(aka_name, index, value) -> None
    Set the ColumnFill value of SGridPanel.
    note: Supported widgets: SGridPanel.

    Args:
        aka_name (Name): The aka name of the widget
        index (int32): The index of column.
        value (float): The column fill value.

add_column

Add a column to SHeaderRow

data.add_column(aka_name, label) -> None
    Add a column to SHeaderRow
    note: Supported widgets: SHeaderRow.

    Args:
        aka_name (Name): The aka name of the widget
        label (str): The Label of new column.

set_column_lable

Set the label of SHeaderRow

data.set_column_lable(aka_name, index, label) -> None
    Set the label of SHeaderRow
    note: Supported widgets: SHeaderRow.

    Args:
        aka_name (Name): The aka name of the widget
        index (int32): The index of HeaderRow.
        label (str): The Label of column.

set_progress_bar_percent

Set the Percent of SProgressBar

data.set_progress_bar_percent(aka_name, percent) -> None
    Set the Percent of SProgressBar
    note: Supported widgets: SProgressBar.

    Args:
        aka_name (Name): The aka name of the widget
        percent (float): The Percent value.

set_tool_tip_text

Set the ToolTip Text of Widget

data.set_tool_tip_text(aka_name, tool_tip_text) -> None
    Set the ToolTip Text of Widget
    note: Supported widgets: SWidget.

    Args:
        aka_name (Name): The aka name of the widget
        tool_tip_text (str): The Tool Tip Text.

get_scroll_box_offsets

Get the Offset, ScrollOffsetOfEnd, ViewFraction, ViewOffsetFraction values in Map.

data.get_scroll_box_offsets(aka_name) -> Map(str, float)
    Get the Offset, ScrollOffsetOfEnd, ViewFraction, ViewOffsetFraction values in Map.
    note: Supported widgets: SScrollBox.

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        Map(str, float):

set_scroll_box_offset

Set the Offset Text of ScrollBox

data.set_scroll_box_offset(aka_name, offset) -> bool
    Set the Offset Text of ScrollBox
    note: Supported widgets: SScrollBox.

    Args:
        aka_name (Name): The aka name of the widget
        offset (float): The offset value of ScrollBox

    Returns:
        bool:

request_close

Request close specified chameleon tools.

unreal.ChameleonData.request_close(tools_path="") -> bool
    Request close specified chameleon tools.

    Args:
        tools_path (str): The JSON path of Chameleon tool.

    Returns:
        bool: succeed or not

launch_chameleon_tool

Launch specified chameleon tools.

unreal.ChameleonData.launch_chameleon_tool(tools_path="") -> bool
    Launch specified chameleon tools.

    Args:
        tools_path (str): The JSON path of Chameleon tool.

    Returns:
        bool: succeed or not

get_is_expanded

Get the Expanded state of Specified SExpandableArea

data.get_is_expanded(aka_name) -> bool
    Get the Expanded state of Specified SExpandableArea
    note: Supported widgets: SExpandableArea.
    note: added in v1.0.4

    Args:
        aka_name (Name): The aka name of the widget

    Returns:
        bool: Is Expanded or not.

set_is_expanded

Set the Expanded state of Specified SExpandableArea

data.set_is_expanded(aka_name, expanded, animated=False) -> None
    Set the Expanded state of Specified SExpandableArea
    note: Supported widgets: SExpandableArea.
    note: added in v1.0.4

    Args:
        aka_name (Name): The aka name of the widget
        expanded (bool): Is Expanded or not.
        animated (bool): Expanded with animation or not.

get_chameleon_window_size

Get the window size of the Chameleon Tool

unreal.ChameleonData.get_chameleon_window_size(tools_path, client_size_in_screen=False) -> Vector2D
    Get the window size of the Chameleon Tool
    note: added in v1.0.8

    Args:
        tools_path (str): The relative JSON path of Chameleon tool in Python folder. For instance, the gallery tool's path is "ChameleonGallery/ChameleonGallery.json"
        client_size_in_screen (bool): Get ClientSize or not

    Returns:
        Vector2D: The  size of window

set_chameleon_window_size

Set the window size of the Chameleon Tool

unreal.ChameleonData.set_chameleon_window_size(tools_path, new_size) -> bool
    Set the window size of the Chameleon Tool
    note: added in v1.0.8

    Args:
        tools_path (str): The relative JSON path of Chameleon tool in Python folder. For instance, the gallery tool's path is "ChameleonGallery/ChameleonGallery.json"
        new_size (Vector2D): The new size of window

    Returns:
        bool: True if succeed

get_chameleon_window_position

Get the window position of the Chameleon Tool

unreal.ChameleonData.get_chameleon_window_position(tools_path) -> Vector2D
    Get the window position of the Chameleon Tool
    note: added in v1.0.8

    Args:
        tools_path (str): The relative JSON path of Chameleon tool in Python folder.

    Returns:
        Vector2D: The position of window

set_chameleon_window_position

Set the window position of the Chameleon Tool

unreal.ChameleonData.set_chameleon_window_position(tools_path, new_position) -> bool
    Set the window position of the Chameleon Tool
    note: added in v1.0.8

    Args:
        tools_path (str): The relative JSON path of Chameleon tool in Python folder. For instance, the gallary tool's path is "ChameleonGallery/ChameleonGallery.json"
        new_position (Vector2D):

    Returns:
        bool: True if succeed

flash_chameleon_window

Flash the Chameleon Tool

unreal.ChameleonData.flash_chameleon_window(tools_path) -> bool
    Flash the  Chameleon Tool
    note: added in v1.0.8

    Args:
        tools_path (str): The relative JSON path of Chameleon tool in Python folder.

    Returns:
        bool: The position of window

snapshot_chameleon_window

Snapshot the chameleon Window, and save it to an image file. This function can save the whole UI, even it is bigger than the screen. or in a ScrollBox

unreal.ChameleonData.snapshot_chameleon_window(tools_path, override_window_size=[0.000000, 0.000000], image_file_path="") -> str
    Snapshot the chameleon Window, and save it to an image file. This function can save the whole UI, even it is bigger than the screen. or in a ScrollBox
    note: added in v1.0.8

    Args:
        tools_path (str): The relative JSON path of Chameleon tool in Python folder.
        override_window_size (Vector2D): Override size of the window.
        image_file_path (str): The output file path

    Returns:
        str: ImageFilePath if succeed or Empty string