Grow a Tree with AI
A guided example: build a Procedural Vegetation graph from empty, grow a trunk that branches and droops, skin it into a mesh, scatter foliage, and export the plant to mesh assets.
A guided example: build a Procedural Vegetation graph from empty, grow a trunk that branches and droops, skin it into a mesh, scatter foliage, and export the plant to mesh assets.
This walkthrough grows a tree from an empty asset: a trunk that branches and bends under its own weight, a mesh skinned onto it, foliage scattered over the result, and an export to real mesh assets with no click. Every command here needs Unreal Engine 5.8 or later. They are all listed in the Procedural Vegetation reference.
This is the thing worth knowing first. A Procedural Vegetation asset derives from the same graph type PCG uses, and every vegetation node from the same settings type, so the whole PCG command set works on one. You add nodes, wire pins, set properties, lay the graph out and batch edits exactly as you would anywhere else. There is no separate add node command for vegetation, and none is needed.
These nodes are large. The Grower alone carries 179 properties, many of them gated behind a condition that decides whether they do anything at all. Discovery is not optional here, it is how you avoid setting things that quietly have no effect.
Node titles and categories come from the plugin's own add node menu, so they are always what your engine really has. Several searches in one call.
cfa search_pv_nodes --filters "grower,mesh,foliage" --max-results 5Every property path with its type, default, Unreal's own description, the valid values of every enum, the slider and clamp ranges, and the edit condition. Narrow by category, because the full set will not fit in one answer.
cfa describe_pv_nodes --node PVGrowerSettings --category GrowthEvery node and every property, written to disk so it never floods the conversation. Read the file instead of asking again.
cfa export_pv_schema --name FullSchemaThe chain runs Grower, then any post growth modifiers, then Mesh Builder, Bone Reduction, and Foliage Distributor. The Mesh Builder wants a cross section on its Profile pin, and the Distributor wants a palette on its Foliage pin.
Without a sample you get just Input and Output. Prefer empty while learning, because a duplicated sample hides over a hundred authored values you did not choose.
cfa create_procedural_vegetation --asset-path /Game/Veg/PV_OakOrdinary PCG node adds. Read the stable names back rather than predicting them, because they follow the node title and not the class.
cfa add_pcg_node --graph-path /Game/Veg/PV_Oak --settings-class /Script/ProceduralVegetation.PVGrowerSettings
cfa add_pcg_node --graph-path /Game/Veg/PV_Oak --settings-class /Script/ProceduralVegetation.PVMeshBuilderSettings
cfa read_pcg_graph --graph-path /Game/Veg/PV_OakPin labels matter. The Mesh Builder's inputs include Profile, BranchRadius, MeshDetails and MaterialDetails, and one of them is spelled with spaces.
cfa connect_pcg_pins --graph-path /Game/Veg/PV_Oak \
--from-node-name ProceduralVegetationGrower_0 --from-pin-label Out \
--to-node-name ProceduralVegetationMesher_0 --to-pin-label InThe Plant Profile Loader takes its shape from a data asset, and its output pin is named after the profile you author. The points are a cross section measured around the branch, not a taper running up the trunk, so they have to close back on themselves.
Roughly a hundred samples around the ring. A constant radius is a circle, and gentle variation reads as bark.
cfa create_data_asset --asset-path /Game/Veg/PPD_Oak \
--class-name ProceduralVegetationPlantProfileDataAsset
cfa set_asset_property --asset-path /Game/Veg/PPD_Oak --property-name Profiles \
--property-value '((Name="Trunk",Points=(1.0,1.02,0.99,...)))'The output pin appears once the asset is assigned, and carries the name you gave the profile.
cfa set_pcg_node_property_path --graph-path /Game/Veg/PV_Oak \
--node-name ProceduralVegetationPlantProfileLoader_0 \
--property-path PlantProfileData --property-value '"/Game/Veg/PPD_Oak.PPD_Oak"'The simulation runs in cycles. One cycle grows one segment, so the number of cycles is the budget the whole plant is built from, and the trunk spends it first.
This is the master switch and its default is the minimum. Everything else you tune is judged against it.
cfa set_pcg_node_property_path --graph-path /Game/Veg/PV_Oak \
--node-name ProceduralVegetationGrower_0 \
--property-path GrowerParams.GrowthCycles --property-value 45Height, spread, thickness and branch depth. Set several in one batch so they land as a single undo step.
cfa set_pcg_node_property_path --graph-path /Game/Veg/PV_Oak --node-name ProceduralVegetationGrower_0 \
--property-path GrowerParams.TrunkGrowth.PlantTargetLength --property-value 11.0Root zone auxin suppresses sprouting near the base, and apical dominance keeps a single leader. Together they give a clean trunk with the crown above it.
cfa set_pcg_node_property_path --graph-path /Game/Veg/PV_Oak --node-name ProceduralVegetationGrower_0 \
--property-path GrowerParams.Auxin.RadicalAuxin --property-value 0.3Selecting a node is what drives the viewport, so you can inspect any stage by asking for that node. It reads what is already there rather than running the graph again, which is the difference between a wait of over a minute and about half a second. The graph regenerates by itself whenever you change a property, so you never need to ask for that.
The Grower for the branch skeleton, Bone Reduction for the bone colouring, the Foliage Distributor for the finished plant.
cfa open_asset --asset-path /Game/Veg/PV_Oak
cfa preview_pv_node --graph-path /Game/Veg/PV_Oak --node-name ProceduralVegetationFoliageDistributor_0Nodes added over the bridge all land at the origin on top of each other. Lay it out, then save, because layout is an unsaved edit.
cfa layout_pcg_graph --graph-path /Game/Veg/PV_Oak
cfa save_asset --asset-path /Game/Veg/PV_OakUnreal offers no scripted way to export a plant, so this drives the editor's own Export command and answers its dialog for you. It works the same whether the editor is in front of you or running unattended.
The graph needs an Export node with a mesh name set. Export reads evaluated data, so on a graph that has not generated yet the first call starts generation and reports needs_generation. Call it again once that finishes.
cfa set_pcg_node_property_path --graph-path /Game/Veg/PV_Oak --node-name Export_0 \
--property-path ExportSettings.MeshName --property-value '"SM_Oak"'
cfa export_procedural_vegetation --asset-path /Game/Veg/PV_OakDumps only the values that differ from their defaults, plus the wiring. Epic's shipped tree collapses to 143 authored values, which is what makes two plants comparable.
cfa export_pcg_graph_config --graph-path /Game/Veg/PV_Oak