updateMorphTargets method

void updateMorphTargets()
inherited

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.');
  //   }
  // }
}