Skip to content

Commit aad046a

Browse files
author
Roberto De Ioris
authored
Update Slate_API.md
1 parent 3dec5c9 commit aad046a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/Slate_API.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,3 +710,29 @@ window = SWindow(client_size=(512, 64), title='Open Asset', sizing_rule=0)(
710710
![OOP](https://github.com/20tab/UnrealEnginePython/raw/master/docs/screenshots/slate_OOP.png)
711711

712712
As you can see, you can inherit from SWidget. Obviously you can mix 'visual' style, with fully procedural one, but the use of classes will simplify 'context' management.
713+
714+
## SObjectPropertyEntryBox
715+
716+
This widget allows the user to select an asset from a specific class
717+
718+
```python
719+
from unreal_engine import SWindow, SObjectPropertyEntryBox
720+
from unreal_engine.classes import Material
721+
import unreal_engine as ue
722+
723+
724+
725+
window = SWindow(client_size=(512, 256), title='Material Selector', sizing_rule=0)(
726+
(
727+
SObjectPropertyEntryBox(allowed_class=Material, on_object_changed=lambda choice: ue.open_editor_for_asset(choice.get_asset()))
728+
)
729+
)
730+
```
731+
732+
![SObjectPropertyEntryBox](https://github.com/20tab/UnrealEnginePython/raw/master/docs/screenshots/slate_SObjectPropertyEntryBox.png)
733+
734+
note that the callable executed by on_object_changed receives an FAssetData object as argument (this is why we need to call get_asset())
735+
736+
More infos here: https://api.unrealengine.com/INT/API/Editor/PropertyEditor/SObjectPropertyEntryBox/index.html
737+
738+
##

0 commit comments

Comments
 (0)