Help With Error // Error: Error While Parsing Arguments. //

Hi I am new to mel scripting, and I am having a problem with an error I keep getting which is // Error: Error while parsing arguments. //

my script should allow me to control one 3d fluid container with another based on desinty, heat and voxel location. I have got it to work for both heat and desnity here is a link to it on youtube http://www.youtube.com/watch?v=F8RDW41O-Uk...re=channel\_page. Like I said I am new to scripting this is only my second script that I have made which isnt from a tutorial any help would be greatly appreciated. my script is below

float $largeresX = largeshape.resolutionW;
float $largeresY = largeshape.resolutionH;
float $largeresZ = largeshape.resolutionD;
float $smallresX = smallshape.resolutionW;
float $smallresY = smallshape.resolutionH;
float $smallresZ = smallshape.resolutionD;

int $largeheight, $largewidth, $largedepth, $smallheight, $smallwidth, $smalldepth;

for ($largeheight = 0; $largeheight < $largeresX; $largeheight++) {
for ($largewidth = 0; $largewidth < $largeresY; $largewidth++) {
for ($largedepth = 0; $largedepth < $largeresZ; $largedepth++){
for ($smallheight = 0; $smallheight < $smallresX; $smallheight++) {
for ($smallwidth = 0; $smallwidth < $smallresY; $smallwidth++) {
for ($smalldepth = 0; $smalldepth < $smallresZ; $smalldepth++){
float $largeheat[] = `getFluidAttr -at "temperature" - xi $largeheight -yi $largewidth -zi $largedepth largeshape`;
float $largedensity[] = `getFluidAttr -at "density" - xi $largeheight -yi $largewidth -zi $largedepth largeshape`;
float $smallheat[] = `getFluidAttr -at "temperature" - xi $smallheight -yi $smallwidth -zi $largedepth smallshape`;
float $smalldensity[] = `getFluidAttr -at "density" - xi $smallheight -yi $smallwidth -zi $largedepth smallshape`;
int $largevox[] = `fluidVoxelInfo -os false -cb -voxel - xi $largeheight -yi $largewidth -zi $largedepth largeshape`;
int $smallvox[] = `fluidVoxelInfo -os false -cb -voxel - xi $smallheight -yi $smallwidth -zi $smalldepth smallshape`;
if ($largevox[0] != $smallvox[0]){
if ($largeheat[0] > 0 && $largedensity[0] > 0){
setFluidAttr -at "temperature" - xi $smallheight -yi $smallwidth -zi $smalldepth -fv 1 smallshape;
}
}
}
}
}
}
}
}

any help would be great even if it is not directly to do with the error itself but on how I can better the script .

I tried running it and there's a few errors that need fixing first.

CODE
// Error: float $largeresX = largeshape.resolutionW; //
// Error: Line 1.42: Invalid use of Maya object "largeshape.resolutionW". //
// Error: float $largeresY = largeshape.resolutionH; //
// Error: Line 2.42: Invalid use of Maya object "largeshape.resolutionH". //
// Error: float $largeresZ = largeshape.resolutionD; //
// Error: Line 3.42: Invalid use of Maya object "largeshape.resolutionD". //
// Error: float $smallresX = smallshape.resolutionW; //
// Error: Line 4.42: Invalid use of Maya object "smallshape.resolutionW". //
// Error: float $smallresY = smallshape.resolutionH; //
// Error: Line 5.42: Invalid use of Maya object "smallshape.resolutionH". //
// Error: float $smallresZ = smallshape.resolutionD; //
// Error: Line 6.42: Invalid use of Maya object "smallshape.resolutionD". //

that should be
CODE
float $largeresX = getAttr largeshape.resolutionW;
etc...

And 6 nested for loops scares me.....a lot. I'm not sure what you're doing but generally that's a really bad idea as it's super slow.

QUOTE
And 6 nested for loops scares me.....a lot. I'm not sure what you're doing but generally that's a really bad idea as it's super slow.

Especially when 3 is enough! But yes thst would be a complexity of n^6 wich would mean a whopping milion iterations for just a 10x10x10 wide cube. And it will get very soon out of hand lets sauy each command takes 0.1 missisrecond wich is in some neibourhood for a very fast computer then that would mean the loop for a 10x10x10 cube would take a 100 seconds or more than a minute and half, now a 20x20x20 grid would go already to whopping 106 Minutes

But actually he has hidden a slight caveat in the code wich means its actually more than n^6 close to n^7

thank you for the replys, like I said I have never scripted before, so this was probably a little ambitious for my second script. thank you for looking at it and I will ammend the code like you suggested. How would I go about re-writing the 6 nested fors so that it checks each voxel in the three axis of both fluid containers any help would be greatly appreciated.