add material IDs to every material in scene?

Is there a way to automatically set materialIDs for all shaders in a scene?

In Maya, you just add a Vray materialID node to every shader you want and set a colour (or use a script like Deex’s Vray Arsenal to add them automatically to every shader).
Is there anything like this in 3ds Max? Being limited to Max’s paltry 15 material IDs is horrible! Plus I often forget to add them.

Cheers

You can add more in the Vray material options.

Sorry, can you explain better please ? I don’t see anywhere in VRay Material Options to add more.

‘Override material effect Id’

It’s naming is a little obscure. I had to do a search as I had forgotten.

Thanks for that DPS :slight_smile:

It’d be great if it were possible to assign random numbers to those Effect ID’s :slight_smile: (I have Olly’s wonderful VMC script which can handle Effect ID’s but not assign every scene material a unique one - I’ll ask him if he can modify VMC to accommodate this).

Thanks again.

Yes that’s a great idea. Been hoping for something like that for ages. It should be simple enough, I’d have thought.

Not sure if these would help?

http://www.scriptspot.com/3ds-max/scripts/effectschannelset

http://www.scriptspot.com/3ds-max/scripts/material-id-organizer

^they still seem very clunky though. Am not in front of PC right now but “Material ID Organizer” might warrant a look. Cheers

Basically, if I can find a way to set up a materialID render element with every material in the scene represented as a different colour, I’ll be happy. If I can do it in 3 clicks like in V-ray for Maya, I’ll be even happier.

Out of interest - which compositing app are you using?

www.chaosgroup.com/en/2/material_ID_channel.html

This is the sort of thing that would be ideal. A little swatch on the V-ray material that you pick your matID colour in, and viola
(Is that V-ray for sketchup that has the feature?!!)

I have no qualms in revealing I’m using the immensely mighty… Photoshop CS5. Because I mainly only do stills.

Could you use the Gbuffer + MultiMatteElement? (or selection sets per material + MultiMatteElement, depending on your favorite approach.)
Would end up with the same ‘idea’.

On our side, we are also using wirecolor. As we apply materials, we make sure that the wirecolors are identical, and we add a VrayWireColor pass.

With these 2 methods, you cans get out everything you want. Probably not in the same way as what you are used with Vray for Sketchup, but in a similar way.

On a sidenote, when we only need quick fixex of masks, there is always this script, that works really well.

http://www.scriptspot.com/3ds-max/scripts/rendermask

So I’m an idiot. DPS said in the third post where the option to add additional IDs was, and I completely missed it.

I guess if that box was automatically checked and the number randomised by default the situation would be pretty perfect.

However (slightly off topic) for some reason I get really jagged edges from it?

here is my MatID

Yet when I do this same thing in Maya, the materialID pass has no jaggies and is nicely aliased?

I do notice the Multimatte element doesn’t give this jaggy result in Max, but with Multimatte you wind up with a zillion layers (depending on how many materials you need masks for) because they only have 3 channels, R G and B

Don’t those methods all work on a per-object basis though?

There are Material Effect IDs, which are the 0-15 number selection set in the material that you can override in the VRayMtl as well as mentioned before.
Also there are the GBuffer Object IDs in the object properties. Both can be rendered with the MultiMatte element.

Then there are the confusingly-named (Face) Material IDs that you set per face on the object, for example to switch a multi-sub material. You can set it for the whole object with a Material modifier. You can render those with a VRayMultiSubTex in a VRayExtraTex. Set the VRayMultiSubTex to Face material ID and add as many colours and IDs as you want. I prefer just three set to R, G and B. Forest pack uses these so this can be a great way to render masks for different objects in those.

Just some options, as combining those can be very powerful and will reduce your need for many IDs, as you can select objects based on several different masks.

TL: DR but this script is awesome: http://www.scriptspot.com/3ds-max/scripts/automultimatte

It is possible to assign a material ID to every single material in the scene. I’ll try post up a code snippet later on.

There’s a workaround for the 15 limit of the max interface for Material effects ID that doesn’t use the VrayMtl override.

That would be awesome Dave.

I’m still stumped as to why my matID element in Max comes out jaggy vs the nice antialiased Maya version though