updateMorphTargets method

void updateMorphTargets()

Updates the morphTargets to have no influence on the object. Resets the morphTargetInfluences and morphTargetDictionary properties.

Implementation

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

  final morphAttributes = geometry!.morphAttributes;
  final keys = morphAttributes.keys.toList();

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

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

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

        morphTargetInfluences.add(0.0);
        morphTargetDictionary![name] = m;
      }
    }
  }

}