List of all layers in the scene ?

A forum dedicated to George scripting questions
Post Reply
lluisllobera
Posts: 4
Joined: 08 Feb 2014, 16:29

List of all layers in the scene ?

Post by lluisllobera »

Hi,

As stated in a previous thread, I am noob to George and I'm trying to find my way through the Wiki.

For now, I'd like to see if anybody can help me out get one specific script jump-started.

How can I get a list of all the layers in the scene ? I'd like to get the list, then go through each layer individually and do different things depending on some of their attributes.

Thanks !
Last edited by lluisllobera on 26 Jan 2016, 19:22, edited 1 time in total.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: List of all layers in the scene ?

Post by Svengali »

Here's a simple loop structure in George that grabs what you need.

Code: Select all

ExitFlag = 0
Counter = 0

While ExitFlag == 0
	tv_LayerGetID Counter
	LayerID = result
	IF CMP(LayerID, "none") 
		Total = Counter - 1
		ExitFlag = 1
	ELSE
		tv_LayerInfo LayerID
		parse result LDisplay LPosition LOpacity LName LType LStart LEnd LPre_LT LPost_LT LSelection 
		LayerInfo(Counter,0) = LayerID
		LayerInfo(Counter,1) = LName
	END
	Counter = Counter + 1
END
// see what was captured in the array:
For i = 0 to Total
	tv_warn "Layer# = " i "     LayerID = " LayerInfo(i,0)"  LayerName = " LayerInfo(i,1)

END
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
lluisllobera
Posts: 4
Joined: 08 Feb 2014, 16:29

Re: List of all layers in the scene ?

Post by lluisllobera »

Awesome !!!

Thanks for your help Sven :-)
Post Reply