# Custom graph and PCGPainterActor

***

{% embed url="<https://www.youtube.com/watch?v=eBXwmPBT4C4>" %}
Latest features video documentation
{% endembed %}

***

## PCG points to graphs

As said at the [Tool documentation](/cgtoolbox-docs/pcg-painter/tool-documentation.md#tool-location), the tool works in steps, it generates the scattered points then executes a custom graph created by the user, with those points as inputs.

The core graph which will generate the root and scattered points is "PCG\_PainterGraphPreparePoints". It can be found in PCGPainter/PCGGraph folder.

In this graph, a node "Execute PCG graph processor" will execute the custom graph selected by the user or the graph set in custom PCGPainterActor.

<figure><img src="/files/yjhbdd9XIRh7gNcooKw0" alt=""><figcaption><p>The core PCG graph "PCG_PainterGraphPreparePoints"</p></figcaption></figure>

An exampler of PCG graph processor is available in the "PCGPainterData" folder "PCG\_PainterExample"

Few attributes are available to help you build the systems you need:

* \_\_BrushCustomData (int, from 0 to  9)
* \_\_BrushRadius (float)
* \_\_BrushStrokeId (int)
* \_\_PainterImpactNormal (vector, inverted object hit normal)
* \_\_BrushSampleCount (int)
* \_\_RootPoint (int, 0 or 1)
* \_\_RayCastLengh (float)
* ActorReference (SoftRef)
* PhysicalMaterial (SoftRef)

<figure><img src="http://cgtoolbox.com/wp-content/uploads/2024/11/image-21-1024x391.png" alt=""><figcaption><p><em>Example of a simple PCG graph processor ( PCG_PainterExample ).</em></p></figcaption></figure>

***

## Custom PCGPainterActor

A custom BP actor can be used to process the painted points, it can embbed a PCG process graph of your choice, expose parameters or add any custom features you'd need.

{% hint style="info" %}
You can see an example here in the PCGPainterData folder:\
\
/Game/PCGPainterData/CustomPainterActor
{% endhint %}

To create a custom PCGPainterActor BP, it must be of type "PCGPainterActor":

<figure><img src="https://cgtoolbox.com/wp-content/uploads/2025/03/image-1.png" alt=""><figcaption><p><em>Creation of a new custom PCGPainter actor</em></p></figcaption></figure>

Then you can set the PCG graph you want to use to process the painted point directly in the PCG component of the actor:

<figure><img src="https://cgtoolbox.com/wp-content/uploads/2025/03/image-2-1024x1004.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
As the PCG graph is embedded directly in the actor, the pcg painter UI widget will not ask you to select it.

![](/files/R97J8U2ATe5Ng22Lj7sG)
{% endhint %}

Any parameters added in the category "Painter Parameters" will be exposed when "instance parameters" option is checked on.\
As seen in the CustomPainterActor example:<br>

<figure><img src="https://cgtoolbox.com/wp-content/uploads/2025/03/image-3.png" alt=""><figcaption><p><em>Note that the parameters must be public of course</em></p></figcaption></figure>

\
Example of parameters exposed which can be edited directly from the PCG Painter UI:

<figure><img src="https://cgtoolbox.com/wp-content/uploads/2025/03/image-4-1024x452.png" alt=""><figcaption></figcaption></figure>

\
Those parameters can be access by the PCG graph processor simply using the "GetActorProperty" node

<figure><img src="https://cgtoolbox.com/wp-content/uploads/2025/03/image-5-1024x252.png" alt=""><figcaption><p><em>PCGgraph example: /Game/PCGPainterData/PCG_CustomActorExample</em></p></figcaption></figure>

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cgtoolbox.gitbook.io/cgtoolbox-docs/pcg-painter/custom-graph-and-pcgpainteractor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
