Automating AnimMontage Asset Creation

Hello,
I am supporting a request from our animators to make a tool for generating AnimMontage assets for their newly imported AnimSequences. When I call create_asset for a new AnimMontage nothing is created. I believe the problem is the factory is missing a SourceAnimation or TargetSkeleton asset to build from but I can’t set these protected variables from Python. Any help on how I need to go about creating a brand new AnimMontage would be greatly appreciated.

Current test

unreal.AssetToolsHelpers.get_asset_tools().create_asset(asset_name=‘test’, package_path=‘/Game/’, asset_class=unreal.AnimMontage, factory=unreal.AnimMontageFactory())

unreal.AssetTools.create_asset_with_dialog(unreal.AssetToolsHelpers.get_asset_tools(), asset_name = "test", package_path = "/Game/", asset_class = unreal.AnimMontage,factory=unreal.AnimMontageFactory())

Thanks for help L1z. I want to create the asset without prompting the user with a dialog. To do that I learned I need to edit the AnimMontageFactory.h and tag the TargetSkeleton and SourceANimation with BlueprintReadWrite flag to allow python to set it.

UPROPERTY(BlueprintReadWrite)

This was useful for me thanks. Did you ever find a way to set the slot for the track?