Skip to content

Commit bae6dee

Browse files
author
rdeioris
authored
Update PythonConsole.md
1 parent 2542a72 commit bae6dee

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

docs/PythonConsole.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is a plugin module giving you a shell for running python commands. It is th
77

88
In this screenshot you can see how to get access to the editor world, and how to add actors to it.
99

10-
The console is still in early stage of development (it is really raw, do not expected a good user experience)
10+
The console supports history
1111

1212
Running python scripts
1313
----------------------
@@ -25,10 +25,12 @@ ue.exec('yourscript.py')
2525

2626
python scripts are searched from the /Content/Scripts directory
2727

28-
Editor scripting
29-
----------------
28+
Note: on python2 ue.exec is not a valid function, you need to use ue.py_exec
3029

31-
The following functions allows access to editor internals:
30+
Editor scripting example
31+
------------------------
32+
33+
This is an example of editor scripting from the python console
3234

3335
```py
3436
# get access to the editor world
@@ -47,8 +49,8 @@ unreal_engine.editor_select_actor(an_actor)
4749
new_asset = unreal_engine.import_asset(filename, package[, factory_class])
4850
```
4951

50-
Asset importing
51-
---------------
52+
Asset importing example
53+
-----------------------
5254

5355
The following code shows how to import an asset from python (an image as a texture):
5456

@@ -86,17 +88,17 @@ factory_obj.set_property('bRGBToEmissive', True)
8688
new_object = ue.import_asset('C:/Users/Tester/Desktop/logo.png', '/Game/FooBar/20tab', factory_obj)
8789
```
8890

89-
Reimporting
90-
-----------
91+
Reimporting example
92+
-------------------
9193

9294
You can reimport an object with the asset_reimport() method:
9395

9496
```py
9597
uobject.asset_reimport([ask_for_new_file, show_notification, filename])
9698
```
9799

98-
Assets listing
99-
--------------
100+
Assets listing example
101+
----------------------
100102

101103
```py
102104
# get the assets under the specified path
@@ -169,3 +171,8 @@ ret = ue.message_dialog_open(ue.APP_MSG_TYPE_YES_NO, "Do you want to shot ?")
169171
if ret == ue.APP_RETURN_TYPE_YES:
170172
ue.log('You choose "YES"')
171173
```
174+
175+
Multiline mode
176+
--------------
177+
178+
If a statement ends with ':' the python console will assume an 'incomplete' commands and will wait for the next line NOT starting with a space to issue the instructions. This mode allows you to enter functions, classes, cycles in the console.

0 commit comments

Comments
 (0)