Sometimes you just want to tell max to do something and it seems rediculous that there isn’t a button already there to do it. Often the code behind it isn’t even that complicated, I get asked quite a lot for a quick script to do something and often it can be done in just one line of Maxscript! These are what I call the one-liners and is one of the most powerful things you can learn to do in max.
Some examples of one-liners, see how similar the actual code is to just writing it out in english, albeit a geeky-grammar based language, perhaps one day our language will evolve to be able to communicate with computers in a way they understand more, things like Siri can understand basic instructions but if we want to get to the Star Trek level of talking to a computer we either need computers to be able to understand our often unclear English or adjust the way of speaking to make it clear.
Make the material in slot 1 of the material editor the current object’s material, just because it’s a pain to pick some times.
meditmaterials = $.material
For every object in our selection where the material is not undefined put it in the material slot of the same index (will bug after 24)
for i = 1 to selection.count where selection[i].material != undefined do meditmaterials[i] = selection[i].material
For every instance of the class Turbosmooth in the scene set the render Iterations to the same as the display iterations
for o in getclassinstances Turbosmooth do o.renderIterations = o.iterations
For every object in selection change the wirecolor to a random colour
for o in selection do o.wirecolor = color (random 0 255) (random 0 255) (random 0 255)
select every object in the objects where the object’s material is not defined
select (for o in objects where o.material == undefined collect o)
Put any requests for simple one-liners in the comments section and I’ll see if they can be done in one line of code.