unreal.MediaTexture

class unreal.MediaTexture(outer=None, name='None')

Bases: unreal.Texture

Implements a texture asset for rendering video tracks from UMediaPlayer assets.

C++ Source:

  • Module: MediaAssets
  • File: MediaTexture.h

Editor Properties: (see get_editor_property/set_editor_property)

  • address_x (TextureAddress): [Read-Write] The addressing mode to use for the X axis.

  • address_y (TextureAddress): [Read-Write] The addressing mode to use for the Y axis.

  • adjust_brightness (float): [Read-Write] Static texture brightness adjustment (scales HSV value.) (Non-destructive; Requires texture source art to be available.)

  • adjust_brightness_curve (float): [Read-Write] Static texture curve adjustment (raises HSV value to the specified power.) (Non-destructive; Requires texture source art to be available.)

  • adjust_hue (float): [Read-Write] Static texture hue adjustment (0 - 360) (offsets HSV hue by value in degrees.) (Non-destructive; Requires texture source art to be available.)

  • adjust_max_alpha (float): [Read-Write] Remaps the alpha to the specified min/max range, defines the new value of 1 (Non-destructive; Requires texture source art to be available.)

  • adjust_min_alpha (float): [Read-Write] Remaps the alpha to the specified min/max range, defines the new value of 0 (Non-destructive; Requires texture source art to be available.)

  • adjust_rgb_curve (float): [Read-Write] Static texture RGB curve adjustment (raises linear-space RGB color to the specified power.) (Non-destructive; Requires texture source art to be available.)

  • adjust_saturation (float): [Read-Write] Static texture saturation adjustment (scales HSV saturation.) (Non-destructive; Requires texture source art to be available.)

  • adjust_vibrance (float): [Read-Write] Static texture “vibrance” adjustment (0 - 1) (HSV saturation algorithm adjustment.) (Non-destructive; Requires texture source art to be available.)

  • alpha_coverage_thresholds (Vector4): [Read-Write] Alpha values per channel to compare to when preserving alpha coverage.

  • asset_import_data (AssetImportData): [Read-Only] Asset Import Data

  • asset_user_data (Array(AssetUserData)): [Read-Write] Array of user data stored with the asset

  • auto_clear (bool): [Read-Write] Whether to clear the texture when no media is being played (default = enabled).

  • chroma_key_color (Color): [Read-Write] The color that will be replaced with transparent black if chroma keying is enabled

  • chroma_key_texture (bool): [Read-Write] Whether to chroma key the image, replacing any pixels that match ChromaKeyColor with transparent black

  • chroma_key_threshold (float): [Read-Write] The threshold that components have to match for the texel to be considered equal to the ChromaKeyColor when chroma keying (<=, set to 0 to require a perfect exact match)

  • clear_color (LinearColor): [Read-Write] The color used to clear the texture if AutoClear is enabled (default = black).

  • composite_power (float): [Read-Write] default 1, high values result in a stronger effect e.g 1, 2, 4, 8 this is no slider because the texture update would not be fast enough

  • composite_texture (Texture): [Read-Write] Can be defined to modify the roughness based on the normal map variation (mostly from mip maps). MaxAlpha comes in handy to define a base roughness if no source alpha was there. Make sure the normal map has at least as many mips as this texture.

  • composite_texture_mode (CompositeTextureMode): [Read-Write] defines how the CompositeTexture is applied, e.g. CTM_RoughnessFromNormalAlpha

  • compression_no_alpha (bool): [Read-Write] If enabled, the texture’s alpha channel will be discarded during compression

  • compression_quality (TextureCompressionQuality): [Read-Write] The compression quality for generated textures.

  • compression_settings (TextureCompressionSettings): [Read-Write] Compression settings to use when building the texture.

  • defer_compression (bool): [Read-Write] If enabled, defer compression of the texture until save.

  • dither_mip_map_alpha (bool): [Read-Write] When true, the alpha channel of mip-maps and the base image are dithered for smooth LOD transitions.

  • filter (TextureFilter): [Read-Write] The texture filtering mode to use when sampling this texture.

  • flip_green_channel (bool): [Read-Write] When true the texture’s green channel will be inverted. This is useful for some normal maps.

  • lod_bias (int32): [Read-Write] A bias to the index of the top mip level to use.

  • lod_group (TextureGroup): [Read-Write] Texture group this texture belongs to

  • max_texture_size (int32): [Read-Write] The maximum resolution for generated textures. A value of 0 means the maximum size for the format on each platform, except HDR long/lat cubemaps, which default to a resolution of 512.

  • media_player (MediaPlayer): [Read-Write] The media player asset associated with this texture.

    This property is meant for design-time convenience. To change the associated media player at run-time, use the SetMediaPlayer method. SetMediaPlayer:

  • mip_gen_settings (TextureMipGenSettings): [Read-Write] Per asset specific setting to define the mip-map generation properties like sharpening and kernel size.

  • never_stream (bool): [Read-Write] Never Stream

  • num_cinematic_mip_levels (int32): [Read-Write] Number of mip-levels to use for cinematic quality.

  • padding_color (Color): [Read-Write] The color used to pad the texture out if it is resized due to PowerOfTwoMode

  • power_of_two_mode (TexturePowerOfTwoSetting): [Read-Write] How to pad the texture to a power of 2 size (if necessary)

  • preserve_border (bool): [Read-Write] When true the texture’s border will be preserved during mipmap generation.

  • srgb (bool): [Read-Write] This should be unchecked if using alpha channels individually as masks.

  • use_legacy_gamma (bool): [Read-Write] A flag for using the simplified legacy gamma space e.g pow(color,1/2.2) for converting from FColor to FLinearColor, if we’re doing sRGB.

address_x

(TextureAddress) – [Read-Write] The addressing mode to use for the X axis.

address_y

(TextureAddress) – [Read-Write] The addressing mode to use for the Y axis.

auto_clear

(bool) – [Read-Write] Whether to clear the texture when no media is being played (default = enabled).

clear_color

(LinearColor) – [Read-Write] The color used to clear the texture if AutoClear is enabled (default = black).

get_aspect_ratio() → float

Gets the current aspect ratio of the texture. GetHeight, GetWidth:

Returns:Texture aspect ratio.
Return type:float
get_height() → int32

Gets the current height of the texture. GetAspectRatio, GetWidth:

Returns:Texture height (in pixels).
Return type:int32
get_media_player() → MediaPlayer

Get the media player that provides the video samples. SetMediaPlayer:

Returns:The texture’s media player, or nullptr if not set.
Return type:MediaPlayer
get_width() → int32

Gets the current width of the texture. GetAspectRatio, GetHeight:

Returns:Texture width (in pixels).
Return type:int32
set_media_player(new_media_player) → None

Set the media player that provides the video samples. GetMediaPlayer:

Parameters:new_media_player (MediaPlayer) – The player to set.