Changing Position of a Layer...something is weired
Posted: February 3rd, 2012, 8:48 am
Hi Guys,
messing around with someone elses working script
"randomShifterScript" i tried to change some parameters, as i would like to set randomly the position of layers.
currentLayer.transform.position[0] = 200;
this code seems to be wrong, but i tried different things...and found also a lot of old code, but maybe one of you could tel what the right syntax is.
What it does: Select all layers, than randomly set the new positin.
thank you very much
messing around with someone elses working script
"randomShifterScript" i tried to change some parameters, as i would like to set randomly the position of layers.
Code: Select all
.
..
...
var selectedLayers = myComp.selectedLayers;
if (selectedLayers.length != 0) {
for (i = 0; i < selectedLayers.length; ++i) {
var dotsMin = 0;
var dotsMax = 1024;
var myRandomDots = min + ((dotsMin-dotsMax)*Math.random());
var currentLayer = selectedLayers[i];
currentLayer.startTime += myRandom;
currentLayer.transform.position[0] = 200;
...
..
.
this code seems to be wrong, but i tried different things...and found also a lot of old code, but maybe one of you could tel what the right syntax is.
What it does: Select all layers, than randomly set the new positin.
thank you very much