Page 1 of 1

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

Posted: Tue Nov 03, 2015 12:19 pm
by Lukas
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!

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

Posted: Tue Nov 03, 2015 1:35 pm
by hayasidist
does right click the layer in the layers window give you what you want?

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

Posted: Tue Nov 03, 2015 1:48 pm
by Lukas
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.

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

Posted: Tue Nov 03, 2015 2:17 pm
by Víctor Paredes
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.

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

Posted: Tue Nov 03, 2015 2:22 pm
by Lukas
Thanks :) But changing the folder structure breaks the rig too much, it's a bit too risky at the moment :/

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

Posted: Tue Nov 03, 2015 2:36 pm
by Víctor Paredes
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 :))

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

Posted: Tue Nov 03, 2015 2:37 pm
by hayasidist
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.

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

Posted: Tue Nov 03, 2015 3:32 pm
by Lukas
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.