Search Unity

UnityEditor.Timeline.EditorClip and other Internal timeline woes

Discussion in 'Timeline' started by Cameron_SM, Sep 12, 2021.

  1. Cameron_SM

    Cameron_SM

    Joined:
    Jun 1, 2009
    Posts:
    915
    If you have clips on the timeline selected then Selection.objects will be an array of UnityEditor.Timeline.EditorClip instances, but as that is an internal class you can't do anything with it, nor can you access the underlying TimelineClip that it references (which is a public class) without using reflection. I hate having that code debt to maintain not to mention the performance overhead. Can we get this changed to a public class in future versions?

    I don't even mind if it's not documented because 99% of the time you can look at the Timeline package source and infer what's going on.

    While we're on the subject, would love to be able to extend TimelineWindow (among many others) and really dig into customising the timeline features. The proliferation of private and internal classes within the Timeline is very frustrating. Wish it wasn't so locked down. So much potential being walled off.

    I know there's more cost to Unity in maintaining the public API but when it comes to these kinds of low traffic internals I really don't mind if it changes a lot or if obsolete apis are hard-pruned yearly with major releases. Finding and maintaining obsolete API usage is far easier, quicker and more performant than finding and fixing reflection hacks.
     
    daxiongmao, wallflower6 and Lyje like this.
  2. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    412
    Unity loves to do this. Oh look we made the source available but if you want to use it you have to duplicate everything.
    They do not make most of their packages even with source easy to extend or use.