LoginSignup
4
5

More than 3 years have passed since last update.

[UE4]Unreal PythonからコンソールコマンドやPythonを実行する

Last updated at Posted at 2019-12-23

Unreal Pythonからコンソールコマンドを実行することで、Pythonでは出来ない処理(QUIT_EDITORなど)を行うことが出来ます。

Unreal Pythonからコンソールコマンド実行

qiita.py
import unreal

Editor = unreal.EditorLevelLibrary.get_editor_world()
unreal.SystemLibrary.execute_console_command(Editor, "任意のコマンド")

また、さらに別のPython実行に繋げる事もできます。

Unreal PythonからUnreal Python実行

qiita.py
import unreal

unreal.PythonScriptLibrary.execute_python_command("任意のスクリプトかパス")

execute_python_command_exという関数もありますが、こちらはステートメントとして実行するかファイルとして実行するかどうかと、実行時のスコープ制御が可能になっています。

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5