class

MAssetPicker

Module
Miri
Header
#include "Miri/Widgets/MAssetPicker.h"
Namespace
Miri

Properties

TypeNameDescription
MiriDelegate<void(const std::string&)>OnAssetSelected
MiriDelegate<void()>OnResetFired by the clear (reset) button — distinct from selecting the None row so callers can reset to a component default rather than empty.
MiriDelegate<void(const std::string&)>OnBrowseToFired by the magnifier button with the current asset path — the host reveals it in the asset browser.

Public functions

ReturnsNameDescription
MIRI_WIDGET_ARGS
voidSetEntries
voidSetCurrentAsset
voidSetPlaceholderText
const std::string&GetCurrentAssetPath
boolIsOpen
voidSetShowThumbnails
voidSetShowPathSubtitlesTwo-line rows: asset name over its project path in secondary text.
voidSetShowClearButton
voidSetUnresolvedThe field holds a reference that names nothing that exists.
boolIsUnresolved
voidSetThumbnailResolverResolves an asset path/key to an Miri texture.
MiriVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseMove
CReplyOnMouseButtonUp
CReplyOnMouseWheel
CReplyOnKeyDown
CReplyOnKeyChar
boolIsTextInputThe open dropdown types its search: keys must stay out of the shortcuts of the panel behind it.
voidOnMouseEnter
voidOnMouseLeave
voidOnFocusLost
boolOnDragEnterAsset drops from a browser.
boolOnDragOver
voidOnDragLeave
boolOnDrop
boolCanCacheDesiredSizeA fixed dropdown frame; the asset name inside it is elided to fit rather than widening the picker.
const char*GetTypeName
boolIsFocusableEnter and Space on a tabbed-to picker open its list; the arrows and typing inside the open list were already keyboard-driven.
boolOnActivate

Function details

MIRI_WIDGET_ARGS

C++
MIRI_WIDGET_ARGS(MAssetPicker) MIRI_ATTR(int32_t, MaxVisibleRows) MIRI_ATTR(bool, ShowThumbnails) MIRI_ATTR(bool, ShowClearButton) MIRI_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetEntries

C++
void SetEntries(std::vector<FAssetEntry> entries)

SetCurrentAsset

C++
void SetCurrentAsset(const std::string& path, const std::string& name)

SetPlaceholderText

C++
void SetPlaceholderText(const std::string& text)

GetCurrentAssetPath

C++
const std::string& GetCurrentAssetPath() const

IsOpen

C++
bool IsOpen() const

SetShowThumbnails

C++
void SetShowThumbnails(bool show)

SetShowPathSubtitles

C++
void SetShowPathSubtitles(bool show)

Two-line rows: asset name over its project path in secondary text. Off by default — compact pickers (node menus) keep single-line rows.

SetShowClearButton

C++
void SetShowClearButton(bool show)

SetUnresolved

C++
void SetUnresolved(bool unresolved)

The field holds a reference that names nothing that exists. Drawn in the error colour rather than silently as ordinary text: a path that was renamed away otherwise reads exactly like one that resolves, and the author only finds out when the thing fails to appear at runtime.

IsUnresolved

C++
bool IsUnresolved() const

SetThumbnailResolver

C++
void SetThumbnailResolver(std::function<IMiriRHITexture*(const std::string&)> resolver)

Resolves an asset path/key to an Miri texture. Called every paint (never cached) so a thumbnail that finishes decoding late fills in on the next frame with no extra plumbing. Null result = nothing drawn yet.

ComputeDesiredSize

C++
MiriVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& renderer, int32_t layerId) const override

OnMouseButtonDown

C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) override

OnMouseMove

C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) override

OnMouseButtonUp

C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) override

OnMouseWheel

C++
CReply OnMouseWheel(const CGeometry& geo, const CPointerEvent& event) override

OnKeyDown

C++
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) override

OnKeyChar

C++
CReply OnKeyChar(const CGeometry& geo, const CCharacterEvent& event) override

IsTextInput

C++
bool IsTextInput() const override

The open dropdown types its search: keys must stay out of the shortcuts of the panel behind it.

OnMouseEnter

C++
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) override

OnMouseLeave

C++
void OnMouseLeave(const CPointerEvent& event) override

OnFocusLost

C++
void OnFocusLost(const CFocusEvent& event) override

OnDragEnter

C++
bool OnDragEnter(const CGeometry& geo, const CDragDropEvent& event) override

Asset drops from a browser. The entry list is already narrowed to the types this field accepts, so membership in it IS the type check — a texture dragged onto a mesh field is simply not offered.

OnDragOver

C++
bool OnDragOver(const CGeometry& geo, const CDragDropEvent& event) override

OnDragLeave

C++
void OnDragLeave(const CDragDropEvent& event) override

OnDrop

C++
bool OnDrop(const CGeometry& geo, const CDragDropEvent& event) override

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

A fixed dropdown frame; the asset name inside it is elided to fit rather than widening the picker.

GetTypeName

C++
const char* GetTypeName() const override

IsFocusable

C++
bool IsFocusable() const override

Enter and Space on a tabbed-to picker open its list; the arrows and typing inside the open list were already keyboard-driven.

OnActivate

C++
bool OnActivate() override
Generated from Miri/Widgets/MAssetPicker.h via miri.json · Dec 5, 2026Version 1.1.0