auto_generate_mesh_uvs
Generates a UV unwrap for a mesh using patch builder or xatlas, packing islands into standard UV space. Use for organic or mixed-orientation geometry when projection fails.
Instructions
Compute a real UV UNWRAP for the whole mesh via UGeometryScriptLibrary_MeshUVFunctions::AutoGeneratePatchBuilderMeshUVs or AutoGenerateXAtlasMeshUVs. This is what sits behind the editor's "Auto UV" button. Use it when a projection is not enough (organic or mixed-orientation geometry); for plank-and-post shapes set_mesh_uvs_from_projection with box is usually cleaner and far cheaper. Both methods PACK the result into standard UV space by default, so island layout is handled too. SLOW on dense meshes: this is a solver, not a projection. A UV channel the mesh does not have, or an empty mesh, is an error; applied is false, and the call fails, when the solver reports an error (xatlas needs a compact mesh: run compact_mesh first).
Returns: { actor_name, method, uv_channel, triangle_count: int, uv_channel_count: int, applied: bool }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | 'patch_builder' (default, the editor's Auto UV) or 'xatlas'. | |
| auto_pack | No | Pack the resulting islands into standard UV space (default true). | |
| actor_name | Yes | Label or name of the target DynamicMeshActor. | |
| uv_channel | No | UV channel to write (default 0). | |
| max_angle_deg | No | patch_builder: max angle in degrees between merged patches (default 45). | |
| max_iterations | No | xatlas: solver iterations (default 2). Higher is slower and slightly tighter. | |
| min_patch_size | No | patch_builder: minimum triangles per patch (default 2). | |
| merging_threshold | No | patch_builder: patch merging metric threshold (default 1.5). Higher merges more aggressively, giving fewer islands. | |
| respect_polygroups | No | patch_builder: seed patches from the existing polygroups instead of curvature (default false). Useful right after append_mesh_primitive, where each appended face is already its own group. | |
| initial_patch_count | No | patch_builder: how many patches to seed (default 100). More patches = less distortion, more seams. |