PDA

View Full Version : Maxscript favor needed, anyon wanna help


Rhinokey
08-26-2011, 06:08 AM
Any max script gurus out there, how hard would it be to make a script that goes in the material editor. looks at the name of the texture in the difues slot. paste that name in the name slot at the top of each heiarchy of the material,, so if you have a multi sub with 60 materials, it will look at the difuse texture in each slot, copy that name to the bitmap name slot, the material name slot (for that material not the multisub). and then also copy it in the big list of names on the multi sub list.

I'm not sure how complex this is to do. but if its some easy thing one you super heroes could do i would appreciate it

i tried the one linked at the bottom of this page http://www.scriptspot.com/forums/3ds-max/general-scripting/rename-multisub-materials and while its a start, it only changes the material name and not the bitmap name, and not the name in the multisub list.

Thanks.

cw
08-26-2011, 06:36 AM
ok.


fn copy_bitmapname_to_materials=
(
myslot = medit.getactivemtlslot()
mymat = getmeditmaterial(myslot)
if classof mymat == multimaterial then
(
--iterate over multimaterial materiallist
for i = 1 to mymat.materiallist.count do
(
m=mymat.materiallist[i]
--if there is a diffusemap, get the filename
if classof m == standardmaterial then
(
--if it is a bitmap
if classof m.diffusemap == bitmaptexture then
(
try(thepicname = getfilenamefile(m.diffusemap.filename))catch()
if thepicname != undefined and thepicname != "" then
(
m.diffusemap.name = thepicname
m.name = thepicname
mymat.names[i] = thepicname
)
)
)
)
)
)

copy_bitmapname_to_materials()


If you need any tweaks just let me know. It will name the multisub name, material name and bitmaptexture name to be the filename (minus extension) of the bitmaptexture.

Rhinokey
08-26-2011, 07:04 AM
This seems to work PERFECT! thanks a lot!

cw
08-26-2011, 09:16 AM
no probs, glad to help.