Why do I get non-integer numbers when using script?
Hi guys, I am trying to build a simple script that sets keyframes automatically every 'i' seconds and changes position by fixed amount of pixels ( in my case -640) on every keyframe.
I wrote a simple lines of code to do it:
var curX = 320.0;
for (i = 10; i <= 240; i += 5){
selection[0].setValueAtTime(i, [curX,540])
curX += -640.0;
};
But all values of every keyframe are non-integer numbers, although in the code above there are only integers. Here is the some values I get when running the code:
10 sec position x:320 y: 540;
15 sec position x:-321,9194 y: 540;
19,29 sec position x:-958,29 y: 540;
24.29 sec position x:-1598,9316 y: 540;
......
....
0;02;59;27 position x: -21433,1681 y: 540;
selection in this code is app.project.activeItem.selectedProperties, so selection[0] is position
Any suggestion why is this happening and how to fix?
Thank you in advance 🙂
