Mattrne
01-30-2009, 07:23 PM
I'm currently writing a little tool to go through all textures assigned to geo in my scene and change their texture-maps from .psd to .tga. I have got all my loops working fine to take their existing filename and create a string which is the corresponding .tga version (all textures will share the same name but with the different extension).
However I seem to have hit a roadblock actually using this string to change the currently used texture. So going back to basics I have just written the following;
myBmp = "c:\512.tga"
isValid = doesFileExist myBmp
$.mat.materialList[1].diffuseMap = myBmp
What I am not understanding is that I get an error saying;
-- Unable to convert: "c:\512.tga" to type: TextureMap
Now I know that that texture exists because isValid returns true. I'm sure I am doing something blatently obvious but I can't figure what!
Any suggestions would be great.
However I seem to have hit a roadblock actually using this string to change the currently used texture. So going back to basics I have just written the following;
myBmp = "c:\512.tga"
isValid = doesFileExist myBmp
$.mat.materialList[1].diffuseMap = myBmp
What I am not understanding is that I get an error saying;
-- Unable to convert: "c:\512.tga" to type: TextureMap
Now I know that that texture exists because isValid returns true. I'm sure I am doing something blatently obvious but I can't figure what!
Any suggestions would be great.
