No announcement yet.

Checking an asset's "Source File"

  • Filter
  • Time
  • Show
Clear All
new posts

    Checking an asset's "Source File"

    I'm trying to build a utility that checks to see if all of my assets that are in a project have "Source Files" that are located within the project. I want to ensure that source control for the ue4 project includes all of the source that assets were built from. I only need to generate a text report that I can use as a reference to find the source files that are in the wrong place.

    I've started building a plugin that grabs filtered assets via the AssetRegistryModule.Get().Get().GetAssetsByPath(), but now with this list of my assets in the format of FAssetData, I don't see a way to check their "Source File", only their name, package, and similar info.

    Is there a way to pull the Source File info from FAssetData struct?
    Am I going about this the right way with Asset Registry? I'm not yet convinced that I haven't missed an easier solution.

    Thanks for your help!

    For those interested, I ended up solving this with the following engine tools in a UE4 plugin

    Core UE4 tools used (Check online docs if you want to know more details)
    AssetRegistry and FARFilter - How we get all assets in the project, use the filter to only grab things with a source asset
    IFileManager - File copy utility
    FPaths - path management
    FReimportManager - singleton used to reimport specific asset
    FEditorFileUtils - Save dirty packages after reimport
    ISourceControlModule - source control history reading