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: 913
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 » 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?
Screenshot 2021-06-23 233309.png
Hackintosh, OS 10.13.6, Cintiq 22", TVP Pro 11.5.1, http://danasb.com

User avatar
Xavier
Site Admin
Posts: 1002
Joined: 01 Oct 2019, 11:08

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

Post by Xavier » 25 Jun 2021, 10:01

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

Not sure.
Not now please, I'm on leave !

User avatar
Peter Wassink
Posts: 3864
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 » 25 Jun 2021, 11:28

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: Win10/64 Home - Xeon Quadcore E5410@2.33Ghz - 12Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM

Svengali
Posts: 1427
Joined: 28 Dec 2006, 10:08
Contact:

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

Post by Svengali » 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...)

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.
Desktop: tvp Pro 11.0.10-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.36-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB internal - no microSD yet

User avatar
Soom
Posts: 913
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 » 27 Jun 2021, 00:29

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! :)
Hackintosh, OS 10.13.6, Cintiq 22", TVP Pro 11.5.1, http://danasb.com

Svengali
Posts: 1427
Joined: 28 Dec 2006, 10:08
Contact:

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

Post by Svengali » 27 Jun 2021, 13:36

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.
Desktop: tvp Pro 11.0.10-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.36-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB internal - no microSD yet

User avatar
Soom
Posts: 913
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 » 27 Jun 2021, 17:59

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
Hackintosh, OS 10.13.6, Cintiq 22", TVP Pro 11.5.1, http://danasb.com

Svengali
Posts: 1427
Joined: 28 Dec 2006, 10:08
Contact:

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

Post by Svengali » 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
Desktop: tvp Pro 11.0.10-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.36-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB internal - no microSD yet

User avatar
Soom
Posts: 913
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 » 27 Jun 2021, 21:49

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
Hackintosh, OS 10.13.6, Cintiq 22", TVP Pro 11.5.1, http://danasb.com

Svengali
Posts: 1427
Joined: 28 Dec 2006, 10:08
Contact:

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

Post by Svengali » 28 Jun 2021, 00:24

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
Desktop: tvp Pro 11.0.10-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.36-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB internal - no microSD yet

User avatar
Soom
Posts: 913
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 » 28 Jun 2021, 13:01

Fantastic! thank you so much!
Hackintosh, OS 10.13.6, Cintiq 22", TVP Pro 11.5.1, http://danasb.com

Post Reply