Control blend via script

Hello,

I want to switch between three cameras with a rough cut between the first ones and a blend between second ones. But I can’t get it working. When running the code the blend happens all the way from oldcam directly to newsinglecam. However: If I comment out the last three lines I get the rough cut from oldcam to singlecam, but of course then I don’t get the blend switch to my last cam. Why does the rough cut dissappear when adding the three last lines?

            brain = FindObjectOfType<CinemachineBrain>(); //Get our camera brain
            brain.m_DefaultBlend.m_Time = 0; // 0 Time equals a cut between coming two cams
            oldCam.m_Priority = 2; // Cut from this cam...
            singleCam.m_Priority = 99; // ... to this cam
            brain.m_DefaultBlend.m_Time = 2; // Time equals a blend between coming two cams
            singleCam.m_Priority = 2; // Slide from this cam
            newSingleCam.m_Priority = 99; //... to this cam

Respectfully, Ellen

Hi Ellen,

You need need to make the cut happen on one frame (i.e. without the last 3 lines), allow that to be processed, and then execute the last three lines on the next frame.

Normally, instead of playing around with the default blend, one would set it to something reasonable, then leave it alone. To get specific blends for specific vcams, you can set up the Custom Blends asset on the brain.

4154692--366379--upload_2019-1-28_9-15-18.png