| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7d9f4c5 commit 2aac28d
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -739,6 +739,29 @@ More infos here: https://api.unrealengine.com/INT/API/Editor/PropertyEditor/SObj | |||
| 739 | 739 | ||
| 740 | 740 | ## SPythonEditorViewport | |
| 741 | 741 | ||
| 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 | +  | ||
| 764 | + | ||
| 742 | 765 | ## Properties Editors | |
| 743 | 766 | ||
| 744 | 767 | ```python | |
| Back | FazBrowse Home | New Git URL |
0 commit comments