> For the complete documentation index, see [llms.txt](https://dilly.gitbook.io/dilly/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dilly.gitbook.io/dilly/deformer-graph/setup-graph.md).

# Setup graph

Setup graphs are essentially the "Begin play" method of deformer graphs. They execute once when a graph is set on a skinned mesh. Setup graph is where you can do complex initialization logic that would be expensive or unnecessary to run in the update graph, or clear out resource buffers.&#x20;

Clearing or resetting resource buffers in the setup graph is crucial to ensure they don't contain old data. When you unset/remove a deformer graph from a skinned mesh (or destroy the actor the deformer graph is acting on), the values inside the resource buffers remain in GPU memory. That means if you re-apply the graph at a later time, old data can still be in the buffers, which can lead to undesired results or break a mesh completely.

<figure><img src="/files/YQyhezKR82DMEwlWBPPg" alt=""><figcaption></figcaption></figure>

This code demonstrates initializing the VectorBuffer resource with a value of 0,0,0 when the graph is applied:

<figure><img src="/files/7RajTghDA73cI3EYgWjY" alt=""><figcaption></figcaption></figure>
