unreal.GeometryScript_AssetUtils

class unreal.GeometryScript_AssetUtils(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

Although the class name indicates StaticMeshFunctions, that was a naming mistake that is difficult to correct. This class is intended to serve as a generic asset utils function library. The naming issue is only visible at the C++ level. It is not visible in Python or BP.

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: MeshAssetFunctions.h

classmethod check_static_mesh_has_available_lod(static_mesh_asset, requested_lod, debug=None) GeometryScriptSearchOutcomePins or None

Check if a Static Mesh Asset has the RequestedLOD available, ie if CopyMeshFromStaticMesh will be able to succeed for the given LODType and LODIndex.

Parameters:
Returns:

outcome (GeometryScriptSearchOutcomePins):

Return type:

GeometryScriptSearchOutcomePins or None

classmethod convert_material_list_to_material_map(material_list, material_slot_names) Map[Name, MaterialInterface]

Converts material list and slot names list to material map, which is the format expected by CreateNewSkeletalMeshAssetFromMesh. Material List and Material Slot Names should have the same length. However, if there are fewer slot names than materials, slot names will be auto-generated (as ‘[Name of material]_[Index]’, or ‘Material_[Index]’ for null materials)

Parameters:
Return type:

Map[Name, MaterialInterface]

classmethod convert_material_map_to_material_list(material_map) -> (material_list=Array[MaterialInterface], material_slot_names=Array[Name])

Converts material map to a material list and a slot names list. Null materials will be kept in the list, and the list will have the same number of elements as the map.

Parameters:

material_map (Map[Name, MaterialInterface])

Returns:

material_list (Array[MaterialInterface]):

material_slot_names (Array[Name]):

Return type:

tuple

classmethod copy_mesh_from_skeletal_mesh(from_skeletal_mesh_asset, to_dynamic_mesh, asset_options, requested_lod, debug=None) -> (DynamicMesh, outcome=GeometryScriptOutcomePins)

Extracts a Dynamic Mesh from a Skeletal Mesh Asset.

Parameters:
Returns:

outcome (GeometryScriptOutcomePins):

Return type:

GeometryScriptOutcomePins

classmethod copy_mesh_from_static_mesh(from_static_mesh_asset, to_dynamic_mesh, asset_options, requested_lod, debug=None) -> (DynamicMesh, outcome=GeometryScriptOutcomePins)

Extracts a Dynamic Mesh from a Static Mesh Asset, using section indices for the material IDs – use GetSectionMaterialListFromStaticMesh to get the corresponding materials.

Note that the LOD Index in RequestedLOD will be silently clamped to the available number of LODs (SourceModel or RenderData)

Parameters:
Returns:

outcome (GeometryScriptOutcomePins):

Return type:

GeometryScriptOutcomePins

classmethod copy_mesh_from_static_mesh_v2(from_static_mesh_asset, to_dynamic_mesh, asset_options, requested_lod, use_section_materials=True, debug=None) -> (DynamicMesh, outcome=GeometryScriptOutcomePins)

Extracts a Dynamic Mesh from a Static Mesh Asset.

Note that the LOD Index in RequestedLOD will be silently clamped to the available number of LODs (SourceModel or RenderData)

Parameters:
Returns:

outcome (GeometryScriptOutcomePins):

Return type:

GeometryScriptOutcomePins

classmethod copy_mesh_to_skeletal_mesh(from_dynamic_mesh, to_skeletal_mesh_asset, options, target_lod, debug=None) -> (DynamicMesh, outcome=GeometryScriptOutcomePins)

Updates a Skeletal Mesh Asset with new geometry and bone weights data from a Dynamic Mesh.

Parameters:
Returns:

outcome (GeometryScriptOutcomePins):

Return type:

GeometryScriptOutcomePins

classmethod copy_mesh_to_static_mesh(from_dynamic_mesh, to_static_mesh_asset, options, target_lod, use_section_materials=True, debug=None) -> (DynamicMesh, outcome=GeometryScriptOutcomePins)

Updates a Static Mesh Asset with new geometry converted from a Dynamic Mesh

Parameters:
Returns:

outcome (GeometryScriptOutcomePins):

Return type:

GeometryScriptOutcomePins

classmethod copy_morph_target_to_skeletal_mesh(from_morph_target, to_skeletal_mesh_asset, morph_target_name, options, target_lod, debug=None) -> (DynamicMesh, outcome=GeometryScriptOutcomePins)

Add a Dynamic Mesh morph target to a Skeletal Mesh Asset.

Parameters:
Returns:

outcome (GeometryScriptOutcomePins):

Return type:

GeometryScriptOutcomePins

classmethod copy_skin_weight_profile_to_skeletal_mesh(from_dynamic_mesh, to_skeletal_mesh_asset, target_profile_name, source_profile_name, options, target_lod, debug=None) -> (DynamicMesh, outcome=GeometryScriptOutcomePins)

Add a Dynamic Mesh skin weight profile to a Skeletal Mesh Asset.

Parameters:
Returns:

outcome (GeometryScriptOutcomePins):

Return type:

GeometryScriptOutcomePins

classmethod get_lod_material_list_from_skeletal_mesh(from_skeletal_mesh_asset, requested_lod, debug=None) -> (material_list=Array[MaterialInterface], material_index=Array[int32], material_slot_names=Array[Name], outcome=GeometryScriptOutcomePins)

Extracts the Material List and corresponding Material Indices from the specified LOD of the Skeletal Mesh Asset. If Copy Mesh To Skeletal Mesh was used to create a Dynamic Mesh, then the returned Material List can be passed directly to a Dynamic Mesh Component.

Parameters:
Returns:

material_list (Array[MaterialInterface]):

material_index (Array[int32]): this returned array is the same size as MaterialList, with each value the index of that Material in the Skeletal Mesh’s Material List

material_slot_names (Array[Name]):

outcome (GeometryScriptOutcomePins):

Return type:

tuple

classmethod get_material_list_from_skeletal_mesh(from_skeletal_mesh_asset, debug=None) -> (material_list=Array[MaterialInterface], material_slot_names=Array[Name])

Get the asset materials from the skeletal mesh asset. Note: For LOD-specific materials, use GetLODMaterialListFromSkeletalMesh instead.

Parameters:
Returns:

material_list (Array[MaterialInterface]):

material_slot_names (Array[Name]):

Return type:

tuple

classmethod get_material_list_from_static_mesh(from_static_mesh_asset, debug=None) -> (material_list=Array[MaterialInterface], material_slot_names=Array[Name])

Get the asset materials from the static mesh asset. These will match the DynamicMesh material if CopyMeshFromStaticMesh was used to create a DynamicMesh with bUseSectionMaterials=false

Parameters:
Returns:

material_list (Array[MaterialInterface]):

material_slot_names (Array[Name]):

Return type:

tuple

classmethod get_num_static_mesh_lo_ds_of_type(static_mesh_asset: StaticMesh, lod_type: GeometryScriptLODType = Ellipsis) int

deprecated: ‘get_num_static_mesh_lo_ds_of_type’ was renamed to ‘get_num_static_mesh_lods_of_type’.

classmethod get_num_static_mesh_lods_of_type(static_mesh_asset, lod_type=GeometryScriptLODType.SOURCE_MODEL) int32

Determine the number of available LODs of the requested LODType in a Static Mesh Asset

Parameters:
Return type:

int32

classmethod get_section_material_list_from_static_mesh(from_static_mesh_asset, requested_lod, debug=None) -> (material_list=Array[MaterialInterface], material_index=Array[int32], material_slot_names=Array[Name], outcome=GeometryScriptOutcomePins)

Extracts the Material List and corresponding Material Indices from the specified LOD of the Static Mesh Asset. The MaterialList is sorted by Section, so if CopyMeshToStaticMesh was used to create a DynamicMesh with bUseSectionMaterials=true, then the returned MaterialList here will correspond to the MaterialIDs in that DynamicMesh (as each Static Mesh Section becomes a MaterialID, in-order). So, the returned MaterialList can be passed directly to (eg) a DynamicMeshComponent.

Parameters:
Returns:

material_list (Array[MaterialInterface]):

material_index (Array[int32]): this returned array is the same size as MaterialList, with each value the index of that Material in the StaticMesh Material List

material_slot_names (Array[Name]):

outcome (GeometryScriptOutcomePins):

Return type:

tuple