misterwolfy
11-13-2010, 05:51 AM
string $cubes2[] = `ls -type transform "gridCube*"`;
for( $each in $cubes2) {
float $u = `getAttr($each + ".translateX")`;
float $v = `getAttr($each + ".translateZ")`;
float $capValueF[] = `colorAtPoint -o RGB -u (($u+40)/80) -v (($v+40)/80) file1`;
setAttr ($each + ".scaleY") (($capValueF[0]+$capValueF[1]+$capValueF[2])*10);
setAttr ($each + "Lam.incandescenceR") $capValueF[0];
setAttr ($each + "Lam.incandescenceG") $capValueF[1];
setAttr ($each + "Lam.incandescenceB") $capValueF[2];
}
flushUndo;
This expression watches the value of colorAtPoint, it cycles through a grid of cubes, and takes the value as interpreted in texture's UV space, and applies it to the scaleY of the cube. Easier to just watch the a video.
youtube video (http://www.youtube.com/watch?v=_r-5UfwR444)
The only problem is that it does not evaluate correctly when rendering. It just renders the same frame over and over again. While if I bake the animation, it will work fine, but baking takes a long time and crashes Maya often. Also the baked file is rather large.
Is there a better way to do this?
Thanks!!
for( $each in $cubes2) {
float $u = `getAttr($each + ".translateX")`;
float $v = `getAttr($each + ".translateZ")`;
float $capValueF[] = `colorAtPoint -o RGB -u (($u+40)/80) -v (($v+40)/80) file1`;
setAttr ($each + ".scaleY") (($capValueF[0]+$capValueF[1]+$capValueF[2])*10);
setAttr ($each + "Lam.incandescenceR") $capValueF[0];
setAttr ($each + "Lam.incandescenceG") $capValueF[1];
setAttr ($each + "Lam.incandescenceB") $capValueF[2];
}
flushUndo;
This expression watches the value of colorAtPoint, it cycles through a grid of cubes, and takes the value as interpreted in texture's UV space, and applies it to the scaleY of the cube. Easier to just watch the a video.
youtube video (http://www.youtube.com/watch?v=_r-5UfwR444)
The only problem is that it does not evaluate correctly when rendering. It just renders the same frame over and over again. While if I bake the animation, it will work fine, but baking takes a long time and crashes Maya often. Also the baked file is rather large.
Is there a better way to do this?
Thanks!!
