Power Masker

3 votes
Date Updated: 

The 3dsmax UI only allows you to set material effects ID up to 16 channels. The VRayMtl allows you to go beyond this using the effects ID override but other types of materials don't have any UI to adjust this. This tool using a backdoor into 3dsmax to set the effects ID beyond the 16 limit imposed by the UI.

This means you can create masks for every material in your scene. Using this tool you can either assign effects IDs by hand or just press to automatically create them and their mask render elements.

You can also make a Vray Multi-matte mask for each layer in the scene too, this uses the include/exclude lists rather than the GBuffferIds, so that you can therefore use the GBuffer IDs for doing variation with texture maps or mask objects individually if you want to.

Additional Info: 

Bug found with VRay that made some of the mask render white. Put work-around in the script, don't worry that the layer masks say their ID is 10000.

dwpowermasker.mcr6.17 KB
dwpowermasker.mcr7.87 KB


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
MaximuM's picture

Same thing here

The script works fine for me with VRayBlend and Multi-sub object materials, but at sub level only, not for the main material (with the larger .mcr file).

obaida's picture


for making this script , but if you can make it apply at sub level materials like (multi/sub-object , vrayblend) will be more handy.
thanks in advanced

alessandrod84's picture

All to zero problem

Hi, first of all really thanks for this script i really need it.
Just one thing if i use the All to zero option it do not function with the main material of multisub and vrayblend.

Is my fault or a little bug?

Thanks Again.

MaximuM's picture

Thank you

Thank you Dave,

Your script now works the way I expected, but not with Multiscatter objects which have a Multi-Subobject Material on it. And this is due to Multiscatter creating a temporary layer at rendering time only: so your script can not create the appropriate render element. In this case I think I will rely on another usefull script: Render Mask.

Thank you again for the great work :)

DaveWortley's picture

Test it for me :)

I've added a new version (It's the larger file), see if it works for you.

MaximuM's picture

Thanks ! Why not a switch ?

This is great news Dave, thank you !

I understand what you say and it's true it can quickly become very messy on complex scenes with a lot of Multi/Sub-Object and/or VRayBlendMtl. But as I mainly do exterior visualisations with few materials it should be very acceptable.

So why would'nt you create a simple switch to turn on or off this possibility depending on the user's needs ?

Thanks a lot again !

DaveWortley's picture

I can but....

It's an all or nothing, if you want sub-materials then you get sub-material masks for everything and none for the root materials as 3dsmax/Vray can only give you a gBuffer ID for one material level at a time.

So if you have lots of levels of VRayBlend Materials this could get quite messy!

I've got a version, I'll upload it tomorrow when I've tested it some more.

MaximuM's picture

Cool (and improvement idea)

Thanks Dave, it works fine now :)
The only remaining point which could be improved to me, is that right now, one Material ID channel is generated for each sub-object material in the scene but all the Sub-Material inside of it remain to zero. It would be great if all the Sub-Materials could receive a unique ID too. I guess it is a bit more complicated but if it is possible, it would be totally awesome !

DaveWortley's picture

Thanks problem solved!

Thanks, found the bug! A strange VRay one, not sure why I didn't see it originally, might be because I didn't have any empty layers.

I've made it a macroscript too now.

MaximuM's picture

Yes indeed

Yes indeed ! I forgot to mention it: for convenience I wanted your script to be assigned to a button so I added few lines at the begining of your script and saved it as .mcr and here comes the problem. I must have done something wrong here ...

But I don't have any problem when I drag & drop the .ms in 3dsmax, the script works fine except the VRay MME per Layer which still appear pure white (I checked, this is not the alpha channel).

Thank you Dave,

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.