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:
target_mesh (DynamicMesh) –
skeleton (Skeleton) – The skeleton to compute binding for the skin weights.
options (GeometryScriptSmoothBoneWeightsOptions) – The options to set for the binding algorithm.
profile (GeometryScriptBoneWeightProfile) – The skin weight profile to update with the smooth binding.
debug (GeometryScriptDebug) –
- Return type:
- classmethod copy_bones_from_mesh(source_mesh, target_mesh, debug=None) DynamicMesh ¶
Copy the bone attributes (skeleton) from the SourceMesh to the TargetMesh.
- Parameters:
source_mesh (DynamicMesh) – Mesh we are copying the bone attributes from.
target_mesh (DynamicMesh) – Mesh we are copying the bone attributes to.
debug (GeometryScriptDebug) –
- Return type:
- classmethod discard_bones_from_mesh(target_mesh, debug=None) DynamicMesh ¶
Discard the bone attributes (skeleton) from the TargetMesh.
- Parameters:
target_mesh (DynamicMesh) – Mesh we are discarding bone attributes from.
debug (GeometryScriptDebug) –
- Return type:
- 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:
target_mesh (DynamicMesh) – Mesh containing the bone attributes.
debug (GeometryScriptDebug) –
- Returns:
bones_info (Array[GeometryScriptBoneInfo]): Skeleton information.
- Return type:
- 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:
target_mesh (DynamicMesh) –
bone_name (Name) –
debug (GeometryScriptDebug) –
- 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:
target_mesh (DynamicMesh) – Mesh containing the bone attributes.
bone_name (Name) – The name of bone.
debug (GeometryScriptDebug) –
- 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:
target_mesh (DynamicMesh) –
vertex_id (int32) – requested vertex
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- 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:
target_mesh (DynamicMesh) –
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- 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:
target_mesh (DynamicMesh) – Mesh containing the bone attributes.
debug (GeometryScriptDebug) –
- Returns:
bone_name (Name): The name of the root bone.
- Return type:
- 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:
target_mesh (DynamicMesh) –
vertex_id (int32) – requested vertex
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- 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:
target_mesh (DynamicMesh) –
replace_existing_profile (bool) – if true, if the Profile already exists, it is reset
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- Returns:
profile_existed (bool): will be returned true if the requested bone weight profile already existed
- Return type:
- 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:
target_mesh (DynamicMesh) –
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- Returns:
has_bone_weights (bool): will be returned true if the requested bone weight profile exists
- Return type:
- 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:
target_mesh (DynamicMesh) –
bone_weights (Array[GeometryScriptBoneWeight]) – input array of bone index/weight pairs for the Vertex
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- Return type:
- 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:
target_mesh (DynamicMesh) –
vertex_id (int32) – vertex to update
bone_weights (Array[GeometryScriptBoneWeight]) – input array of bone index/weight pairs for the Vertex
profile (GeometryScriptBoneWeightProfile) – identifier for the bone/skin weight profile
- Returns:
is_valid_vertex_id (bool): will be returned as true if the vertex ID is valid
- Return type:
- 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:
source_mesh (DynamicMesh) – The mesh we are transferring the weights from.
target_mesh (DynamicMesh) – The mesh we are transferring the weights to.
options (GeometryScriptTransferBoneWeightsOptions) – The options to set for the transfer weight algorithm.
debug (GeometryScriptDebug) –
- Return type: