what use only selected layers?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
vutshy
Posts: 3
Joined: Mon Nov 12, 2007 7:42 am

what use only selected layers?

Post by vutshy »

Hi all


what use only selected layers?

Image


what use this command > fLayer? (from ScriptInterface)



forgive, I bad know english.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post 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
vutshy
Posts: 3
Joined: Mon Nov 12, 2007 7:42 am

Post 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
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post 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
vutshy
Posts: 3
Joined: Mon Nov 12, 2007 7:42 am

Post by vutshy »

Thanks HEYVERN!!!
Post Reply