unreal.EditorSkeletalMeshLibrary

class unreal.EditorSkeletalMeshLibrary(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

Utility class to altering and analyzing a SkeletalMesh and use the common functionalities of the SkeletalMesh Editor. The editor should not be in play in editor mode.

C++ Source:

  • Plugin: EditorScriptingUtilities

  • Module: EditorScriptingUtilities

  • File: EditorSkeletalMeshLibrary.h

classmethod create_physics_asset(skeletal_mesh)PhysicsAsset

This function creates a PhysicsAsset for the given SkeletalMesh with the same settings as if it were created through FBX import

Parameters

skeletal_mesh (SkeletalMesh) –

Returns

Return type

PhysicsAsset

classmethod get_lod_build_settings(skeletal_mesh, lod_index)SkeletalMeshBuildSettings

Copy the build options with the specified LOD build settings.

Parameters
  • skeletal_mesh (SkeletalMesh) – Mesh to process.

  • lod_index (int32) – The LOD we get the reduction settings.

Returns

out_build_options (SkeletalMeshBuildSettings): The build settings where we copy the build options.

Return type

SkeletalMeshBuildSettings

classmethod get_lod_count(skeletal_mesh)int32

Retrieve the number of LOD contain in the specified skeletal mesh.

Parameters

skeletal_mesh (SkeletalMesh) –

Returns

The LOD number.

Return type

int32

classmethod get_lod_material_slot(skeletal_mesh, lod_index, section_index)int32

Gets the material slot used for a specific LOD section.

Parameters
  • skeletal_mesh (SkeletalMesh) – SkeletalMesh to get the material index from.

  • lod_index (int32) – Index of the StaticMesh LOD.

  • section_index (int32) – Index of the StaticMesh Section.

Returns

MaterialSlotIndex Index of the material slot used by the section or INDEX_NONE in case of error.

Return type

int32

classmethod get_num_sections(skeletal_mesh, lod_index)int32

Get number of sections for a LOD of a Skeletal Mesh

Parameters
  • skeletal_mesh (SkeletalMesh) – Mesh to get number of vertices from.

  • lod_index (int32) – Index of the mesh LOD.

Returns

Number of sections. Returns INDEX_NONE if invalid mesh or LOD index.

Return type

int32

classmethod get_num_verts(skeletal_mesh, lod_index)int32

Get number of mesh vertices for an LOD of a Skeletal Mesh

Parameters
  • skeletal_mesh (SkeletalMesh) – Mesh to get number of vertices from.

  • lod_index (int32) – Index of the mesh LOD.

Returns

Number of vertices. Returns 0 if invalid mesh or LOD index.

Return type

int32

classmethod import_lod(base_mesh, lod_index, source_filename)int32

Import or re-import a LOD into the specified base mesh. If the LOD do not exist it will import it and add it to the base static mesh. If the LOD already exist it will re-import the specified LOD.

Parameters
  • base_mesh (SkeletalMesh) –

  • lod_index (int32) –

  • source_filename (str) –

Returns

The index of the LOD that was imported or re-imported. Will return INDEX_NONE if anything goes bad.

Return type

int32

classmethod regenerate_lod(skeletal_mesh, new_lod_count=0, regenerate_even_if_imported=False, generate_base_lod=False)bool

Regenerate LODs of the mesh

Parameters
  • skeletal_mesh (SkeletalMesh) – The mesh that will regenerate LOD

  • new_lod_count (int32) – Set valid value (>0) if you want to change LOD count. Otherwise, it will use the current LOD and regenerate

  • regenerate_even_if_imported (bool) – If this is true, it only regenerate even if this LOD was imported before If false, it will regenerate for only previously auto generated ones

  • generate_base_lod (bool) – If this is true and there is some reduction data, the base LOD will be reduce according to the settings

Returns

true if succeed. If mesh reduction is not available this will return false.

Return type

bool

classmethod reimport_all_custom_lo_ds(skeletal_mesh)bool

Re-import the specified skeletal mesh and all the custom LODs.

Parameters

skeletal_mesh (SkeletalMesh) –

Returns

true if re-import works, false otherwise see log for explanation.

Return type

bool

classmethod remove_lo_ds(skeletal_mesh, to_remove_lo_ds)bool

Remove all the specified LODs. This function will remove all the valid LODs in the list. Valid LOD is any LOD greater then 0 that exist in the skeletalmesh. We cannot remove the base LOD 0.

Parameters
  • skeletal_mesh (SkeletalMesh) – The mesh inside which we are renaming a socket

  • to_remove_lo_ds (Array(int32)) – The LODs we need to remove

Returns

true if the successfully remove all the LODs. False otherwise, but evedn if it return false it will have removed all valid LODs.

Return type

bool

classmethod rename_socket(skeletal_mesh, old_name, new_name)bool

Rename a socket within a skeleton

Parameters
  • skeletal_mesh (SkeletalMesh) – The mesh inside which we are renaming a socket

  • old_name (Name) – The old name of the socket

  • new_name (Name) – The new name of the socket

Returns

true if the renaming succeeded.

Return type

bool

classmethod set_lod_build_settings(skeletal_mesh, lod_index, build_options)None

Set the LOD build options for the specified LOD index.

Parameters
  • skeletal_mesh (SkeletalMesh) – Mesh to process.

  • lod_index (int32) – The LOD we will apply the build settings.

  • build_options (SkeletalMeshBuildSettings) – The build settings we want to apply to the LOD.

classmethod strip_lod_geometry(skeletal_mesh, lod_index, texture_mask, threshold)bool

This function will strip all triangle in the specified LOD that don’t have any UV area pointing on a black pixel in the TextureMask. We use the UVChannel 0 to find the pixels in the texture.

Parameters
Returns

Return type

bool