Personal run-down: masking as I understand it so far

Have you come up with a good Moho trick? Need help solving an animation problem? Come on in.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
AcouSvnt
Posts: 190
Joined: Wed Aug 04, 2004 4:14 am
Location: Rochester, NY
Contact:

Personal run-down: masking as I understand it so far

Post by AcouSvnt »

While the existing tutorials do a good job of explaining a few fairly simple step-by-step procedures for masking, it helps to understand how things actually work in order to do anything more complex.

First of all, it appears that you can't use masking at all unless you have a group layer. And that group layer can be in one of three states, the first and default being "there is no such thing as a mask". This is not to say that masking still can't happen in a sub-group if it's switched on for that, but everything that happens in that sub-group is immaterial to the parent group; the parent doesn't care what's going on inside the sub-group, it only cares what that sub-group puts out.

(This is a good thing, by the way. It keeps masking under control by confining it to the level just under a group; no unwanted surprises or side-effects.)

So you first have to explicitly allow masking by choosing one of two "starting states" at the group level, which are show all and hide all. Doing this means that before you even render the bottom child layer in the group, you already have a mask (just not a very interesting one). As the child layers in that group are rendered upwards from bottom to top, they can either be masked by the existing mask, change the mask, or ignore the mask, depending on how you set each layer's preferences.

If that child happens to be a group layer within a group layer, its group mask settings only pertain to any masking that happens within it (grandchildren), whereas its layer masking settings pertain to its output in relation to its peers, regardless of whether or not any masking was used inside it -- you can think of its contents as being already merged by this point, so that it will now behave like any other type of layer with regard to masking.

One thing that bothered me about masks was that the mask itself could not be used to form a nice-looking outline around the thing being masked; an outline on a mask winds up just being part of the mask. A good workaround I've discovered for this is to apply a 1-pixel, no-blur, no-offset shadow and/or shading to the group layer; notice it's important to do this at the group level, because any shadow or shading that happens on a sub-layer being used as a mask will only become part of the mask (in the case of a shadow it would only make the mask itself larger).

The above are of course just user observations, so if anything I've said here is inaccurate, LM will need to correct me.
-Keith
User avatar
sherlock
Posts: 48
Joined: Fri Nov 05, 2004 1:31 am
Contact:

Post by sherlock »

Thanks, Keith.

Tackling the masking learning curve was next on my agenda. This should be quite helpful.
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Re: Personal run-down: masking as I understand it so far

Post by Lost Marble »

AcouSvnt wrote:The above are of course just user observations, so if anything I've said here is inaccurate, LM will need to correct me.
No correction needed. That's a very accurate description of how masking works in Moho.
dexterdog
Posts: 2
Joined: Fri Dec 03, 2004 5:59 am

Post by dexterdog »

New user here, apologies for possible stupid question, etc.

Why does masking not seem to work properly, for me at least, when exported to Flash - e.g. tutorial 2.6_2? Looks good when exported to QuickTime, but when exported to Flash the entire eyelid layer in this tutorial is visible at all times. Moho problem? User ignorance problem?

Running Moho 5.0.3, Flash player 7.0.14.0
-dex
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

That's because Moho's masking just isn't exportable to Flash, so any masking effects you use will not appear in the SWF file.

For a list of what can and can't be exported to Flash, look in the user's manual, in the Reference section, under "Flash Tips".
User avatar
AcouSvnt
Posts: 190
Joined: Wed Aug 04, 2004 4:14 am
Location: Rochester, NY
Contact:

Post by AcouSvnt »

Maybe the flash export needs to have that speedbump put back in, a popup warning to the effect that not all features can be exported, with a "do not show this warning again" checkbox and possibly a "more details" button to take the user right to the appropriate help file.

(Actually, since I never export to Flash, maybe Moho already has this?)
-Keith
dexterdog
Posts: 2
Joined: Fri Dec 03, 2004 5:59 am

Post by dexterdog »

Obviously I didn't dig into the manual enough before posting, sorry.
Thanks for the help.
-dex
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Re: Personal run-down: masking as I understand it so far

Post by BA »

