Material Override Excluder

3 votes
Version: 
1.4
Date Updated: 
06/15/2015
Author Name: 
Dave Wortley

Do you use the Vray Material Override to do chalk renders and wish that it would allow you to exclude certain materials? Like VRayLightMtl and any refractive materials like glass? Well now you can using this little script. It sets up a Shell Material which allows you to switch from one material setup to another. So even if those pesky VRayLightMtls and refractive materials are within Multi-sub materials then you’ll still be able to exclude them. Give it a go, test it out and let me know how it works for you! Cheers to Fraggle from the Chaosgroup forums for giving me the motivation to do this one. It should be easy enough to hack it for Mental Ray or other renderers, feel free to ping me a message with any specific requests, I'll add Corona soon.

 

Additional Info: 

Usage

Choose the Material Editor Sample Slot you want to get your Override/Chalk Shader from, that’s down bottom left in Slate or one of the sample slots in the Compact-Material-Editor. Keep the excludes on for whichever materials you want to preserve (let me know if you want more there). You can keep refractive materials and automatically desaturate refraction / fog / exit colour/maps. You can choose to keep opacity maps/bump maps/ displace maps this will work with nested materials, multi-sub, VrayBlends etc… You can also exclude by a material name, and using Wildcards you can exclude all materials which have glass in their name for instance by putting in *glass* into the name exclude box. You can also get your the objects you have in your include/exclude List in the VRay Material Override Exclude Dialog. Press ‘Create Override Setup’ and your scene is now ready to render with override materials on, you can press ‘Go Material’ at any point to return to the original materials, and press ‘Go Chalk’ to go back to rendering chalks. Press ‘Remove Override Setup’ to revert back to how your scene was, even if you close and reopen the script. Hold Shift on the ‘Go Override’ and ‘Go Material’ buttons to turn just the selected objects to Override or Material.

Installation

Download the MCR File Run it using the Maxscript(now called Scripting in 2016) Menu -> Run Script or Drag and drop it from your hard drive into the viewport.

You'll find the macro under 'DW Tools'

Changes

v.1.2 Updated to fix, bug when not using Vray Material Exclude List, and extra layer of warning messages added.

v.1.3 Updated to add override to objects with no materials.

 v.1.4 Update to allow overrider of XRefScene Materials, and exclude by name can have multiple inputs using commas to separate.

 

Version Requirement: 
3dsmax 6+
Other Software Required: 
Vray 2.0 +
AttachmentSize
dw_materialoverrideexcluder.mcr13.62 KB

Comments

Comment viewing options

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

Corona!

corona renderer!

MaximuM's picture

By the way

By the way: it would be nice to have the possibility to save and load presets, so the user doesn't have to repeat the same steps each time he uses the script :)

Thank you

MaximuM's picture

Ah ! Ok, sorry I didn't

Ah ! Ok, sorry I didn't notice that.
It works fine, thank you Dave :)

DaveWortley's picture

Monochrome Refractions

Max.. There is an option which sets the refractions to monochrome, untick this if you want to keep the colour.

MaximuM's picture

Bug with diffuse color

I found the following bug:
_ when I setup a VRayMtl with let's say a pink color on the diffuse slot and a refractive value of 0.5, this material is not overriden (assume that "keep Refractive VRayMtls" is ticked), but the wrapped material created by the script ignores the diffuse color.

MaximuM's picture

Multiscatter ready

Hi,

Just to let you know that I tested the script with Multiscatter and it seems to work fine so far.
In my projects I sometimes use RailClone too, so it would be nice if you could have your script working with it too :)

1rv's picture

I can't make the script work

I can't make the script work well with VrayProxy vegetation (only trunk get white, the rest is rendered as usual). Any ideas why?

DaveWortley's picture

ForestPro

Ah yes, pesky ForestPro with it's bizarre way of storing materials internally... I'll look into it, should be fairly simple to do.

I guess I'll need to check RailClone and PFlow as well.

Stirling's picture

Superb

This is so useful. Thanks for doing it!

One question: I'm having trouble getting the override to work with Forest Pack Pro objects, namely the grass which still renders with it's material. Any idea why this might be?

Thanks again

MaximuM's picture

Yes

Yes Dave: personally I think it would be better if the script would pick the material from the VRay Material Override Slot in the render settings dialog. It seems more handy to me.

Comment viewing options

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