How to Store the Source file Path with Relative Path

I wonder Is there a way to Import Assets and Remember the source files with their relative path.I think “Shooter Game” have already done it but i don’t know how to set.

122350-relativepath.jpg

And this “Source File” Can’t write, and if I browser a new source file or import a new asset, it just give me a absolute path.

122361-relativepath2.jpg

I’m managing a unreal project. Aside the unreal project is our art resource folder, they’re like this:

122349-projectstructure.jpg

In the Example “Shooter Game” Project, I know assets’ source file path can be relative path and it’s easy to keep the relationship like reimport between UAsset and Source file. And I also create a faked folder to test it should work.
It will be friendly to keep art resource be independent with unreal project and reimport any asset through the relative path wherever their parent folder be placed.

En, And I also tried Auto Reimport Setting. it can be auto import by relative path but “Source File” is still absolute path.

Hei, just add RelativePath to the list of meta properties, like so:

/** Just a demo property */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Demo", meta = (RelativePath))
FDirectoryPath TestPath;
1 Like

I don’t know how to override Unreal Native Asset Importer using UPROPPERTY. I mean the Asset like a .fbx file which can be imported to Unreal Editor and turn into a UAsset, Not a property reference in my BP or C++ Class. The “Source File” Path of the UAsset’ Import Setting is absolute path.If I can use a property to fix that, where should I modify with "meta = (RelativePath) "?

122496-source+file.png

The “Source File” Setting In Picture is what I want to modify to Relative Path.

RelativePath only workds for FDirectoryPath and not for FilePath (which points to single file instead of whole directory). Is there a way to make FilePath relative?

1 Like