# Assigning Materials to Geometry Caches with Python

**URL:** <https://forums.unrealengine.com/t/assigning-materials-to-geometry-caches-with-python/684759>\
**Category:** Editor Scripting\
**Tags:** unreal-engine, UE5-0, Alembic, question\
**Created:** [November 5, 2022, 7:45pm UTC](https://forums.unrealengine.com/t/assigning-materials-to-geometry-caches-with-python/684759 "2022-11-05T19:45:07Z")\
**Posts on this page:** 1\
**Page:** 1

<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:45pm UTC](https://forums.unrealengine.com/t/assigning-materials-to-geometry-caches-with-python/684759/1 "2022-11-05T19:45:07Z")

</div>

Trying to assign materials based on name. This is not working for GeometryCaches. The material slot names come up empty. Can you see why?

```python
geom_cache_list = []
# directory of alembic imports
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 []

```
