for ($x=0; $x<8; $x++)
{
for ($y=0; $y<8; $y++)
{
for ($z=0; $z<8; $z++)
{
$name = `shadingNode -asShader blinn`;
$tmp = $name + ".color";//blinnShader1.color
setAttr $tmp -type double3 ($x/7.0) ($y/7.0) ($z/7.0);
polySphere -ch on -o on -r .03;
xform -translation ($x/7.0) ($y/7.0) ($z/7.0);
hypershade -assign $name;
}
}
};
However, an error occured regarding the variable $name. After some help from Casey and Rachel, I realized that the variables $name and $tmp were not initialized. I then placed these two lines of code above the 3 for loops:
string $name;
string $tmp;
The color cube was created almost immediately. But one interesting point I discovered while working on this was that Mel programming is not case-sensitive like the Java programming language. The type string should not be capitilized. Also getting into the habit of checking carefully for tiny mistakes like missing tick marks and correct sign usage such as <, >, or =, would be tremendously helpful to my workflow.
file -import "ColorCube.mel"
and put the file name in double quotations. The mel scripts will always have the extension of .mel. After these issues, the program worked fine.
Goal #1 : Try changing the colors of the color cube in Mel to represent deeper colors like those that were displayed on classmates PC computers.
Goal # 2: Figure out why the color ball that it supposed to represent full black color is displaying gray and how to make it black.
No comments:
Post a Comment