bindSkeletons method

dynamic bindSkeletons(
  1. dynamic object,
  2. dynamic skeletons
)

Implementation

bindSkeletons(object, skeletons) {
  if (skeletons.keys.length == 0) return;

  object.traverse((child) {
    if (child is SkinnedMesh && child.skeleton != null) {
      var skeleton = skeletons[child.skeleton];

      if (skeleton == null) {
        print(
            'THREE.ObjectLoader: No skeleton found with UUID: ${child.skeleton}');
      } else {
        child.bind(skeleton, child.bindMatrix);
      }
    }
  });
}