Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto De Ioris committed Dec 29, 2017
2 parents 098f306 + cdb8555 commit cdc4d75
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions docs/DataTable_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,36 @@ So if you have a 'FWeaponStruct', you can build a DataTable full of 'FWeaponStru
You can create a DataTable (in addition to creating it directly from the content browser) directly from python:

```python
import unreal_engine as ue

from unreal_engine.classes import DataTableFactory
from unreal_engine.structs import Transform

dt_factory = DataTableFactory()
dt_factory.Struct = Transform

dt = dt_factory.factory_create_new('/Game/TransformDataTable')
```

data_table_add_row(row_name, struct)
Being a UStruct, Transform is a perfectly valid type for a DataTable (you can obviously use any structure, check https://github.com/20tab/UnrealEnginePython/blob/master/examples/create_user_defined_struct.py for creating custom structs)

Once you get a reference to a DataTable you can use the api:

### data_table_add_row(row_name, struct)

```python
# add an empty Transform
dt.data_table_add_row('FirstRow', Transform())
```

data_table_remove_row(row_name)
### data_table_remove_row(row_name)

data_table_rename_row(old_row_name, new_row_name)
### data_table_rename_row(old_row_name, new_row_name)

data_table_as_dict()
### data_table_as_dict()

data_table_as_json(flags=0)
### data_table_as_json(flags=0)

data_table_find_row(row_name)
### data_table_find_row(row_name)

data_table_get_all_rows()
### data_table_get_all_rows()

0 comments on commit cdc4d75

Please sign in to comment.