Script request: Set current layer to 'Don't mask this layer'

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
User avatar
Lukas
Posts: 783
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Script request: Set current layer to 'Don't mask this layer'

Post by Lukas » Tue Nov 03, 2015 12:19 pm

Hey guys,

I have 0 lua experience but I'm hoping this is something super-easy for someone out here :) I could really use a script that simply sets the current layer's masking settings to 'Don't mask this layer'. I need it to get the viewport preview certain masking situations correctly.

Any help would be greatly appreciated!
hayasidist
Posts: 2132
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Script request: Set current layer to 'Don't mask this la

Post by hayasidist » Tue Nov 03, 2015 1:35 pm

does right click the layer in the layers window give you what you want?
User avatar
Lukas
Posts: 783
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Script request: Set current layer to 'Don't mask this la

Post by Lukas » Tue Nov 03, 2015 1:48 pm

hayasidist wrote:does right click the layer in the layers window give you what you want?
There's some situations where the right click layer menu is not available (For example the SUBSWITCH layer in the sample file). There's ways to go around it, but this particular situation happens ALL the time with our current project. Basically each time a character picks up a prop, which happens almost in every shot. A simple script that would set new layers to 'Don't mask' would be the quickest fix because otherwise animators need to mess with the rig which is already way to complicated in the first place. :P

The red circle should NOT be masked, but the layer structure should not be messed with either. You could manually fix it by dragging the SUBSWITCH layer out of the SWITCH layer and set it to 'don't mask this layer', but by doing it that way our rig gets broken.

Sample file:
http://www.lukaskrepel.nl/temp/ASP/dont ... mple.anime

To be clear, this is all about the viewport. As you see in the sample file it renders fine. The red masked is only being masked in the viewport and not in the actual render.
User avatar
Víctor Paredes
Posts: 4874
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Re: Script request: Set current layer to 'Don't mask this la

Post by Víctor Paredes » Tue Nov 03, 2015 2:17 pm

It's an interesting file. I don't think a script will be the definitive solution, because it seems to be it's a bug: the software is trying to get a good preview for the mask, but it fails during the process.
There's a way you can "fix" the preview without really changing the file:

- Select SUBSWITCH and in the new layer button, select "Group with selection"
- Open the new GROUP layer proprieties, masking tab and set "hide all"
- Now the red circle won't be masked in the preview
- Drag SUBSWITCH out of the group, put it inside SWITCH (its original location)
- Delete the group
- Now the preview is working well

Maybe that can work for you in the meanwhile.
Víctor Paredes
Former Moho Product Manager
Animator in Cartoon Saloon
My Youtube Channel - My webinars
User avatar
Lukas
Posts: 783
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Script request: Set current layer to 'Don't mask this la

Post by Lukas » Tue Nov 03, 2015 2:22 pm

Thanks :) But changing the folder structure breaks the rig too much, it's a bit too risky at the moment :/
User avatar
Víctor Paredes
Posts: 4874
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Re: Script request: Set current layer to 'Don't mask this la

Post by Víctor Paredes » Tue Nov 03, 2015 2:36 pm

Lukas wrote:Thanks :) But changing the folder structure breaks the rig too much, it's a bit too risky at the moment :/
But you break it a little, fix the mask preview and then everything goes back to its original structure. It shouldn't be a problem for the software (but make a backup, anyway :))
Víctor Paredes
Former Moho Product Manager
Animator in Cartoon Saloon
My Youtube Channel - My webinars
hayasidist
Posts: 2132
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Script request: Set current layer to 'Don't mask this la

Post by hayasidist » Tue Nov 03, 2015 2:37 pm

agreeing with Victor - IMO the problem is that the work area does not properly show what will be rendered - a render shows the red circle correctly - (i.e.NOT masked) but the work area shows it (incorrectly) masked. Which, again IMO and to be blunt, is a bug -- and it has been logged a few times in various forms in Mantis.

The Layers window for subswitch does not have any masking options to manipulate - I think masking options are only available for bone and group layers and their direct children, so I don't think a script will help here.


You could try changing display quality to switch off masking -- this reveals the red circle but also the whole of shading.
User avatar
Lukas
Posts: 783
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Script request: Set current layer to 'Don't mask this la

Post by Lukas » Tue Nov 03, 2015 3:32 pm

You're right, and thanks for thinking with me. But we can't wait for an ASP update to fix this, we need this right now. :)

My current fix is using Ramon's Lost Layer Tool: http://lostastools.blogspot.nl/2010/05/ ... -tool.html
I was surprised it's still working in ASP11.

If you click the red cross from his toolbar: Image
with the SUBSWITCH selected the problem is fixed.
Post Reply