internal void GenerateProceduralAnnotations() { bool bNotationsAdded = false; Experimental.IProceduralAnnotationsGenerator[] generators = Experimental.ProceduralAnnotations.CreateGenerators(false); for (int i = 0; i < m_ClipSelection.Count; ++i) { var taggedClip = m_ClipSelection[i]; AnimationClip clip = taggedClip.GetOrLoadClipSync(); Experimental.ProceduralAnnotations annotations = new Experimental.ProceduralAnnotations(); foreach (var generator in generators) { generator.GenerateAnnotations(clip, annotations); } if (annotations.NumAnnotations > 0) { bNotationsAdded = true; foreach (TagAnnotation tag in annotations.Tags) { taggedClip.AddTag(tag); } foreach (MarkerAnnotation marker in annotations.Markers) { taggedClip.AddMarker(marker); } } } if (bNotationsAdded) { //Refresh() alone doesn't seems to work for showing new tags and markers. if (m_ClipSelection.Count == 1) { SelectItem(m_ClipSelection[0]); } Refresh(); } }
public void GenerateProceduralAnnotations() { Experimental.IProceduralAnnotationsGenerator[] generators = Experimental.ProceduralAnnotations.CreateGenerators(true); foreach (TaggedAnimationClip taggedClip in asset.AnimationLibrary) { AnimationClip clip = taggedClip.GetOrLoadClipSync(); Experimental.ProceduralAnnotations annotations = new Experimental.ProceduralAnnotations(); foreach (var generator in generators) { generator.GenerateAnnotations(clip, annotations); } if (annotations.NumAnnotations > 0) { clipProceduralAnnotations.Add(taggedClip.AnimationClipGuid, annotations); } } }