Game Development Community

SetSkinName and materials

by Kristoffer Benjaminsson · in Torque Game Engine Advanced · 08/22/2007 (2:09 pm) · 2 replies

I have an issue with setSkinName and materials. Let's say I have the following materials:

new Material(base_object_mat)
{
baseTex[0] = "base_object";
mapTo = "base.object";
};

new Material(blue_object_mat)
{
baseTex[0] = "blue_object";
mapTo = "blue.object";
};

By default the base_object_mat is used on my model since it uses a material named base.object. But since TGEA doesn't allow a filename with more than one dot in it, I had to rename my textures to use _ instead of. which works since mapTo handles dots. I.e. I changed the names from base.object.png to base_object.png.
But when I use %obj.setSkinName(blue) to change material on my object, the engine requires a file on disk named blue.object.png, but it doesn't use it. It still uses the correct material (in this case blue_object_mat).
So basically setSkinName does what it should, but I need to have two sets of textures for it to work...

Am I missing something or is this a known bug? If it is a bug, I guess the solution is to fix the code that validates the filename for the textures to allow more than one dot?

Sorry if I'm unclear...

/Kristoffer

#1
08/23/2007 (12:45 pm)
I was wrong about the filename part. The base texture can have multiple dots in it.
But I still would like the the setSkinName to work with the mapTo field and not rely on the texture filename to correspond to the material name.
I guess I'll have to implement that myself right?

/Kristoffer
#2
08/23/2007 (3:50 pm)
I believe you will. Keep in mind setSkinName came from the TGE days where the name of the texture file was all that there was. It's possible the whole setSkinName process may need to be updated for the TGEA and Material way of doing things.