Page 1 of 1

what use only selected layers?

Posted: Mon Nov 12, 2007 8:06 am
by vutshy
Hi all


what use only selected layers?

Image


what use this command > fLayer? (from ScriptInterface)



forgive, I bad know english.

Posted: Mon Nov 12, 2007 9:47 am
by heyvern
fLayer returns the currently selected layer. This is a "read only" value.

This is how you access the layer:

Code: Select all

moho.layer
---------

SetSelLayer(layer) is used to change which layer is selected:

It would be used like this:

Code: Select all

moho:SetSelLayer(layer)
"layer" is the layer object to switch to.

I am using this in a menu script to copy bones from one layer and pasting to another layer. I can only "copy" bones into a list from the currently selected layer. So I have to change layers in the menu script to "copy" a list of bones and their values and switch to another layer to paste based on settings in the menu script.

-vern

Posted: Mon Nov 12, 2007 10:08 am
by vutshy
Thanks HEYVERN

But
as returns the currently selected layerS with this fLayer?
please give small code for example

me need find only visible(with eye in square) layers
please help

Posted: Mon Nov 12, 2007 11:57 am
by heyvern
I don't think you can access that with scripting.

You can change all of the layers other values on and off. The stuff in the layer options when you double click a layer, but as far as I know you can't change the "eyeball" value on and off because it isn't an animated value.

Look at the scripting reference section for "MohoLayer" that lists all of the items you can change. Plus each layer type has other things that can be modified.

-vern

Posted: Mon Nov 12, 2007 12:39 pm
by vutshy
Thanks HEYVERN!!!