Notifications
Clear all

[Closed] get an array of the materials in a loaded matlib

I was just trying out some maxscript again and thought it might be nice to try my hand at a material preset floater.

what i’m trying to do is load a matlib, and then populate a dropdownlist with the materials from that matlib. [and after that trying to get the selected material to be applied to the selected object(s) with an added bonus of a UVWmap with dimensions specified in the materialname but that’s for later worries

so in short, how do i go about loading the materials of a loaded matlib into a dropdownlist ?

Cheers,

Yves

4 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

There was another topic about this today…

Here is a start:

macroScript MatLibAssign category:"Equinoxx"
(
theMaterials = for m in currentMaterialLibrary where superclassof m == Material collect m
rollout MatLibAssign_Rollout "MatLibAssign"
(
listBox displayMaterials items:(for m in theMaterials collect m.name)
on displayMaterials doubleClicked itm do 
	selection.material = theMaterials[itm]
)
createDialog MatLibAssign_Rollout
)

thx for that, I had a feeling it had to do with the currentmateriallibrary but couldn’t get something out of it.

do i feel dome for there being anohter topic on the same subject matter. oh well,
teaches me that besides the searchfunction i should look thru the forum as well.

the search for library in the maxscript forum turned up nothing i could use.

perhaps it’s a good time to order that 101 maxscript dvd now

…and then wait for my DVD to be released by CG Academy – it will deal with everyday’s problems like this.

The other thread was about selecting objects by material, but the basics were about the same except it used sceneMaterials instead of currentMaterialLibrary…

ah now there’s something to look forward to

cheers again.