Monday, February 7, 2011

Code from 2-3-11

//This is where I create the initial variables
int $x;
int $y;
int $z;
string $name;
string $name2;

//This is the for loop to create the polyspheres color cube without color.
for ($z = 0; $z<8; ++$z)
{
for ($y = 0; $y<8; ++$y)
{
for ($x = 0; $x <8; ++$x)
{
polySphere -ch on -o on -r .03;
xform -translation ($x/7.0) ($y/7.0) ($z/7.0);
}
}
};

//This is trying to give them color, but it doesn't work yet
for ($z = 0; $z<8; ++$z)
{
for ($y = 0; $y<8; ++$y)
{
for ($x = 0; $x <8; ++$x)
{
polySphere -ch on -o on -r .03;
$name = `shadingNode -asShader lambert`;
$name2 = $name + ".color";
//connectAttr -f lambert2.outColor lambert2SG.surfaceShader;
//sets -e -forceElement lambert2SG;
xform -translation ($x/7.0) ($y/7.0) ($z/7.0);
setAttr $name2 -type double3 1 0 0 ;
}
}
};

No comments:

Post a Comment