Search Unity

Please make more methods related to tracks protected or public

Discussion in 'Timeline' started by WF_Bart, Jul 24, 2017.

  1. WF_Bart

    WF_Bart

    Joined:
    Apr 16, 2014
    Posts:
    29
    I'd like to be able to drop certain assets on my custom tracks and do my own processing to make clips of them.

    UnityEngine.Timeline.AnimationTrack does this by overriding OnCreateClipFromAsset. However, that method is marked internal. Is it possible that this method could be marked protected in future versions so we can write our own processors?

    Additionally, AnimationTrack has a SupportsChildTracksAttribute which is also marked internal. Having access to this and being able to mix multiple tracks/layers would be very helpful.


    Additionally, would it be possible to get a hook to draw on top of the Timeline Clip elements to display extra information particular to that clip with a custom editor?
     
    monoky likes this.
  2. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    177
    You do bring valid points here. When thinking about improving the Timeline API for custom clips/tracks, these are the first things we thought about. We will definitely try to tackle this in future versions of Unity.

    I'm curious; what do you intend to do in OnCreateClipFromAsset? Your use case could be helpful to us ;)
     
  3. WF_Bart

    WF_Bart

    Joined:
    Apr 16, 2014
    Posts:
    29
    Well, I'm working on a dialogue-animation system and it needs to 'pause' for player input a lot. Obviously having all animations pause as well would be less than ideal (I mean, I guess that could be a stylistic choice, but not what we're going for), so one of my avenues of exploration is a 'AnimationStatePlayable' that sets an animator's state but is otherwise independent of the 'time' component of the Timeline. Another solution could be setting the Animator override.

    In both cases, I'd like to be able to drop animation clips on my custom timeline, create my own wrapping AnimationStatePlayableClip and save that to the Timeline asset. Of course, this wouldn't only work with animation clip assets, but with any kind of asset that you don't want to be a clip itself.
     
  4. Antoine_OSG

    Antoine_OSG

    Joined:
    Sep 2, 2016
    Posts:
    43
    Hello,
    I'm really interested in this too. I'm trying to create a custom track that would be able to play/preview animation clips the way an Animation Track does it. I'm stuck pretty much at the same point as you, as I can't extend Animation Track.
    Have you made any progress on this topic?
     
  5. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    In the current form the timeline api is mostly useless. All the actual useful methods are hidden from us. So much for the big release for designers and artists, what use is it if I cant even get our code functioning on the timeline in a way that actually improves workflow rather than hinders it?
     
    monoky likes this.
  6. Atrixx

    Atrixx

    Joined:
    Feb 8, 2012
    Posts:
    24
    I second the above, the Timeline API is very lacklustre. I'm disappointed that you can find the APIs you need through reflection and decompiling source code, but otherwise there are no resources on extending it meaningfully.

    ...and 10 months later, not a word on development.
     
    ovrdb likes this.
  7. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    224
    Would be nice to override OnCreateClipFromAsset to initialize a Scriptable Object member of my custom Playable Behaviour associated to my clip.

    Defining a constructor for my custom PlayableBehaviour doesn't help, as the created scriptable object won't be serialized so everything will disappear on Play.

    EDIT: the only solution I could find was to define a Scriptable Asset somewhere in the project and refer to it. But I will have to create many assets every time I want a clip with slightly different parameters.
     
    Last edited: Jul 3, 2018