View Single Post
# 1 17-11-2004 , 04:10 AM
Renderizer's Avatar
Subscriber
Join Date: Jun 2002
Location: Germany
Posts: 276

Script doesn't remember variables

Hi all,


this is really my first attempt to dabble in MEL, so be kind, please...

Now, please take a look at the following if-statement.

The reason I post this, is that the script seems to forget the values for $MR_rotX, $MR_rotY and $MR_rotZ as soon as it leaves the if-block. Inside the block everything is fine (I printed the values to the script editor to confirm this), outside the block all values are set to zero. If I delete the if-statement and the brackets, the values remain intact..

Any idea why this happens?

Thanks!

Mario


if ($MR_SnapButton == 1)
{
int $MR_randX = rand (360/$MR_snapx);
int $MR_rotX = $MR_randX*$MR_snapx;

int $MR_randY = rand (360/$MR_snapy);
int $MR_rotY = $MR_randY*$MR_snapy;

int $MR_randZ = rand (360/$MR_snapz);
int $MR_rotZ = $MR_randZ*$MR_snapz;
}


Subdivide and conquer!

Free your mind, and your ass will follow!