ScriptSpot

Forum topic · General Scripting

Save texturemaps to mat file

By biiik · 2010-01-03

Description

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 (1)

Marco Brunetta · 2010-01-03

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.