FORUMS: list search recent posts

importing numbered frames into AE?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
ben wolfinsohn
importing numbered frames into AE?
on Nov 18, 2012 at 1:24:08 am

I have a text document with a string of numbers that I want to import into AE so I can apply those numbers to a slider. can I do this?


Return to posts index

Dan Ebberts
Re: importing numbered frames into AE?
on Nov 18, 2012 at 3:31:17 am

Depending on the format of the text (comma or tab delimited?) you can probably do it with a fairly simple script. I would guess you'd set it up so that the script would assume the slider is selected, prompt you to navigate to the text file, read the file, parse the numbers, and create keyframes on the slider. All very do-able.

Dan



Return to posts index

ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 18, 2012 at 3:42:37 am

or is it easier if i just copy the number and past them into a expression or into the keyframes? but I have no idea how to do ether of those things. they are separated by returns now, but i could change to another formate if better.


Return to posts index


Dan Ebberts
Re: importing numbered frames into AE?
on Nov 18, 2012 at 3:54:25 am

You could probably paste it into an expression. What should the expression do with the numbers?

Dan



Return to posts index

ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 18, 2012 at 4:41:43 am

right now i have a timeremaped layer that has an expression pointing it to a slider so I can move the timeremaped layer back and forth between the first 8 frames easily.


Return to posts index

Dan Ebberts
Re: importing numbered frames into AE?
on Nov 18, 2012 at 6:11:44 am

I'm still not sure what you're after exactly, but this expression will give you a new value from the comma-delimited text string each frame:

txt = "3,2,8,6,7,0";
f = timeToFrames(time);
s = txt.split(",");
parseInt(s[Math.min(f,s.length-1)])


Dan



Return to posts index


ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 18, 2012 at 6:52:06 pm

not sure if that will work. here's a really simple version of what I'm trying to do -

if I have a comp that is 12 frames long.
I have only 1 sold layer in it.
I only want to change the opacity of that layer to the values below in order.
2,6,3,8,1,5,3,1,4,5,4,2
I do not want to manually have to frame forward to each frame and adjust it, just want to be able to copy and paste those number into the layer somewhere.

what might be the code/expression and where and how exactly might I put it? sorry, I'm brand new to doing expressions.

thanks!


Return to posts index

Dan Ebberts
Re: importing numbered frames into AE?
on Nov 18, 2012 at 7:04:04 pm

The same expression should work for opacity:

txt = "2,6,3,8,1,5,3,1,4,5,4,2";
f = timeToFrames(time);
s = txt.split(",");
parseInt(s[Math.min(f,s.length-1)])

Just apply it to the opacity property of the solid.

Dan



Return to posts index

ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 18, 2012 at 7:10:48 pm

oh wow. that totally works. thanks!


Return to posts index


ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 19, 2012 at 1:10:37 am

another question -

I have a null object with a slider.
I have solid object layer with a checkbox I added to it and it is pointing to that null slider.
I want the check box to turn on when the slider slides to 1. when the slider slides to any other number I want it to turn off.
the current expression in my solid with the checkbox is -
comp("head contol").layer("head contols view 1").effect("head-turn")("Slider")

any ideas?
thanks


Return to posts index

Dan Ebberts
Re: importing numbered frames into AE?
on Nov 19, 2012 at 1:50:22 am

Try this:

comp("head contol").layer("head contols view 1").effect("head-turn")("Slider") == 1


Dan



Return to posts index

ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 19, 2012 at 2:11:32 am

wow, thats easy.
thanks!


Return to posts index


ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 24, 2012 at 8:01:28 am

txt = "2,6,3,8,1,5,3,1,4,5,4,2";
f = timeToFrames(time);
s = txt.split(",");
parseInt(s[Math.min(f,s.length-1)])

this script above you wrote works on the opacity of a solid. but when i try to apply it to a slider i attached to a null it gives me an error of -
class 'array' has no property or method named '-1'

when i turn on expressions for the slider it first looks like this before i put the script in -
effect("m-shape")(1)

thanks!


Return to posts index

Dan Ebberts
Re: importing numbered frames into AE?
on Nov 24, 2012 at 5:21:43 pm

Try changing the last line to this:

parseInt(s[clamp(f,0,s.length-1)],10)


Dan



Return to posts index

ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 24, 2012 at 5:57:38 pm

works! thanks!


Return to posts index


ben wolfinsohn
Re: importing numbered frames into AE?
on Nov 24, 2012 at 6:49:14 pm

in general, if you can have at the end of your expression " == 8" and you can have a " < 1" but can you have both with a "or"?


Return to posts index

Dan Ebberts
Re: importing numbered frames into AE?
on Nov 24, 2012 at 7:21:04 pm

like this (it's just core JavaScript):

if((i == 8) || (i < 1))

Dan



Return to posts index

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