updateMorphTargets method

void updateMorphTargets()

Implementation

void updateMorphTargets() {
  var geometry = this.geometry;

  if (geometry is BufferGeometry) {
    var morphAttributes = geometry.morphAttributes;
    var keys = morphAttributes.keys.toList();

    if (keys.isNotEmpty) {
      List<BufferAttribute>? morphAttribute = morphAttributes[keys[0]];

      if (morphAttribute != null) {
        morphTargetInfluences = [];
        morphTargetDictionary = {};

        for (var m = 0, ml = morphAttribute.length; m < ml; m++) {
          String name = morphAttribute[m].name ?? m.toString();

          morphTargetInfluences!.add(0.0);
          morphTargetDictionary![name] = m;
        }
      }
    }
  }
  // else {
  //   var morphTargets = geometry?.morphTargets;

  //   if (morphTargets != null && morphTargets.length > 0) {
  //     print(
  //         'THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');
  //   }
  // }
}