timeline dynamically create shot,ProcessFrame func can't get process weight value

When I dynamically create cinemachinShot to timelineasset, processFrame() func in CinemachineMixer can’t get process weight value,but 0 or 1 value.
After in editor hierarchy clicked playabledirector and showed the timeline window, then normal linear values can be obtained.

using Cinemachine;
using Cinemachine.Timeline;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;

public class DynamShotDemo : MonoBehaviour
{
    public CinemachineBrain cinemachineBrain;
    public PlayableDirector playableDirector;
    public Transform _vcamsParent;

    private CinemachineTrack cinemachineTrack;
    private TimelineAsset timelineAsset;

    void Start()
    {
        timelineAsset = playableDirector.playableAsset as TimelineAsset;
        var tracks = timelineAsset.GetOutputTracks();

        foreach (TrackAsset track in tracks)
            if (track.name == "Cinemachine Track")
            {
                cinemachineTrack = track as CinemachineTrack;
                break;
            }

        // clear clips
        var clips = cinemachineTrack.GetClips().ToArray();
        foreach (var c in clips)
            cinemachineTrack.DeleteClip(c);

        // clear vcams
        var count = _vcamsParent.childCount;
        for (var d = count - 1; d >= 0; d--)
            DestroyImmediate(_vcamsParent.GetChild(d).gameObject);

        // create vcam and shot clips
        AddNode(0, new Vector3(0, 0, 0), 0, 1f);
        AddNode(1, new Vector3(5, 0, 5f), 0, 2f);
        AddNode(2, new Vector3(-5, 0, 5f), 1, 4f);

        playableDirector.RebuildGraph();
    }
 
    private void AddNode(int idx, Vector3 position, float start, float duration)
    {
        var node = new GameObject("VCam-" + idx);
        node.transform.SetParent(_vcamsParent);
        node.transform.position = position;

        var vcam = node.AddComponent<CinemachineVirtualCamera>();

        TimelineClip clip = cinemachineTrack.CreateClip<CinemachineShot>();
        clip.start = start;
        clip.duration = duration;

        var shot = clip.asset as CinemachineShot;
        shot.VirtualCamera.exposedName = node.name;

        playableDirector.SetReferenceValue(shot.VirtualCamera.exposedName, vcam);
    }
}

Not active playableDirector in hierachy:
9399344--1315622--2023-10-10-11-20-16.gif

Afte active playableDirector in hierachy:
9399344--1315619--2023-10-10-11-21-44.gif

I debug CinemachineMixer class, and found that in the processframe func, before active playableDirector in hierarchy, weight can only get the value of 0 or 1. Don’t know why this is happening:


9399344--1315625--1291736-dc7f6323dee55cd2837d658e4e0ee1bd.gif

CinemachineMixer can only make sense of up to 2 clips at any given time. It’s a 2-way blend. Therefore, only clips 0 and 1 are relevant. This will always work if you ensure that there are never more than 2 active clips at any moment on the timeline. Your code sets up 3 active clips at the 1 second mark.