unreal.GeometryScript_UVs
¶
- class unreal.GeometryScript_UVs(outer: Object | None = None, name: 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:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
options (GeometryScriptPatchBuilderOptions) –
debug (GeometryScriptDebug) –
- Return type:
- classmethod auto_generate_x_atlas_mesh_u_vs(target_mesh, uv_set_index, options, debug=None) DynamicMesh ¶
Auto Generate XAtlas Mesh UVs
- Parameters:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
options (GeometryScriptXAtlasOptions) –
debug (GeometryScriptDebug) –
- Return type:
- 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 Channel identified by ToUVChannel 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 Channel 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 To UV Channel 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 UV Channel in CopyFromMesh to the 3D vertex positions in CopyToUVMesh, with the triangle mesh topology defined by the UV Channel. Generally this “UV Mesh” topology 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)
CopyMeshToMeshUVChannel will copy the 3D UV Mesh back to the UV Channel. This pair of functions can then be used to implement UV generation/editing via other mesh functions.
- Parameters:
copy_from_mesh (DynamicMesh) –
uv_set_index (int32) –
copy_to_uv_mesh (DynamicMesh) –
debug (GeometryScriptDebug) –
- 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:
target_mesh (DynamicMesh) –
from_uv_set (int32) –
to_uv_set (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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 Channel. The UV Channel 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:
target_mesh (DynamicMesh) –
uv_set_index (int32) – index of UV Channel to read
debug (GeometryScriptDebug) –
- 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 Channel 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 Channel
- 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 Channel 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 UV Channel 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:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
options (GeometryScriptRecomputeUVsOptions) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- classmethod repack_mesh_u_vs(target_mesh, uv_set_index, repack_options, debug=None) DynamicMesh ¶
Repack Mesh UVs
- Parameters:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
repack_options (GeometryScriptRepackUVsOptions) –
debug (GeometryScriptDebug) –
- Return type:
- classmethod rotate_mesh_u_vs(target_mesh, uv_set_index, rotation_angle, rotation_origin, selection, debug=None) DynamicMesh ¶
Rotate Mesh UVs
- Parameters:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
rotation_angle (float) –
rotation_origin (Vector2D) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- classmethod scale_mesh_u_vs(target_mesh, uv_set_index, scale, scale_origin, selection, debug=None) DynamicMesh ¶
Scale Mesh UVs
- Parameters:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
scale (Vector2D) –
scale_origin (Vector2D) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
triangle_id (int32) –
u_vs (GeometryScriptUVTriangle) –
defer_change_notifications (bool) –
- Returns:
is_valid_triangle (bool):
- Return type:
- 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:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
box_transform (Transform) –
selection (GeometryScriptMeshSelection) –
min_island_tri_count (int32) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
cylinder_transform (Transform) –
selection (GeometryScriptMeshSelection) –
split_angle (float) –
debug (GeometryScriptDebug) –
- Return type:
- 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:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
plane_transform (Transform) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type:
- classmethod set_num_uv_sets(target_mesh, num_uv_sets, debug=None) DynamicMesh ¶
Set Num UVSets
- Parameters:
target_mesh (DynamicMesh) –
num_uv_sets (int32) –
debug (GeometryScriptDebug) –
- Return type:
- classmethod translate_mesh_u_vs(target_mesh, uv_set_index, translation, selection, debug=None) DynamicMesh ¶
Translate Mesh UVs
- Parameters:
target_mesh (DynamicMesh) –
uv_set_index (int32) –
translation (Vector2D) –
selection (GeometryScriptMeshSelection) –
debug (GeometryScriptDebug) –
- Return type: