Finding Current Clip Position

A forum dedicated to George scripting questions
Post Reply
User avatar
NathanOtano
Posts: 1202
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Finding Current Clip Position

Post by NathanOtano »

Hey!

I can't make the "or" logical operator to work. For example if I want to use "do ... until" and for the until I want to set two possibilities : a specific number or "none"

If I try to find the clip position of my current clip for exemple :

Code: Select all

		tv_clipcurrentid
		ClipID = result
		
		ClipPos = 0		
		DO 
			tv_ClipEnumID -1 ClipPos
			Parse Result PosID
			i = i+1
			
		UNTIL (CMP(PosID,ClipID)==1 || CMP(PosID,"None") == 1)
Another question is if there is already a command or a script to quickly find the current clip position :)

Nathan

EDIT : OK found the solution :) the logical operators works well, the problem was in the syntax of the script himself.

+ the tv_ClipCurrentID never returns none cause we can't have no clip selected, don't know why I was thinking that. So no need for the "or" opérator. Final script :

Code: Select all

#Function Otano_ClipCurrentPos()
		LOCAL ClipID ClipPos PosID

		tv_clipcurrentid
		ClipID = result
		
		ClipPos = 0
		tv_ClipEnumID -1 ClipPose
		PosID = result
		
		While (CMP(PosID, ClipID)==0)
			ClipPos = ClipPos+1
			tv_ClipEnumID -1 ClipPos
			PosID = result
		END

			result = ClipPos
#End
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Post Reply