Выберите «Из Content Browser» для готового ассета или «С диска», чтобы добавить локальный файл. Поддерживаются MP3 и совместимые MP4 и MOV. Для обычного MP4 подойдут H.264 и звук AAC.
Откройте нужную вкладку, проверьте файл в предпросмотре, настройте и сохраните ассет.
Для замены щёлкните правой кнопкой по источнику в Content Browser и выберите Reimport. Снова проверьте ролик в прежнем плеере.
Для сборки игры держите импортированный файл в проекте. Если ролик не открывается, проверьте, чем закодированы его видео и звук.
03Живое видео и звук в материале
Материал показывает картинку, а Media Work воспроизводит звук из той же сессии. Когда вы ставите ролик на паузу или перематываете, картинка и звук меняются вместе.
В «Видео в текстуру» выберите клип, запустите предпросмотр и сохраните текстуру.
Добавьте в Material Editor ноду Media Work Video Texture. Для светящегося экрана выберите Unlit и подключите RGB к Emissive Color.
Создайте экземпляр материала, назначьте сохранённую текстуру параметру MediaWorkVideo и примените материал к мешу. Для виджета используйте материал для UI.
Для ручного запуска вызовите Start на видеотекстуре в Blueprint. Пауза, остановка, перемотка и громкость управляются через ту же сессию или контроллер.
Media Work Video Texture · RGB → Emissive Color · Opacity → Opacity
04Прозрачный MOV и маски
Откройте MOV с альфа-каналом, например ProRes 4444 с включённой альфой. Проверьте ролик на контрастном фоне.
В материале выберите Translucent. Подключите RGB для изображения, а выход Opacity ноды к входу Opacity материала.
Для мягкого края выберите одну из 50 масок в «Видео в текстуру». У чёрно-белой картинки используйте канал Red, у прозрачного PNG — Alpha. Белый или полная альфа оставляют изображение, чёрный или нулевая альфа скрывают.
Оставляйте центр своей маски цельным, а плавный переход заканчивайте до края картинки. Маска сочетается с исходной прозрачностью и применяется к отдельной видеотекстуре.
ProRes 4444 · AlphaVideo texture · Soft Lens
05Полный видеоплеер
В «Видео плеер» выберите файл и оформление. Screen показывает плеер на экране, Plane размещает его на плейне, Texture выдаёт картинку вместе с рамкой и кнопками для материала.
Оставьте пропорции на «Авто» или укажите ширину, делённую на высоту. Масштабируйте и смещайте видео внутри рамки. Заголовок можно оставить пустым.
Сохраните плеер и вызовите Open Saved Player в Blueprint. Сохраните ссылку на результат, чтобы получить поверхность, текстуру и сессию или закрыть плеер.
Для своего материала возьмите текстуру через Get Output Texture. Включите отрисовку кнопок, если они нужны на самой текстуре.
Media Work · Video playerOpen Saved Player · Screen / Plane / Texture
06Кнопки и адресное управление
Передайте поверхность плеера в Configure Media Work Player Controls. Выберите курсор или кнопки, персонажа и максимальную дистанцию.
На плейне можно использовать луч. Для своего меша передавайте координаты указателя через Update Pointer UV. X и Y идут от 0 до 1 по текстуре. Передавайте нажатие и отпускание.
Чтобы вынести управление в отдельный виджет, добавьте Media Work Controls и привяжите его к сессии или ID плеера. Выберите набор кнопок и их оформление.
Проверьте на двух экранах. Пауза на одном не должна останавливать второй. При выходе из зоны удержание кнопки или перемотки должно завершиться.
Configure Media Work Player Controls
07Аудио и плейлист
В «Аудио плеер» добавьте MP3 или импортированные источники. Выбирайте дорожки списком или кнопками предыдущего и следующего трека.
Включите повтор или перемешивание, задайте громкость и настройте шесть полос от басов до верхних частот. Сброс EQ выравнивает все полосы.
Выберите оформление, по желанию скройте название трека или список и сохраните плейлист.
В Widget Blueprint добавьте Media Work Player и вызовите Open Playlist с сохранённым ассетом. Для своих кнопок используйте команды сессии.
Media Work · Audio playlist
08Своя рамка и кнопки
Сделайте копию готового стиля и ассетов его кнопок, если их тоже меняете. Откройте SVG-шаблон в графическом редакторе.
Нарисуйте четыре угла, четыре стороны, верхнее и нижнее украшения при необходимости, две кнопки, дорожки и бегунки. Вокруг силуэтов оставьте прозрачность и запас места. Перед экспортом RGBA PNG скройте направляющие.
Импортируйте PNG. Назначьте детали в Frame в порядке на шаблоне. Для атласа разделите координаты прямоугольника каждой детали на ширину и высоту всего изображения и впишите их в UV Min и UV Max.
Сведите стороны с углами через Corner Anchors, Corner Arm Widths и Side Profiles. Corner Offsets задаются в процентах от размера угла, отрицательные X и Y смещают влево и вверх. Join Overlap заводит сторону под угол. Проверьте, что украшение целиком помещается на прозрачном холсте.
Кнопка может сохранить цвет, получить общий оттенок или менять только выбранную часть. Белое на цветовой маске разрешает перекраску. Проверьте широкий, квадратный и вертикальный кадры и компактный аудиоплеер на светлой и тёмной подложках.
Импортируйте SRT, VTT, ASS, SSA, TTML, DFXP или SBV. Откройте ассет и проверьте строки и время.
В видеоплеере включите субтитры, назначьте дорожку и выберите язык, если их несколько.
Подберите шрифт с нужными буквами, например Golos Text для кириллицы. Поправьте время смещением и сохраните плеер.
Media Work · Golos Text
10Эффекты видео
Откройте «Эффекты видео», выберите ролик и пресет. Сравните с исходным видео на ходу.
Настройте силу, цвет и другие доступные параметры. Оставьте Preserve Alpha включённым, если нужна прозрачность.
Сохраните эффект. В Blueprint подключите его к сессии и используйте выходную текстуру в материале.
Video · OriginalVideo · Effect
11Камера в текстуру
В «Камера» выберите камеру сцены и убедитесь, что в её кадре нужные объекты.
Задайте размер текстуры, частоту обновления и при желании эффект. Сохраните настройки. Для небольшого охранного монитора можно снизить частоту.
Добавьте Media Work Camera Texture в сцену или Blueprint. Назначьте камеру и настройки, передайте Get Output Texture в параметр материала или вызовите Apply to Material.
Media Work · Camera textureMedia Work · Camera texture + effect
12Качество вывода
Прямой вывод использует исходный кадр. Включите обработку для изменения разрешения, фильтрации или альфы. У полного плеера отдельные разрешение и частота перерисовки.
Включите сглаживание при масштабировании или выключите для пиксельной графики. 16 бит подходят для плавных переходов, 8 бит экономят память.
Выберите частоту отдельно для видеотекстуры, плеера и камеры. Проверьте вид и звук там, где их увидит игрок.
13Сборка игры для Windows
Сохраните источники, материалы, плееры и стили, на которые ссылаются сцены и Blueprint. Проверьте включение ассетов, подгружаемых во время игры.
Упакуйте проект под Windows 64-bit. Настройка делается в редакторе, сохранённый плеер работает в игре.
В отдельном запуске проверьте первый кадр, звук, перемотку, прозрачность и нажатия. Если источник открывается только в редакторе, проверьте, попал ли он с зависимостями в сборку.
14Справочник нод Blueprint
Откройте группу, выберите ноду и посмотрите назначение и пины на настоящем снимке Unreal. Подключение RGB и Opacity показано выше на снимке материала.
Названия нод, пины и подсказки в справочнике приведены как в английском интерфейсе Unreal.
Ничего не найдено
MWCameraCaptureComponent · 13
Apply to Material
Connects the live picture to a texture parameter. The connection follows changes in output size.
MWCameraCaptureComponent.ApplyToMaterialApply to Material
Close Camera
Stops capture and releases this camera's picture buffers and material connections.
MWCameraCaptureComponent.CloseCameraClose Camera
Set camera texture settings
Creates a live camera texture with the saved size, update rate and effect.
MWCameraCaptureComponent.ConfigureSet camera texture settings
Update camera texture
Draws one new frame. Use this when automatic updates are paused.
MWCameraCaptureComponent.DrawFrameUpdate camera texture
Get Output Texture
Returns the finished live texture, or no texture while the camera is unavailable.
Connects the processed picture and its transparency to a texture parameter. The connection follows changes of effect and output size.
MWEffectPlayer.ApplyToMaterialApply to Material
Close
Releases this effect's picture buffers and material connections. The shared player and its sound continue playing.
MWEffectPlayer.CloseClose
Get Player Id
The ID of the shared player used by this effect.
MWEffectPlayer.GetPlayerIdGet Player Id
Preserve Alpha
Keeps the original video's transparency. Turn off only when you want a solid rectangular picture.
MWEffectPlayer.PreserveAlphaPreserve Alpha
Draw video effect
Processes the current video frame and returns the finished texture.
MWEffectPlayer.RenderDraw video effect
Change effect color
Changes a color in a pass of the selected effect.
MWEffectPlayer.SetColorChange effect color
Set video effect
Applies this effect and its saved settings to the video.
MWEffectPlayer.SetEffectSet video effect
Change effect value
Changes one setting in a pass of the selected effect.
MWEffectPlayer.SetScalarChange effect value
Set Strength
Sets how strongly the effect changes the picture, from zero to one.
MWEffectPlayer.SetStrengthSet Strength
Use Session
Processes this player's live picture using its own playback clock. Sound and controls keep using the same player. An optional texture can supply its masked picture.
MWEffectPlayer.UseSessionUse Session
MWMaskedVideoTexture · 10
Apply video to material
Connects this live texture to a texture parameter in a material.
MWMaskedVideoTexture.ApplyToMaterialApply video to material
Close player surface
Stops drawing this texture.
MWMaskedVideoTexture.CloseVideoClose player surface
Update masked video
Draw the current video frame and its edge fade into this texture.
MWMaskedVideoTexture.DrawFrameUpdate masked video
Player ID
This session has its own unique ID. Use it to address only this player.
MWMaskedVideoTexture.GetPlayerIdPlayer ID
Change edge fade
Apply a saved mask to this video texture. An empty choice restores the original video transparency.
MWMaskedVideoTexture.SetMaskChange edge fade
Use edge fade
Switch the chosen mask on or off. The original video alpha is preserved.
MWMaskedVideoTexture.SetMaskEnabledUse edge fade
Reveal the faint edge
Zero preserves the painted fade. Higher values reveal more of its faint outer edge without cutting off the gradient.
MWMaskedVideoTexture.SetMaskSoftnessReveal the faint edge
Set picture framing
Moves or scales the picture inside the video texture.
Closes this player’s source and sound. Its ID and texture remain available for reopening.
MWMediaController.CloseClose source
Finished video texture
Connect this texture to your material. It includes the chosen edge fade.
MWMediaController.GetOutputTextureFinished video texture
Player ID
This session has its own unique ID. Use it to address only this player.
MWMediaController.GetPlayerIdPlayer ID
Open media
Opens a saved media asset and connects its sound to this game world.
MWMediaController.OpenMediaOpen media
Pause
Pauses playback and keeps its position.
MWMediaController.PausePause
Play
Starts or resumes the current track.
MWMediaController.PlayPlay
Seek
Moves to a time in seconds. Returns false when the source cannot seek.
MWMediaController.SeekSeek
Set picture framing
Resizes and moves only this controller’s video inside its fixed output. After the first change, get Output Texture again and assign it to your material or UI: framing may create a processed output. The sound and session stay the same.
Apply a saved mask to this video texture. An empty choice restores the original video transparency.
MWMediaController.SetVideoMaskChange edge fade
Set volume
Sets this player's volume from 0 for silent to 1 for full volume.
MWMediaController.SetVolumeSet volume
Stop
Stops playback and returns to the beginning. The source stays selected.
MWMediaController.StopPlaybackStop
Play or pause
Pauses a playing track or resumes a paused track.
MWMediaController.TogglePlaybackPlay or pause
MWMediaSession · 33
Can seek
Reports whether the source can jump to a chosen time.
MWMediaSession.CanSeekCan seek
Change track
Use 1 for the next track, -1 for the previous track and 0 to restart the current track.
MWMediaSession.ChangeTrackChange track
Close source
Stops playback and releases the decoder and sound. Reopen Source can open it again.
MWMediaSession.CloseClose source
Find player by ID
Finds only the matching player in this game world. An unknown ID returns no player. Connect the result to Play, Pause or another command.
MWMediaSession.FindPlayerByIdFind player by ID
Source duration
Returns the length in seconds, or zero while it is unknown.
MWMediaSession.GetDurationSource duration
Get six-band gains
Six bands from bass to treble. Zero keeps the original sound; positive values boost and negative values reduce the band. Each track keeps the chosen settings. A band can only affect frequencies present in the recording.
Tells you whether the playlist plays in shuffled order.
MWMediaSession.GetPlaylistShuffleIs shuffled
Playback position
Returns the current time in seconds for a clock or progress bar.
MWMediaSession.GetPositionPlayback position
Get current subtitle lines
Returns the lines at this player’s real playback time. Use them in your own UI. Hidden, stopped or invalid subtitles return empty text.
MWMediaSession.GetSubtitleTextGet current subtitle lines
Track count
The number of tracks in this playlist.
MWMediaSession.GetTrackCountTrack count
Playlist track index
Returns the selected row from zero, or -1 for a single source.
MWMediaSession.GetTrackIndexPlaylist track index
Track name
The name of a playlist row. Use -1 for the current track.
MWMediaSession.GetTrackTitleTrack name
Get volume
Returns this player's loudness from 0 to 1.
MWMediaSession.GetVolumeGet volume
Reopen source
Reopens the selected source after closing it or after an error.
MWMediaSession.OpenReopen source
Open media
Opens a saved media asset and connects its sound to this game world.
MWMediaSession.OpenMediaOpen media
Open playlist
Starts a saved playlist. Replace any missing tracks before playing.
MWMediaSession.OpenPlaylistOpen playlist
Pause
Pauses playback and keeps its position.
MWMediaSession.PausePause
Play
Starts or resumes the current track.
MWMediaSession.PlayPlay
Reset equalizer
Returns all six gains to zero without restarting the track or changing its volume.
MWMediaSession.ResetEqualizerReset equalizer
Seek
Moves to a time in seconds. Returns false when the source cannot seek.
MWMediaSession.SeekSeek
Play playlist row
Plays the chosen playlist row. The first row is zero.
MWMediaSession.SelectTrackPlay playlist row
Set equalizer
Sets 60, 150, 400, 1000, 2500 and 8000 Hz from -12 to +12 dB. Missing band values become zero.
MWMediaSession.SetEqualizerSet equalizer
Set one equalizer band
Changes one gain from -12 to +12 dB. Band zero is 60 Hz, then 150, 400, 1000, 2500 and 8000 Hz. Other bands stay as they are. Returns false for an invalid band or value.
MWMediaSession.SetEqualizerBandSet one equalizer band
Set repeat
Repeats the current source at its end. Playlists have their own repeat setting.
MWMediaSession.SetLoopingSet repeat
Set playlist repeat
Starts a new pass after the last track. Turn off to stop when this pass ends.
Changes the order of upcoming tracks. Each track plays once per pass, and the selected track starts first. Previous returns through the tracks you have heard.
MWMediaSession.SetPlaylistShuffleSet shuffled order
Set subtitle language
Choose a language found in this file. The default uses the language saved in the source.
MWMediaSession.SetSubtitleLanguageSet subtitle language
Set subtitle visibility
Shows or hides captions in views sharing this session. Video, sound and position keep playing as before.
Selects one player for this controller, chooses cursor or buttons, and sets the required interaction distance. Calling it again changes the selected player.
MWPlayerInteractionLibrary.ConfigurePlayerControlsConfigure Media Work Player Controls
MWPlayerOutput · 8
Close
Closes this output and releases its screen, plane, texture and playback session.
MWPlayerOutput.CloseClose
Get Output Texture
Returns the complete live player texture for texture and plane outputs.
MWPlayerOutput.GetOutputTextureGet Output Texture
Get Plane
Returns the plane created for a saved plane output.
MWPlayerOutput.GetPlaneGet Plane
Get Player Id
Returns the ID used to control only this player.
MWPlayerOutput.GetPlayerIdGet Player Id
Get Screen Player
Returns the screen widget when the saved output is the game screen.
MWPlayerOutput.GetScreenPlayerGet Screen Player
Get Session
Returns this output's playback session, shared by its picture, sound and controls.
MWPlayerOutput.GetSessionGet Session
Get Status
Shows opening progress or the reason why this output could not play.
MWPlayerOutput.GetStatusGet Status
Get Surface
Returns the surface component used to send pointer and key input to a player texture or plane.
MWPlayerOutput.GetSurfaceGet Surface
MWPlayerOutputLibrary · 1
Open Saved Player
Opens the saved player on the game screen, on a plane or as a complete texture, according to its output setting. Keep the returned object to control and close this player.
MWPlayerOutputLibrary.OpenSavedPlayerOpen Saved Player
MWPlayerPlane · 5
Open Player
Opens a saved player on this plane with its picture, frame, buttons and sound.
MWPlayerPlane.OpenPlayerOpen Player
Player UVTo World
Converts texture UV coordinates into a world point on this plane.
MWPlayerPlane.PlayerUVToWorldPlayer UVTo World
Ray to Player UV
Finds where a ray meets this plane, including beyond its edges for a held slider.
MWPlayerPlane.RayToPlayerUVRay to Player UV
Set Plane Width
Changes plane width while preserving the displayed player's proportions.
MWPlayerPlane.SetPlaneWidthSet Plane Width
World to Player UV
Converts a point on this plane to texture UV coordinates. Points beyond its edges also return their coordinates.
MWPlayerPlane.WorldToPlayerUVWorld to Player UV
MWPlayerRenderTexture · 1
Apply to Material
Connects the complete player picture, frame and buttons to a material texture parameter.
MWPlayerRenderTexture.ApplyToMaterialApply to Material
MWPlayerSurfaceComponent · 20
Bind Player Id
Connects to this player's ID in the same world. An unknown ID disconnects this surface.
MWPlayerSurfaceComponent.BindPlayerIdBind Player Id
Cancel Pointer
Cancels a held button or an unfinished seek without applying it. Use this when the pointer loses control.