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

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
Soom
Posts: 1185
Joined: 25 Jul 2011, 16:25
Location: World
Contact:

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

Post 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
at home: Hackintosh Intel Core i9-9900K, GPU AMD RX 6600 8GB, Cintiq 22" + Dell P2415Q 4K displays, MAC OS High Sierra / Windows 10, TVP Pro 11.7.1 + TVP Pro beta
at work: Windows 10, TVP 11.7.1 Std
https://vimeo.com/danas
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

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

Post by Xavier »

Indeed, I can see no length displayed when I select clips.

Not sure.
User avatar
Peter Wassink
Posts: 4437
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

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

Post by Peter Wassink »

It could be in the left side panel, under name:

Name:
Bruno_SB_SQ0220_v001
Duration:
00:18:12
Layers:
6
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

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

Post 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
Last edited by Svengali on 27 Jun 2021, 14:46, edited 1 time in total.
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Soom
Posts: 1185
Joined: 25 Jul 2011, 16:25
Location: World
Contact:

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

Post 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! :)
at home: Hackintosh Intel Core i9-9900K, GPU AMD RX 6600 8GB, Cintiq 22" + Dell P2415Q 4K displays, MAC OS High Sierra / Windows 10, TVP Pro 11.7.1 + TVP Pro beta
at work: Windows 10, TVP 11.7.1 Std
https://vimeo.com/danas
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

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

Post 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"?
Last edited by Svengali on 27 Jun 2021, 20:07, edited 1 time in total.
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Soom
Posts: 1185
Joined: 25 Jul 2011, 16:25
Location: World
Contact:

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

Post 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
at home: Hackintosh Intel Core i9-9900K, GPU AMD RX 6600 8GB, Cintiq 22" + Dell P2415Q 4K displays, MAC OS High Sierra / Windows 10, TVP Pro 11.7.1 + TVP Pro beta
at work: Windows 10, TVP 11.7.1 Std
https://vimeo.com/danas
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

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

Post 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
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Soom
Posts: 1185
Joined: 25 Jul 2011, 16:25
Location: World
Contact:

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

Post 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
at home: Hackintosh Intel Core i9-9900K, GPU AMD RX 6600 8GB, Cintiq 22" + Dell P2415Q 4K displays, MAC OS High Sierra / Windows 10, TVP Pro 11.7.1 + TVP Pro beta
at work: Windows 10, TVP 11.7.1 Std
https://vimeo.com/danas
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

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

Post 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
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Soom
Posts: 1185
Joined: 25 Jul 2011, 16:25
Location: World
Contact:

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

Post by Soom »

Fantastic! thank you so much!
at home: Hackintosh Intel Core i9-9900K, GPU AMD RX 6600 8GB, Cintiq 22" + Dell P2415Q 4K displays, MAC OS High Sierra / Windows 10, TVP Pro 11.7.1 + TVP Pro beta
at work: Windows 10, TVP 11.7.1 Std
https://vimeo.com/danas
Post Reply