# Preview Custom Primitive Data In Material Editor

**URL:** <https://forums.unrealengine.com/t/preview-custom-primitive-data-in-material-editor/489505>\
**Category:** Community & Industry Discussion\
**Tags:** data, unreal-engine, editor, custom, question\
**Created:** [October 4, 2021, 11:28am UTC](https://forums.unrealengine.com/t/preview-custom-primitive-data-in-material-editor/489505 "2021-10-04T11:28:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitrooo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nitrooo](https://forums.unrealengine.com/u/nitrooo)\
**Post date:** [October 4, 2021, 11:28am UTC](https://forums.unrealengine.com/t/preview-custom-primitive-data-in-material-editor/489505/1 "2021-10-04T11:28:25Z")

</div>

Is there any way to preview custom primitive data (per instance data) inside material editor? When I create a material parameter and set it to “Use Custom Primitive Data” with primitive data index 0, preview becomes black bacause the input value from such parameter inside material editor is 0. I know I can place an object in the world and add custom data in the rendering section of that object, but is there a way to preview it inside material editor?

---

<div class="post-metadata">

**Author:** ![NtrickN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ntrickn/32/474191_2.png) [@NtrickN](https://forums.unrealengine.com/u/NtrickN)\
**Post date:** [November 23, 2021, 1:08am UTC](https://forums.unrealengine.com/t/preview-custom-primitive-data-in-material-editor/489505/2 "2021-11-23T01:08:04Z")

</div>

You can set the Const Default Value of the PerInstanceCustomData node and it will reflect in the preview.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2f42a29e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2f42a29e](https://forums.unrealengine.com/u/anonymous_user_2f42a29e)\
**Post date:** [March 4, 2022, 10:54pm UTC](https://forums.unrealengine.com/t/preview-custom-primitive-data-in-material-editor/489505/3 "2022-03-04T22:54:54Z")

</div>

Needing to set default values other than 0 in PrimitiveCustomData in the Material View also.

There seems to be more limitation on the PerInstanceCustomData node, versus converting a parameter into using PrimitiveCustomData

Specifically getting Errors about invalid node in Pixel/null/domain. There are some comments about nodes that are incompatible with the PerInstanceCustomData node. Why are these limits not on the Parameter Custom Data workflow?

---

<div class="post-metadata">

**Author:** ![The\_Great\_Khanny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@The\_Great\_Khanny](https://forums.unrealengine.com/u/The_Great_Khanny)\
**Post date:** [April 10, 2024, 1:56pm UTC](https://forums.unrealengine.com/t/preview-custom-primitive-data-in-material-editor/489505/4 "2024-04-10T13:56:55Z")

</div>

add your Custom Initialization code in the UPrimitiveComponent::PostInitProperties() and PostLoad() and PostEditChange, and etc.  
such as:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/7/2479e35cca1d5d2178fb5c09084f7649dab05aaf.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/7/e975ea47e00973817638d46b6f7594ab0c285b02.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/5/87577e8ec20532851b8a7bc3b3bf057e94ef9ce2.png)

---

<div class="post-metadata">

**Author:** ![RikiBabs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RikiBabs](https://forums.unrealengine.com/u/RikiBabs)\
**Post date:** [August 10, 2024, 3:04am UTC](https://forums.unrealengine.com/t/preview-custom-primitive-data-in-material-editor/489505/5 "2024-08-10T03:04:05Z")

</div>

Its a bit of a workaround but you could just plase and Add node and put the custom data into the A slot - then plug that into your graph. It will change the default to 1 at least. Better than having everything black.

---

<div class="post-metadata">

**Author:** ![Pierrax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pierrax/32/596699_2.png) [@Pierrax](https://forums.unrealengine.com/u/Pierrax)\
**Post date:** [November 27, 2024, 6:29pm UTC](https://forums.unrealengine.com/t/preview-custom-primitive-data-in-material-editor/489505/6 "2024-11-27T18:29:41Z")

</div>

> Its a bit of a workaround but you could just plase and Add node and put the custom data into the A slot - then plug that into your graph. It will change the default to 1 at least. Better than having everything black.

This, this is the solution.
