d***@adobeforums.com
2008-08-04 05:22:30 UTC
Hi
It's rather an expression issue so i post it here as well.
I've got a comp (720*576).In this comp 256 layers form a grid (16rows+16columns).
opacity expession so far:
pRow=Math.ceil(index/16);
pCol=Math.ceil(index-(pRow-1)/16);
if(pRow % 2 == 0){
linear(index,1,256,100,0)//even row
}else {
100-index*(100/256) //odd row
}
Basically,on the first row(layer1-16) layers opacity should decrease from left to right.
however,on the second row (layer17-32) layers opacity should decrease from right to left and so on....
The result should be a perfect gradient from pure white for the first layer and black for the last layer (layer 256).I can not figure out the code so that on odd rows layer's opacity decreases from right to left.Any help appreciated.
In another comp i'd like to fill each layer with a different color.It should look similar to this
<Loading Image...
>
layers next to each other ,above or underneath should not have the same color.
Fill expression so far
colors = [[1,0,0,1], // red
[1,1,1,1],
[0,1,0,1], // green
[0,0,1,1], // blue
[1,0,1,1], // magenta
[1,1,0,1], // yellow
[0,1,1,1]] // cyan
seedRandom(index,true);
random(colors.length)
unfortunately,it gives me a 4 dimensional error,why?
Thx
It's rather an expression issue so i post it here as well.
I've got a comp (720*576).In this comp 256 layers form a grid (16rows+16columns).
opacity expession so far:
pRow=Math.ceil(index/16);
pCol=Math.ceil(index-(pRow-1)/16);
if(pRow % 2 == 0){
linear(index,1,256,100,0)//even row
}else {
100-index*(100/256) //odd row
}
Basically,on the first row(layer1-16) layers opacity should decrease from left to right.
however,on the second row (layer17-32) layers opacity should decrease from right to left and so on....
The result should be a perfect gradient from pure white for the first layer and black for the last layer (layer 256).I can not figure out the code so that on odd rows layer's opacity decreases from right to left.Any help appreciated.
In another comp i'd like to fill each layer with a different color.It should look similar to this
<Loading Image...
layers next to each other ,above or underneath should not have the same color.
Fill expression so far
colors = [[1,0,0,1], // red
[1,1,1,1],
[0,1,0,1], // green
[0,0,1,1], // blue
[1,0,1,1], // magenta
[1,1,0,1], // yellow
[0,1,1,1]] // cyan
seedRandom(index,true);
random(colors.length)
unfortunately,it gives me a 4 dimensional error,why?
Thx