Skip to content

Commit 2fda5cd

Browse files
author
rdeioris
authored
Update README.md
1 parent a2a966f commit 2fda5cd

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ vec = self.uobject.GetActorLocation()
449449

450450
Reflection based functions are those in camelcase (or with the first capital letter). Native functions instead follow the python style, with lower case, underscore-as-separator function names.
451451

452-
The automagic UClass and UEnums mappers
453-
---------------------------------------
452+
The automagic UClass, UStruct and UEnums mappers
453+
------------------------------------------------
454454

455455
Instead of doing a gazilion of unreal_engine.find_class(name) calls, the plugin adds a 'magic' module called unreal_engine.classes. It allows to import unreal classes like python classes:
456456

@@ -496,6 +496,20 @@ if is_hitting_something:
496496
ue.log(hit_result)
497497
```
498498

499+
Structs are exposed by the unreal_engine.structs virtual module. remember that structs are copied by value, so a unreal_engine.UScriptStruct object is exposed.
500+
501+
To create a new struct instance you can do:
502+
503+
```python
504+
from unreal_engine.structs import TerrificStruct
505+
506+
ts = TerrificStruct()
507+
```
508+
509+
To access the fields of a struct just call the fields() method.
510+
511+
A good example of struct usage is available here: https://github.com/20tab/UnrealEnginePython/blob/master/docs/Settings.md
512+
499513
The ue_site.py file
500514
-------------------
501515

0 commit comments

Comments
 (0)