Consolidates an asset by replacing all references/uses of the provided AssetsToConsolidate with references to AssetToConsolidateTo. This is useful when you want all references of assets to be replaced by a single asset. The function first attempts to directly replace all relevant references located within objects that are already loaded and in memory. Next, it deletes the AssetsToConsolidate, **leaving behind object redirectors to AssetToConsolidateTo. **The AssetsToConsolidate are DELETED by this function.: Modified objects will be saved if the operation succeeds.
I couldn’t find a straightforward API that mentions Redirectors. I expect something that would look like
fix_up_redirector(folder_path)
, but there is none, which is weird, considering that’s what you do exactly in the Editor.
Just stumbled upon your question because I currently try to do something similar. I develop a plugin where a “fixup redirectors” step would be included in a workflow.