FORUMS: list search recent posts

Export transform.position keyframes to txt file?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Joe Watson
Export transform.position keyframes to txt file?
on Jan 23, 2012 at 6:46:46 am

Hi there im new here im new here at the cow forum - a friend of mine told me that people here could maybe help me with my problem.

I would like to know if it is possible to write an expression script that will reveal all the values from transform.position keyframes of an object, format and export them to a .txt file? (I would like to do the same thing with the scale keyframes).

Here is my senario: Im writing an Unity3D Iphone app where I have a video that I would like to animate a texture upon(this texture is dynamic and changes everytime you play the video), there is made a test animation within After Effects and i would like to copy all the positions form a specific object in AE so i dont need to reanimate it in Unity3D.

thanks in advance,

/joe


Return to posts index

Joe Watson
Re: Export transform.position keyframes to txt file?
on Jan 23, 2012 at 12:33:25 pm

the ideal thing for me would be to record the position of the object every frame, then its pretty easy for me to sync it up with the video in Unity3D

/joe


Return to posts index

Dale Paquette
Re: Export transform.position keyframes to txt file?
on Jan 23, 2012 at 1:13:04 pm

I'm afraid I can't answer the question, but I have a similar need. When I use the motion tracker for positional stabilization, a keyframe is applied to every frame to mark a change in anchor point location. I would like to export the anchor points in a file of any kind (text is fine) so that I can calculate the average change thus enabling me to position the tracked layer such that the maximum black border around the stabilized footage is the same in +/- X and +/- Y. Thanks


Return to posts index


Joe Watson
Re: Export transform.position keyframes to txt file?
on Jan 23, 2012 at 1:49:01 pm

I think it would something like this...

I dont know the syntax at all or if I need other references, to get the position. Or where I need to run the script, if it its on the layer or in the transform.position parameter? - If it looked like this does the script run every frame of the animation or do i need to loop thru all the frames?

var position = transform.position;

file = fopen("path/to/file.txt", "a");

if(file != null){
var stringWithPostion = position.toString();
fwrite(file, stringWithPostion);
fclose(file);
}


/joe


Return to posts index


Joe Watson
Re: Export transform.position keyframes to txt file?
on Jan 23, 2012 at 3:03:33 pm

One of my friends came op with a solution around expressions. We could mark all the keyframes and copy paste them to a text file.. haha - and he suggested to use wiggler to set all the inbetween frames. set frequency to the current frameRate and magnitude to 0; this will work for me.

/joe


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]