existingAction method

dynamic existingAction(
  1. dynamic clip,
  2. dynamic optionalRoot
)

Implementation

existingAction(clip, optionalRoot) {
  var root = optionalRoot ?? this.root;
  var rootUuid = root.uuid;

  var clipObject = clip is String ? AnimationClip.findByName(root, clip) : clip,
      clipUuid = clipObject ? clipObject.uuid : clip,
      actionsForClip = _actionsByClip[clipUuid];

  if (actionsForClip != null) {
    return actionsForClip.actionByRoot[rootUuid];
  }

  return null;
}