# vray hair shader?

**URL:** <https://forums.chaos.com/t/vray-hair-shader/40235>\
**Category:** General\
**Created:** [February 4, 2012, 7:44pm UTC](https://forums.chaos.com/t/vray-hair-shader/40235 "2012-02-04T19:44:59Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![treyharrell](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@treyharrell](https://forums.chaos.com/u/treyharrell)\
**Post date:** [February 16, 2012, 6:15am UTC](https://forums.chaos.com/t/vray-hair-shader/40235/22 "2012-02-16T06:15:07Z")

</div>

> [@sharktacos](#):
>
> If you could share the MEL for that it would be awesome. I’m not very good at that kind of thing so I don’t think I could write it myself.

Here you go:

[http://www.treyharrell.com/downloads/th\_ShaveMultimatter.zip](http://www.treyharrell.com/downloads/th_ShaveMultimatter.zip)

It’s quick & hacky, but gets the job done. I’ve used a similar technique in production… the mattes are quite good, but depending on how picky your comp artists are, nothing short of a premulted & isolated alpha may be good enough for them 🙂

Unzip the .mel into your maya/\<version\>/scripts directory and restart Maya.

From there, make sure VRay is set as your render engine and you’ve got a shave node in your scene.

Then you alter the pre-render MEL command in your VRay common tab to look like this:

shaveVrayPreRender;th\_ShaveMultimatter(200);

This will give you a separate multimatte for every Shave node in your scene automatically, starting with ObjectID 200 in this case. Change the number in the command if you’d like the change your starting ID.

You can hack the script if you don’t like the pass/element naming conventions.

It uses the ugly/hacky old-style render element creation code, so it should work with VRay 1.5+ (2.0 introduced much, much cleaner ways to create passes… using old-style for compatibility with both).

--T

---

_[View the full topic](https://forums.chaos.com/t/vray-hair-shader/40235)._
