Save texturemaps to mat file

Hi there,

I'm trying to write a script to add an array of texturemaps to a specified mat file and failing miserably. For example:

a = loadTempMaterialLibrary "f:\bleh.mat"

for i in (getclassinstances Cellular) do
(
append i a
)

saveTempMaterialLibrary a "f:\bleh.mat"

Gives me 'No ""append"" function for Map #1:Cellular'. I guess the append function doesn't apply to texturemaps as they are a subclass of materials, not materials themselves.

Help!

Comments

Comment viewing options

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

The append method requires

The append method requires the array first and the item to append, you are doing it the other way around... =P

Also, consider using more descriptive variable names, it helps to avoid errors like these.

Comment viewing options

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