Static Meshes
Static Meshes: Get a static mesh ready for a game. Unreal Engine 5 command reference with parameters and examples.
Static Meshes: Get a static mesh ready for a game. Unreal Engine 5 command reference with parameters and examples.
9 commands. Each shows its parameters and an example, and has a copyable deep link, so you (or an AI agent) can jump straight to one.
set_static_mesh_naniteTurn Nanite on or off and set Nanite settings, then rebuild and report whether Nanite data was built
Reads the mesh's FMeshNaniteSettings, applies --properties by reflection (field names are this engine's own: KeepPercentTriangles, FallbackPercentTriangles, FallbackRelativeError, PositionPrecision, ShapePreservation on 5.7+, bPreserveArea on 5.6...), sets --enabled if given, and rebuilds the mesh through the Static Mesh Editor subsystem. The reply's nanite.has_data says whether the build produced Nanite data. Undoable.
| Parameter | Type | Required | Description |
|---|---|---|---|
| mesh_path | string | Yes | Static mesh path |
| enabled | bool | No | Turn Nanite on (--enabled) or off (--enabled=false); leave out to keep |
| properties | json | No | FMeshNaniteSettings fields as JSON, e.g. {"KeepPercentTriangles":0.5} |
cfa set_static_mesh_nanite --mesh-path /Game/Props/SM_Rock --enabled
cfa set_static_mesh_nanite --mesh-path /Game/Props/SM_Rock --properties '{"KeepPercentTriangles":0.5}'set_static_mesh_lodsGenerate LODs by triangle fraction or count, set screen sizes, or switch automatic screen size
--percent-triangles [0.5,0.25] regenerates LOD1.. at those triangle fractions (LOD0 stays full), as Epic's generate_lods does. --lod-count 4 makes 4 LODs in total, each half the triangles of the last. --screen-sizes [1,0.5,0.25] (one per LOD, strictly descending, else refused) turns automatic screen size off; given alone it only changes the screen sizes. Reply: triangles, vertices and screen size per LOD. Undoable.
| Parameter | Type | Required | Description |
|---|---|---|---|
| mesh_path | string | Yes | Static mesh path |
| percent_triangles | json | No | Triangle fraction (0..1] per LOD after LOD0, e.g. [0.5,0.25] |
| lod_count | int | No | Total LODs including LOD0, each half the last (ignored with percent_triangles) |
| screen_sizes | json | No | Screen size per LOD, LOD0 first, strictly descending, e.g. [1,0.5,0.25] |
| auto_screen_size | bool | No | Let the engine compute screen sizes; leave out to keep |
cfa set_static_mesh_lods --mesh-path /Game/Props/SM_Rock --lod-count 4
cfa set_static_mesh_lods --mesh-path /Game/Props/SM_Rock --percent-triangles '[0.5,0.2]' --screen-sizes '[1,0.4,0.1]'remove_static_mesh_lodsRemove every LOD except LOD0
| Parameter | Type | Required | Description |
|---|---|---|---|
| mesh_path | string | Yes | Static mesh path |
cfa remove_static_mesh_lods --mesh-path /Game/Props/SM_Rockset_static_mesh_collisionAdd simple collision (box, sphere, capsule, NDOP, convex), remove it, or set collision complexity
--shape is the engine's EScriptCollisionShapeType (box, sphere, capsule, ndop10_x, ndop10_y, ndop10_z, ndop18, ndop26), convex (convex decomposition with --hull-count, --max-hull-vertices, --hull-precision; Epic's defaults 4/16/100000), or none. --replace (default true) removes the existing simple collision first; --replace=false adds to it. --complexity is the engine's ECollisionTraceFlag: default, simple_and_complex, simple_as_complex, complex_as_simple. Reply: element counts by shape and the complexity. Undoable.
| Parameter | Type | Required | Description |
|---|---|---|---|
| mesh_path | string | Yes | Static mesh path |
| shape | string | No | box, sphere, capsule, ndop10_x/y/z, ndop18, ndop26, convex, or none |
| replace | bool | No | Remove existing simple collision first |
| hull_count | int | No | Convex: number of hulls |
| max_hull_vertices | int | No | Convex: vertices per hull |
| hull_precision | int | No | Convex: voxel precision |
| complexity | string | No | default, simple_and_complex, simple_as_complex or complex_as_simple |
cfa set_static_mesh_collision --mesh-path /Game/Props/SM_Crate --shape box
cfa set_static_mesh_collision --mesh-path /Game/Props/SM_Rock --shape convex --hull-count 8
cfa set_static_mesh_collision --mesh-path /Game/Props/SM_Floor --complexity complex_as_simpleadd_static_mesh_socketAdd a socket to a static mesh with location, rotation, scale and tag
Done the way the Static Mesh Editor's Socket Manager does it, so it is undoable. --properties takes UStaticMeshSocket fields by reflection: RelativeLocation, RelativeRotation, RelativeScale, Tag. List sockets with get_mesh_info.
| Parameter | Type | Required | Description |
|---|---|---|---|
| mesh_path | string | Yes | Static mesh path |
| socket_name | string | Yes | Name of the new socket |
| properties | json | No | UStaticMeshSocket fields as JSON: RelativeLocation, RelativeRotation, RelativeScale, Tag |
cfa add_static_mesh_socket --mesh-path /Game/Weapons/SM_Rifle --socket-name Muzzle --properties '{"RelativeLocation":{"X":60,"Y":0,"Z":8}}'set_static_mesh_socketRename or move a static mesh socket, or change its scale or tag
| Parameter | Type | Required | Description |
|---|---|---|---|
| mesh_path | string | Yes | Static mesh path |
| socket_name | string | Yes | The socket to change |
| new_name | string | No | Rename the socket to this |
| properties | json | No | UStaticMeshSocket fields to change as JSON |
cfa set_static_mesh_socket --mesh-path /Game/Weapons/SM_Rifle --socket-name Muzzle --new-name Barrel --properties '{"RelativeLocation":{"X":64}}'remove_static_mesh_socketRemove a socket from a static mesh
| Parameter | Type | Required | Description |
|---|---|---|---|
| mesh_path | string | Yes | Static mesh path |
| socket_name | string | Yes | The socket to remove |
cfa remove_static_mesh_socket --mesh-path /Game/Weapons/SM_Rifle --socket-name Barrelmerge_static_mesh_actorsMerge Static Mesh Actors into one new static mesh asset (the editor's Merge Actors tool)
Uses the engine's own merge (UStaticMeshEditorSubsystem::MergeStaticMeshActors). Only Static Mesh Actors with a mesh can be merged. The engine names a merged mesh SM_<name>: /Game/Merged/SM_Houses lands exactly there, /Game/Merged/Houses becomes SM_Houses. The new asset is never written over an existing one. The merged actor is placed by default (--spawn-merged-actor=false to skip); the source actors are kept unless --destroy-source-actors. --properties takes FMeshMergingSettings fields by reflection, e.g. {"bMergeMaterials":true}. Creating the asset cannot be undone, like the editor's own Merge Actors.
| Parameter | Type | Required | Description |
|---|---|---|---|
| actors | stringlist | Yes | Static Mesh Actors to merge, by label or name |
| asset_path | string | Yes | Package path of the merged mesh, e.g. /Game/Merged/SM_Houses |
| spawn_merged_actor | bool | No | Place an actor with the merged mesh |
| destroy_source_actors | bool | No | Delete the source actors after merging |
| actor_label | string | No | Label of the merged actor (default: the asset name) |
| properties | json | No | FMeshMergingSettings fields as JSON |
cfa merge_static_mesh_actors --actors House_1,House_2,House_3 --asset-path /Game/Merged/SM_Housesvalidate_static_meshVerdict for a static mesh: engine data validation, Nanite, materials, LODs, lightmaps, collision
Returns verdict = pass | pass_with_warnings | fail plus findings (code, severity, target, message). Errors (fail): engine_data_invalid, zero_triangles, nanite_no_data, section_bad_material_index, no_collision. Warnings: nanite_material_unsupported (the engine then draws the mesh without Nanite), material_slot_empty, lod_not_reduced (a CFA rule), lod_screen_sizes_not_descending, lightmap_index_invalid, lightmap_uvs_missing, lightmap_uvs_bad (only with --check-lightmap-uvs, slow on big meshes), complex_as_simple. Info: material_slot_unused. counts_by_code is always complete; only the findings list is capped.
| Parameter | Type | Required | Description |
|---|---|---|---|
| mesh_path | string | Yes | Static mesh path |
| check_lightmap_uvs | bool | No | Also run the engine's lightmap UV overlap check |
| filter | string | No | Substring filter on the finding code, target or message |
| max_results | int | No | Max findings to return (0 = all); reports truncated |
cfa validate_static_mesh /Game/Props/SM_Rock
cfa validate_static_mesh /Game/Props/SM_Rock --check-lightmap-uvs