Mesh¶
12 tools. Back to the index.
clear_procedural_mesh¶
Destructive, idempotent.
Empty the geometry of one section, or drop every section, of a UProceduralMeshComponent on an editor-world actor found by label, then rebuild its bounds and collision. A single cleared section keeps its slot (remaining_sections unchanged); with section_index omitted or -1 all sections go. Transient: nothing is marked dirty, saved or undoable. A missing actor or component_index is an error, and so is a section_index past the end or below -1. remove_procedural_mesh_component deletes the component itself.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
section_index |
number | no | Optional 0-based section to empty; omit it, or pass -1, to drop all sections |
Returns: { actor_label: string, section_cleared: int, remaining_sections: int }
create_procedural_box_mesh¶
Destructive.
Generate a box mesh via UKismetProceduralMeshLibrary::GenerateBoxMesh and push it into a procedural mesh component as a single section: section_index replaces an existing section, or equals the section count to append a new one. A negative section_index, or one past the section count, is an error checked before anything changes.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
section_index |
number | no | Optional target section index, 0 to the current section count (which appends a new section); defaults to 0 |
box_radius |
array | no | Optional [x, y, z] half-extents; defaults to (50, 50, 50) |
create_collision |
boolean | no | Optional bool; defaults to false |
Returns: { actor_label: string, section_index: int, vertex_count: int, triangle_count: int, total_sections: int }
create_procedural_grid_mesh¶
Destructive.
Build a flat welded grid of num_x by num_y vertices spaced grid_spacing apart, centred on the component origin in its XY plane with 0-1 UVs and +Z normals, and write it into section_index of a UProceduralMeshComponent on an editor-world actor found by label, replacing that section if it exists, or appending a new one when section_index equals the section count. A missing actor or component, or a section_index that is negative or past the section count, is an error checked before anything changes. num_x * num_y is capped at 1,000,000 vertices (1000 x 1000) because each grid vertex costs about 300 bytes across the generated arrays, the section copy and the render buffers, so one call stays near 300 MB with every index far inside int32; a larger grid, or a count outside int32, is an error too. Transient: nothing is marked dirty, saved or undoable. Add the component with create_procedural_mesh_component first; create_procedural_box_mesh builds a box.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
section_index |
number | no | Optional target section index, 0 to the current section count (which appends a new section); defaults to 0 |
num_x |
number | no | Optional vertex count along X (the grid has num_x - 1 cells; below 2 there is no geometry); defaults to 10; num_x * num_y at most 1000000 |
num_y |
number | no | Optional vertex count along Y (the grid has num_y - 1 cells; below 2 there is no geometry); defaults to 10; num_x * num_y at most 1000000 |
grid_spacing |
number | no | Optional grid cell size in world units; defaults to 16.0 |
create_collision |
boolean | no | Optional bool; defaults to false |
Returns: { actor_label: string, section_index: int, vertex_count: int, triangle_count: int, total_sections: int }
create_procedural_mesh_component¶
Additive, idempotent.
Spawn a bare AActor in the editor world and attach a fresh UProceduralMeshComponent as its root. Idempotent: reuses the actor's existing PMC if found.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label for the new actor |
location |
array | no | Optional [x, y, z] world location; defaults to (0,0,0) |
Returns: { actor_label: string, actor_name: string, component_index: int, section_count: int, reused: bool }
get_procedural_mesh_info¶
Read-only.
Read summary info (section count, collision flags, per-section vertex/triangle counts) for a procedural mesh component on a named actor.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
Returns: { actor_label: string, num_sections: int, use_complex_as_simple_collision: bool, use_async_cooking: bool, sections: [{ index, vertex_count, triangle_count }] }
get_procedural_mesh_section_data¶
Read-only.
Read back the raw geometry (vertices, triangles, normals, UV0, tangents, colors) of a single procedural mesh section. A negative or missing section is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
section_index |
number | yes | Required target section index (>= 0) |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
Returns: { actor_label, section_index, vertex_count, triangle_count, vertices, triangles, normals, uv0, tangents, colors, local_box, collision_enabled, visible }
get_procedural_mesh_section_visible¶
Read-only.
Read the visibility flag of a single section on a procedural mesh component.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
section_index |
number | no | Target section index; defaults to 0 |
Returns: { actor_label: string, section_index: int, visible: bool }
remove_procedural_mesh_component¶
Destructive.
Destroy the UProceduralMeshComponent on a named actor in the editor world (inverse of create_procedural_mesh_component). It removes only the FIRST such component it finds, so an actor carrying several needs one call each; the response says whether one was found at all, and whether it was the actor's root.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the component |
Returns: { actor_label, removed, component_name?, was_root? }
set_procedural_mesh_material¶
Destructive, idempotent.
Assign a material to one slot of the first UProceduralMeshComponent on an editor-world actor (found by label or object name) with SetMaterial, marking the actor package dirty without saving. Returns the loaded material_path, element_index and previous_material_path when the slot had a material. element_index may name a slot the component has (one per section, or an existing override) or the next one past them; a negative one, or one further past, is an error checked before anything changes. A slot that already holds the material succeeds with material_set false and a note, touching nothing; otherwise material_set is read back from the slot and the call fails when it is false.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label or object name of the actor; the first actor matching either is used |
material_path |
string | yes | Material or material instance asset path, e.g. "/Game/Materials/M_Rock" |
element_index |
number | no | Material slot index, usually the section index; default 0; from 0 up to the larger of the section count and the override count |
Returns: { actor_label, material_path, element_index, material_set, previous_material_path?, note? }
set_procedural_mesh_section_visible¶
Destructive, idempotent.
Toggle the visibility of a single section on a procedural mesh component. Idempotent: sets the section's bSectionVisible flag directly.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
visible |
boolean | yes | Required bool; new visibility for the section |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
section_index |
number | no | Target section index; defaults to 0 |
Returns: { actor_label: string, section_index: int, visible: bool, total_sections: int }
slice_procedural_mesh¶
Destructive.
Slice a procedural mesh in place with a plane, optionally spawning the other half as a new PMC on the same actor. NOT idempotent: mutates the mesh destructively; re-running slices the already-sliced result.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
plane_position |
array | no | [x,y,z] world-space point on the slice plane |
plane_normal |
array | no | [x,y,z] slice plane normal (must be non-zero); geometry on the positive side is kept |
create_other_half |
boolean | no | Optional bool; if true, the sliced-off half is spawned as a new PMC on the same actor |
cap_option |
string | no | Optional "NoCap" | "CreateNewSectionForCap" | "UseLastSectionForCap"; defaults to "NoCap" |
cap_material_path |
string | no | Optional /Game path to a UMaterialInterface for the cap |
Returns: { actor_label, sliced, total_sections, other_half_created, other_half_component_name?, other_half_sections? }
update_procedural_mesh_section¶
Destructive.
Update an existing procedural mesh section in-place (same topology, new vertex positions). A negative or missing section is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Editor label of the actor carrying the PMC |
component_index |
number | no | Optional 0-based PMC index on the actor; defaults to 0 |
section_index |
number | no | Optional target section index (>= 0); defaults to 0 |
vertices |
string | no | Required [[x, y, z], ...] array with the same vertex count as the existing section |
Returns: { actor_label: string, section_index: int, vertex_count: int }