In python it’s pretty simple:
import unreal as ue
editor_util = ue.EditorUtilityLibrary()
editor_asset_lib = ue.EditorAssetLibrary()
material_lib = ue.MaterialEditingLibrary()
def SetParentMaterial():
default_material_path = "Material'/Game/Props/Reparent.Reparent'"
materialToReparent = editor_asset_lib.load_asset(default_material_path)
selected_assets = editor_util.get_selected_assets()
for asset in selected_assets:
material_lib.set_material_instance_parent(asset, materialToReparent)
editor_asset_lib.save_loaded_asset(asset,False)
SetParentMaterial()
Be careful: this doesn’t have any check inside it, be sure to select the correct materials and the correct parent path!
Always try with a single asset before running a batch!