bman6200
02-29-2008, 06:49 PM
Hi,
I saw a thread here that talked about switching textures with an expressions connected to a ramp texture, but unfortunatly that thread was closed. I am trying to make a generic character that I will need to import multiple times and have control over each individual character's textures. I have the switching textures set up with this expression.
character.shader=character.texture;
if (character.shader==0)
{
// texture 1
setAttr "ramp_armyAntBody.colorEntryList[0].position" 1;
setAttr "ramp_armyAntBody.colorEntryList[1].position" 1;
setAttr "ramp_armyAntBody.colorEntryList[2].position" 0;
setAttr "ramp_armyAntHead.colorEntryList[0].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[1].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[2].position" 0;
}
else if (character.shader==1)
{
//texture 2
setAttr "ramp_armyAntBody.colorEntryList[0].position" 1;
setAttr "ramp_armyAntBody.colorEntryList[1].position" 0;
setAttr "ramp_armyAntBody.colorEntryList[2].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[0].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[1].position" 0;
setAttr "ramp_armyAntHead.colorEntryList[2].position" 1;
}
else if (character.shader==2)
{
//texture 3
setAttr "ramp_armyAntBody.colorEntryList[0].position" 0;
setAttr "ramp_armyAntBody.colorEntryList[1].position" 1;
setAttr "ramp_armyAntBody.colorEntryList[2].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[0].position" 0;
setAttr "ramp_armyAntHead.colorEntryList[1].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[2].position" 1;
}
This expression works fine for just the original character in it's file. My problem is, if I import the same character a few times, that control will only effect the original character. I am trying to figure a way that each character's texture switching channel would control it's own textures and not the original character. I don't know if I explained that too well...
I appreciate the help,
Jason
I saw a thread here that talked about switching textures with an expressions connected to a ramp texture, but unfortunatly that thread was closed. I am trying to make a generic character that I will need to import multiple times and have control over each individual character's textures. I have the switching textures set up with this expression.
character.shader=character.texture;
if (character.shader==0)
{
// texture 1
setAttr "ramp_armyAntBody.colorEntryList[0].position" 1;
setAttr "ramp_armyAntBody.colorEntryList[1].position" 1;
setAttr "ramp_armyAntBody.colorEntryList[2].position" 0;
setAttr "ramp_armyAntHead.colorEntryList[0].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[1].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[2].position" 0;
}
else if (character.shader==1)
{
//texture 2
setAttr "ramp_armyAntBody.colorEntryList[0].position" 1;
setAttr "ramp_armyAntBody.colorEntryList[1].position" 0;
setAttr "ramp_armyAntBody.colorEntryList[2].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[0].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[1].position" 0;
setAttr "ramp_armyAntHead.colorEntryList[2].position" 1;
}
else if (character.shader==2)
{
//texture 3
setAttr "ramp_armyAntBody.colorEntryList[0].position" 0;
setAttr "ramp_armyAntBody.colorEntryList[1].position" 1;
setAttr "ramp_armyAntBody.colorEntryList[2].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[0].position" 0;
setAttr "ramp_armyAntHead.colorEntryList[1].position" 1;
setAttr "ramp_armyAntHead.colorEntryList[2].position" 1;
}
This expression works fine for just the original character in it's file. My problem is, if I import the same character a few times, that control will only effect the original character. I am trying to figure a way that each character's texture switching channel would control it's own textures and not the original character. I don't know if I explained that too well...
I appreciate the help,
Jason
