# Casting Geometry Cache to Static Mesh

**URL:** <https://forums.unrealengine.com/t/casting-geometry-cache-to-static-mesh/1346231>\
**Category:** Programming & Scripting\
**Tags:** Editor-Utility, unreal-engine, Blueprint, question\
**Created:** [October 26, 2023, 11:50am UTC](https://forums.unrealengine.com/t/casting-geometry-cache-to-static-mesh/1346231 "2023-10-26T11:50:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![M3M3DE4LER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/m3m3de4ler/32/984846_2.png) [@M3M3DE4LER](https://forums.unrealengine.com/u/M3M3DE4LER)\
**Post date:** [October 26, 2023, 11:50am UTC](https://forums.unrealengine.com/t/casting-geometry-cache-to-static-mesh/1346231/1 "2023-10-26T11:50:06Z")

</div>

Hey folks

I’m trying to create an Editor Utility Blueprint that will let me change material assignments to Geometry Cache. The idea behind this is to be able to quickly change material assignments across multiple variations of the same asset.

The logic behind this would be that I select the Material Instance that I want to swap and get the Material Index of the selected material from the Geometry Cache. Then taking that Index, I would swap out the material at the index slot with a new Material Instance.

I’m not able to find is how to get Material Index out of a Geometry Cache asset type.

Any help would be appreciated!!

---

<div class="post-metadata">

**Author:** ![zorianflorian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zorianflorian](https://forums.unrealengine.com/u/zorianflorian)\
**Post date:** [December 18, 2024, 7:58pm UTC](https://forums.unrealengine.com/t/casting-geometry-cache-to-static-mesh/1346231/2 "2024-12-18T19:58:14Z")

</div>

have you found a solution to this?

---

<div class="post-metadata">

**Author:** ![M3M3DE4LER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/m3m3de4ler/32/984846_2.png) [@M3M3DE4LER](https://forums.unrealengine.com/u/M3M3DE4LER)\
**Post date:** [January 29, 2025, 6:08pm UTC](https://forums.unrealengine.com/t/casting-geometry-cache-to-static-mesh/1346231/3 "2025-01-29T18:08:24Z")

</div>

I ended up not casting and just used arrays to get this done. It’s not the most optimized way but it works for me.

I saved the material slot names and material assignments from the Geometry Cache asset in two separate arrays. Then the selected materials name would query through all the elements of the array to find and replace with the new materials.

I kept the material slot names because if I wanted to reset the material assignments, it wouldn’t be a pain.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 28, 2025, 6:08pm UTC](https://forums.unrealengine.com/t/casting-geometry-cache-to-static-mesh/1346231/4 "2025-02-28T18:08:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
