issue with instantiating AssetTool class from unreal python module

I’m trying to use the following code to create a sequence in UE using python:

new_sequence = unreal.AssetTools().create_asset(‘testSequence’, ‘/Game/Cinematics/’, unreal.LevelSequence, unreal.LevelSequenceFactoryNew)

unfortunately, i get this exception:
LogPython: Error: Exception: AssetTools: Class ‘AssetTools’ is abstract

I’m somewhat confused as to why instantiating the AssetTools class is coming back with these kinds of errors, and was hoping someone could clarify a bit for me

Thank you!

I know it’s late, but I also stumbled into the same problem and couldn’t find a solution. To get an instance you need to call: unreal.AssetToolsHelpers.get_asset_tools().

tools = unreal.AssetToolsHelpers.get_asset_tools()
tools.create_asset_with_dialog(
    asset_name="landinio",
    package_path="/Game/wut",
    asset_class=unreal.Material,
    factory=unreal.MaterialFactoryNew(),
)

In the actual definition from unreal.py you can see the AssetTools as: class AssetTools(Interface):. It would be nice to have some documentation instead of guess searching things, but that’s the way things are.

The previous code works and creates a material using a dialog.

1 Like