Notifications
Clear all

[Closed] Material Editor Slots

Material editor has only maximum of 24 slots. Is there a way to increase the number of slots in meditmaterial or any other libraries?

I need about 100 active slots assign to 100 objects. Does anyone hav any idea how to write this script?

5 Replies
1 Reply
(@hblan)
Joined: 11 months ago

Posts: 0

as i know . add slots in material editor is not available now.
but we can make a script to turn page of the slots .
so u can load the material into a array . then show them by 24 material a group .

  1. set a array . load what u want to it . for eg: theArray = scenematerials as array
  2. count the items in theArray . and count: (theArray.count/24). get the page count .
  3. make a button , loop the page count . each time show 24 materials in the editor . group by group .
  4. if turned to the last page . then set the page index to 1. for loop show .

hi,

may I ask how to write a script for setting a texturemap to diffuselevelmap for Translucent shadertype in material editor?

anyone thk…

theBitMap = bitmaptexture filename:“d:\SNAG-0001.jpg” – create a bitmap value .
theMaterial_from_Editor = getMeditMaterial 1 – get the No.1 slot Material .
theMaterial_from_Editor.diffuseMap = theBitMap – set diffuse channel to bitmap .
theMaterial_from_Editor.specularMap = theBitMap – set specularMap channel .
theMaterial_from_Editor.glossinessMap = theBitMap – set glossinessMap channel .
… – set the channel u want …

thk bros:)

I tried out your code but still return me the same error message –>
– Unable to convert: BitMap to type: TextureMap

This is wat I did on my orginal code –>
BitMap = bitmaptexture filename:“E:\desktop\fB1_swallowtail_leftwing.jpg”

$leftwing50.material = standard shadertype:7

$leftwing50.material.diffuselevelmap = BitMap

Is there any problem with my code? [size=1]
[/size]

1 Reply
(@hblan)
Joined: 11 months ago

Posts: 0

–BitMap = bitmaptexture filename:“E:\desktop\fB1_swallowtail_leftwing.jpg”
–note: 1. the word “bitMap” is reserved by max , it is a function to create a empty bitmap.
– so , we cant use it as a variable , for it is not safe .
– 2. bitmap fileName path format . in max , we use \ as a \ for path.
– follow is right one :
theBitMap = bitmaptexture filename:“E:\desktop\fB1_swallowtail_leftwing.jpg”

– note: we set a variable for the object need modify . it will make work more easy when u
– change the object or when u want make a loop , use array variable.
– follow:
theobj = $ – for select one object .
theobj.material = standard shadertype:7
theobj.material.diffuselevelMap = theBitMap

– or if u select many objects . do like this , and i added a try( )catch() code , for some
– objects in ur selection cant be set material ,it will skip automaticly :

theBitMap2 = bitmaptexture filename:“E:\desktop\fB1_swallowtail_leftwing.jpg”
theobjs = selection as array
for i in theobjs do
try(
i.material = standard shadertype:7
i.material.diffuselevelMap = theBitMap2
)catch()