haircut100
06-12-2009, 11:52 PM
Hi, I am new to maya scripting, this is only my second script and I am having some trouble, maya has allowed my expresion but then I get this error "Error while parsing arguments". and I am not sure how to solve it. My script basically "should" allow for a small 3d fluid container to be influenced by a larger fluid container based on the x,y,z values of each voxel. I have got this to work where the two fluid containers are the same size and dont have to overlap but I cant seem to get this new script to work. Any help would be greatly appreciated. here is my script
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;
}
}
}
}
}
}
}
}
p.s if anyone has got any suggestions on how to improve it in any other way which isnt related to the error I am all ears
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;
}
}
}
}
}
}
}
}
p.s if anyone has got any suggestions on how to improve it in any other way which isnt related to the error I am all ears
