Hi, I'm tring to write a script that will access material libraries from different folders (much like Sigershader's VMPP). My first listbox is populated by an array of Material Categories and are defined as such...
MatSections = #()
append MatSections #("Metal","C:\Users\Alex\Documents\3dsMax\materiallibraries\Metal\\")
append MatSections #("Wood","C:\Users\Alex\Documents\3dsMax\materiallibraries\Wood\\")
append MatSections #("Glass","C:\Users\Alex\Documents\3dsMax\materiallibraries\Glass\\")
Which currently works. When I select an item in this listbox, I want the second listbox to be populated with a list of the matlibs that reside in the relevant folder. Here's what I have so far...
on lbx_MatSection selected itm do
(
MatCatPath = getFiles "((MatSections[objList.selection][2])"+"*.mat")
MatCatFiles = for i in MatCatPath collect ( filenamefrompath i )
lbx_MatCat.items = MatCatFiles
)
Which doesn't work. I get an error saying "-- Syntax error: at =, expected name". Previously I had a simpler script that just loaded all matlibs from a folder (which worked)...
allMatLibs = getFiles "C:\Users\Alex\Documents\3dsMax\materiallibraries\*.mat"
list = for i in allMatLibs collect (getFilenameFile i)
lbx_MatSection.items = list
But it was too simple for what I need now. Basically I'm trying to get the two bits of code to work together but I'm struggling, so any help would be greatly appreciated. Cheers,
Alex
br0t · 2012-12-15
barigazy · 2012-12-15