# Find texture and apply it to the material

**URL:** <https://forums.unrealengine.com/t/find-texture-and-apply-it-to-the-material/427465>\
**Category:** Rendering\
**Tags:** unreal-engine, find, question, Blueprint\
**Created:** [June 15, 2018, 6:42pm UTC](https://forums.unrealengine.com/t/find-texture-and-apply-it-to-the-material/427465 "2018-06-15T18:42:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![t0msk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t0msk/32/614638_2.png) [@t0msk](https://forums.unrealengine.com/u/t0msk)\
**Post date:** [June 15, 2018, 6:42pm UTC](https://forums.unrealengine.com/t/find-texture-and-apply-it-to-the-material/427465/1 "2018-06-15T18:42:25Z")

</div>

Hello,

I have folder called Textures and inside that folder I have lot of textures (about 100) and I would like to dynamically apply it to the actor (mesh).

Problem is that I don’t know how to find texture from string. I know that I have to create Material Instance with param Texture and I can add texture to that param and then apply that Material to the mesh (actor).

But I don’t know how to find that texture. Imagine that you have function called ApplyTexture like this, and you have only string:

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/d/f8dce83f6d45f7d1acbd921f2911aee49c360813.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b5b115c41](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b5b115c41](https://forums.unrealengine.com/u/anonymous_user_b5b115c41)\
**Post date:** [June 15, 2018, 10:05pm UTC](https://forums.unrealengine.com/t/find-texture-and-apply-it-to-the-material/427465/2 "2018-06-15T22:05:12Z")

</div>

You won’t be able to find it by searching the folder hierarchy. You’ll want a list or table to reference that contains the textures with a unique identifier (could be a string, int, Name, etc).

You could do this with a Map or a Data Table, but I think a map is probably the simplest.

Like so:

 ![244444-example.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/1/ab19b7731b7e33ce32e71f24dbe7de7552317544.png)

---

<div class="post-metadata">

**Author:** ![t0msk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t0msk/32/614638_2.png) [@t0msk](https://forums.unrealengine.com/u/t0msk)\
**Post date:** [June 15, 2018, 10:19pm UTC](https://forums.unrealengine.com/t/find-texture-and-apply-it-to-the-material/427465/3 "2018-06-15T22:19:58Z")

</div>

But for example if I had 500 textures, then I had to manually each texture import to the Map?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b5b115c41](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b5b115c41](https://forums.unrealengine.com/u/anonymous_user_b5b115c41)\
**Post date:** [June 15, 2018, 10:56pm UTC](https://forums.unrealengine.com/t/find-texture-and-apply-it-to-the-material/427465/4 "2018-06-15T22:56:56Z")

</div>

If you want to do this all through Blueprint, I believe so. With C++, you may be able to find specific assets by file path. I haven’t done that before, but I’m sure it’s possible. You can read up on the Asset Manager and Asset Bundles as a possible starting point in getting and loading bundles of assets.

Alternatively, Data Tables and a script to write a CSV file for import might be able to accomplish a similar result, although I’m not sure if getting an asset reference that way is possible.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [June 15, 2018, 11:00pm UTC](https://forums.unrealengine.com/t/find-texture-and-apply-it-to-the-material/427465/5 "2018-06-15T23:00:04Z")

</div>

@t0msk: if you have this data in a spreadsheet, you could use a data table. You can fetch items by Row Name. Look up Structs and DataTables on YT to get the hang of it.

You could use a DT directly. Or you can use it to build a Map dynamically, like in dachora1’s example.

---

<div class="post-metadata">

**Author:** ![t0msk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t0msk/32/614638_2.png) [@t0msk](https://forums.unrealengine.com/u/t0msk)\
**Post date:** [June 16, 2018, 3:30pm UTC](https://forums.unrealengine.com/t/find-texture-and-apply-it-to-the-material/427465/6 "2018-06-16T15:30:39Z")

</div>

@dachora1 It can be found by searching the folder, you can use:

> **[Get Asset by Object Path (Message)](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/AssetRegistry/GetAssetbyObjectPath_Message/)**
>
> Get Asset by Object Path (Message)
