Maxscript MatID for Multimatte

Hi all

So by default the UI only allows 16 different ID’s for MatID. Can I use maxcsript to set it to whatever I want? I have about 35 materials on a mutltitude of objects and want to use the matID’s in couple of multimattes.
I’m hoping to avoid using objectID. I’ve looked at dlparisi’s Multimatte Generator Script, but I don’t think its for me.

Anybody can help with maxscript command?
I need to set currently selected material in material browser to a specific MatID
OR
Automatically give each Material a unique ID (that can go above the 16 limit)

is this at all possible?

I think you can use vray properties to assign mat ID’s higher than 16, vlado mentioned adding it in at some point although I’m not sure where it’s set. I’ll get back to you on it.

Thanks John
I had a quick look in vray properties but dont see anything. Maybe I’m just looking at the wrong place.

Looking forward to your feedback

The VRayWrapperMtl allows using higher numbers if i recall right.

Regards,
Thorsten

Okay so it’s in the options of the material, it’s the last tick box called “override material effect” and has an effect ID spinner beside it. The maxscript commands are

.effect_id : integer (whole number)
.override_effect_id : boolean (either 0 and 1 or true and false)

So your code for a selected object would be something like $.material.override_effect_id = true and $.material.effect_id = 22 or (whatever number)

under vraymtl options rollout you need to tick “override material ID” (i think it’s named that) then you can enter a custom number.

There is a fantastic script to make this process super easy. its here: http://www.sergepogosyan.com/scripts/AutoMultiMatte/

Doesnt look like there is an option in there, unless it’s the “GI surface ID” option, which is also in the vray properties of the object

Thanks John, this helps a LOT!
Since it’s already in the VRayMtl as an option its easier to just set it there. But in the near future I would like to write a script that will run through all materials in the scene and automatically incerement this number.
OR
Maybe Olly can just add it to his VMC script :wink:

Thanks will take a look!

This is the one I use. It will auto-assign random Mat or Object ID’s, or within a given range. It uses the Vray ones, and it can also automatically create all the Multimatte render elements for you. It’s handy.

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

I like many of Sergo’s scripts. With this one, it is very important to use the prefix feature. The script will use that prefix to replace render elements if you run it a second time. So if you don’t use a prefix, it deletes all of the render elements…

My favorite at the moment is Alexander Kramer’s tools:

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

Hello,
I wonder what are the benefit of using ObjectID on top of MatID.Can somebody give me an explanation and how to use it in post prod?
Thanks

They simply serve different use cases. ObjectIDs can be used to distinguish different parts of a scene that have the same material. In addition you can easily create masks for groups of objects without having all their MatIDs beeing the same. As you can freely mix them you can put an object in 2 different mattes. For example you could have Mattes for the different Materials, and still get a matte for the “whole thing” simultaneously.

Regards,
Thorsten