Notifications
Clear all

[Closed] Road Creator Script

Hey guys, hoping somebody might know of a script I can steal from. First of all, I’m new to scripting, and the way I learn best is to pick apart what others have done. I’ve gone through a lot of the scripts in the help file, but most of them have nothing to do with what I’m trying to do, so its hard to relate.

Aaaaaanywho…

here’s my problem: We create custom road maps for our architecture scene. I’m trying to come up with a script that allows me to create a multi-sub material, give an option to choose the path for the maps, then apply it to the selected mesh.

I’m not looking for someone to write a script that will do that, just trying to see if there’s a similar script I can learn from and take pieces from. btw…I’ve checked Scriptspot, but most of what I come up with is scripts for converting materials and new material editors, not creating new ones.

Thanks!

peakyfreak

2 Replies

This one is very straight forward, so just go through the help file and find each piece…

look at “MulitMaterial” show how to construct a MM. If you have a network share point for everyone, aka common folder, I would hand create a MM and save it there as a .mat file then just load it in and swap the map. see “Material Library” in the help… if you are in Max 9 or newer… tn = loadTempMaterialLibrary <filename> will give you the mat in a library.

check out “[b][b]getOpenFileName” for getting the bitmap file name
check out “ShowProperties” and “getPropnames” to expore objects and materials.

All objects with an ablity to have a material have a “material” property so just assign it.

$.material = < your new material >

Have fun.

[/b][/b]

Thanks Kramsurfer for the guidance! I’m sure I’ll be back because I doubt I’ll get it right the first time.

-peakyfreak