//----------------------------------------------------------------------------------------------------------------------
        protected override void DrawPreviewImageV(ref PreviewDrawInfo drawInfo, TimelineClip clip,
                                                  StreamingImageSequencePlayableAsset sisAsset)
        {
            int    imageIndex = sisAsset.LocalTimeToImageIndex(clip, drawInfo.LocalTime);
            string imagePath  = sisAsset.GetImageFilePath(imageIndex);

            PreviewUtility.DrawPreviewImage(ref drawInfo, imagePath);
        }
Esempio n. 2
0
//----------------------------------------------------------------------------------------------------------------------
        protected override void DrawPreviewImageV(ref PreviewDrawInfo drawInfo, TimelineClip clip,
                                                  ImageFolderPlayableAsset <SISClipData> playableAsset)
        {
            StreamingImageSequencePlayableAsset sisAsset = playableAsset as StreamingImageSequencePlayableAsset;

            Assert.IsNotNull(sisAsset);

            int    imageIndex = sisAsset.LocalTimeToImageIndex(clip, drawInfo.LocalTime);
            string imagePath  = sisAsset.GetImageFilePath(imageIndex);

            PreviewUtility.DrawPreviewImage(ref drawInfo, imagePath);
        }
Esempio n. 3
0
//----------------------------------------------------------------------------------------------------------------------

        protected override void DrawPreviewImageV(ref PreviewDrawInfo drawInfo, TimelineClip clip,
                                                  RenderCachePlayableAsset renderCachePlayableAsset)
        {
            double normalizedLocalTime = drawInfo.LocalTime / clip.duration;
            int    numImages           = renderCachePlayableAsset.GetNumImages();

            Assert.IsTrue(numImages > 0);

            //Can't round up, because if the time for the next frame hasn't been reached, then we should stick
            int index = Mathf.FloorToInt(numImages * (float)normalizedLocalTime);

            index = Mathf.Clamp(index, 0, numImages - 1);

            //Draw
            string imagePath = renderCachePlayableAsset.GetImageFilePath(index);

            PreviewUtility.DrawPreviewImage(ref drawInfo, imagePath);
        }