bindSkeletons method

void bindSkeletons(
  1. Object3D object,
  2. Map<String, dynamic> skeletons
)

Implementation

void bindSkeletons(Object3D object, Map<String, dynamic> skeletons) {
  if (skeletons.keys.length == 0) return;

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

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