General help with Maya, mel and Multimattes

Hi there,

Just wondering if anyone has a solution for this scenario:

Basically I use multimattes quite extensively and set them up throughout a project. However a lot of the times I forget which numbers are already taken up. Is there a way to query which numbers are being used by multimattes in VRay and print them out the script editor?

Hiya,
Yup I use it in my own material browser all the time.

The snippet of code I use:

//procedure: Check for Vray MaterialID or display blank
global proc int RHMatVRayID (string $RHNodeSource)
{
int $RHVRIDCHK;
int $ICBCB;

if (`objExists  ($RHNodeSource + ".vrayMaterialId")`)
    {
    int $ICBCB = `getAttr ($RHNodeSource + ".vrayMaterialId")`;
    if ($ICBCB > 0 ) $RHVRIDCHK = $ICBCB;
    else $RHVRIDCHK= 0;
    }

return $RHVRIDCHK;
}

not elegant, but you get the idea :slight_smile:

Edit: post deleted due to old version linked. Updated link below :slight_smile:

Cool, thank you very much for sharing that.

I had a couple of hours to spare this morning now that I’m back, so I went through my version and cleaned out all the garbage.
Seems stable as well now, so feel free to download the latest:

www.ricoholmes.com/OtherStuff/Downloads/RHMatBrowse_v5_0.zip

DISCLAIMER: This is a tool designed for personal use, and is shared as such. (very rare) crashes have been known to happen. Also note that it’s a user contribution and I have no affiliation with ChaosGroup *

Having said all that, assume it’s Beta and feel free to make any changes you see fit. (I’d love to see any updates :))

* Because they’re gods, and I have the mel scripting prowess of a 4yr old.

That’s very generous of you, thanks Rico!

I’m trying to get my own vray scripts up and running, I’m working on a an automated sun + Hdri setup that automatically locks the sun with the HDRi but its taking a while to get the bugs out. :slight_smile:

My pleasure :slight_smile: It’s actually nice to have had time and justification to fix the rare problems I’ve had with it. I’ve been using it for a year or so now, but I knew the caveats and what was likely to cause the rare crash. It’s been updated twice now since the above link (click again and just download.. should be on version 5.2). I’ve stress tested the stuff I knew to seldom crash it, and it seems rock solid now (thank you!). Turns out deferred procs work a treat (controls not existing while being rebuilt = bad ;p)

http://www.ricoholmes.com/OtherStuff/Downloads/RHMatBrowse_v5_0.zip (5.2 internally)

Good luck with your scripting too. It can be very rewarding, even if you have to bang your head on the wall a little :wink: