Page 1 of 1

Is there any way to see selected clips range in the Project view?

Posted: 23 Jun 2021, 22:38
by Soom
When I select multiple clips in the Project view, I would like to know their total length. Is it possible?
Screenshot 2021-06-23 233309.png

Re: Is there any way to see selected clips range in the Project view?

Posted: 25 Jun 2021, 10:01
by Xavier
Indeed, I can see no length displayed when I select clips.

Not sure.

Re: Is there any way to see selected clips range in the Project view?

Posted: 25 Jun 2021, 11:28
by Peter Wassink
It could be in the left side panel, under name:

Name:
Bruno_SB_SQ0220_v001
Duration:
00:18:12
Layers:
6

Re: Is there any way to see selected clips range in the Project view?

Posted: 25 Jun 2021, 15:03
by Svengali
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...)

Second EDIT: I'm removing the original version which causes the crash. see the revised script posted below for Totals Only Output...

Code: Select all

ScriptName = "SelectedClipInfo"

 = = = = = removed by Svengali  June 27, 2021 = = = = =

sven

Re: Is there any way to see selected clips range in the Project view?

Posted: 27 Jun 2021, 00:29
by Soom
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...)

Code: 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

sven
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! :)

Re: Is there any way to see selected clips range in the Project view?

Posted: 27 Jun 2021, 13:36
by Svengali
I did not have that problem, but I tested it on a limited number of clips... I'm curious, how many clips in total were in the project you tested the script on?
Bottom line though, if the script, as is, causes a crash - then please don't use it.

Update: I tried the original script on a project with 105 clips... which did INDEED crash after the info display listing all the combined stats for all clips, and the final, total count of frames was displayed.
I simplified the script so that the info display listing all the combined stats for all clips was bypassed and the final total count of frames was displayed, which resulted in NO CRASH. Conclusion, the tv_ListRequest command can't handle an extremely large list or an extremely loooooong string.

But if the total selected clip count and the frame count for just the selected clips is all you need, then this modified script should work for you... Test it first on non-critical project(s).

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
(sorry for not testing more rigorously before my first post... :oops: :cry: )
sven

p.s. I wonder if just this information (number of selected clips and the total frame count for just those) should be made part of the normal "PROJECT" Clip Thumbnails display option"?

Re: Is there any way to see selected clips range in the Project view?

Posted: 27 Jun 2021, 17:59
by Soom
Svengali wrote: 27 Jun 2021, 13:36 But if the total selected clip count and the frame count for just the selected clips is all you need, then this modified script should work for you... Test it first on non-critical project(s).
Nice, it works perfect! thanks!
is it also possible to add the total time in seconds after the frame count? will save me time calculating every time. thanks

Re: Is there any way to see selected clips range in the Project view?

Posted: 27 Jun 2021, 20:14
by Svengali
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

Re: Is there any way to see selected clips range in the Project view?

Posted: 27 Jun 2021, 21:49
by Soom
Svengali 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
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 :)
vpaint_frame_count_2.png

Re: Is there any way to see selected clips range in the Project view?

Posted: 28 Jun 2021, 00:24
by Svengali
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 :)
Took another look and I think this might do it (counts only Markin to MarkOut in Selected Clips) Remembre to set your FPS :

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
sven

Re: Is there any way to see selected clips range in the Project view?

Posted: 28 Jun 2021, 13:01
by Soom
Fantastic! thank you so much!