Unreal PCG Painter



Get PCG Painter blueprints:


Unreal 5.5 is mandatory ! No support for versions below 5.5 !!


PCG Painter is a Blueprint Scriptable tool which allows you to paint a PCG graph in the world, on any objects ( by default, it traces all Visible objects ). As it’s 100% made with Blueprint and PCG graph, it’s easily customizable.

Youtube video demonstrating the tool


To find the tool, you have to activate the “Scriptable tools” mode:

The tool activated in the 3D view.

The tool works in three steps:

  1. Trace “root points” on visible objects according to “brush strokes” ( click and drag from the tool ).
  2. Scatter points around those root points, in the given radius, using the samples count parameter and project them on the visible objects.
  3. Execute a selected PCG graph with those points as input ( roots + scattered ).
1. Trace root points.
2. Scatter points around root points.
3. Execute a PCG graph on the points.

Tool parameters

Tool header allows you to check which painter actor you’re editing ( empy when none is selected but a new one is create ).
Double click on the name allows you to edit the actor’s display label in the outline.

Graph: The PCG graph instance which will be executed on root and scattered points ( only graph instance are supported, not regular PCG graphs ).

Show graph instances parameters: Display the selected PCG graph instances parameters ( if any exposed ), they can be tweaked directly from this UI widget.

Example of exposed PCG graph instance parameters.

Randomize button: Force a recook of the PCG graph with a different seed.

Clear all points: Delete all generated points ( roots and scattered ).

Size: The size ( radius ) of the brush. It will be used to scatter the points in it, as well as used to project them on the visible objects.

Size of 200.

Samples count: The number of “rays” or “samples” to be processed in the brush radius when the use click and drag it. It doesn’t represent the real number of output points, but more a “density”.

Samples count: 10.
Size: 400.0.
Samples count: 50.
Brush Size: 400.0

Custom data: A simple integer value which can be set to any brush strokes. This is useful to drive the PCG graph behavior differently between brushes if needed.

Here the blue cylinder’s points have custom data set to 1.

Global samples mult. : A global multiplier applied on the whole PCG graph ( not per strokes ). Multiplies the number of samples used to create the scattered points.

Scatter points bounds: Set the scatter points ( around roots ) bounds size, used to remove overlapping point if needed ( the option can be turned on / off using the checkbox ), the setting is applied globally, not per strokes.

Bounds size set to 10.0 ( default ).

Bounds size set to 20.0.

Debug options

Show root points:

Show scatter points:

Show roots points is still on is this example.

Show roots radius:

Show root radius ( brush size ).

PCG points to graphs

As said as the beginning, 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.

Tn this graph, a node “Execute PCG graph processor” will execute the custom graph selected by the user.

The PCG graph will be executed at the green node level on the right.

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)
  • __BrushRadius (float)
  • __PainterImpactNormal (vector)
  • __BrushSampleCount (int)
  • __RootPoint ( 0 or 1 )
  • __RayCastLengh (float)
  • ActorReference (SoftRef)
  • PhysicalMaterial (SoftRef)
Example of a simple PCG graph processor ( PCG_PainterExample ).

The tool only accept Graph instances, not regular graphs, you need to create a graph instance by right click on the graph => Create PCG graph instance.



Github depot:
https://github.com/cgtoolbox/PCGPainter


contact@cgtoolbox.com