Skip to content

Commit 7682644

Browse files
author
Roberto De Ioris
committed
2 parents 08ddf2b + aad046a commit 7682644

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

docs/Slate_API.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,6 @@ class AssetOpener(SHorizontalBox):
685685
def open_or_validate(self):
686686
try:
687687
asset = ue.load_object(Object, self.asset_name_picker.get_text())
688-
print(asset)
689688
except:
690689
ue.message_dialog_open(ue.APP_MSG_TYPE_OK, 'invalid path')
691690
return
@@ -711,3 +710,29 @@ window = SWindow(client_size=(512, 64), title='Open Asset', sizing_rule=0)(
711710
![OOP](https://github.com/20tab/UnrealEnginePython/raw/master/docs/screenshots/slate_OOP.png)
712711

713712
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)