How to loop the materials in the Slate Material Editor ?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

Yes because you need

Yes because you need maxObject material to create node inside SME View. But after creation you can delete tempObject

ActiveSMEView = sme.GetView (sme.activeView)
mtl = Standard name:"TestMat" diffuse:green
mtlpos = [0,0]
tempObj = TargetObject material:mtl isHidden:on
ActiveSMEView.CreateNode tempObj.material &mtlpos
delete tempObj

barigazy

barigazy's picture

edit

Also you can use this if you need more then one material

ActiveSMEView = sme.GetView (sme.activeView)
tempObj = TargetObject isHidden:on
mtlpos = [0,0]
for m in 1 to 10 do
(
	tempObj.material = Standard name:("StdMtl_"+m as string) diffuse:(random black white)
	ActiveSMEView.CreateNode tempObj.material &mtlpos
	mtlpos.x = 180*m
) 
delete tempObj

barigazy

Rodman's picture

I have a new question

I have now my materials in the SME. It's great !

But now I wonder how to assign one to an object. How to recognize it as a material, one material can have multiple nodes. How I can choose the Parent node ?

The documentation has no exemples. It's really hard to use it.

Rodman

barigazy's picture

I don't know.This is not

I don't know.This is not exposed in mxs.
SME is bed solution for your script,obviously.
Anyway, why do you need this?

barigazy

Rodman's picture

No limitation

I don't want to be limited with the number of slot in meditMaterials[i]

That's why I wanna loop through SME.

Rodman

barigazy's picture

For that people store your

For that people store your materials in material library.
That is better solution than SME.Here on scriptspot you can find very cool scipts for that and one of them is http://www.scriptspot.com/3ds-max/scripts/smes-super-material-editor-swi...

barigazy

Rodman's picture

I know it. The code can't

I know it. The code can't help to do the job I need.

Rodman

Rodman's picture

.

.

Rodman

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.