Version: 2021.1

Mesh.GetBoneWeights

切换到手册
public void GetBoneWeights (List<BoneWeight> boneWeights);

参数

boneWeights 要填充的 BoneWeight 结构列表。

描述

获取网格的骨骼权重。

如果要避免在每次访问时都分配新数组,请使用此方法而不是 Mesh.boneWeights

The BoneWeight at each index corresponds to the vertex with the same index if this mesh has bone weights defined. Otherwise the list will be empty.

Note that this property uses BoneWeight structs, which represent exactly 4 bone weights per vertex. The newer BoneWeight1 struct describes a single bone weight, and it can be used with the associated Mesh.GetAllBoneWeights, Mesh.SetBoneWeights and Mesh.GetBonesPerVertex APIs to describe up to 255 bone weights per vertex. It is preferable to use BoneWeight1 and its associated APIs; they offer more flexibility, and might result in small performance benefits as Unity does not have to perform unnessary conversion operations.

另请参阅:Mesh.boneWeightsMesh.GetAllBoneWeightsMesh.SetBoneWeightsMesh.GetBonesPerVertexModelImporter.maxBonesPerVertexQualitySettings.skinWeightsSkinnedMeshRenderer.quality