Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Eco-Editor · Jun 11, 2018 at 12:29 PM · starttimelinecliptrackduration

How to get the Track and the Clip of a Timeline?

Hi all!

I'm trying to get a list of all the tracks and the clips time on those track from my timeline.

I've checked the web for a whole day now and found several API's: TrackAsset, GetClip().start, GetClip().duration. Playable, PlayableAsset and more... they all give me some error in visual studio.

Is there a timeline expert in the crowed? I've managed to get the playabelBinding and the sourceObject bind to that binding "track" but I can't seem to do the leap towards what's on the other side of the timeline (see pic. for reference).

alt text

timeline-question.png (41.1 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by seant_unity · Jun 19, 2018 at 11:19 AM

The animation track with keys (i.e. infinite track) is a special case in timeline. There is actually no timeline clip on it, just an animation clip.

You can get the duration of the track using the duration property . There is no public API for getting the attached animation clip, but if you use SerializedObject and SerializedProperty, the animation clip reference is serialized under the "m_AnimClip" property name.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image secret_portal_mike · Nov 26, 2019 at 03:40 PM 0
Share

Thanks this worked great, here's a snippet of code that might help others trying to get at the animation clips inside these timeline:

       for(int i = 0; i < TimelineTo$$anonymous$$odify.outputTrackCount; i++)
       {
          TrackAsset track = TimelineTo$$anonymous$$odify.GetOutputTrack(i);
 
          AnimationTrack animTrack = track as AnimationTrack;
          if(animTrack && !animTrack.inClip$$anonymous$$ode)
          {
             //try to find the clip
             var so = new SerializedObject(animTrack);
             SerializedProperty sp = so.FindProperty("m_AnimClip");
             if(sp.objectReferenceValue != null)
             {
                AnimationClip clip = sp.objectReferenceValue as AnimationClip;
 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

87 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to get a track from a timeline from a playable director? 1 Answer

Peculiar Bleed-through of Exposed References on different Timeline Tracks 2 Answers

Clip offset do not work in the Timeline, What am I doing wrong? 0 Answers

How do you move Timeline tracks to a new Timeline? 1 Answer

How to move track group timeline? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges