unreal.GeometryScript_BoneWeights

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

Bases: BlueprintFunctionLibrary

Geometry Script Library Mesh Bone Weight Functions

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: MeshBoneWeightFunctions.h

classmethod compute_smooth_bone_weights(target_mesh, skeleton, options, profile=['Default'], debug=None) DynamicMesh

Computes a smooth skin binding for the given mesh to the skeleton provided.

Parameters:
Return type:

DynamicMesh

classmethod copy_bones_from_mesh(source_mesh, target_mesh, debug=None) DynamicMesh

Copy the bone attributes (skeleton) from the SourceMesh to the TargetMesh.

Parameters:
Return type:

DynamicMesh

classmethod discard_bones_from_mesh(target_mesh, debug=None) DynamicMesh

Discard the bone attributes (skeleton) from the TargetMesh.

Parameters:
Return type:

DynamicMesh

classmethod get_all_bones_info(target_mesh, debug=None) -> (DynamicMesh, bones_info=Array[GeometryScriptBoneInfo])

Get an array of bones representing the skeleton. Each entry contains information about the bone.

Parameters:
Returns:

bones_info (Array[GeometryScriptBoneInfo]): Skeleton information.

Return type:

Array[GeometryScriptBoneInfo]

classmethod get_bone_children(target_mesh, bone_name, recursive, debug=None) -> (DynamicMesh, is_valid_bone_name=bool, children_info=Array[GeometryScriptBoneInfo])

Get the information about the children of the bone.

Parameters:
  • target_mesh (DynamicMesh) – Mesh containing the bone attributes.

  • bone_name (Name) – The name of bone.

  • recursive (bool) – If set to true, grandchildren will also be added recursively

  • debug (GeometryScriptDebug) –

Returns:

is_valid_bone_name (bool): Set to true if the TargetMesh contains a bone with the given name, false otherwise.

children_info (Array[GeometryScriptBoneInfo]): The informattion of the children.

Return type:

tuple

classmethod get_bone_index(target_mesh, bone_name, debug=None) -> (DynamicMesh, is_valid_bone_name=bool, bone_index=int32)

Get Bone Index

Parameters:
Returns:

is_valid_bone_name (bool):

bone_index (int32):

Return type:

tuple

classmethod get_bone_info(target_mesh, bone_name, debug=None) -> (DynamicMesh, is_valid_bone_name=bool, bone_info=GeometryScriptBoneInfo)

Get the bone information.

Parameters:
Returns:

is_valid_bone_name (bool): Set to true if the TargetMesh contains a bone with the given name, false otherwise.

bone_info (GeometryScriptBoneInfo): The information about the bone.

Return type:

tuple

classmethod get_largest_vertex_bone_weight(target_mesh, vertex_id, profile=["Default"]) -> (DynamicMesh, bone_weight=GeometryScriptBoneWeight, has_valid_bone_weights=bool)

Return the Bone/Skin Weight with the maximum weight at a given vertex of TargetMesh

Parameters:
Returns:

bone_weight (GeometryScriptBoneWeight): the bone index and weight that was found to have the maximum weight

has_valid_bone_weights (bool): will be returned as true if the vertex has bone weights in the given profile and a largest weight was found

Return type:

tuple

classmethod get_max_bone_weight_index(target_mesh, profile=["Default"]) -> (DynamicMesh, has_bone_weights=bool, max_bone_index=int32)

Determine the largest bone weight index that exists on the Mesh

Parameters:
Returns:

has_bone_weights (bool): will be returned true if the requested bone weight profile exists

max_bone_index (int32): maximum bone index will be returned here, or -1 if no bone indices exist

Return type:

tuple

classmethod get_root_bone_name(target_mesh, debug=None) -> (DynamicMesh, bone_name=Name)

Get the name of the root bone.

Parameters:
Returns:

bone_name (Name): The name of the root bone.

Return type:

Name

classmethod get_vertex_bone_weights(target_mesh, vertex_id, profile=["Default"]) -> (DynamicMesh, bone_weights=Array[GeometryScriptBoneWeight], has_valid_bone_weights=bool)

Return an array of Bone/Skin Weights at a given vertex of TargetMesh

Parameters:
Returns:

bone_weights (Array[GeometryScriptBoneWeight]): output array of bone index/weight pairs for the given Vertex

has_valid_bone_weights (bool): will be returned as true if the vertex has bone weights in the given profile, ie BoneWeights is valid

Return type:

tuple

classmethod mesh_create_bone_weights(target_mesh, replace_existing_profile=False, profile=["Default"]) -> (DynamicMesh, profile_existed=bool)

Create a new BoneWeights attribute on the TargetMesh, if it does not already exist. If it does exist, and bReplaceExistingProfile is passed as true, the attribute will be removed and re-added, to reset it.

Parameters:
Returns:

profile_existed (bool): will be returned true if the requested bone weight profile already existed

Return type:

bool

classmethod mesh_has_bone_weights(target_mesh, profile=["Default"]) -> (DynamicMesh, has_bone_weights=bool)

Check whether the TargetMesh has a per-vertex Bone/Skin Weight Attribute set

Parameters:
Returns:

has_bone_weights (bool): will be returned true if the requested bone weight profile exists

Return type:

bool

classmethod set_all_vertex_bone_weights(target_mesh, bone_weights, profile=['Default']) DynamicMesh

Set all vertices of the TargetMesh to the given Bone/Skin Weights

Parameters:
Return type:

DynamicMesh

classmethod set_vertex_bone_weights(target_mesh, vertex_id, bone_weights, profile=["Default"]) -> (DynamicMesh, is_valid_vertex_id=bool)

Set the Bone/Skin Weights at a given vertex of TargetMesh

Parameters:
Returns:

is_valid_vertex_id (bool): will be returned as true if the vertex ID is valid

Return type:

bool

classmethod transfer_bone_weights_from_mesh(source_mesh, target_mesh, options=[TransferBoneWeightsMethod.CLOSEST_POINT_ON_SURFACE, OutputTargetMeshBones.SOURCE_BONES, ['Default'], ['Default'], -1.000000, -1.000000, True, 0, 0.000000, 'None'], debug=None) DynamicMesh

Transfer the bone weights from the SourceMesh to the TargetMesh. Assumes that the meshes are aligned. Otherwise, use the TransformMesh geometry script function to align them.

Parameters:
Return type:

DynamicMesh