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.

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.

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

Last updated