pcg

Create and wire PCG graphs in Unreal Engine using the native PCG Python API.

648|142|Updated Sep 12, 2025
One-click install
npx skills add https://github.com/kevinpbuckley/VibeUE --skill pcg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pcg
Source: https://github.com/kevinpbuckley/VibeUE/tree/main/Content/Skills/pcg
Command: npx skills add https://github.com/kevinpbuckley/VibeUE --skill pcg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Building Procedural Content Generation graphs in Unreal Engine by hand is slow and error-prone, and the PCG Python API has non-obvious pin labels, protected properties, and save/reload requirements that cause silent failures. This Skill provides verified patterns for creating, wiring, and generating PCG graphs without trial-and-error.

Core Features & Use Cases

  • Graph Authoring: Create PCG Graph assets, add nodes (Surface Sampler, Static Mesh Spawner, filters), and connect pins with correct labels via add_edge.
  • Volume Generation: Place a PCGVolume, assign a graph with set_graph, run generate(force=True), and verify output through ISM instance counts.
  • Pitfall Prevention: Built-in guidance for known traps such as the Volume Sampler "Volume" pin, Vector-typed voxel_size, protected graph property, and mandatory save-then-reload cycles.
  • Use Case: Ask the agent to scatter static meshes across a landscape; it creates the graph, wires Surface Sampler to Static Mesh Spawner, configures mesh entries, places a PCGVolume, and generates instances.

Quick Start

Use the pcg skill to create a PCG graph at /Game/PCG that scatters cube meshes with a Surface Sampler and Static Mesh Spawner, then place a PCGVolume and generate.

Frequently Asked Questions about pcg

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a PCG graph in Unreal Engine with Python?

Use unreal.PCGGraphFactory with AssetToolsHelpers.get_asset_tools().create_asset to make the asset, then call graph.add_node_of_type with a settings class like PCGSurfaceSamplerSettings to add nodes. Save with EditorAssetLibrary.save_asset and reload the package to refresh the editor.

How do I connect PCG nodes and pins in Python?

Call graph.add_edge(from_node, 'Out', to_node, 'In') after inspecting pin labels via each pin's properties label. Pin names vary by node: Surface Sampler's input is "Surface", the graph input node's output is "In", and the output node's input is "Out".

Why does my PCG graph produce zero points after generating?

Common causes are wiring to the wrong pin label (add_edge silently no-ops on mismatches), using Surface Sampler in an empty level with no geometry, or forgetting to reload the package so the component runs a cached old graph. Use Volume Sampler with unbounded=True for empty levels.

What plugins are required for PCG Python scripting in Unreal?

Both the PCG and PCGPythonInterop plugins must be enabled in the project's .uproject file. Verify at runtime with hasattr(unreal, 'PCGGraph') before executing any graph code.

How do I assign a static mesh to the PCG Static Mesh Spawner?

Build a PCGMeshSelectorWeightedEntry, set static_mesh on its descriptor, and assign the entry list to mesh_entries on the spawner's mesh_selector_parameters. There is no set_mesh shortcut; materials go on the descriptor's override_materials, not on static_mesh.

Why can't I delete a PCG graph asset in Unreal Engine?

UE holds an open file handle on loaded .uasset files until shutdown. Close the asset editor tab first, break subgraph cross-references, save, and run garbage collection; if deletion still fails, restart the editor and delete before the assets reload.