Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Play TimelineEditor from script

Discussion in 'Timeline' started by Charcolle, Aug 17, 2017.

  1. Charcolle

    Charcolle

    Joined:
    Dec 3, 2016
    Posts:
    4
    I want to play TimelineEditor from my custom script.

    I update TimelineEditor.playableDirector.time and get EditorWindow of Timeline and repaint it every frame, however it did not work..
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Add the following calls:
    playableDirector.DeferredEvaluate();
    GameView.RepaintAll();
    SceneView.RepaintAll();

    The DeferredEvaluate will evaluate the timeline the next time the views are repainted.
     
  3. Charcolle

    Charcolle

    Joined:
    Dec 3, 2016
    Posts:
    4
    Thanks, but It didn't work...

    Can I update TimelineEditor from code in the future version?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Can provide some example code of what you are trying?
     
  5. Charcolle

    Charcolle

    Joined:
    Dec 3, 2016
    Posts:
    4
    I'm sorry I found my code was bad. Finally, It worked.
    Thank you.
     
  6. entropicjoey1

    entropicjoey1

    Joined:
    Jun 1, 2014
    Posts:
    26
    How do you reference the playable timeline prefab thriugh code? I vant find info anywhere but i want to achieve starting the timeline or playable through code aswell
     
  7. entropicjoey1

    entropicjoey1

    Joined:
    Jun 1, 2014
    Posts:
    26
    Nvm..what i was looking for is using unityengine.playables etc etc ^^