# How to get disk or SourceControl path from an asset's game path (Blueprint or python)

**URL:** <https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706>\
**Category:** Editor Scripting\
**Tags:** Python, unreal-engine, Source-Control, question\
**Created:** [May 21, 2021, 10:29am UTC](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706 "2021-05-21T10:29:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_077a2248](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_077a2248](https://forums.unrealengine.com/u/anonymous_user_077a2248)\
**Post date:** [May 21, 2021, 10:29am UTC](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706/1 "2021-05-21T10:29:57Z")

</div>

Hi,

I’ve got an asset path (‘/Game/…’) and I want to convert it to the SourceControl depot path (‘//…/Content/…’) or at least to the local path (on my local disk).  
I’ve not found anything in Paths or SourceControl documentation.

I could do something like this :  
game\_asset\_path.replace(‘/Game/’, unreal.Paths.project\_content\_dir())

but the file extension is different between the asset (‘my\_asset\_name.my\_asset\_name’) and the file (‘my\_asset\_name.uasset’) so I can’t deduce it from it.

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [May 21, 2021, 3:21pm UTC](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706/2 "2021-05-21T15:21:29Z")

</div>

Hello! You can try this

- let **path** will be asset path
- if **path** contains “.” then take part to the left of it (throw away dot itself also)
- add proj prefix to **path**

That should be it…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_077a2248](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_077a2248](https://forums.unrealengine.com/u/anonymous_user_077a2248)\
**Post date:** [May 21, 2021, 3:37pm UTC](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706/3 "2021-05-21T15:37:12Z")

</div>

Thanks for the reply, but if I want to perform operations on my local file, I need its full path, extension included.  
Currently I assume it’s a .uasset and I’m doing what you suggest + adding ‘.uasset’ at the end of the full\_path.  
But if a user calls this function to query a level file path, then it’s not valid as level files extensions are ‘.umap’.

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [May 21, 2021, 4:03pm UTC](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706/4 "2021-05-21T16:03:52Z")

</div>

At the moment I dont find if there is common way to get .tail part from assets… Even in plugin copy code they use just a list of cases as strings… it seems that there is no common and easy way to get that… As for practical thing - you can just collect all existing .tails and create simple replcaer for them

---

<div class="post-metadata">

**Author:** ![josef.struz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@josef.struz](https://forums.unrealengine.com/u/josef.struz)\
**Post date:** [June 28, 2022, 7:41am UTC](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706/5 "2022-06-28T07:41:42Z")

</div>

You are looking for get\_system\_path function from SystemLibrary [unreal.SystemLibrary — Unreal Python 4.27 (Experimental) documentation](https://docs.unrealengine.com/4.27/en-US/PythonAPI/class/SystemLibrary.html?highlight=system_path#unreal.SystemLibrary.get_system_path)

---

<div class="post-metadata">

**Author:** ![LocalDisabledMan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/localdisabledman/32/952237_2.png) [@LocalDisabledMan](https://forums.unrealengine.com/u/LocalDisabledMan)\
**Post date:** [February 18, 2024, 10:22am UTC](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706/6 "2024-02-18T10:22:19Z")

</div>

dont know if this is the right thing

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/e/7/8e7041731eca273c74a49740236cc8e51e812ffd.png)

You get the asset import data property from the object property then you put it into a asset import data cast (ex: FBX) and then get the filename function from the cast, and there you have it

Asset import types:

> **[UAssetImportData](https://docs.unrealengine.com/4.26/en-US/API/Runtime/Engine/EditorFramework/UAssetImportData/)**
>
> Todo: Make this class better suited to multiple import paths - maybe have \[FAssetImportInfo\](API\\Runtime\\Engine\\EditorFramework\\FAssetImportInfo) use a map rather than array?

---

<div class="post-metadata">

**Author:** ![Dobbie1992](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dobbie1992](https://forums.unrealengine.com/u/Dobbie1992)\
**Post date:** [July 9, 2024, 9:14am UTC](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706/7 "2024-07-09T09:14:04Z")

</div>

> [@How to get disk or SourceControl path from an asset's game path (Blueprint or python)](https://forums.unrealengine.com/t/how-to-get-disk-or-sourcecontrol-path-from-an-assets-game-path-blueprint-or-python/483706/5):
>
> You are looking for get\_system\_path function from SystemLibrary [unreal.SystemLibrary — Unreal Python 4.27 (Experimental) documentation](https://docs.unrealengine.com/4.27/en-US/PythonAPI/class/SystemLibrary.html?highlight=system_path#unreal.SystemLibrary.get_system_path)

Really Helpful! In Blueprint, you can use [Unreal Engine API Reference | Unreal Engine 4.27 Documentation](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Utilities/GetSystemPath/)
