# Python: Getting the source file of a texture map

**URL:** <https://forums.unrealengine.com/t/python-getting-the-source-file-of-a-texture-map/156405>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [January 15, 2021, 6:58pm UTC](https://forums.unrealengine.com/t/python-getting-the-source-file-of-a-texture-map/156405 "2021-01-15T18:58:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mad\_guru](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mad\_guru](https://forums.unrealengine.com/u/mad_guru)\
**Post date:** [January 15, 2021, 6:58pm UTC](https://forums.unrealengine.com/t/python-getting-the-source-file-of-a-texture-map/156405/1 "2021-01-15T18:58:03Z")

</div>

Hi,

I’m trying to get the source file of a texture map asset via python. I can get all the Texture2D maps, but I am not sure how to get the source file. I saw that there is an AssetImportData and asset\_import\_data flag or command, but I am not sure how to use them, or if they work on an asset.

Also, I often have to dig around to get clarity on python command usage for unreal. is there a way to query examples/flags etc in the python command prompt in Unreal?

```auto

asset_registry = unreal.AssetRegistryHelpers.get_asset_registry()
all_assets = asset_registry.get_assets_by_path('/Game', recursive=True)
for asset in all_assets:
    if asset.asset_class == 'Texture2D':
        print asset.asset_name
        print asset.object_path
        print unreal.AssetImportData(asset)
        print asset_import_data = asset.asset_import_data()

```

Thank you.

Adnan Hussain

---

<div class="post-metadata">

**Author:** ![cgsquirrel2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cgsquirrel2](https://forums.unrealengine.com/u/cgsquirrel2)\
**Post date:** [January 18, 2021, 4:55am UTC](https://forums.unrealengine.com/t/python-getting-the-source-file-of-a-texture-map/156405/2 "2021-01-18T04:55:43Z")

</div>

I usually do this if I have selected an asset in the content browser

```auto

assets = unreal.EditorUtilityLibrary.get_selected_assets()
unreal.log(assets[0].get_editor_property("asset_import_data").get_first_filename())

```

Based on your code you will need to go from AssetData to the main asset object then “get\_editor\_property(“asset\_import\_data”).get\_first\_filename()”
