Hi there!
I've started to play with maxscript a while ago, but I'm still much green. Last time I tried to make a script I've stuck on a function that creates a multimaterial, puts it into slot 1 and changes names of its slots. The only thing that doesn't seem to work is changing the slot names. I've been searching the net for an answer for all day long, with no success. Here is a chunk of code that won't work no matter what I change in it:
-- CREATE MATERIAL
BODY = multiMaterial numsubs:13
BODY.name = "BODY"
BODY.names ArrayParameter default: ("FACE", "LIMBS", "HEAD", "SOMETHING", "SOMETHING", "SOMETHING", "SOMETHING", "SOMETHING", "SOMETHING", "SOMETHING", "SOMETHING", "SOMETHING", "SOMETHING",)
medit.PutMtlToMtlEditor BODY 1
medit.SetActiveMtlSlot 1 true
Main error that I encounter most frequently is: "Syntax error: at),, expected in line: BODY.names ArrayParameter default: ("XX...". I know that there should be something else for "ArrayParameter" but there nothing in my mind that could be used for it. This damn is hardly explained and I don't seem to find enough on the net about it.
If somebody could point me in the right direction I would be very thankful. :)
Comments (2)
Comment policy
Hey,
you got it almost right, its just a little syntax thing.
Arrays are written like
So you only have to change the line with the names array like this:
Be sure to not have a "," after your last array element, as this will throw an error.
Cheers
Thanks a lot, you really hleped me out. :) I've tried this syntax before, but never paid any attention to the "," a the end, and that ruined it then. Now it works just fine.