Is there any way to see selected clips range in the Project view?
Posted: 23 Jun 2021, 22:38
When I select multiple clips in the Project view, I would like to know their total length. Is it possible?
TVPaint boards for technical support, requests and discussions about animation.
http://tvpaint.org/forum/
Code: Select all
ScriptName = "SelectedClipInfo"
= = = = = removed by Svengali June 27, 2021 = = = = =
Haha - I used this script, and indeed it showed a huge list of all the frames, and in the end a total count of frames - I said - cool, it works! and then TVPaint crashed!Svengali wrote: ↑25 Jun 2021, 15:03 A short GEORGE script could probably do this... Using selected clips, it could provide total frames, a list of clip frame sizes and other clip info.
EDIT: rereading your question, I'm not sure if GEORGE would do what you want... but maybe this script (copy and embed it in a button...)svenCode: Select all
ScriptName = "SelectedClipInfo" ClipFlag = 1 Clipcounter = 0 ProjectFrameCount = 0 ClipList(0) = 0 While ClipFlag == 1 tv_ClipEnumID -1 ClipCounter ClipID = result IF CMP(ClipID, "none") == 1 ClipFlag = 0 ELSE tv_clipinfo ClipID parse result d d d d d d d IsSelected d d d d d d d ClipFrameCount d ClipList(ClipCounter) = result IF IsSelected == 1 ProjectFrameCount = ProjectFrameCount + ClipFrameCount END END ClipCounter = ClipCounter + 1 END ClipInfo = "Clip Profiles:|" FOR i = 0 to (ClipCounter - 2) ThisClip ="Clip #" i " " ThisClip = CONCAT(ThisClip,ClipList(i) "|") ClipInfo = CONCAT(ClipInfo, ThisClip) END Totals = "|Total Frames in Selected Clips = " ProjectFrameCount"|" ClipInfo = CONCAT(ClipInfo, Totals) tv_ListRequest ClipInfo
Code: Select all
ScriptName = "SelectedClipInfo"
ClipFlag = 1
Clipcounter = 0
ProjectFrameCount = 0
SelectedClips = 0
ProjectFrameRate = 25 // change this to your project frame rate
While ClipFlag == 1
tv_ClipEnumID -1 ClipCounter
ClipID = result
IF CMP(ClipID, "none") == 1
ClipFlag = 0
ELSE
tv_clipinfo ClipID
parse result d d d d d d d IsSelected d d d d d d d ClipFrameCount d
IF IsSelected == 1
ProjectFrameCount = ProjectFrameCount + ClipFrameCount
SelectedClips = SelectedClips + 1
END
END
ClipCounter = ClipCounter + 1
END
ProjectRunTime = ProjectFrameCount / ProjectFrameRate
Totals = "Total Selected Clips = " SelectedClips " Total Frames in Selected Clips = " ProjectFrameCount " Project FPS = " ProjectFrameRate " Project RunTime in Seconds = " ProjectRunTime
tv_warn Totals
Nice, it works perfect! thanks!
dear SvenSvengali wrote: ↑27 Jun 2021, 20:14 OK, I updated the script to calculate the Runtime for selected clips... but you have to modify the script where it currently defines the ProjectFrameRate = 25
When you copy and insert the updated script into the embedded script listing, just modify the ProjectFrameRate value to whatever you use.
sven
Took another look and I think this might do it (counts only Markin to MarkOut in Selected Clips) Remembre to set your FPS :Soom wrote: ↑27 Jun 2021, 21:49 dear Sven
it works, but alas - there is another major problem. if the clip has a different length inside the clip than it has on the Project View timeline, then the frame count is wrong. Since I often use the pen/mouse to just drag the clips directly on timeline - this method doesn't actually add frames inside the clip, but just creates In and Out points. (If I use the add exposure shortcut, then it's all correct). that means I cannot use the dragging function if I want an accurate frame count... is there any way the script can ignore the real existing frames inside the clip, and just read the info from the In and Out points? thanks, sorry for keeping you busy
Code: Select all
ScriptName = "SelectedClipInfo"
ClipFlag = 1
Clipcounter = 0
ProjectFrameCount = 0
SelectedClips = 0
ProjectFrameRate = 25
While ClipFlag == 1
tv_ClipEnumID -1 ClipCounter
ClipID = result
IF CMP(ClipID, "none") == 1
ClipFlag = 0
ELSE
tv_clipinfo ClipID
parse result d d d d d d d IsSelected d d d d d d d d d MarkIn d MarkOut d
tv_warn"IsSelected = " IsSelected " MarkIn = " MarkIn " MarkOut = " MarkOut
IF IsSelected == 1
MarkedFrames = MarkOut - MarkIn + 1
ProjectFrameCount = ProjectFrameCount + MarkedFrames
SelectedClips = SelectedClips + 1
END
END
ClipCounter = ClipCounter + 1
END
Seconds = ProjectFrameCount / ProjectFrameRate
Totals = "Total Selected Clips = " SelectedClips " Total Marked Frames in Selected Clips = " ProjectFrameCount " ProjectFrameRate = " ProjectFrameRate " Project Runtime in seconds = " Seconds
tv_warn Totals