# How to create Macros for Material Functions?

**URL:** <https://forums.unrealengine.com/t/how-to-create-macros-for-material-functions/481471>\
**Category:** Rendering\
**Tags:** macro-library, macros, unreal-engine, question, Blueprint\
**Created:** [April 6, 2021, 11:10am UTC](https://forums.unrealengine.com/t/how-to-create-macros-for-material-functions/481471 "2021-04-06T11:10:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Syrill](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Syrill](https://forums.unrealengine.com/u/Syrill)\
**Post date:** [April 6, 2021, 11:10am UTC](https://forums.unrealengine.com/t/how-to-create-macros-for-material-functions/481471/1 "2021-04-06T11:10:34Z")

</div>

I wanted to create a macro for a material function, but it seems not possible to call the macro (library) from within a material function. Is there some tutorial available or is this just not possible?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 6, 2021, 11:40am UTC](https://forums.unrealengine.com/t/how-to-create-macros-for-material-functions/481471/2 "2021-04-06T11:40:52Z")

</div>

Material functions are the macros of the material world, you’re already there…

---

<div class="post-metadata">

**Author:** ![Syrill](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Syrill](https://forums.unrealengine.com/u/Syrill)\
**Post date:** [April 6, 2021, 12:00pm UTC](https://forums.unrealengine.com/t/how-to-create-macros-for-material-functions/481471/3 "2021-04-06T12:00:22Z")

</div>

Thank you. So there is no way to use “normal” macros inside material functions at all? As far as I can gather, the macros allow more flexibility, especially since I want to control the execution flow with it.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 6, 2021, 1:56pm UTC](https://forums.unrealengine.com/t/how-to-create-macros-for-material-functions/481471/4 "2021-04-06T13:56:01Z")

</div>

Macros are part of blueprints. They have nothing to do with materials.

I remember getting materials and blueprints confused when I first started. They look like each other, but they are not related at all.

---

<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:** [April 6, 2021, 2:11pm UTC](https://forums.unrealengine.com/t/how-to-create-macros-for-material-functions/481471/5 "2021-04-06T14:11:31Z")

</div>

> I want to control the execution flow

Materials don’t have _much_ flow control, you do have these:

![334928-screenshot-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/6/4/1644b3cc3b7016449a3c85c37d43cdb117892f35.png)

Usually combined with other math nodes. You run macros in the relevant blueprint and push values into parametrised dynamic material instances.
