tv_layerInfo selection parameter

A forum dedicated to George scripting questions
Post Reply
User avatar
ZigOtto
Posts: 4102
Joined: 17 Feb 2006, 22:50
Location: south-Petazonia

tv_layerInfo selection parameter

Post by ZigOtto »

the selection parameter returned by tv_layerInfo seems to be not always trustable .
when using this little script :

Code: Select all

param none

tv_layerInfo 
parse result display pos opac name type start end prelight postlight sel scoob
tv_warn sel
on an unselected layer, I get "0", that's OK,
I select the current layer, the script returns me now "1", that's fine,
I unselect now the same layer, and the script returns me "1" again, instead of "0" .
:x
Svengali
Posts: 1557
Joined: 28 Dec 2006, 10:08

Re: tv_layerInfo selection parameter

Post by Svengali »

I think the tv_LayerInfo id command works a little differently than that. What it provides to you is info on the layer with the ID # you PASS to it, which includes whether THAT layer is selected or not.

The tv_LayerGetID position command provides the ID for a given layer based on its position in the layer hierarchy. That resulting ID is the argument you would use in the tv_LayerInfo command to find out if THAT layer with that ID is active or not.

Also, the george SDK recommends when working with multiple layers in a script you FIRST use the LayerGetID command to get the true ID numbers for all layers. Here's some code I use in the MergeAllLayers script to get the list (and count # of visible layers too)...

Code: Select all

Counter = 0
Visible = 0
DO														// find ID numbers for all existing layers and store in LayerID array
	tv_LayerGetID Counter								// get layer ID using its position
	parse result ID
	LayerID(Counter) = ID								// store ID for layer in array
	Counter = Counter + 1								// increase counter and do again
	tv_LayerInfo ID										// check layer state
	parse result LayerVisibility d
	IF CMP(LayerVisibility,"ON")						// is layer visible?
		Visible = Visible + 1							// yes, so count it
	END
UNTIL CMP(ID,"NONE")									// NONE means no more layers to identify
Visible = Visible - 1									// actual number of visible layers
Counter = Counter - 2									// total number of layers
IF (Visible < 1)										// check layer count is greater than one
	tv_warn "Requires one visible, Aborting"
	EXIT
END


Sven
User avatar
ZigOtto
Posts: 4102
Joined: 17 Feb 2006, 22:50
Location: south-Petazonia

Re: tv_layerInfo selection parameter

Post by ZigOtto »

thanks Sven to come in rescue trying to help me, 8)
and you're right on layer's Identification which is usually needed in a script, but here, it's not the point.
(afaik, when no ID mentionned, I thought tv_layerinfo command used to work on the current one...)

anyway, even after inserting lines to Identify the targeted layer, the result is quite the same
(inconsistent after the layer's deselection, maybe a layer's statut refresh problem ?)

try this one and proceed the 3 steps described in my previous post, and tell me what you get.

Code: Select all

param none
tv_LayerGetID 0
parse result ID
tv_layerInfo ID
parse result display pos opac name type start end prelight postlight sel scoob
tv_warn sel
actually, I have to "select" another layer to get back a "0" for the selection parameter.
Svengali
Posts: 1557
Joined: 28 Dec 2006, 10:08

Re: tv_layerInfo selection parameter

Post by Svengali »

You are right, there is something hinky when the current layer is UNSELECTED, it is still reported as selected.

But I think it might be a problem of ambiguous intent. Another command, tv_LayerSet id implies the ID layer is SELECTED but it actually only makes the ID the "current" layer. After that, the tv_LayerInfo command still returns that "current" layer as NOT SELECTED.

On one hand, SELECT seems to mean making a specific layer the "current" layer...
On the other hand, SELECT seems to mean a specific layer's ICON has been clicked on and now has a yellow perimeter indicating it is really "SELECTED".

I'd also expect there would be a tv_cmd that actually performs a real "SELECT" (or un-select) for one or more ID layers, something like
tv_LayerSelect id - Alas that command is already used instead to select a range of frames on the current layer.

So, bottom line you were right and perhaps the tv_LayerInfo command still needs debugging or clarification and/or another command. :(

Sven
User avatar
ZigOtto
Posts: 4102
Joined: 17 Feb 2006, 22:50
Location: south-Petazonia

Re: tv_layerInfo selection parameter

Post by ZigOtto »

agreed, in my mind, "Select layer ID" isn't equivalent of "Go to layer ID" (or "make it the current one"),
probably an ambiguity here,
Svengali wrote:... I'd also expect there would be a tv_cmd that actually performs a real "SELECT" (or un-select) for one or more ID layers, something like
tv_LayerSelect id - Alas that command is already used instead to select a range of frames on the current layer.
imo, the command which should do that could be tv_layerset ID Params,
where Params are the 12 layer's parameters :
Display (ON/OFF), Position, Opacity (0>255), Name, Type (SEQUENCE/IMAGE/VIDEO), Start, End, Pre-Lighttable (0>7), Post-Lighttable (0>7), Selection (0/1), unLock (0/1), Stencil (OFF/ON/INVERT)
f.i. to make a layer ID selected, we could type : tv_layerset ID selection 1

thanks again for your answers.
Svengali
Posts: 1557
Joined: 28 Dec 2006, 10:08

Re: tv_layerInfo selection parameter

Post by Svengali »

I like that!
Post Reply