//---------------------------------------------------------------------------------------------------------------------- /// <inheritdoc/> public override void DrawBackground(TimelineClip clip, ClipBackgroundRegion region) { base.DrawBackground(clip, region); Rect rect = region.position; if (rect.width <= SISEditorConstants.MIN_PREVIEW_REGION_WIDTH) { return; } StreamingImageSequencePlayableAsset curAsset = clip.asset as StreamingImageSequencePlayableAsset; if (null == curAsset || !curAsset.HasImages()) { return; } if (Event.current.type == EventType.Repaint) { PreviewClipInfo clipInfo = new PreviewClipInfo() { Duration = clip.duration, TimeScale = clip.timeScale, ClipIn = clip.clipIn, FramePerSecond = clip.parentTrack.timelineAsset.editorSettings.fps, ImageDimensionRatio = curAsset.GetOrUpdateDimensionRatio(), VisibleLocalStartTime = region.startTime, VisibleLocalEndTime = region.endTime, VisibleRect = rect, }; PreviewUtility.EnumeratePreviewImages(ref clipInfo, (PreviewDrawInfo drawInfo) => { DrawPreviewImage(ref drawInfo, clip, curAsset); }); //For hiding frame marker automatically int numFrames = Mathf.RoundToInt((float)((region.endTime - region.startTime) * clipInfo.FramePerSecond)); double widthPerFrame = rect.width / numFrames; TimelineClipSISData timelineClipSISData = curAsset.GetBoundTimelineClipSISData(); if (null != timelineClipSISData) { timelineClipSISData.SetTimelineWidthPerFrame(widthPerFrame); } } }