[Python API] "Rename Directory" function no longer works in 5.1?

Hi,

The “rename directory” function no longer works in version 5.1, and I wonder if anyone found a solution.
I have tried both EditorAssetLibrary and EditorAssetSubsystem, but both don’t work.

Any suggestions would be greatly appreciated.

[Code 1]
import unreal
unreal.EditorAssetLibrary.rename_directory(“/Game/From” , “/Game/To”)

[Log 1]
Error: /Game/From/test - Invalid object name
Couldn’t rename ‘Blueprint /Game/From/test.test’.
LogEditorAssetSubsystem: Error: RenameDirectory failed: Could not rename the assets.

[Code 2]
unreal.get_editor_subsystem(unreal.EditorAssetSubsystem).rename_directory(“/Game/From” , “/Game/To”)

[Log 2]
Error: /Game/From/test - Invalid object name
Couldn’t rename ‘Blueprint /Game/From/test.test’.
LogEditorAssetSubsystem: Error: RenameDirectory failed: Could not rename the assets.

Bump the question

Hey @reverie195, I’m not sure what the underlying cause is, but I added a utility script to my github repo for Python in Unreal that should do the trick. Under the hood, I think all it’s doing is a rename operation anyways. :stuck_out_tongue:

Small Note: renaming things in Unreal can cause unpredicted side-effects/issues, so use with discretion :stuck_out_tongue:

Github Link: https://github.com/aaronbcarlisle/unreal-python-dev/blob/master/python/editor_utils/asset_utils.py

Gist Link (if that’s easier): https://gist.github.com/aaronbcarlisle/8c0719ee3fc82c857213b3987c33ff6c