badtertle
04-30-2008, 06:13 AM
So, I have a unique project where I'm trying to create an in-maya game. I will give the players a number of characters to choose from, but they are all the same rig and geometry, just different accesories which visibility is toggled by an expression on an attribute on the main rig control.
On the same expression I am assigning different shaders. It works fine most of the time, but I keep getting these fatal errors when I switch characters. I'm not sure why its happening, but I assume it has to do with this texture switching.
Even if it doesnt, I really dont like the way i have this set up...heres a sample of the expression.
//robot
if (Main_Control.Character == 6)
{
NurseAccesories.visibility = 0;
WomanAccesories.visibility = 0;
AbeAccesories.visibility = 0;
RobotAccesories.visibility = 1;
NinjaAccesories.visibility = 0;
select CharacterA;
hyperShade -assign RobotShader;
select -cl;
}
is there any way to do the shader assignment just with nodes instead of having to do the selection bit? In the hypershade I cant see any connections from the shader to the model, so I'm not sure how to apply it there. Also, because it's an in-maya perspective window game, things like layered shaders probably won't do any good.
Also, if there are any other ideas what might make this scenario unstable to give me fatal errors every 8 or so times I switch....maybe a memory thing?? I dont' know..
Any help would be much appreciated.
On the same expression I am assigning different shaders. It works fine most of the time, but I keep getting these fatal errors when I switch characters. I'm not sure why its happening, but I assume it has to do with this texture switching.
Even if it doesnt, I really dont like the way i have this set up...heres a sample of the expression.
//robot
if (Main_Control.Character == 6)
{
NurseAccesories.visibility = 0;
WomanAccesories.visibility = 0;
AbeAccesories.visibility = 0;
RobotAccesories.visibility = 1;
NinjaAccesories.visibility = 0;
select CharacterA;
hyperShade -assign RobotShader;
select -cl;
}
is there any way to do the shader assignment just with nodes instead of having to do the selection bit? In the hypershade I cant see any connections from the shader to the model, so I'm not sure how to apply it there. Also, because it's an in-maya perspective window game, things like layered shaders probably won't do any good.
Also, if there are any other ideas what might make this scenario unstable to give me fatal errors every 8 or so times I switch....maybe a memory thing?? I dont' know..
Any help would be much appreciated.
