Announcement

Collapse
No announcement yet.

Python scripting to fix up redirectors in a folder?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Python scripting to fix up redirectors in a folder?

    Other than the project-wise redirector fixing, i.e.:


    Code:
    UE4Editor.exe <GameName or uproject> -run=ResavePackages -fixupredirects -autocheckout -projectonly -unattended

    could we fix up redirectors in a specified folder through scripting as we do with the context menu in the Content Browser?

    I briefly looked at the high-level API in EditorAssetLibrary, other than


    Code:
    consolidate_assets(asset_to_consolidate_to, assets_to_consolidate) → bool

    which does some obscure things:

    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
    Code:
    fix_up_redirector(folder_path)
    , but there is none, which is weird, considering that's what you do exactly in the Editor.
    Last edited by kakyoism; 04-22-2019, 07:31 PM.
Working...
X