@robberyman
Yes I work on 4.27.2 not 5.x
I forgot the menu for a time, and start with a simple script.
I succeed to do something in full Python, it’s not perfect but do the job
BUUUUT, If I closed the UE4, and restart it, materials lose the link to textures …
I don’t know how I can fix that, or even if it’s possible …
import unreal
prefixTexture2D = "T_"
prefixMaterialInstance = "MIC_"
workingPath = "/Game/TEST_IMPORT/BKP"
@unreal.uclass()
class MyEditorAssetLIbrary(unreal.EditorAssetLibrary):
pass
def GetProperPrefix(className):
_prefix = ""
if className == "Texture2D":
_prefix = prefixTexture2D
elif className == "MaterialInstanceConstant":
_prefix = prefixMaterialInstance
else:
_prefix = ""
return _prefix
editorAssetLib = MyEditorAssetLIbrary()
allAssets = editorAssetLib.list_assets(workingPath, True, False)
allAssetsCount = len(allAssets)
selectedAssetPath = workingPath
editorAssetLib.make_directory(workingPath+"/Textures_")
editorAssetLib.make_directory(workingPath+"/Materials_")
with unreal.ScopedSlowTask(allAssetsCount, selectedAssetPath) as ST:
ST.make_dialog(True)
for asset in allAssets:
_assetData = editorAssetLib.find_asset_data(asset)
_assetName = _assetData.get_asset().get_name()
_assetPathName = _assetData.get_asset().get_path_name()
_assetClassName = _assetData.get_asset().get_class().get_name()
_assetPrefix = GetProperPrefix(_assetClassName)
print("_assetClassName : "+_assetClassName)
if _assetClassName == "MaterialInstanceConstant": _assetPathOnly = workingPath+"/Materials/"
if _assetClassName == "Texture2D": _assetPathOnly = workingPath+"/textures/"
if _assetPrefix in _assetName:
continue
elif _assetPrefix == "":
continue
else:
_targetPathName = _assetPathOnly + ("%s%s%s" % (_assetName, ".", _assetName))
editorAssetLib.rename_asset(_assetPathName, _targetPathName)
unreal.log(">>>>>> moving [%s] to [%s]" %(_assetPathName, _targetPathName))
if ST.should_cancel():
break
ST.enter_progress_frame(1, asset)
Edit: interesting, if I open a material, save it again, and close it before restart UE4, I’ve not problem of “white material” anymore. Maybe if save asset after move them ( specially materials ) : it could be works. 
Edit2: YES! It was that, it works ! I added :
# force save asset to avoid f***g white materials !!
editorAssetLib.save_asset(_targetPathName)
…
Now it could be cool to add all of that to your menu @robberyman to get my “workingPath” on the fly, but I don’t know how to get it