Page 1 of 1

Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 2:44 pm
by TheSharpestPencil
Hi!
I'm a new user and I'd really appreciate some help with what I'm guessing is a pretty standard process.

I thought I'd start learning the software by trying to rig a basic Photoshop file of a character, separated into what I think is a pretty logical layer hierarchy for rigging. I've rigged characters in After Effects with Duik and in Toon Boom Harmony Pro too, but I've heard Moho is great at rigging Photoshop files, which is why I've taken the plunge.

The problem I'm having is this. The character's plaits/hair need to appear behind the head but in front of the breast plate armour. The breast plate armour sits in front of the head. In Photoshop, this is easily achieved by creating an inverted mask of the head shape on the hair/plaits layer (i.e. the hair is hidden by the head).

However, I'm not sure how to achieve this in Moho! Hopefully the diagram helps to explain the issue. When I rig this, the hair will be a child of the head, so ideally I want the use the head layer as the mask (inverted) so that when the head moves, the hair moves too.

Thanks in advance for any suggestions or tips anybody can offer!

Image

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 2:47 pm
by slowtiger
Is there a reason for having that breast plate in front of the head? You avoid this problem if you put all head parts on top.

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 2:56 pm
by TheSharpestPencil
Image
Spatially, the breast plate is in front of the head - you should get the idea from the image. Left = incorrect position / Right = correct position

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 4:30 pm
by TheSharpestPencil
I think I've solved this one. Initially, I copied the face layer and grouped it with the hair so to enable masking. I discovered that Moho doesn't/can't use the alpha channel of the PSD layer for masks - is that correct?

Anyway, I made a vector layer and traced over the face and used the vector layer as the mask (i.e. subtracted from the mask) and it worked.

Has anybody else managed to get Moho to use the alpha in a PSD layer to mask another layer?

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 4:51 pm
by slowtiger
Moho can use any image as mask. It will use the non-transparent pixels as mask. Also it can combine more than one layer into a mask.

Layer ordering is not the same as Z depth - you can have something on top of the layer hierarchy so it covers everything else, but be "in the back" of something else. Of course this only works with stuff which doesn't get in contact with each other.

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 4:58 pm
by TheSharpestPencil
slowtiger wrote: Sat Nov 19, 2022 4:51 pm Moho can use any image as mask. It will use the non-transparent pixels as mask. Also it can combine more than one layer into a mask.

Layer ordering is not the same as Z depth - you can have something on top of the layer hierarchy so it covers everything else, but be "in the back" of something else. Of course this only works with stuff which doesn't get in contact with each other.
Thanks for all your answers - it's encouraging to know that there is help out there! I tried fiddling about with z-depth; it works much the same way in Moho as in After Effects and TBH, but I couldn't seem to make the very modest adjustments I needed. Does Moho 'snap' to a grid by default when moving layers in z space (at least that's how it felt).

In the end after much trial and error, I turned off gpu acceleration and discovered that Moho was in fact rendering layer masking correctly. I'm hoping there's a bug fix for that at some point.

Again, many thanks for taking the time to help. Much appreciated!

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 5:09 pm
by Greenlaw
TheSharpestPencil wrote: Sat Nov 19, 2022 4:30 pm I think I've solved this one. Initially, I copied the face layer and grouped it with the hair so to enable masking. I discovered that Moho doesn't/can't use the alpha channel of the PSD layer for masks - is that correct?
That's correct. A Layer Mask is one of these 'Photo-shop specific' features that doesn't carry over into Moho. Normally, you would flatten that layer for Moho, but in this situation you actually want to keep the mask independent of the breast plates, so you will need to extract the mask into its own layer. In Photoshop just disable the Layer Mask, select and copy the Layer Mask art, and then Ctrl-Shift-Paste it into a new layer (to paste 'in-position.') When this standalone element is imported to Moho, you can use it like a regular Moho mask layer.

Moho will ignore the disabled Layer Mask but I'd keep it in there in case you need to reference it later when working in Photoshop.

As for the actual Alpha region of a Photoshop layer (the normal transparent area,) Moho does respect that. What Moho doesn't see in your PSD is called a Layer Mask. Basically, any of the uniquely Photoshop features like Layer Mask, Clipping, Mask, and Adjustment Layers won't carry over. The more traditionally 'generic' Photoshop features like groups and (most) blending modes should work fine from programs that support programs that export layered PSD files.

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 5:15 pm
by TheSharpestPencil
Greenlaw wrote: Sat Nov 19, 2022 5:09 pm That's correct. A Layer Mask is one of these 'Photo-shop specific' features that doesn't carry over into Moho. Normally, you would flatten that layer for Moho, but in this situation you actually want to keep the mask independent of the breast plates, so you will need to extract the mask into its own layer. In Photoshop just disable the Layer Mask, select and copy the Layer Mask art, and then Ctrl-Shift-Paste it into a new layer (to paste 'in-position.') When this standalone element is imported to Moho, you can use it like a regular Moho mask layer.
Thanks. The thing is, I didn't export any of the PSD layer masks in the version I imported into Moho (I figured they would complicate matters and that I would need to use Moho's masking method to achieve the same result). The problem seems to be with the display renderer not recognising transparency unless I turned off GPU acceleration. Then it rendered the masked areas correctly. It didn't have the same issue with vector masks however. I'm guessing this is a bug others have encountered too?

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 6:32 pm
by Greenlaw
TheSharpestPencil wrote: Sat Nov 19, 2022 5:15 pm The problem seems to be with the display renderer not recognising transparency unless I turned off GPU acceleration.
That's curious...GPU Acceleration should not have any effect on rendering at all.

Or are you talking about the display preview? If so, yes, in some situations, masking previews are more accurate when GPU Acceleration is disabled. For this reason, I tend to keep GPU Acceleration disabled until I really need to use it (which is pretty rare.)

In nearly all cases where the masking preview doesn't look correct in the display preview, it will actually render correctly so I just ignore this error. You can see an example of this in the eyes of my Puss-In-Boots rig here: My 'Puss In Boots Interactive' Demo Reel (2018)

In the rare situation where I absolutely need masking in the display preview to be accurate, I'll create a duplicate of the elements and re-arrange the layering so it displays correctly, even if it doesn't render correctly. Then I'll set the original to be not seen but render, and the duplicate to be seen but not render. So long as the elements are bound identically, having a duplicate with different render settings should work fine. But most of the time I'm too busy to bother with that and I'll just ignore the display error. 😸

Of course, it would be better if masking always displayed and rendered similarly and correctly. Lost Marble is well aware of this and I'm sure they're working to improve this for a future version of Moho.

Hope this helps.

Re: Layer Order and Masking Puzzle

Posted: Sat Nov 19, 2022 7:50 pm
by synthsin75
I would just make a reference of the head group and use it as a subtraction mask for the hair.
But yeah, complex masking usually only displays correctly when rendered.

Re: Layer Order and Masking Puzzle

Posted: Thu Nov 24, 2022 6:36 pm
by Víctor Paredes
I'm late to the conversation here and maybe someone already mentioned it, but what about masking the hair on top? That can be a pretty simple mask.
Here's a mock-up:
https://www.dropbox.com/s/2mmre9ns9tuuy ... moho?raw=1