# creating dynamic material instances from csv file 

**URL:** <https://forums.unrealengine.com/t/creating-dynamic-material-instances-from-csv-file/2443142>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [April 6, 2025, 1:09pm UTC](https://forums.unrealengine.com/t/creating-dynamic-material-instances-from-csv-file/2443142 "2025-04-06T13:09:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CiaranFrench](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CiaranFrench](https://forums.unrealengine.com/u/CiaranFrench)\
**Post date:** [April 6, 2025, 1:09pm UTC](https://forums.unrealengine.com/t/creating-dynamic-material-instances-from-csv-file/2443142/1 "2025-04-06T13:09:34Z")

</div>

Is there a way to drive the RGB material values of a single object that has multiple instances from a csv file where the index of the object instance and the index of the rgb values from the csv align?

Cheers

 ![csv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/9/3/49362fb4c372bf38c3e30a8eef96ad3933d5e0d3.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/e/25e4c626245dfc0ef75ecb16fda9703ef6e0c1aa.jpeg)

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [April 6, 2025, 1:46pm UTC](https://forums.unrealengine.com/t/creating-dynamic-material-instances-from-csv-file/2443142/2 "2025-04-06T13:46:32Z")

</div>

Yes there is a way.

Your problem is basically two (and quite standard) tasks:

- read bunch of numbers from CVS. You can find tutorials about that.
- second part is dynamically creating array of dynamic material instances, which is also standard task

However i ma not really certain:  
do you want dynamic instanced materials, or bunch of instanced not dynamic materials?

So, all you want is to read those numbers and create instanced materials out of them.  
Or you want to read those numbers and have them dynamically changing during runtime?

Because for reading bunch of CSV numbers then making batch task in editor that creates bunch on instanced materials. You need to watch tut about making blueprintable unreal editor tools.

For that tool all you need is event that you can trigger from actor that holds that mesh from picture. Event should create instanced materials in some folder, then apply them to meshes or components or material slots in mesh.

Get CSV into data table:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/0/420d0dd88a81aaec3fbdfefb67e611a5158bbd49.jpeg "Import CSV into DataTable UE5 - Unreal Engine 5 Tutorial") ](https://www.youtube.com/watch?v=AKrWTVqTYBQ)

instanced materials:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/a/e/6ae6ac76048cee825e4f7204bc8ea688ee4eabb8.jpeg "How to Create a Material Instance in Unreal Engine 5") ](https://www.youtube.com/watch?v=FzFtht_kMCc)

And for tool that processes it all:

- make actor that keeps that bars mesh as component.
- make event that is "EVENT\_process\_csv

in that event: read that CVS into table

- read CVS into table
- go trough table and create instanced materials (you should work with material assets on disc not loaded copies in memory).
- change their parameter, and save back. (to asset on disc!)
- assign materials to slots

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [April 6, 2025, 2:03pm UTC](https://forums.unrealengine.com/t/creating-dynamic-material-instances-from-csv-file/2443142/3 "2025-04-06T14:03:16Z")

</div>

And i just asked my Yellow Rubber Duck about whole task (and checked if it is not total derpy derp ajj).

This is rubbers duck reply:

## GOAL

Create and save multiple **Material Instance Constants** on disk:

- Based on a **master material**.
- Each with a different **LinearColor parameter** set (e.g., RGBA values).
- Named and saved in a desired folder.

## 🧱 REQUIRED SETUP

### 1. **Enable These Plugins:**

- ✅ **Editor Scripting Utilities** (`Edit > Plugins > Editor`)
- ✅ **Asset Tools Editor**

Then **restart the editor**.

### 3. **Variables Setup**

| Variable Name | Type | Details |
| --- | --- | --- |
| `MaterialTemplate` | `MaterialInterface` | Expose On Spawn |
| `OutputFolder` | `String` | Default: `/Game/Materials/Instances` |
| `ColorArray` | `LinearColor Array` | Colors to assign |
| `ParameterName` | `Name` | Default: `ColorTint` or your param name |

### 4. **Function: `GenerateMaterialInstances`**

Inside your EUB, add a custom function (or just logic in `Run` if you prefer) with the following:

### 🧠 Full Node Logic (in text form):

#### Loop over `ColorArray` (using **For Each Loop** )

Inside the loop:

1. **Create a New Material Instance Constant Asset**

- Use node: `Create Asset`
- **Asset Name** : `"MI_Color_" + Index`
- **Package Path** : `OutputFolder`
- **Factory** : `MaterialInstanceConstantFactoryNew`
- **Set Factory’s Parent** to `MaterialTemplate`

1. **Cast to MaterialInstanceConstant** → Store as `NewInstance`
2. **Set Vector Parameter**

- Use: `Set Vector Parameter Value`
- Target: `NewInstance`
- Parameter: `ParameterName`
- Value: Current `LinearColor`

1. **Save the Asset**

- Use: `Save Asset` (optional if you want to be safe)

Looks mostly correct, however that worst part about chatGPT, answers always look correct then it does totally bogus error in middle of all of it. But at least you have general idea described step by step.

---

<div class="post-metadata">

**Author:** ![CiaranFrench](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CiaranFrench](https://forums.unrealengine.com/u/CiaranFrench)\
**Post date:** [April 8, 2025, 3:52pm UTC](https://forums.unrealengine.com/t/creating-dynamic-material-instances-from-csv-file/2443142/4 "2025-04-08T15:52:03Z")

</div>

Legend, thanks so much mate

---

<div class="post-metadata">

**Author:** ![ShadowBr0kerz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shadowbr0kerz/32/1201558_2.png) [@ShadowBr0kerz](https://forums.unrealengine.com/u/ShadowBr0kerz)\
**Post date:** [October 23, 2026, 7:57pm UTC](https://forums.unrealengine.com/t/creating-dynamic-material-instances-from-csv-file/2443142/5 "2026-10-23T19:57:49Z")

</div>

two halves to this: reading the csv and pushing the values into material params  
reading csv rows at runtime is easiest if you import it as a data table asset and call get data table row, that works in packaged builds too, then loop your instances and set the vector parameter from each row  
if you need players to point at their own csv file on disk instead you can also try Async Runtime File Dialog, a runtime file picker for Unreal Engine that opens a native open dialog with a csv filter from blueprint: [Async Runtime File Dialog — Native OS File Picker for Blueprints | Fab](https://www.fab.com/listings/0044ee86-6930-4839-931a-bd63bf6ea34f)
