shenmue
05-19-2007, 06:25 PM
Hi guys
I am learning Mel script,and I am starting to create my scripts...well,actually trying to create scripts :rolleyes:
I am doing basic stuff.In this script I try to create a sphere random generator based on the value on the intField.So I create the UI,but when I call the procedure from the button "create Balls" I am running in to that problem :
// Error: Line 1.16: Wrong number of arguments on call to CreateRudiBalls. //
I donŽt know what I am missing.Can you help me please?
Here is the code.Thanks
if (`window -q -ex "rudiBallsCreator_W"`) deleteUI "rudiBallsCreator_W";
window -t "Rudi Balls Creator" "rudiBallsCreator_W";
rowLayout -nc 2 -columnWidth2 125 100 "sphereCreator_RL";
button -l "create Random Balls" -c "CreateRudiBalls";
intField "ballIntField";
$ballsNumber = `intField -q -value "ballIntField"`;
global proc CreateRudiBalls (int $ballsNumber)
{
for ($i=0;$i<=$ballsNumber;$i++)
{
float $randomRadius =`rand 0.5 5`;
float $randomPosX = `rand 0 20`;
float $randomPosY = `rand 0 20`;
float $randomPosZ = `rand 0 20`;
polySphere -r $randomRadius;
move -r -os -wd $randomPosX $randomPosY $randomPosZ;
}
}
showWindow;
I am learning Mel script,and I am starting to create my scripts...well,actually trying to create scripts :rolleyes:
I am doing basic stuff.In this script I try to create a sphere random generator based on the value on the intField.So I create the UI,but when I call the procedure from the button "create Balls" I am running in to that problem :
// Error: Line 1.16: Wrong number of arguments on call to CreateRudiBalls. //
I donŽt know what I am missing.Can you help me please?
Here is the code.Thanks
if (`window -q -ex "rudiBallsCreator_W"`) deleteUI "rudiBallsCreator_W";
window -t "Rudi Balls Creator" "rudiBallsCreator_W";
rowLayout -nc 2 -columnWidth2 125 100 "sphereCreator_RL";
button -l "create Random Balls" -c "CreateRudiBalls";
intField "ballIntField";
$ballsNumber = `intField -q -value "ballIntField"`;
global proc CreateRudiBalls (int $ballsNumber)
{
for ($i=0;$i<=$ballsNumber;$i++)
{
float $randomRadius =`rand 0.5 5`;
float $randomPosX = `rand 0 20`;
float $randomPosY = `rand 0 20`;
float $randomPosZ = `rand 0 20`;
polySphere -r $randomRadius;
move -r -os -wd $randomPosX $randomPosY $randomPosZ;
}
}
showWindow;
