This is probably very easy but what I want is to get an array of the number of materials inside a .mat file array.
What I have so far is:
--array of mat files
mat = #("F:\\3dwannab Maps_Corona.mat", "F:\\3dwannab Set_Corona.mat", "F:\Basic_Corona_Set.mat")
--loop setup to get the count
for i in 1 to mat.count do (
)
--for getting materials only count (I need this to count for each mat). I'm not sure how to do this.. At the moment this works for the last material in that above array.
for i in mat do matFile = loadTempMaterialLibrary i
materialsOnly = for i in matFile where superclassof i == material collect i
materialsOnly.count
By
Comments (5)
Comment policy
One question
Lets say I've two arrays like so:
And I want to append each of their values to the corresponding mat like so:
New array should be:
The MSX Array help doesn't show this (at least I can't see it) ;]
.
Both arrays must have the same amount of elements.
Great, thank you.
The method of my madness was I just wanted to display info in a listbox without the need for using .net for columns. See finished but not fully tested script. It creates teapots from the materials inside .mat files and puts them on teapots. I made it so I could manage my .mat files better and update the Materials when I needed to. It recurses through directories also.
The code Swordslayer gave me didn't work as intended:
So I went with this instead which accurately gets all the Materials and Maps.
Would you know why this is the case here? I've commented in the script where this is.
See attached script and code below also.
Attachments
You almost had it :)
Thanks Swordslayer
I never used the while command so I came up with this method which doesn't get an array like yours but might come in useful in my quest to learn MXS.