Error: Cannot read properties of undefined (reading 'getRestPose')

There are two problems in your PG:

  • the “Armature” node is named “Armature.001” in the 2nd avatar:
    image
    I used “Armature” instead of “Armature.001” when searching for children in the PG below but a better fix would be to correct the naming in the DCC tool. Also, you should pass avatarMesh and not armatureMesh to copy() otherwise “Armature” will not be found when searching for children (destMesh.parent does not go high enough in the hierarchy if destMesh==armatureMesh)
  • the 3rd anim is a morph target animation, not a rigged animation. You should skip it in the copy() function.

Here’s a corrected PG:

3 Likes