File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -26,4 +26,27 @@ unreal_engine.editor_deselect_actors()
2626
2727# select an actor
2828unreal_engine.editor_select_actor(an_actor)
29+
30+ # import an asset
31+ new_asset = unreal_engine.import_asset(filename, package[, factory_class])
32+ ```
33+
34+ Asset importing
35+ ---------------
36+
37+ The following code shows how to import an asset from python (an image as a texture):
38+
39+ ``` py
40+ import unreal_engine as ue
41+
42+ # get a factory class
43+ factory = ue.find_class(' TextureFactory' )
44+
45+ # import the asset using the specified class
46+ new_asset = ue.import_asset(' C:/Users/Tester/Desktop/logo.png' , ' /Game/Content/Foo' , factory)
47+
48+ # print the asset class (it will be a Texture2D)
49+ ue.log(new_asset.get_class().get_name())
2950```
51+
52+ The last argument (the factory class) can be omitted, in such a case the factory will be detected by the file extension.
Original file line number Diff line number Diff line change @@ -738,4 +738,4 @@ Investigate what to do with threads (maybe disallowing unreal engine calls in py
738738Contacts
739739--------
740740
741- If you want to contact us, drop a mail to info at 20tab.com
741+ If you want to contact us, drop a mail to info at 20tab.com or follow @unbit on twitter
You can’t perform that action at this time.
0 commit comments