Skip to content

Commit 2aac28d

Browse files
author
Roberto De Ioris
authored
Update Slate_API.md
1 parent 7d9f4c5 commit 2aac28d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/Slate_API.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,29 @@ More infos here: https://api.unrealengine.com/INT/API/Editor/PropertyEditor/SObj
739739

740740
## SPythonEditorViewport
741741

742+
This is probably tu funniest widget, an EditorViewportClient and a whole World all in a single SWidget:
743+
744+
```python
745+
from unreal_engine import SWindow, SPythonEditorViewport, FVector, FRotator
746+
from unreal_engine.classes import Blueprint
747+
import unreal_engine as ue
748+
749+
editor_viewport = SPythonEditorViewport()
750+
world = editor_viewport.get_world()
751+
world.actor_spawn(ue.load_object(Blueprint, '/Game/ThirdPersonCPP/Blueprints/ThirdPersonCharacter').GeneratedClass)
752+
editor_viewport_client = editor_viewport.get_editor_viewport_client()
753+
editor_viewport_client.set_view_location(FVector(-200, 300, 200))
754+
editor_viewport_client.set_view_rotation(FRotator(0, -30, -90))
755+
756+
window = SWindow(client_size=(512, 256), title='Mannequin Properties', sizing_rule=0)(
757+
(
758+
editor_viewport
759+
)
760+
)
761+
```
762+
763+
![SPythonEditorViewport](https://github.com/20tab/UnrealEnginePython/raw/master/docs/screenshots/slate_SPythonEditorViewport.png)
764+
742765
## Properties Editors
743766

744767
```python

0 commit comments

Comments
 (0)