PDA

View Full Version : Help Creating a Lightning Fx


powerdan
05-30-2005, 06:41 PM
Hi im working on a Vfx, i must create some lightnings coming out of a Machine, im using Maya 'couse must be in 3D. Im writing a Mel (down) that Create a base. But i think im going on the hard way.

The Maya pre maded Fx (effects >> Create Lightning) dont work for me, i need the lightning to have childs (split in other lightnings).

Here its the Mel, its BETA, and dont have an Interface (sorry)

//Declarar Variables
int $jointNumber=1,$cant=10,$i;
string $jointName="",$cilName="",$jointAnt2="joint1",$inst="";
vector $startJoint=<<0,0,0>>;
vector $antJoint=<<0,0,0>>;
float $randomX=0.0,$randomY=0.0,$randomZ=0.0;

//Creo el Joint Inicial [Starting Joint]
joint -p ($startJoint.x) ($startJoint.y) ($startJoint.z);
$jointName="joint"+$jointNumber;
$jointNumber++;
joint -e -zso -oj xyz -sao yup $jointName;


//Creo los siguientes joints [Next Joints]
while($cant>0){
$randomX=rand($randomX-5,$randomX+5);
$randomY=rand($randomY-3,$randomY-8);
$randomZ=rand($randomZ-5,$randomZ+5);
joint -p $randomX $randomY $randomZ;
$jointName="joint"+$jointNumber;
joint -e -zso -oj xyz -sao yup $jointName;
$cilName = "Cilindro"+($jointNumber-1);

//Se crea los cilindrios [Create Cilinders, Lightning geometry]
cylinder -p 0 0 0 -ax 0 1 0 -ssw 0 -esw 360 -r 1 -hr 2 -d 3 -ut 0 -tol 0.01 -s 8 -nsp 1 -ch 1 -n $cilName;
select -r $jointAnt2;
select -tgl $cilName;
pointConstraint -offset 0 0 0 -weight 1;
$jointAnt2="joint"+$jointNumber;
$jointNumber++;
$cant--;
select -cl;
select -r $jointAnt2;
$inst= $jointAnt2 + ".translate";
$antJoint = `getAttr $inst`;

//[Move the endles Hull CV's to fit joint Sizes.]
for ($i=0; $i<8; $i++){
$inst=$cilName+"Shape.controlPoints["+$i+"].xValue";
setAttr $inst ($antJoint.x);
}
for ($i=0; $i<8; $i++){
$inst=$cilName+"Shape.controlPoints["+$i+"].yValue";
setAttr $inst ($antJoint.y);
}
for ($i=0; $i<8; $i++){
$inst=$cilName+"Shape.controlPoints["+$i+"].zValue";
setAttr $inst ($antJoint.z);
}

};
select -cl;

//End Of Mel

CGTalk Moderation
05-30-2005, 06:41 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.