Dragons0088
01-23-2010, 08:17 AM
Hey guys,
This is my first attempt ever at using MEL to do something. My goal is to make some particles hit an object and every time they hit the object it changes the transparency of the object like a forcefield in a way. I have written this much and made it to the Run After Dynamics on the ParticleShape. Do you know why its not working? Am I approaching this wrong? BTW HailShape is my particle shape, event is the collision test and lambert2 is the material on the forcefield.
if (HailShape.event == 1)
{
float $Rand=rand (1);
setAttr lambert2.transparencyR $Rand;
setAttr lambert2.transparencyG $Rand;
setAttr lambert2.transparencyB $Rand;
}
else
{
setAttr lambert2.transparencyR 0;
setAttr lambert2.transparencyG 0;
setAttr lambert2.transparencyB 0;
}
This is my first attempt ever at using MEL to do something. My goal is to make some particles hit an object and every time they hit the object it changes the transparency of the object like a forcefield in a way. I have written this much and made it to the Run After Dynamics on the ParticleShape. Do you know why its not working? Am I approaching this wrong? BTW HailShape is my particle shape, event is the collision test and lambert2 is the material on the forcefield.
if (HailShape.event == 1)
{
float $Rand=rand (1);
setAttr lambert2.transparencyR $Rand;
setAttr lambert2.transparencyG $Rand;
setAttr lambert2.transparencyB $Rand;
}
else
{
setAttr lambert2.transparencyR 0;
setAttr lambert2.transparencyG 0;
setAttr lambert2.transparencyB 0;
}
