Targeting another bone layers skeleton?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Targeting another bone layers skeleton?

Post by heyvern »

So I guess you can't do this.

As in:

Code: Select all

skel = moho:Skeleton()
To target another layer in the document? Looking in the documentation there doesn't seem to be a way to paste or modify bones on another layer?

So if that's true (as far as I can tell) I am using:

Code: Select all

moho:SetSelLayer(ToLayer)
ToLayer is the variable with the "target" layer ID (for copying and pasting bones from one layer to another with one script). This works GREAT... I just thought I could target the skeleton of another layer without changing layers.

-vern
User avatar
Rasheed
Posts: 2008
Joined: Tue May 17, 2005 8:30 am
Location: The Netherlands

Post by Rasheed »

Here's the technique I often use:

Code: Select all

local prevLayer = moho.layer
moho:SetSelLayer(ToLayer)   -- switch to another layer
-- do your thing on ToLayer
moho:SelSelLayer(prevLayer) -- switch back to previous layer
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Bumping this up again.

Trying to figure out how to access bones in another layer with a layer script. This would during user interaction with the bones so I can't switch to another layer.

So is there no way to access the skeleton of another layer?

I am trying to come up with a way to control bones on one with bones on another layer using only one script... but I can't figure out how to access the bones on another layer.

I would even be happy to access the skeleton of a child layer of a bone layer. There must be a way.

There were rumors that someone had done this but it never got finished or posted.

-vern
Post Reply