unreal.SkeletalMeshEditorSubsystem¶
- class unreal.SkeletalMeshEditorSubsystem(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
EditorSubsystemUSkeletalMeshEditorSubsystem Subsystem for exposing skeletal mesh functionality to scripts
C++ Source:
Module: SkeletalMeshEditor
File: SkeletalMeshEditorSubsystem.h
- classmethod assign_physics_asset(target_mesh, physics_asset) bool¶
Assigns a PhysicsAsset to the given SkeletalMesh if it is compatible. Passing nullptr / None as the physics asset will always succeed and will clear the physics asset assignment for the target SkeletalMesh
- Parameters:
target_mesh (SkeletalMesh) – The mesh to attempt to assign the PhysicsAsset to
physics_asset (PhysicsAsset) – The physics asset to assign to the provided mesh (or nullptr/None)
- Returns:
Whether the physics asset was successfully assigned to the mesh
- Return type:
- classmethod create_physics_asset(skeletal_mesh, set_to_mesh=True, lod_index=0) 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)
set_to_mesh (bool)
lod_index (int32)
- Return type:
- 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:
- 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
- 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
- get_material_slot_overlay_material(skeletal_mesh, slot_index) MaterialInterface¶
Get the overlay material for a material slot in a Skeletal Mesh.
- Parameters:
skeletal_mesh (SkeletalMesh) – Mesh to get material overlay from.
slot_index (int32) – Index of the skeletal mesh material slot.
- Returns:
the material interface or null if there is no overlay material.
- Return type:
- classmethod get_morph_targets_generated_by_engine(target_mesh) Array[Name]¶
Get morph targets marked as generated by engine.
- Parameters:
target_mesh (SkeletalMesh) – The mesh to get morph targets.
- Returns:
out_names (Array[Name]): Receive the names of morph targets marked as generated by engine
- Return type:
- 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
- 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
- get_section_cast_shadow(skeletal_mesh, lod_index, section_index) bool or None¶
Get bCastShadow from a section of 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.
section_index (int32) – Index of the LOD section.
- Returns:
false if invalid mesh or LOD index or section index.
out_cast_shadow (bool): The function will set the bCastShadow used by the section
- Return type:
bool or None
- get_section_recompute_tangent(skeletal_mesh, lod_index, section_index) bool or None¶
Get bRecomputeTangent from a section of 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.
section_index (int32) – Index of the LOD section.
- Returns:
false if invalid mesh or LOD index or section index.
out_recompute_tangent (bool): The function will set the bRecomputeTangent used by the section
- Return type:
bool or None
- get_section_recompute_tangents_vertex_mask_channel(skeletal_mesh, lod_index, section_index) uint8 or None¶
Get RecomputeTangentsVertexMaskChannel from a section of 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.
section_index (int32) – Index of the LOD section.
- Returns:
false if invalid mesh or LOD index or section index.
out_recompute_tangents_vertex_mask_channel (uint8): The function will set the RecomputeTangentsVertexMaskChannel used by the section
- Return type:
uint8 or None
- get_section_visible_in_ray_tracing(skeletal_mesh, lod_index, section_index) bool or None¶
Get bVisibleInRayTracing from a section of 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.
section_index (int32) – Index of the LOD section.
- Returns:
false if invalid mesh or LOD index or section index.
out_visible_in_ray_tracing (bool): The function will set the bVisibleInRayTracing used by the section
- Return type:
bool or None
- get_skeletal_mesh_overlay_material(skeletal_mesh) MaterialInterface¶
Get the overlay material for a Skeletal Mesh.
- Parameters:
skeletal_mesh (SkeletalMesh) – Mesh to get the material overlay from.
- Returns:
the material interface or null if there is no material.
- Return type:
- classmethod get_skeleton_curve_meta_data_names(target_skeleton, filter) Array[Name]¶
Retrieve all curve metadata name from the skeleton.
- Parameters:
target_skeleton (Skeleton) – The skeleton we query the data from.
- Returns:
out_names (Array[Name]): Receive all the name of the curves that has metadata in the skeleton.
- Return type:
- 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 is_physics_asset_compatible(target_mesh, physics_asset) bool¶
Checks whether a physics asset is compatible with the given SkeletalMesh
- Parameters:
target_mesh (SkeletalMesh) – The mesh to test for compatibility
physics_asset (PhysicsAsset) – The PhysicsAsset to test for compatibility
- Returns:
Whether the physics asset is compatible with the target SkeletalMesh
- Return type:
- 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:
- classmethod reimport_all_custom_lo_ds(skeletal_mesh: SkeletalMesh) bool¶
deprecated: ‘reimport_all_custom_lo_ds’ was renamed to ‘reimport_all_custom_lods’.
- classmethod reimport_all_custom_lods(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:
- classmethod remove_lo_ds(base_mesh: SkeletalMesh, to_remove_lo_ds: None) bool¶
deprecated: ‘remove_lo_ds’ was renamed to ‘remove_lods’.
- classmethod remove_lods(base_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:
base_mesh (SkeletalMesh)
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:
- 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:
- 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.
- set_material_slot_overlay_material(skeletal_mesh, slot_index, new_section_overlay_material) bool¶
Set the overlay material for a material slot in a Skeletal Mesh.
- Parameters:
skeletal_mesh (SkeletalMesh) – Mesh to set material overlay to.
slot_index (int32) – Index of the skeletal mesh material slot.
new_section_overlay_material (MaterialInterface) – The function will set the OverlayMaterial used by the slot
- Returns:
false if invalid mesh or material slot index is invalid.
- Return type:
- classmethod set_morph_targets_to_generated_by_engine(target_mesh, optional_names) bool¶
Set morph targets has generated by engine.
- Parameters:
target_mesh (SkeletalMesh) – The mesh to convert morph targets to generated by engine.
optional_names (Array[str]) – The names of morph targets to convert. If the array is empty all morph will be converted.
- Returns:
Return true if the target mesh was modified, false otherwise.
- Return type:
- classmethod set_morph_targets_to_generated_by_engine_for_all_skeletal_mesh(optional_names, optional_paths) None¶
Set morph targets has generated by engine for all skeletalmesh in the content.
- set_section_cast_shadow(skeletal_mesh, lod_index, section_index, cast_shadow) bool¶
Set bCastShadow for a section of 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.
section_index (int32) – Index of the LOD section.
cast_shadow (bool) – The function will set the bCastShadow used by the section
- Returns:
false if invalid mesh or LOD index or section index.
- Return type:
- set_section_recompute_tangent(skeletal_mesh, lod_index, section_index, recompute_tangent) bool¶
Set bRecomputeTangent for a section of 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.
section_index (int32) – Index of the LOD section.
recompute_tangent (bool) – The function will set the bRecomputeTangent used by the section
- Returns:
false if invalid mesh or LOD index or section index.
- Return type:
- set_section_recompute_tangents_vertex_mask_channel(skeletal_mesh, lod_index, section_index, recompute_tangents_vertex_mask_channel) bool¶
Set RecomputeTangentsVertexMaskChannel for a section of 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.
section_index (int32) – Index of the LOD section.
recompute_tangents_vertex_mask_channel (uint8) – The function will set the RecomputeTangentsVertexMaskChannel used by the section
- Returns:
false if invalid mesh or LOD index or section index.
- Return type:
- set_section_visible_in_ray_tracing(skeletal_mesh, lod_index, section_index, visible_in_ray_tracing) bool¶
Set bVisibleInRayTracing for a section of 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.
section_index (int32) – Index of the LOD section.
visible_in_ray_tracing (bool) – The function will set the bVisibleInRayTracing used by the section
- Returns:
false if invalid mesh or LOD index or section index.
- Return type:
- set_skeletal_mesh_overlay_material(skeletal_mesh, new_overlay_material) bool¶
Set the overlay material for a Skeletal Mesh.
- Parameters:
skeletal_mesh (SkeletalMesh) – Mesh to set material overlay to.
new_overlay_material (MaterialInterface) – the OverlayMaterial we set for the skeletal mesh
- Returns:
false if invalid mesh.
- Return type:
- 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:
skeletal_mesh (SkeletalMesh)
lod_index (int32)
texture_mask (Texture2D)
threshold (float)
- Return type: