unreal.GeometryScript_UVs

class unreal.GeometryScript_UVs(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: BlueprintFunctionLibrary

Geometry Script Library Mesh UVFunctions

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: MeshUVFunctions.h

classmethod auto_generate_patch_builder_mesh_u_vs(target_mesh, uv_set_index, options, debug=None) DynamicMesh

Auto Generate Patch Builder Mesh UVs

Parameters:
Return type:

DynamicMesh

classmethod auto_generate_x_atlas_mesh_u_vs(target_mesh, uv_set_index, options, debug=None) DynamicMesh

Auto Generate XAtlas Mesh UVs

Parameters:
Return type:

DynamicMesh

classmethod copy_mesh_to_mesh_uv_layer(copy_from_uv_mesh, to_uv_set_index, copy_to_mesh, only_uv_positions=True, debug=None) -> (DynamicMesh, copy_to_mesh=DynamicMesh, copy_to_mesh_out=DynamicMesh, found_topology_errors=bool, is_valid_uv_set=bool)

Transfer the 3D vertex positions and triangles of CopyFromUVMesh to the given UV Layer identified by ToUVSetIndex of CopyToMesh. 3D positions (X,Y,Z) will be copied as UV positions (X,Y), ie Z is ignored.

bOnlyUVPositions controls whether only UV positions will be updated, or if the UV topology will be fully replaced. When false, CopyFromUVMesh must currently have a MaxVertexID <= that of the UV Layer MaxElementID When true, CopyFromUVMesh must currently have a MaxTriangleID <= that of CopyToMesh

Parameters:
  • copy_from_uv_mesh (DynamicMesh) –

  • to_uv_set_index (int32) –

  • copy_to_mesh (DynamicMesh) –

  • only_uv_positions (bool) – if true, only (valid, matching) UV positions are updated, a full new UV topology is created

  • debug (GeometryScriptDebug) –

Returns:

copy_to_mesh (DynamicMesh):

copy_to_mesh_out (DynamicMesh):

found_topology_errors (bool):

is_valid_uv_set (bool): will be returned false if ToUVSetIndex is not available

Return type:

tuple

classmethod copy_mesh_uv_layer_to_mesh(copy_from_mesh, uv_set_index, copy_to_uv_mesh, debug=None) -> (DynamicMesh, copy_to_uv_mesh=DynamicMesh, copy_to_uv_mesh_out=DynamicMesh, invalid_topology=bool, is_valid_uv_set=bool)

Copy the 2D UVs from the given UVSetIndex in CopyFromMesh to the 3D vertex positions in CopyToUVMesh, with the triangle mesh topolgoy defined by the UV Set. Generally this “UV Mesh” topolgoy will not be the same as the 3D mesh topology. Polygroup IDs and Material IDs are preserved in the UVMesh.

2D UV Positions are copied to 3D as (X, Y, 0)

CopyMeshToMeshUVLayer will copy the 3D UV Mesh back to the UV Set. This pair of functions can then be used to implement UV generation/editing via other mesh functions.

Parameters:
Returns:

copy_to_uv_mesh (DynamicMesh):

copy_to_uv_mesh_out (DynamicMesh):

invalid_topology (bool): will be returned true if any topological issues were found

is_valid_uv_set (bool): will be returned false if UVSetIndex is not available

Return type:

tuple

classmethod copy_uv_set(target_mesh, from_uv_set, to_uv_set, debug=None) DynamicMesh

Copy UVSet

Parameters:
Return type:

DynamicMesh

classmethod get_mesh_per_vertex_u_vs(target_mesh, uv_set_index, debug=None) -> (DynamicMesh, uv_list=GeometryScriptUVList, is_valid_uv_set=bool, has_vertex_id_gaps=bool, has_split_u_vs=bool)

Get a list of single vertex UVs for each mesh vertex in the TargetMesh, derived from the specified UV Overlay. The UV Overlay may store multiple UVs for a single vertex (along UV seams) In such cases an arbitrary UV will be stored for that vertex, and bHasSplitUVs will be returned as true

Parameters:
Returns:

uv_list (GeometryScriptUVList): output UV list will be stored here. Size will be equal to the MaxVertexID of TargetMesh (not the VertexCount!)

is_valid_uv_set (bool): will be set to true if the UV Overlay was valid

has_vertex_id_gaps (bool): will be set to true if some vertex indices in TargetMesh were invalid, ie MaxVertexID > VertexCount

has_split_u_vs (bool): will be set to true if there were split UVs in the UV overlay

Return type:

tuple

classmethod get_mesh_uv_size_info(target_mesh, uv_set_index, selection, only_include_valid_uv_tris=True, debug=None) -> (DynamicMesh, mesh_area=double, uv_area=double, mesh_bounds=Box, uv_bounds=Box2D, is_valid_uv_set=bool, found_unset_u_vs=bool)

Compute information about dimensions and areas for a UV Set of a Mesh, with an optional Mesh Selection

Parameters:
  • target_mesh (DynamicMesh) –

  • uv_set_index (int32) – index of UV Set to query

  • selection (GeometryScriptMeshSelection) – subset of triangles to process, whole mesh is used if selection is not provided

  • only_include_valid_uv_tris (bool) – if true, only triangles with valid UVs are included in 3D Mesh Area/Bounds

  • debug (GeometryScriptDebug) –

Returns:

mesh_area (double): output 3D area of queried triangles

uv_area (double): output 2D UV-space area of queried triangles

mesh_bounds (Box): output 3D bounding box of queried triangles

uv_bounds (Box2D): output 2D UV-space bounding box of queried triangles

is_valid_uv_set (bool): output flag set to false if UVSetIndex does not exist on the target mesh. In this case Areas and Bounds are not initialized.

found_unset_u_vs (bool): output flag set to true if any of the queried triangles do not have valid UVs set

Return type:

tuple

classmethod recompute_mesh_u_vs(target_mesh, uv_set_index, options, selection, debug=None) DynamicMesh

Recompute Mesh UVs

Parameters:
Return type:

DynamicMesh

classmethod repack_mesh_u_vs(target_mesh, uv_set_index, repack_options, debug=None) DynamicMesh

Repack Mesh UVs

Parameters:
Return type:

DynamicMesh

classmethod rotate_mesh_u_vs(target_mesh, uv_set_index, rotation_angle, rotation_origin, selection, debug=None) DynamicMesh

Rotate Mesh UVs

Parameters:
Return type:

DynamicMesh

classmethod scale_mesh_u_vs(target_mesh, uv_set_index, scale, scale_origin, selection, debug=None) DynamicMesh

Scale Mesh UVs

Parameters:
Return type:

DynamicMesh

classmethod set_mesh_triangle_u_vs(target_mesh, uv_set_index, triangle_id, u_vs, defer_change_notifications=False) -> (DynamicMesh, is_valid_triangle=bool)

Set Mesh Triangle UVs

Parameters:
Returns:

is_valid_triangle (bool):

Return type:

bool

classmethod set_mesh_u_vs_from_box_projection(target_mesh, uv_set_index, box_transform, selection, min_island_tri_count=2, debug=None) DynamicMesh

Set Mesh UVs from Box Projection

Parameters:
Return type:

DynamicMesh

classmethod set_mesh_u_vs_from_cylinder_projection(target_mesh, uv_set_index, cylinder_transform, selection, split_angle=45.000000, debug=None) DynamicMesh

Set Mesh UVs from Cylinder Projection

Parameters:
Return type:

DynamicMesh

classmethod set_mesh_u_vs_from_planar_projection(target_mesh, uv_set_index, plane_transform, selection, debug=None) DynamicMesh

Scale of PlaneTransform defines world-space dimension that maps to 1 UV dimension

Parameters:
Return type:

DynamicMesh

classmethod set_num_uv_sets(target_mesh, num_uv_sets, debug=None) DynamicMesh

Set Num UVSets

Parameters:
Return type:

DynamicMesh

classmethod translate_mesh_u_vs(target_mesh, uv_set_index, translation, selection, debug=None) DynamicMesh

Translate Mesh UVs

Parameters:
Return type:

DynamicMesh