createUniqueName method

dynamic createUniqueName(
  1. dynamic originalName
)

When Object3D instances are targeted by animation, they need unique names.

Implementation

createUniqueName(originalName) {
  var sanitizedName = PropertyBinding.sanitizeNodeName(originalName ?? '');

  var name = sanitizedName;

  for (var i = 1; nodeNamesUsed[name] != null; ++i) {
    name = '${sanitizedName}_$i';
  }

  nodeNamesUsed[name] = true;

  return name;
}