Vern (most likely, but anyone else can jump in),
Is it possible for a script to shift focus to a specific layer? IOW, I want to have a certain layer highlighted (so actions performed are done on that layer) and be able to then run a script that selects another layer for actions on that new layer.
What is happening is that I am doing bone manipulations and then I need to, say, do some vector stuff on another layer. After I'm finished with that layer I need to go back to my master bone layer. If I don't use the mouse to select this layer then naturally any commands (such as rotate) will apply to the vector layer instead, so I select and then rotate bones. But... then I need to go to another layer (perhaps a switch layer) and so forth. And this happens a LOT -- back and forth, back and forth and I'm spending too much time mousing around all the dozens of different layers.
Since I can identify my master bone layer by name I was hoping that a script could provide the focus and select that layer. If so, I can assign a hot key to that script and put that on a button on my shuttle and with one button press I'm back to bone manipulations (I might even assign a button or two to the other switch and vector layers I need the most). I will need to only select the bone layer of the current hierarchy I'm in, but that's another issue (I assume, since you can step through all the layers in a project, there is also a way to only step through layers in a particular master layer -- I just haven't tried this yet).
I know how to select a layer in a script to actively do something to it in the script -- what I don't know is how to shift the focus so it's selected for subsequent mousing... assuming this is possible.
Is it possible to shift focus to a layer?
Moderators: Víctor Paredes, Belgarath, slowtiger
There is a script floating around that is a button to select the parent layer of a layer. I think it was created for a similar purpose, speeding up layer selection, cutting down on all the clicking and scrolling in the layer palette. I don't know if this is enough. It sounds like you want to use hot keys to select specific layers at any time. I am sure this can be done.
If you are looking for the script reference that does this it is:
"layer" is a "MohoLayer". For instance in layer scripts moho.layer refers to the layer that is currently selected. That would be a "MohoLayer" object. You would need to find a moho layer to switch layers. It isn't just the ID or the name. Best bet would be to store all the layers in a table and use a table reference to the MohoLayer to change layers. Almost the same as bones are selected using this to select a specific bone:
-vern
If you are looking for the script reference that does this it is:
Code: Select all
moho:SetSelLayer(layer)
Code: Select all
moho.skeleton:Bone(ID)
Thanks, Vern -- I think that's all I need.
I only have one bone layer for any character, so all I need do, I think, is go through the layers of the character and choose only the one that is a bone layer -- that I can handle. Doing the same thing for multiple switch layers is a different ball game and, as you say, I can read into a table if need be (but I'll work on that if the bone switch thing proves useful to me).
I only have one bone layer for any character, so all I need do, I think, is go through the layers of the character and choose only the one that is a bone layer -- that I can handle. Doing the same thing for multiple switch layers is a different ball game and, as you say, I can read into a table if need be (but I'll work on that if the bone switch thing proves useful to me).
- synthsin75
- Posts: 10267
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
viewtopic.php?t=3720&highlight=select+parent+layer
Here's that script that Vern mentioned. May help give you a starting point for any modifications.
Here's that script that Vern mentioned. May help give you a starting point for any modifications.

Thanks, Wes.
I do remember reading about this -- filed it away somewhere in the back of my mind (a very scary place :>).
Right now I'm busy writing scripts but in a couple of weeks will turn back to animation and am going to try and streamline (yet again!) my workflow in order to get out five or six episodes before the end of the year (the first three half hour shows took about a month a piece).
I do remember reading about this -- filed it away somewhere in the back of my mind (a very scary place :>).
Right now I'm busy writing scripts but in a couple of weeks will turn back to animation and am going to try and streamline (yet again!) my workflow in order to get out five or six episodes before the end of the year (the first three half hour shows took about a month a piece).
In addition to the select parent-script I've also created a "select active child"-script so you could fast and easily select the vector layer you want (If they are rigged inside a switch-layer that is).
(viewtopic.php?t=11718)
I'm also in the process of writing a script to select different layers by assigning shot-cut-keys to them. Not sure when I'll be done with that though.
(viewtopic.php?t=11718)
I'm also in the process of writing a script to select different layers by assigning shot-cut-keys to them. Not sure when I'll be done with that though.
Thanks, Rylleman -- in looking at that thread I realized it was very close to what I was looking for and I'm sure I can modify it to get what I want.
I can't just always select the parent -- because I'm often in a group layer further down (my "head" layer is a group that contains all kinds of head parts, like the pupils, so if I'm manipulating the pupils and I want to jump back up to the bone layer I need to go past the "head" parent and to the bone layer which is the parent of the head group). But I think I can puzzle it out, as the bone layer will always be the layer just below the master parent (which is my character layer).
It sounds like the script you're working on is what I'm trying to do -- perhaps we'll get there by different means and can compare notes. I'm still stuck in script writing mode and may not be able to get to this for a few weeks (so you might beat me to it :>)
I can't just always select the parent -- because I'm often in a group layer further down (my "head" layer is a group that contains all kinds of head parts, like the pupils, so if I'm manipulating the pupils and I want to jump back up to the bone layer I need to go past the "head" parent and to the bone layer which is the parent of the head group). But I think I can puzzle it out, as the bone layer will always be the layer just below the master parent (which is my character layer).
It sounds like the script you're working on is what I'm trying to do -- perhaps we'll get there by different means and can compare notes. I'm still stuck in script writing mode and may not be able to get to this for a few weeks (so you might beat me to it :>)