Search Unity

Question Adding Alembic Track and Clip to Timeline via script

Discussion in 'Timeline' started by RoughSpaghetti3211, Apr 1, 2022.

  1. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,708
    for the life of me, I can't seem to add my alembic gameObj in the scene to timeline using a script. This is not runtime just an editor button. Please help.

    Code (CSharp):
    1.        PlayableDirector playableDirector =  GameObject.Find("TimeLine").GetComponent<PlayableDirector>();
    2.         playableDirector.playableAsset = timeline;
    3.         foreach (TrackAsset track in timeline.GetOutputTracks())
    4.         {
    5.             if(track.name == "Alembic Track")
    6.             {
    7.                 Debug.Log(track.name);
    8.                 playableDirector.SetGenericBinding(track, AbcGameObject);
    9.             }
    10.         }