ue-mcp-plugin-voxel-plugin 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -5
- package/dist/tasks/GetWorldStatus.d.ts +27 -0
- package/dist/tasks/GetWorldStatus.js +57 -0
- package/dist/tasks/GetWorldStatus.js.map +1 -0
- package/docs/Modules.md +107 -0
- package/docs/README.md +47 -0
- package/docs/Tests.md +280 -0
- package/docs/Voxel.md +450 -0
- package/docs/VoxelBlueprint.md +167 -0
- package/docs/VoxelCore.md +128 -0
- package/docs/VoxelGraph.md +386 -0
- package/docs/VoxelPCG.md +288 -0
- package/package.json +3 -2
- package/ue-mcp.plugin.yml +11 -0
package/docs/VoxelPCG.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# VoxelPCG — API Reference
|
|
2
|
+
|
|
3
|
+
The bridge between Epic's PCG (Procedural Content Generation) framework and the Voxel plugin. Provides PCG nodes that read voxel state, drive voxel graphs, and write back voxel stamps — plus voxel-graph nodes that operate on PCG-style point sets.
|
|
4
|
+
|
|
5
|
+
Path: `Plugins/Voxel/Source/VoxelPCG/Public/` (flat, no subfolders). Depends on `Voxel`, `VoxelGraph`, `PCG`.
|
|
6
|
+
|
|
7
|
+
KB: <https://docs.voxelplugin.com/knowledgebase/foliage/>.
|
|
8
|
+
|
|
9
|
+
## Integration pattern
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
PCG framework (Epic) VoxelPCG nodes Voxel runtime
|
|
13
|
+
──────────────────── ───────────────── ─────────────
|
|
14
|
+
|
|
15
|
+
point cloud ────► PCGVoxelQuery / Sampler / Projection ────► reads height/volume layers
|
|
16
|
+
◄──── PCG augmented points with voxel attrs
|
|
17
|
+
|
|
18
|
+
point cloud ────► PCGCallVoxelGraph ────► runs a UVoxelPCGGraph
|
|
19
|
+
◄──── transformed points
|
|
20
|
+
|
|
21
|
+
point cloud ────► PCGVoxelStampSpawner ────► writes stamps via
|
|
22
|
+
UPCGManagedVoxelInstancedStampComponent
|
|
23
|
+
|
|
24
|
+
control flow ────► PCGWaitForVoxelWorld ────► blocks until ready
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Every PCG-side node derives from `UVoxelPCGSettings` (extends `UPCGSettings`). Voxel-side point-graph nodes derive from `FVoxelNode` — they operate on `FVoxelPointSet` inside a voxel graph, distinct from the PCG-side wrappers.
|
|
28
|
+
|
|
29
|
+
## Common base
|
|
30
|
+
|
|
31
|
+
### `UVoxelPCGSettings`
|
|
32
|
+
|
|
33
|
+
Base for all PCG-side nodes. Enforces Voxel-specific serialization.
|
|
34
|
+
|
|
35
|
+
```cpp
|
|
36
|
+
class UVoxelPCGSettings : public UPCGSettings
|
|
37
|
+
{
|
|
38
|
+
UPROPERTY(EditAnywhere)
|
|
39
|
+
bool bTrackLayerChanges = true; // invalidate on layer-dep changes
|
|
40
|
+
|
|
41
|
+
virtual TSharedRef<FVoxelPCGOutput> CreateOutput(...) const;
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### `FVoxelPCGOutput`
|
|
46
|
+
|
|
47
|
+
Async output wrapper.
|
|
48
|
+
|
|
49
|
+
```cpp
|
|
50
|
+
class FVoxelPCGOutput
|
|
51
|
+
{
|
|
52
|
+
virtual FVoxelFuture Run() = 0; // execute, return future of result
|
|
53
|
+
// Deriving classes hold layer refs, settings snapshot, output containers
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### `UVoxelPCGGraph`
|
|
58
|
+
|
|
59
|
+
Specialized voxel graph for PCG use. Subclass of `UVoxelGraph` whose terminal output node is `FVoxelOutputNode_OutputPoints` (instead of the height/volume output terminals).
|
|
60
|
+
|
|
61
|
+
### `UVoxelPCGFunctionLibrary`
|
|
62
|
+
|
|
63
|
+
Voxel-graph-side utilities:
|
|
64
|
+
|
|
65
|
+
```cpp
|
|
66
|
+
UFUNCTION(BlueprintCallable, Category = "Voxel | PCG")
|
|
67
|
+
static FVoxelBox GetPCGBounds(); // bounds of current PCG execution
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Available inside voxel graphs when invoked via `PCGCallVoxelGraph`.
|
|
71
|
+
|
|
72
|
+
## Read-side nodes — query, sample, project
|
|
73
|
+
|
|
74
|
+
### `UPCGVoxelQuerySettings`
|
|
75
|
+
|
|
76
|
+
Reads voxel-world data at PCG point positions.
|
|
77
|
+
|
|
78
|
+
```cpp
|
|
79
|
+
UPROPERTY(EditAnywhere)
|
|
80
|
+
FVoxelStackLayer Layer; // which layer stack to sample
|
|
81
|
+
|
|
82
|
+
UPROPERTY(EditAnywhere)
|
|
83
|
+
int32 LOD = 0;
|
|
84
|
+
|
|
85
|
+
UPROPERTY(EditAnywhere)
|
|
86
|
+
FName HeightOrDistanceAttribute = "VoxelHeight";
|
|
87
|
+
|
|
88
|
+
// optional: also write surface-type and custom metadata attributes
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Augments each input point with the queried attributes. Use it when you have a PCG point cloud and need each point to know what's under it.
|
|
92
|
+
|
|
93
|
+
### `UPCGVoxelSamplerSettings` (sampler node)
|
|
94
|
+
|
|
95
|
+
Generates fresh PCG points on a voxel-world surface.
|
|
96
|
+
|
|
97
|
+
```cpp
|
|
98
|
+
UPROPERTY(EditAnywhere) FVoxelStackLayer Layer;
|
|
99
|
+
UPROPERTY(EditAnywhere) float PointsPerSquaredMeter = 1.0f;
|
|
100
|
+
UPROPERTY(EditAnywhere) float CellSize = 100.0f;
|
|
101
|
+
UPROPERTY(EditAnywhere) float Looseness = 0.5f;
|
|
102
|
+
UPROPERTY(EditAnywhere) float Tolerance = 0.1f;
|
|
103
|
+
UPROPERTY(EditAnywhere) bool bResolveSmartSurfaceTypes = true;
|
|
104
|
+
UPROPERTY(EditAnywhere) int32 LOD = 0;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Takes an optional bounding shape (or falls back to actor bounds).
|
|
108
|
+
|
|
109
|
+
### `UPCGVoxelSamplerV2Settings`
|
|
110
|
+
|
|
111
|
+
Experimental variant — replaces density (points/m²) with target inter-point spacing (`DistanceBetweenPoints`). Same layer/LOD/metadata flow.
|
|
112
|
+
|
|
113
|
+
### `UPCGVoxelProjectionSettings`
|
|
114
|
+
|
|
115
|
+
Projects input points onto a voxel-world surface via raymarching.
|
|
116
|
+
|
|
117
|
+
```cpp
|
|
118
|
+
UPROPERTY(EditAnywhere) FVoxelStackLayer Layer;
|
|
119
|
+
UPROPERTY(EditAnywhere) float KillDistance = -1.0f; // prune unreachable
|
|
120
|
+
UPROPERTY(EditAnywhere) bool bUpdateRotation = true;
|
|
121
|
+
UPROPERTY(EditAnywhere) bool bForceDirection = false; // search downward
|
|
122
|
+
UPROPERTY(EditAnywhere) int32 MaxSteps = 64;
|
|
123
|
+
UPROPERTY(EditAnywhere) float Tolerance = 0.1f;
|
|
124
|
+
UPROPERTY(EditAnywhere) float Speed = 1.0f;
|
|
125
|
+
UPROPERTY(EditAnywhere) float GradientStep = 1.0f;
|
|
126
|
+
UPROPERTY(EditAnywhere) bool bDebugSteps = false;
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### `UPCGVoxelElevationIsolines`
|
|
130
|
+
|
|
131
|
+
Computes contour lines (isolines) for height layers.
|
|
132
|
+
|
|
133
|
+
```cpp
|
|
134
|
+
UPROPERTY(EditAnywhere) FVoxelStackLayer Layer; // height-only
|
|
135
|
+
UPROPERTY(EditAnywhere) float ElevationStart = 0.f;
|
|
136
|
+
UPROPERTY(EditAnywhere) float ElevationEnd = 1000.f;
|
|
137
|
+
UPROPERTY(EditAnywhere) float ElevationIncrement = 100.f;
|
|
138
|
+
UPROPERTY(EditAnywhere) float Resolution = 100.f;
|
|
139
|
+
UPROPERTY(EditAnywhere) bool bOutputAsSpline = false;
|
|
140
|
+
UPROPERTY(EditAnywhere) bool bLinearSpline = false;
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Use case: contour maps, terraced landscaping, elevation-banded foliage gradients.
|
|
144
|
+
|
|
145
|
+
## Drive-side — call & configure voxel graphs
|
|
146
|
+
|
|
147
|
+
### `UPCGCallVoxelGraphSettings`
|
|
148
|
+
|
|
149
|
+
Invokes a voxel graph from PCG, threading PCG point data in.
|
|
150
|
+
|
|
151
|
+
```cpp
|
|
152
|
+
UPROPERTY(EditAnywhere) UVoxelPCGGraph* Graph;
|
|
153
|
+
UPROPERTY(EditAnywhere) FVoxelParameterOverrides ParameterOverrides;
|
|
154
|
+
UPROPERTY(EditAnywhere) TMap<FName, UClass*> ObjectAttributeToType;
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Dynamic input/output pins are generated from the target graph's `FVoxelOutputNode_OutputPoints` pin definitions. Execution is async-capable.
|
|
158
|
+
|
|
159
|
+
### `UPCGApplyOnVoxelGraphSettings`
|
|
160
|
+
|
|
161
|
+
Loads a graph by soft path (sourced from a PCG attribute) and applies property overrides before invoking.
|
|
162
|
+
|
|
163
|
+
```cpp
|
|
164
|
+
UPROPERTY(EditAnywhere) FName ObjectReferenceAttribute = "VoxelGraphRef";
|
|
165
|
+
UPROPERTY(EditAnywhere) TArray<FVoxelPropertyOverrideDescription> PropertyOverrideDescriptions;
|
|
166
|
+
UPROPERTY(EditAnywhere) bool bSynchronousLoad = false;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Use case: per-point instance customization where each point carries its own graph reference + overrides.
|
|
170
|
+
|
|
171
|
+
### `FVoxelPCGGraphParameterOverrides`
|
|
172
|
+
|
|
173
|
+
Struct referenced by the above settings. Maps voxel-graph parameters onto PCG-overridable values; part of the `IVoxelParameterOverridesOwner` contract.
|
|
174
|
+
|
|
175
|
+
## Write-side — spawn stamps & actors
|
|
176
|
+
|
|
177
|
+
### `UPCGVoxelStampSpawnerSettings`
|
|
178
|
+
|
|
179
|
+
Spawns voxel-stamp instances at PCG point locations.
|
|
180
|
+
|
|
181
|
+
```cpp
|
|
182
|
+
UPROPERTY(EditAnywhere) FVoxelStampRef NewTemplate; // e.g., FVoxelHeightmapStamp
|
|
183
|
+
UPROPERTY(EditAnywhere) TSoftObjectPtr<AActor> TargetActor;
|
|
184
|
+
|
|
185
|
+
UPROPERTY(EditAnywhere)
|
|
186
|
+
TArray<FVoxelPropertyOverrideDescription> SpawnedStampPropertyOverrideDescriptions;
|
|
187
|
+
|
|
188
|
+
UPROPERTY(EditAnywhere)
|
|
189
|
+
TArray<FVoxelGraphParameterOverrideDescription> SpawnedGraphParameterOverrideDescriptions;
|
|
190
|
+
|
|
191
|
+
UPROPERTY(EditAnywhere)
|
|
192
|
+
TArray<FName> PostProcessFunctionNames;
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Auto-creates or reuses a `UPCGManagedVoxelInstancedStampComponent` on the target actor for stamp pooling — the lifetime of created stamps is managed by PCG so re-runs don't leak.
|
|
196
|
+
|
|
197
|
+
### `UPCGManagedVoxelInstancedStampComponent`
|
|
198
|
+
|
|
199
|
+
`UPCGManagedComponent` subclass that wraps a `UVoxelInstancedStampComponent`. Implements PCG's managed-component lifecycle:
|
|
200
|
+
|
|
201
|
+
```cpp
|
|
202
|
+
void ReleaseIfUnused();
|
|
203
|
+
void MarkAsUsed();
|
|
204
|
+
void MarkAsReused();
|
|
205
|
+
void ResetComponent();
|
|
206
|
+
void SetRootLocation(const FVector&);
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
`SettingsUID` is cached so the same component is reused (or reset) when settings change.
|
|
210
|
+
|
|
211
|
+
### `UPCGSpawnActorWithVoxelGraphSettings`
|
|
212
|
+
|
|
213
|
+
Spawns actor instances at PCG points, each with custom voxel-graph parameter values.
|
|
214
|
+
|
|
215
|
+
```cpp
|
|
216
|
+
UPROPERTY(EditAnywhere) TSubclassOf<AActor> TemplateActor;
|
|
217
|
+
|
|
218
|
+
UPROPERTY(EditAnywhere)
|
|
219
|
+
TArray<FVoxelPropertyOverrideDescription> SpawnedActorPropertyOverrideDescriptions;
|
|
220
|
+
|
|
221
|
+
UPROPERTY(EditAnywhere)
|
|
222
|
+
TArray<FVoxelGraphParameterOverrideDescription> SpawnedGraphParameterOverrideDescriptions;
|
|
223
|
+
|
|
224
|
+
UPROPERTY(EditAnywhere)
|
|
225
|
+
TArray<FName> PostSpawnFunctionNames; // CallInEditor functions
|
|
226
|
+
|
|
227
|
+
UPROPERTY(EditAnywhere) FAttachmentTransformRules AttachOptions;
|
|
228
|
+
UPROPERTY(EditAnywhere) bool bInheritActorTags = true;
|
|
229
|
+
UPROPERTY(EditAnywhere) EPCGGenerationTrigger GenerationTrigger;
|
|
230
|
+
|
|
231
|
+
UPROPERTY(EditAnywhere) bool bSpawnByAttribute = false;
|
|
232
|
+
UPROPERTY(EditAnywhere) FName SpawnAttribute; // spawn iff attribute == true
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Synchronization
|
|
236
|
+
|
|
237
|
+
### `UPCGWaitForVoxelWorldSettings`
|
|
238
|
+
|
|
239
|
+
Control-flow node — blocks PCG execution until the voxel world is ready to render. Type: `EPCGSettingsType::ControlFlow`. Output is a pass-through of the input.
|
|
240
|
+
|
|
241
|
+
Use case: ensure terrain is generated before downstream sampling/stamping operations that would otherwise sample stale data.
|
|
242
|
+
|
|
243
|
+
## Voxel-side point-graph nodes
|
|
244
|
+
|
|
245
|
+
These are **voxel graph nodes** (`FVoxelNode`-derived) that operate on `FVoxelPointSet` inside a voxel graph — typically a `UVoxelPCGGraph` invoked via `PCGCallVoxelGraph`.
|
|
246
|
+
|
|
247
|
+
| Node | Purpose |
|
|
248
|
+
|---|---|
|
|
249
|
+
| `FVoxelNode_GetInputPoints` | Pure node exposing the input point set from PCG. Output: `Points` (`FVoxelPointSet`). |
|
|
250
|
+
| `FVoxelNode_ScatterPoints` | Random child points around each parent. Inputs: `In`, `Radius`, `RadialOffset` (deg), `NumPoints`, `Seed`. Output: child points only. |
|
|
251
|
+
| `FVoxelNode_PruneByDistance` | Culls points closer than `Distance` to each other. |
|
|
252
|
+
| `FVoxelNode_MergePoints` | Variadic merge of multiple point sets (≥2 inputs). |
|
|
253
|
+
| `FVoxelNode_GenerateSurfacePoints2D` | Generates points on a heightmap surface. Inputs: `Bounds` (`FVoxelBox`), `Height` (`FVoxelFloatBuffer`), `CellSize`, `Jitter`, `Seed`. Internal positions + gradient computation. |
|
|
254
|
+
| `FVoxelNode_RaymarchLayerDistanceField` | Raycasts into a distance-field layer. Inputs: `In`, `Layer`, `MaxDistance`, `StepSize`. Output: intersection points. |
|
|
255
|
+
| `FVoxelOutputNode_OutputPoints` | Terminal node — variadic input pins (`InputPins`, `PinNames`). Each pin becomes a dynamic output on the `PCGCallVoxelGraph` node. Editor allows add/remove/rename pins. |
|
|
256
|
+
|
|
257
|
+
## Support / utilities
|
|
258
|
+
|
|
259
|
+
| Header | Purpose |
|
|
260
|
+
|---|---|
|
|
261
|
+
| `VoxelPCGCallstack.h` | Custom message-callstack token for PCG-graph errors. |
|
|
262
|
+
| `VoxelPCGTracker.h` | Dependency-tracker specialization for PCG ↔ voxel invalidation. |
|
|
263
|
+
| `VoxelPCGHelpers.h` | Shared helpers (point/attribute conversion, layer-id resolution). |
|
|
264
|
+
| `VoxelPointAttributeNodes.h` | Voxel-graph nodes for per-point attribute get/set. |
|
|
265
|
+
| `VoxelPointNodes.h` | Additional point-graph node implementations. |
|
|
266
|
+
| `VoxelPointNodesStats.h` | Stat scopes for profiling point operations. |
|
|
267
|
+
| `VoxelPointUtilities.h` | Point-set algorithm primitives. |
|
|
268
|
+
|
|
269
|
+
## Quick guidance — picking the right node
|
|
270
|
+
|
|
271
|
+
| You want to… | Use |
|
|
272
|
+
|---|---|
|
|
273
|
+
| Read terrain attributes at existing PCG points | `PCGVoxelQuery` |
|
|
274
|
+
| Generate new PCG points on the surface | `PCGVoxelSampler` (or V2) |
|
|
275
|
+
| Snap existing PCG points down onto the surface | `PCGVoxelProjection` |
|
|
276
|
+
| Get contour lines for a height layer | `PCGVoxelElevationIsolines` |
|
|
277
|
+
| Run a custom voxel graph on a PCG point cloud | `PCGCallVoxelGraph` + `UVoxelPCGGraph` |
|
|
278
|
+
| Pick a graph per-point from an attribute | `PCGApplyOnVoxelGraph` |
|
|
279
|
+
| Carve / heap / spline / heightmap stamps from PCG points | `PCGVoxelStampSpawner` |
|
|
280
|
+
| Spawn parameterized actors at PCG points | `PCGSpawnActorWithVoxelGraph` |
|
|
281
|
+
| Wait for terrain before doing the above | `PCGWaitForVoxelWorld` |
|
|
282
|
+
|
|
283
|
+
## Cross-references
|
|
284
|
+
|
|
285
|
+
- The stamps written by the spawner originate in [Voxel.md](Voxel.md#stamps) (`FVoxelStampRef`, the instanced-stamp component).
|
|
286
|
+
- `UVoxelPCGGraph` extends the graph-asset framework documented in [VoxelGraph.md](VoxelGraph.md).
|
|
287
|
+
- The `FVoxelPointSet` data type is declared in `Voxel/Public/VoxelPointSet.h` — see [Voxel.md](Voxel.md#misc-world-level).
|
|
288
|
+
- KB pages: [Configuring PCG](https://docs.voxelplugin.com/knowledgebase/foliage/configuring-pcg.html), [Using PCG on Voxel Terrains](https://docs.voxelplugin.com/knowledgebase/foliage/using-pcg-on-voxel-terrains.html), [Voxel PCG Graphs](https://docs.voxelplugin.com/knowledgebase/foliage/voxel-pcg-graphs.html).
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ue-mcp-plugin-voxel-plugin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Voxel Plugin actions for ue-mcp.
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Voxel Plugin actions for ue-mcp. Cited to the C++ headers each action wraps; full reference under docs/.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"ue-mcp.plugin.yml",
|
|
10
10
|
"knowledge",
|
|
11
|
+
"docs",
|
|
11
12
|
"README.md",
|
|
12
13
|
"LICENSE"
|
|
13
14
|
],
|
package/ue-mcp.plugin.yml
CHANGED
|
@@ -13,11 +13,22 @@ inject:
|
|
|
13
13
|
pointsPerSquaredMeter: { type: number }
|
|
14
14
|
seed: { type: number }
|
|
15
15
|
|
|
16
|
+
level:
|
|
17
|
+
get_voxel_world_status:
|
|
18
|
+
task: voxel.get_world_status
|
|
19
|
+
description: "One-call snapshot of an AVoxelWorld's lifecycle state (isRuntimeCreated, isVoxelWorldReady, isProcessingNewState, progress, numPendingTasks). Call this before scattering / stamping / sampling to confirm the runtime is live and not mid-regeneration. Wraps the 5 zero-arg lifecycle UFUNCTIONs on AVoxelWorld (Voxel/Public/VoxelWorld.h). Params: actorLabel (voxel-world actor label), world? (editor|pie)."
|
|
20
|
+
schema:
|
|
21
|
+
actorLabel: { type: string, required: true }
|
|
22
|
+
world: { type: string }
|
|
23
|
+
|
|
16
24
|
knowledge: {}
|
|
17
25
|
|
|
18
26
|
tasks:
|
|
19
27
|
voxel.build_scatter_graph:
|
|
20
28
|
class_path: tasks/BuildScatterGraph
|
|
21
29
|
description: "Build a Voxel-Sampler-driven PCG mesh scatter graph"
|
|
30
|
+
voxel.get_world_status:
|
|
31
|
+
class_path: tasks/GetWorldStatus
|
|
32
|
+
description: "Snapshot AVoxelWorld lifecycle state in one call"
|
|
22
33
|
|
|
23
34
|
flows: {}
|