unreal.ProceduralMeshLibrary
¶
- class unreal.ProceduralMeshLibrary(outer=None, name='None')¶
Bases:
unreal.BlueprintFunctionLibrary
Kismet Procedural Mesh Library
C++ Source:
Plugin: ProceduralMeshComponent
Module: ProceduralMeshComponent
File: KismetProceduralMeshLibrary.h
- classmethod calculate_tangents_for_mesh(vertices, triangles, u_vs) -> (normals=Array(Vector), tangents=Array(ProcMeshTangent))¶
Automatically generate normals and tangent vectors for a mesh UVs are required for correct tangent generation.
- classmethod convert_quad_to_triangles(triangles, vert0, vert1, vert2, vert3)¶
Add a quad, specified by four indices, to a triangle index buffer as two triangles.
- classmethod copy_procedural_mesh_from_static_mesh_component(static_mesh_component, lod_index, proc_mesh_component, create_collision) → None¶
Copy materials from StaticMeshComponent to ProceduralMeshComponent.
- Parameters
static_mesh_component (StaticMeshComponent) –
lod_index (int32) –
proc_mesh_component (ProceduralMeshComponent) –
create_collision (bool) –
- classmethod create_grid_mesh_split(num_x, num_y, grid_spacing=16.000000) -> (triangles=Array(int32), vertices=Array(Vector), u_vs=Array(Vector2D), uv1s=Array(Vector2D))¶
Generate a vertex buffer, index buffer and UVs for a grid mesh where each quad is split, with standard 0-1 UVs on UV0 and point sampled texel center UVs for UV1. out: Triangles Output index buffer out: Vertices Output vertex buffer out: UVs Out UVs out: UV1s Out UV1s
- Parameters
num_x (int32) – Number of vertices in X direction (must be >= 2)
num_y (int32) – Number of vertices in y direction (must be >= 2)
grid_spacing (float) – Size of each quad in world units
- Returns
triangles (Array(int32)):
vertices (Array(Vector)):
u_vs (Array(Vector2D)):
uv1s (Array(Vector2D)):
- Return type
tuple
- classmethod create_grid_mesh_triangles(num_x, num_y, winding)¶
Generate an index buffer for a grid of quads. out: Triangles Output index buffer
- classmethod create_grid_mesh_welded(num_x, num_y, grid_spacing=16.000000) -> (triangles=Array(int32), vertices=Array(Vector), u_vs=Array(Vector2D))¶
Generate a vertex buffer, index buffer and UVs for a tessellated grid mesh. out: Triangles Output index buffer out: Vertices Output vertex buffer out: UVs Out UVs
- Parameters
num_x (int32) – Number of vertices in X direction (must be >= 2)
num_y (int32) – Number of vertices in y direction (must be >= 2)
grid_spacing (float) – Size of each quad in world units
- Returns
triangles (Array(int32)):
vertices (Array(Vector)):
u_vs (Array(Vector2D)):
- Return type
tuple
- classmethod generate_box_mesh(box_radius) -> (vertices=Array(Vector), triangles=Array(int32), normals=Array(Vector), u_vs=Array(Vector2D), tangents=Array(ProcMeshTangent))¶
Generate vertex and index buffer for a simple box, given the supplied dimensions. Normals, UVs and tangents are also generated for each vertex.
- Parameters
box_radius (Vector) –
- Returns
vertices (Array(Vector)):
triangles (Array(int32)):
normals (Array(Vector)):
u_vs (Array(Vector2D)):
tangents (Array(ProcMeshTangent)):
- Return type
tuple
- classmethod get_section_from_procedural_mesh(proc_mesh, section_index) -> (vertices=Array(Vector), triangles=Array(int32), normals=Array(Vector), u_vs=Array(Vector2D), tangents=Array(ProcMeshTangent))¶
Grab geometry data from a ProceduralMeshComponent.
- Parameters
proc_mesh (ProceduralMeshComponent) –
section_index (int32) –
- Returns
vertices (Array(Vector)):
triangles (Array(int32)):
normals (Array(Vector)):
u_vs (Array(Vector2D)):
tangents (Array(ProcMeshTangent)):
- Return type
tuple
- classmethod get_section_from_static_mesh(mesh, lod_index, section_index) -> (vertices=Array(Vector), triangles=Array(int32), normals=Array(Vector), u_vs=Array(Vector2D), tangents=Array(ProcMeshTangent))¶
Grab geometry data from a StaticMesh asset.
- Parameters
mesh (StaticMesh) –
lod_index (int32) –
section_index (int32) –
- Returns
vertices (Array(Vector)):
triangles (Array(int32)):
normals (Array(Vector)):
u_vs (Array(Vector2D)):
tangents (Array(ProcMeshTangent)):
- Return type
tuple
- classmethod slice_procedural_mesh(proc_mesh, plane_position, plane_normal, create_other_half, cap_option, cap_material) → ProceduralMeshComponent¶
Slice the ProceduralMeshComponent (including simple convex collision) using a plane. Optionally create ‘cap’ geometry.
- Parameters
proc_mesh (ProceduralMeshComponent) – ProceduralMeshComponent to slice
plane_position (Vector) – Point on the plane to use for slicing, in world space
plane_normal (Vector) – Normal of plane used for slicing. Geometry on the positive side of the plane will be kept.
create_other_half (bool) – If true, an additional ProceduralMeshComponent (OutOtherHalfProcMesh) will be created using the other half of the sliced geometry
cap_option (ProcMeshSliceCapOption) – If and how to create ‘cap’ geometry on the slicing plane
cap_material (MaterialInterface) – If creating a new section for the cap, assign this material to that section
- Returns
out_other_half_proc_mesh (ProceduralMeshComponent): If bCreateOtherHalf is set, this is the new component created. Its owner will be the same as the supplied InProcMesh.
- Return type