# Apply materials to a Geometry Cache in scripted action

**URL:** <https://forums.unrealengine.com/t/apply-materials-to-a-geometry-cache-in-scripted-action/481881>\
**Category:** Rendering\
**Tags:** Blueprint-Utilities, Blutilities, unreal-engine, functions, Alembic, question, Blueprint\
**Created:** [April 14, 2021, 1:36am UTC](https://forums.unrealengine.com/t/apply-materials-to-a-geometry-cache-in-scripted-action/481881 "2021-04-14T01:36:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lcraq01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lcraq01](https://forums.unrealengine.com/u/Lcraq01)\
**Post date:** [April 14, 2021, 1:36am UTC](https://forums.unrealengine.com/t/apply-materials-to-a-geometry-cache-in-scripted-action/481881/1 "2021-04-14T01:36:14Z")

</div>

Hi

I’m trying to make a blutility that will apply an array of materials to an .abc import, Geometric Cache’s material slots one after the other. This is to save time and apply the imported character’s materials all at once.

I’ve managed to make a simple version that can work for a static mesh using a material array (blueprint in .png).  
However I can’t seem to find an equivalent “Set Material” Function for a Geometry Cache’s material slots. Thanks in advance you have any info on how to ge this working.

 ![335819-materiallist-forstaticmesh.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/b/4ebde3511e83a7c63bf5869a773570aec5525c62.png)

---

<div class="post-metadata">

**Author:** ![geordiem](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@geordiem](https://forums.unrealengine.com/u/geordiem)\
**Post date:** [November 5, 2022, 7:41pm UTC](https://forums.unrealengine.com/t/apply-materials-to-a-geometry-cache-in-scripted-action/481881/2 "2022-11-05T19:41:18Z")

</div>

I too am trying to do this with Python. the material slot names come up as an empty list. Here is an example of what I’m trying to do. Maybe I’ll try what @Lcraq01 is doing and cast to a Static mesh first.

```python
geom_cache_list = []
target_content = unreal.EditorAssetLibrary.list_assets("/Game/HR/Seq/Cloth/")
for each in target_content:     
    asset_data = unreal.EditorAssetLibrary.find_asset_data(each)

    asset_class = asset_data.get_editor_property('asset_class')
    if asset_class == "GeometryCache":
        geom_cache_list.append(each)

for item in geom_cache_list:    
    geom_cache = unreal.load_asset(item)
    gc_component = unreal.GeometryCacheComponent()
    gc_component.set_geometry_cache(geom_cache)
    msn = gc_component.get_material_slot_names()
    print(f"msn: {msn}")
    # result []

```
