unreal.SkeletalMesh

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

Bases: unreal.StreamableRenderAsset

SkeletalMesh is geometry bound to a hierarchical skeleton of bones which can be animated for the purpose of deforming the mesh. Skeletal Meshes are built up of two parts; a set of polygons composed to make up the surface of the mesh, and a hierarchical skeleton which can be used to animate the polygons. The 3D models, rigging, and animations are created in an external modeling and animation application (3DSMax, Maya, Softimage, etc). see: https://docs.unrealengine.com/latest/INT/Engine/Content/Types/SkeletalMeshes/

C++ Source:

  • Module: Engine

  • File: SkeletalMesh.h

Editor Properties: (see get_editor_property/set_editor_property)

  • asset_import_data (AssetImportData): [Read-Write] Asset Import Data

  • asset_user_data (Array(AssetUserData)): [Read-Write] Array of user data stored with the asset

  • default_animating_rig (Object): [Read-Write] Default Animating Rig

  • disable_below_min_lod_stripping (PerPlatformBool): [Read-Write] Disable Below Min Lod Stripping

  • enable_per_poly_collision (bool): [Read-Write] Enable Per Poly Collision

  • global_force_mip_levels_to_be_resident (bool): [Read-Write] Global and serialized version of ForceMiplevelsToBeResident.

  • lod_info (Array(SkeletalMeshLODInfo)): [Read-Write] Struct containing information for each LOD level, such as materials to use, and when use the LOD.

  • lod_settings (SkeletalMeshLODSettings): [Read-Write] LODSettings

  • materials (Array(SkeletalMaterial)): [Read-Write] Materials

  • max_num_optional_lo_ds (PerPlatformInt): [Read-Write] Max Num Optional LODs

  • max_num_streamed_lo_ds (PerPlatformInt): [Read-Write] Max Num Streamed LODs

  • mesh_clothing_assets (Array(ClothingAssetBase)): [Read-Write] Mesh Clothing Assets

  • min_lod (PerPlatformInt): [Read-Write] Min Lod

  • morph_targets (Array(MorphTarget)): [Read-Write] Morph Targets

  • negative_bounds_extension (Vector): [Read-Write] Bound extension values in addition to imported bound in the negative direction of XYZ,

    positive value increases bound size and negative value decreases bound size. The final bound would be from [Imported Bound - Negative Bound] to [Imported Bound + Positive Bound].

  • never_stream (bool): [Read-Write] Never Stream

  • node_mapping_data (Array(NodeMappingContainer)): [Read-Write] Node Mapping Data

  • num_cinematic_mip_levels (int32): [Read-Write] Number of mip-levels to use for cinematic quality.

  • override_lod_streaming_settings (bool): [Read-Write] Override LODStreaming Settings

  • physics_asset (PhysicsAsset): [Read-Write] Physics Asset

  • positive_bounds_extension (Vector): [Read-Write] Bound extension values in addition to imported bound in the positive direction of XYZ,

    positive value increases bound size and negative value decreases bound size. The final bound would be from [Imported Bound - Negative Bound] to [Imported Bound + Positive Bound].

  • post_process_anim_blueprint (type(Class)): [Read-Write] Post Process Anim Blueprint

  • sampling_info (SkeletalMeshSamplingInfo): [Read-Write] Defines if and how to generate a set of precomputed data allowing targeted and fast sampling of this mesh on the CPU.

  • shadow_physics_asset (PhysicsAsset): [Read-Write] Shadow Physics Asset

  • skel_mirror_axis (AxisType): [Read-Write] Skel Mirror Axis

  • skel_mirror_flip_axis (AxisType): [Read-Write] Skel Mirror Flip Axis

  • skel_mirror_table (Array(BoneMirrorInfo)): [Read-Write] Skel Mirror Table

  • skeleton (Skeleton): [Read-Only] Skeleton

  • skin_weight_profiles (Array(SkinWeightProfileInfo)): [Read-Write] Set of skin weight profiles associated with this mesh

  • support_lod_streaming (PerPlatformBool): [Read-Write] B Support LODStreaming

  • support_ray_tracing (bool): [Read-Write] If true, a ray tracing acceleration structure will be built for this mesh and it may be used in ray tracing effects

  • thumbnail_info (ThumbnailInfo): [Read-Only] Thumbnail Info

property default_animating_rig

[Read-Write] Default Animating Rig

Type

(Object)

find_socket(socket_name)SkeletalMeshSocket

