New Script for changing properties of Vray Materials

Hi,

Inspired by Metin7’s request for a new “Automator” script, I’ve written a script that allows you to change the properties of VRayMtls, VRayLightMtls & VRayFastSSS mats across the scene, selection or material editor for VRay 1.5, so I thought I’d share it with you.

EDIT (2012-10-15) : You can now download it from my website: www.oliverradford.com/3ds-max/scripts/vmc-vray-material-control/.

Let me know what you think or if you have any suggestions…

Cheers,
Olly

Revision v1.01:
Added control for Standard & VRayMtlWrapper materials. Also fixed a bug: VRayMtlWrapper base materials weren’t accounted for in a property change.

Revision v1.03:
Removed display of unsupported properties, specifically sub-materials & maps. Added a help. Thoroughly tested this time, so hopefully no more surprises…

Looking at the script now

I’ve been scouring the net for vray documentation for the various vray classes and structures. I’m only a maxscript noob, but the place I spend most time is with vray stuff. So I thought I’d start by trying to learn that.
I learned that vray.output_on turns on the Vray VFB. this is not documented anywhere, and I found things out by trial and error. Is this the only way?
Raj

Hi Raj,

To find out the scriptable properties of something in max you use either the show or getpropnames functions.

For example:
For vray render properties you can use: show renderers.current
For vraymtl properties you can use: show (vraymtl())

Hope that helps?

Cheers,
Olly

ta. that was how I discovered about the vray-frame buffer. But I arrived at that the vr.output_on after trying a few booleans that I thought fitted the bill. I was wrong a couple of times first. To me it doesn’t seem logical to make that parameter turn on the frame buffer since the name is different. I would have thought that something like vray.vrayVFB would have been the obvious choice. The documentation is sadly lacking behind the development. TO be honest I think I prefer it that way too..
Raj

The names are not always meaningful as sometimes an option starts as something, and ends up as something else; in the meantime, the maxscript name can no longer be changed in order to keep compatibility with existing scripts…

Best regards,
Vlado

Vlado, i’d vote for a maxscript-cleanup version, even if it means putting hand to the whole lot of maxscript code already written for it.
The slight inconsistencies can be annoying as they’d often spoil elegant ways of going about things.
Minor, in a sense, but i’d love to see it relaid out nevertheless, if it isn’t too much work.

Revision v1.04:
Added support for VrayMtl’s contained within VRayOverrideMtl.

Nice! Thanks for sharing.

v1.05:

Added support for vrayblendmtl coatmtl’s.

v1.06:

Added Composite, shellac, shell, top/bottom, blend and RPM Material Support.

v1.07

Performance Optimisations.

v1.08:

Added support for VrayOverrideMtl.

v1.10:

Updated for Vray SP3.

What specifically has changed to break the scripts?

Thanks

Nothing as far as I know.

This is just an update to include the new VrayFastSSS2 material in the VMC…

Cheers,
Olly

ahh, ok, there was another post about some scripts breaking so I just assumed…

Thanks olly! I use this on a regular basis, mainly to limit ray-depths.

v1.11:

Bug fix for scene mats button. Increased width for drop downs to help with long names.