Search Unity

[Question] Why Unity put bindPoses[] in class Mesh instead of SkinnedMeshRenderer?

Discussion in 'Scripting' started by YoungXi, May 27, 2017.

  1. YoungXi

    YoungXi

    Joined:
    Jun 5, 2013
    Posts:
    63
    Hi, all
    I was confused about this.
    Since bindPoses[] are bones related, and bones are Matrix4x4[] stored in SkinnedMeshRenderer. Why not to put bindPoses[] in the SkinnedMeshRenderer too?
    https://docs.unity3d.com/ScriptReference/Mesh-bindposes.html
    But instead they are stored in Mesh class.
    What I think is, meshes should have vertices, boneIndices and boneWeights for each vertex, and that would be enough for skeleton animation...
    Anyone could explain it for me? Thanks!
     
  2. YoungXi

    YoungXi

    Joined:
    Jun 5, 2013
    Posts:
    63
    Is it because that a mesh may not take all the bones into skinning, by putting bindPoses into mesh could save some memory?