Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

AE Script setValueAtTime rounding large values?

$
0
0

Hi guys,

 

I'm just getting started with extendScript, and I've run in to an issue.

 

I'm trying to set a keyframe to an (admittedly) large value, After Effects sets it to a value that is different than the value I pass in. It seems to be snapping more than rounding, and doing so inconsistently.

 

For example, these are the values I'm setting int he script, and what After Effects is setting on the keyframe

 

1248304.6823 1248304.625

-4720535.9958 -4720536

4092748.7335 4092748.75

 

You can see that it seems to be 'snapping' the values to increments of .025, but it does it inconsistently from one value to the next. Is there a setting I can set in the script to force it to use the actual value I want?

 

What's strange is that if I copy and paste those values into After Effects directly on the keyframes, it rounds them to 3 significant digits, as I would expect.

 

Is it just because my numbers are too large? And if so, why does After Effects have no trouble with the values?

 

 

Any ideas or insights would be much appreciated!

 

for (var i = 1; i <= app.project.numItems; i++) {

    if (app.project.item(i) instanceof CompItem) {

        var comp = app.project.item(i);

        var textName = comp.layers.addText( 'test' );

        textName.threeDLayer = true;

        textName.position.setValueAtTime( 0, [ 1248304.6823, -4720535.9958, 4092748.7335 ] );

    }

}


Viewing all articles
Browse latest Browse all 2143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>