Find a socket object in this SkeletalMesh by name. Entering NAME_None will return NULL. If there are multiple sockets with the same name, will return the first one.

Parameters

socket_name (Name) –

Returns

Return type

SkeletalMeshSocket

find_socket_and_index(socket_name) -> (SkeletalMeshSocket, out_index=int32)

Find a socket object in this SkeletalMesh by name. Entering NAME_None will return NULL. If there are multiple sockets with the same name, will return the first one. Also returns the index for the socket allowing for future fast access via GetSocketByIndex()

Parameters

socket_name (Name) –

Returns

out_index (int32):

Return type

int32

find_socket_info(socket_name) -> (SkeletalMeshSocket, out_transform=Transform, out_bone_index=int32, out_index=int32)

Find a socket object and asscociated info in this SkeletalMesh by name. Entering NAME_None will return NULL. If there are multiple sockets with the same name, will return the first one. Also returns the index for the socket allowing for future fast access via GetSocketByIndex() Also rteturns the socket loca transform and the bone index (if any)

Parameters

socket_name (Name) –

Returns

out_transform (Transform):

out_bone_index (int32):

out_index (int32):

Return type

tuple

get_all_morph_target_names()

Returns the list of all morph targets of this skeletal mesh

Returns

The list of morph targets

Return type

Array(str)

get_bounds()BoxSphereBounds

Get the extended bounds of this mesh (imported bounds plus bounds extension)

Returns

Return type

BoxSphereBounds

get_imported_bounds()BoxSphereBounds

Get the original imported bounds of the skel mesh

Returns

Return type

BoxSphereBounds

get_node_mapping_container(source_asset)NodeMappingContainer

Get Node Mapping Container

Parameters

source_asset (Blueprint) –

Returns

Return type

NodeMappingContainer

get_socket_by_index(index)SkeletalMeshSocket

Returns a socket by index. Max index is NumSockets(). The meshes sockets are accessed first, then the skeletons.

Parameters

index (int32) –

Returns

Return type

SkeletalMeshSocket

is_section_using_cloth(section_index, check_corresponding_sections=True)bool

Checks whether the provided section is using APEX cloth. if bCheckCorrespondingSections is true disabled sections will defer to correspond sections to see if they use cloth (non-cloth sections are disabled and another section added when cloth is enabled, using this flag allows for a check on the original section to succeed)

Parameters
  • section_index (int32) – Index to check

  • check_corresponding_sections (bool) – Whether to check corresponding sections for disabled sections

Returns

Return type

bool

property lod_settings

[Read-Write] LODSettings

Type

(SkeletalMeshLODSettings)

property materials

[Read-Write] Materials

Type

(Array(SkeletalMaterial))

property mesh_clothing_assets

[Read-Write] Mesh Clothing Assets

Type

(Array(ClothingAssetBase))

property morph_targets

[Read-Write] Morph Targets

Type

(Array(MorphTarget))

property negative_bounds_extension

[Read-Only] Bound extension values in addition to imported bound in the negative direction of XYZ, positive value increases bound size and negative value decreases bound size. The final bound would be from [Imported Bound - Negative Bound] to [Imported Bound + Positive Bound].

Type

(Vector)

property node_mapping_data

[Read-Only] Node Mapping Data

Type

(Array(NodeMappingContainer))

num_sockets()int32

Returns the number of sockets available. Both on this mesh and it’s skeleton.

Returns

Return type

int32

property physics_asset

[Read-Only] Physics Asset

Type

(PhysicsAsset)

property positive_bounds_extension

[Read-Only] Bound extension values in addition to imported bound in the positive direction of XYZ, positive value increases bound size and negative value decreases bound size. The final bound would be from [Imported Bound - Negative Bound] to [Imported Bound + Positive Bound].

Type

(Vector)

property post_process_anim_blueprint

[Read-Only] Post Process Anim Blueprint

Type

(type(Class))

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

Regenerate LODs of the mesh

Parameters
  • 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

remove_lo_ds(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

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

rename_socket(old_name, new_name)bool

Rename a socket within a skeleton

Parameters
  • 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

property shadow_physics_asset

[Read-Only] Shadow Physics Asset

Type

(PhysicsAsset)

property skeleton

[Read-Only] Skeleton

Type

(Skeleton)

strip_lod_geometry(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
  • lod_index (int32) –

  • texture_mask (Texture2D) –

  • threshold (float) –

Returns

Return type

bool