# MakeCustomVerts not work,why?

**URL:** <https://forums.unrealengine.com/t/makecustomverts-not-work-why/2101380>\
**Category:** UI\
**Tags:** c-c, draw, paint, c-class-wizard, c-and-bluepri, c-custommeshcomponen, c-and-blueprint, c-error, c-class, c-custom-shape, c-programming, c-cone-shape, unreal-engine, slate, question, CPP, UMG\
**Created:** [November 2, 2024, 8:38pm UTC](https://forums.unrealengine.com/t/makecustomverts-not-work-why/2101380 "2024-11-02T20:38:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![user\_6262892adb6307c799b8164fc908d9622ede9b69f191ac7c2ee715](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@user\_6262892adb6307c799b8164fc908d9622ede9b69f191ac7c2ee715](https://forums.unrealengine.com/u/user_6262892adb6307c799b8164fc908d9622ede9b69f191ac7c2ee715)\
**Post date:** [November 2, 2024, 8:38pm UTC](https://forums.unrealengine.com/t/makecustomverts-not-work-why/2101380/1 "2024-11-02T20:38:50Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/2/772f00822337ef7bd8a70afa9426bf53210334de.png)

```auto
	UFUNCTION(blueprintCallable, Category = "Mybpf")
	static void DrawVtx(UPARAM(ref) FPaintContext& Context,
		FWidgetTransform InTransform,
		USlateBrushAsset* Brush,
		TArray<FVector2f> Vertexs,
		TArray<int> Indexs
		)
	{
		TArray<FSlateVertex> vertexs;
		TArray<SlateIndex> indexs;
		auto RenderTransform = InTransform.ToSlateRenderTransform();
		for (auto vtx : Vertexs)
		{
			vertexs.Add(
			FSlateVertex::Make<ESlateVertexRounding::Disabled>(RenderTransform, vtx, FVector2f(),FColor(1,1,1,1))
				);
		}
		for (auto idx : Indexs)
		{
			indexs.Add(idx);
		}
		
		FSlateResourceHandle handle = FSlateApplication::Get().GetRenderer()->GetResourceHandle(Brush->Brush);
		Context.MaxLayer++;
		FSlateDrawElement::MakeCustomVerts(	Context.OutDrawElements,Context.MaxLayer,handle,vertexs,indexs,nullptr,0,0);
	}

```