AcouSvnt wrote: One thing that bothered me about masks was that the mask itself could not be used to form a nice-looking outline around the thing being masked; an outline on a mask winds up just being part of the mask. A good workaround I've discovered for this is to apply a 1-pixel, no-blur, no-offset shadow and/or shading to the group layer; notice it's important to do this at the group level, because any shadow or shading that happens on a sub-layer being used as a mask will only become part of the mask (in the case of a shadow it would only make the mask itself larger).
Just figuring out masking myself, and this is the very problem I've come upon. HEY LOST MARBLE: any recommendations on how to deal with this? The prime example of the situation where the outline dilemma arises is the creation of an eyeball: The white of the eye is used to mask the iris - but the iris shape bleeds to the outside edge of the eyeball, covering its outline. Is there any way to mask the iris inside the eyeball while maintaining the eyeball's outline ON TOP OF the iris?

I tried AcouSvnt's method and it does create an outline around the perimeter of the group, but you still have the unsightly problem of the iris overlapping the eyeball's outline.

And before anyone suggests creating another mask layer (other than the eyeball itself) keep in mind that the shape of the eye needs to be animated, and thus such an arrangement would be quite the hassle (requiring the animator to animate both the eye and the mask).

10 energon cubes to whoever can solve this perplexing puzzle.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

I've wrestled with this one too. I do recall I could do it v4.6, but the masking arrangements then were a lot simpler. Heres what comes to mind. And it does involve duplicating layers, but it would be automated.

Theres 3 ways I usually do the eye shapes. One, usually simple eye shapes, is to use constrained bones to move the upper a lower "lids", usually with the upper eyelid bone controlling the angle of the lower. Two, there's straight point animation (which I don't do a whole lot of for this), and three is a switch layer (which I do a lot). This would work for all of them. What I envision would be a script that would duplicate the eye shape layer, make the fill from the original layer invisible (so it's only an outline), set it to no masking, and set the duplicate as the mask. If you were using bones or point animation, you'd only want to apply the script when you were done animating. Well, actually, you could run it as you go and delete the mask layer and re-run the script when you make changes. If it's a switch layer you would just have to duplicate the keyframes, and that's easy enough to automate as well.

It's a bit of a workaround, but it would do the trick and not be all that painful. If you think that's workable, I'll consider it.
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

Thanks Brian, getting close...

I'm using actions to control point animation to change the shape of the eyes. Why actions and not a switch layer? Because while I want to be able to easily drop specific shapes into the timeline, I also want to be able to change the shape of the eye on the fly, to add a bit of stylised flair to the generic shapes...

If it were just the actions or switches, working the additional outline layer into the animation would be no problem. But to do this while maintaining malleability requires the type of approach you've described - first animate the eyeball layer, then copy the layer and turn it into the outline on top. You described a script that could do this duplication automatically. But that got me thinking:

Along the same lines, would it be possible to write a script that would transfer keyframes from one layer to another (assuming the layers contain the same shape, but with different appearances)? If it were, I suspect this would have useful application far beyond the eyeballs...

So in this case, the outline layer would already exist... and after finishing the animation press the button and it conforms to the motions of the eyeball. Is that the exact same thing you suggested, or is it different? Do-able?

How complicated is it to write such a script?
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

That is possible, and not too hard. The one thing that would be almost a requirement would be to have the outline be a copy of the shape of the eye. You could do it by hand, but there are complications. Moho identifies points not by where they are, really, although they obviously do have a location. Each point is identified by an ID number, and the numbers go in the order they are created. That's one of the reasons the interpolation works as it does. You can draw a shape that has 5 points, but say if you draw the first 5 points as a clockwise semicircle, and the other counter-clockwise, you're going to get some odd results in the interpolation. The same holds here if you want to copy the keyframes from one layer to another.

With that caveat in mind, it shouldn't be too bad. The simplest way I could see to make it work would be select the eye layer, and have the point animation keyframes copied to the layer just above it, which would be the outline layer. Or whatever type of layer you like, as long as the setup is proper. If it would be better, even if a bit more clicking, it might be possible to set up so you can choose the second layer. More flexible, but I'm not sure if a script will recognize that you've changed layers (by clicking in the Layers window while the script is running. At least for Menu scripts. Would probably have to make it a tool script. In a way, it's easier the way you suggest, as you could have it automatically clear the point animation keyframes on the target layer first. That sounds pretty painless.

I'll take a look at it. I haven't done much with manipulating keyframes yet, it make take a few days. There are a few things that aren't really documented too well, or that you have to do in a somewhat roundabout way.

Jeez, I wish there was somewhere to throw out a tip jar in this joint :wink:
myles
Posts: 821
Joined: Sat Aug 21, 2004 3:32 am
Location: Australia, Victoria, Morwell
Contact:

Re: Personal run-down: masking as I understand it so far

Post by myles »

BA wrote:
AcouSvnt wrote:A good workaround I've discovered for this is to apply a 1-pixel, no-blur, no-offset shadow and/or shading to the group layer
I tried AcouSvnt's method and it does create an outline around the perimeter of the group, but you still have the unsightly problem of the iris overlapping the eyeball's outline.
I'm not sure I understand. That part seems to work fine for me. Make sure you use layer shadow and not layer shading.

ImageMoho file here

As for the Flash export problem, I guess one possible solution would be to go back to the old Moho 3.x technique (pre-masking) of cutting holes in the face, and putting the rest of the eyes beneath the face, which is a mask with eyeholes.

Regards, Myles.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

7feet - From what I've seen in the scripting forums, you won't need that tip jar once the moho revolution is fully underway. Such ingenuity must eventually be rewarded....

I think what would be ideal would be to allow the user to target the layer of choice to transfer animation to (assuming of course that the shape is an exact copy of the source layer - only with a different appearance). This would extend the usefulness of the script far beyond eyes.

Speaking of the eyes, the way I've set it up is that there are actually two layers between the source eyeball and target outline. It goes - eyeball (source), pupil(masked), eyelids(masked), and finally eyeline (the target outline layer). I'll try to send you the file as an example so you can see what I'm going for (haven't figured out yet how to post files here)...

