Can someone please help me with this simple script.
I just want to apply the material color that is in an array.
Here is what I have for now.
How can I link so that my material two("colors2") looks for values $dp_matColor[3]
,$dp_matColor[4]
,$dp_matColor[5]
?
It looks like I need an if statement but not sure what condition I need to add.
BTW I will have more than two materials
My final goal is to create button based on $list_of_names[]
and get the background color from $dp_matColor[]
.
When I click, it will create my material based on below for loop by using same arrays.
Currently, I can achieve this by having a procedure for every color, but there is a lot of repeated script.
string $list_of_names[] = {"color1", "color2"};
float $dp_matColor[] = { 1.0, 0.5, 0.5,0.5, 0.5, 1.0};
for ($eachName in $list_of_names){
shadingNode -asShader VRayMtl -n $eachName;
setAttr ($eachName + ".color") -type double3 $dp_matColor[] $dp_matColor[] $dp_matColor[];
}