I was surprised to find that this didn't work: Code (CSharp): using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.Playables; using UnityEngine.Timeline; /// <summary> /// Special <see cref="GroupTrack"/> that mutes all of its children /// when you enter play mode. /// Useful for edit-time tracks that mimic gameplay (such as moving/knockback the character or playing enemy hit reacts) /// that you don't want to impact the final game. /// </summary> public class EditOnlyGroupTrack : GroupTrack { public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) { this.GetChildTracks().ToList().ForEach(t => t.muted = Application.isPlaying); return base.CreateTrackMixer(graph, go, inputCount); } } The result was a rather sad looking non-group track: Is there a reason we can't extend GroupTrack to make our own groups with custom behaviour? Thank you!
I'm looking for something like the bool in the CustomEditor attribute that will make the CustomTrackDrawer for AudioTrack/GroupTrack/etc. also apply to the classes that inherit from it: https://docs.unity3d.com/ScriptReference/CustomEditor.html
Group tracks are excluded from compilation of the PlayableGraph. They exist simply for organization purposes. We should have sealed the class. None of the compilation methods get called on them. And the custom track drawer (which isn't public because it is slated for change) doesn't apply to derived classes.
Ok thank you for the confirmation. It would be helpful to have a way to run scripts over all of the tracks in a group. Is there any plans to allow something like that?
Not that exact request, but giving more access to the customize/extend the Timeline editor in general is planned. Also, we have plans to improve group tracks, and can keep your use case in mind.
Thank you! The idea is basically that we have certain groups on our timeline that are there exclusively for the artist to imitate some of the effects of gameplay, like knockback or projectiles spawning, while they are iterating on VFX in edit mode. I have a workaround where i mute everything in a GroupTrack with a special name when I enter playmode, but it's not too elegant. Code (CSharp): timelineAsset.GetTracks<GroupTrack>().Where(t => t.name.Contains(MUTE)).ToList().ForEach(g => g.GetChildTracks().ToList().ForEach(t => t.muted = true)); public static IEnumerable<T> GetTracks<T>(this TimelineAsset timelineAsset) where T : TrackAsset { return timelineAsset?.outputs .Select(o => o.sourceObject) .OfType<T>(); } BTW, I'm working at a studio that's doing a fairly high profile game/TV show combination and we are very much open to partnership with Unity to showcase features/the platform's potential. Most of our team (except for me) either came from studios with custom engines or Unreal, so it's been interesting to compare Unity's timeline to the features offered by Unreal's Matinee, etc. Let me know if there's a channel I can reach out to to explore this possibility! Thank you