anyway now that I am starting to wrap my head around scripting and actions I'm seeing the endlessness of the possibilities and getting excited...
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

That's about the way I would do my general setup. The only problem I have is that there are some things that are well exposed in the script interface, some that aren't. The one thing, that I'm sure I'll figure out momentarilly, is that while you can easily find the layer name of the currently selected layer, there's no really easy way to find it's ID number, which is what you really need to pick another layer relative to it. At least within a group for masking, which is the task at hand. Perhaps I'm being dim.

Most of the tool scripts allow you to change back and forth between layers. But I tried a basic change in one of my other scripts where I said, "print the current layers name, and then brought up on of those Info popups I've been using a lot of lately. Change a different layer in the Layer window, and hit "OK". Print out what should be the new layer, and I get the name of the old layer. As I said, some of it can be roundabout. Since it seeems to be a different protocal, and the need for some mouse action in the tool scripts seems to cause a more frequent update, that seems to be the way to go. As with all of 'em, that I've done, this'un would make life a lot easier. I probably wouldn't have thought to dupe point moves this way, but it would allow for a lot more expressiveness. And for a bit I've been keeping to plain old black pupils to get around the lack of compensation for outline width.

I have to talk to a designer about her castings, and a director about the prosthetics for his zombie flick tommorow. But the weekend is devoted to sculpting the prosthetics, and Ill get bored at some point and try that out.

Get excited! Actions are very, very cool. If, as you said, you want to add some flavor to a particular point, insert the actions as copies, and then all of the keyframes will be copied as separate entities into the timeline. From there you can do point animation tweaking 'til the cows come home. But you still get a basic movement framework based, perhaps, on story boards or something, to work from.
HBK
Posts: 12
Joined: Wed Feb 02, 2005 8:25 am

Post by HBK »

Guys I am extremely stuck trying to get this mask to work. Here I have a face entering an xray machine. Trying to use masks. Am very stumped! If anyone could help me thatd be so much appreciated. Perhaps if you post your email addy, I'll send the file and maybe you could get it right, and send it back.... Im on the verge of tearing my hair out :(
Post Reply