Bootstrap Chameleon Logo

PythonTextureLib

Function Name Description
create_texture2d_from_raw Create a Texture2D from pixel RawData
set_render_target_data Set the RenderTexture2D By Raw Data.
get_render_target_raw_data Get the Raw Data from RenderTarget2D

create_texture2d_from_raw

Create a Texture2D from pixel RawData

unreal.PythonTextureLib.create_texture2d_from_raw(raw_data, width, height, channel_num, use_srgb=False, texture_filter_value=-1, bgr=False) -> Texture2D
    Create a Texture2D from pixel RawData
    note: The Texture2D type is EPixelFormat::PF_R8G8B8A8
    note: added in v1.0.7

    Args:
        raw_data (Array[uint8]): The flatten uint8 raw data of image, len(RawData) == RawDataWidth * RawDataHeight * RawDataChannelNum
        width (int32): The width of the Texture2D
        height (int32): The Height of the Texture2D
        channel_num (int32): The Number of RawData's Channel. 1: grayscale; 2: grayscale with alpha; 3: rgb; 4 rgb with alpha
        use_srgb (bool): Use SRGB or no0t
        texture_filter_value (int32): The filter of texture: 0: Nearest, 1: Bilinear, 2: Trilinear, 3: Use setting from the Texture Group.
        bgr (bool): Is the order of RawData is Blue, Green, Red, otherwise RGB

    Returns:
        Texture2D: The created Texture2D

set_render_target_data

Set the RenderTexture2D By Raw Data.

unreal.PythonTextureLib.set_render_target_data(render_target_texture, raw_data, raw_data_width, raw_data_height, raw_data_channel_num, use_srgb=False, texture_filter_value=-1, bgr=False) -> None
    Set the RenderTexture2D By Raw Data.
    note: The order of RawData is row first. Lower left corner is the first pixel, and upper right is the last
    note: added in v1.0.7

    Args:
        render_target_texture (TextureRenderTarget2D): The target RenderTarget2D
        raw_data (Array[uint8]): The flatten uint8 raw data of image, len(RawData) == RawDataWidth * RawDataHeight * RawDataChannelNum
        raw_data_width (int32): The width of the RawData, we can fill the rt with smaller RawData
        raw_data_height (int32): The Height of the RawData
        raw_data_channel_num (int32): The Number of RawData's Channel. 1: grayscale; 2: grayscale with alpha; 3: rgb; 4 rgb with alpha
        use_srgb (bool): Use SRGB or not
        texture_filter_value (int32): The filter of texture: 0: Nearest, 1: Bilinear, 2: Trilinear, Use setting from the Texture Group.
        bgr (bool): Is the order of RawData is Blue, Green, Red, otherwise RGB

get_render_target_raw_data

Get the Raw Data from RenderTarget2D

unreal.PythonTextureLib.get_render_target_raw_data(render_target_texture) -> Array[uint8]
    Get the Raw Data from RenderTarget2D
    note: added in v1.0.7

    Args:
        render_target_texture (TextureRenderTarget2D): The source RenderTarget2D

    Returns:
        Array[uint8]:

        out_raw_data (Array[uint8]):

Other Editor Python Libs: