Anyone happen to know if it is possible to use a Python script to add variables/fields to a user data structure asset (used for building data tables)? I figured out how to create the asset with Python, but haven’t figured out how to add variable/fields to it.
In the example snippet here, up to the “if” statement in line 8 works fine, but “add_variable” fails and I’m not sure what the correct code would be to add variables/fields to the newly created Struct asset.
import unreal
asset_tools = unreal.AssetToolsHelpers.get_asset_tools()
structure_asset = asset_tools.create_asset("PlayerData", "/Game", unreal.UserDefinedStruct, unreal.StructureFactory())
# Add variables to the structure
if structure_asset:
structure_asset.add_variable("Player ID", "int32")
structure_asset.add_variable("Team ID", "string")
structure_asset.add_variable("TeamName", "string")
...
...