ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Change value of a field in a different composition.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
George Felix
Change value of a field in a different composition.
on Jul 7, 2017 at 6:54:22 am

I don’t know if this is possible.

Basically I want to do a counter that will store a value so I can later retrieve it in a different frame with an expression

In comp A we have a field called A

In comp B we have a field B that has some expressions in it. We have a variable in it called count.

In the if statement is true, 1 is added to the value of A in Comp A.
When the if statement is true again, it retrieves the value of A in Comp A and adds 1 to it again. The value of A changes, only when the if is true. This will create a counter.

George


Return to posts index

Dan Ebberts
Re: Change value of a field in a different composition.
on Jul 7, 2017 at 1:17:57 pm

Expression have no memory, so there are no persistent variables. There may be workarounds though, depending on what you're trying to do.


Dan



Return to posts index

George Felix
Re: Change value of a field in a different composition.
on Jul 7, 2017 at 2:46:43 pm

I would like to be able to make a loop counter .

I'm making a game clock which will run for 45 minutes. I figured to have the scored change automatically when the clock reaches the time that a goal is scored.

Originally the goals scored of team A is 0.

At 10:05, they score a goal.
This time is at the frame of (10*60 + 5) = 605 seconds and if we have 30 frames per second, then at frame 18150, the score should change from 0 to 1.

At frame 31150 they score a second goal, then the 1 should change to 2. Every time a frame is reached that a new goal is scored, the value displayed should change by 1.

Is their a work around.

We know how many goals will be scored in the half, and the frame that they are scored upon.

Any help will be greatly appreciated.

George


Return to posts index


Dan Ebberts
Re: Change value of a field in a different composition.
on Jul 7, 2017 at 4:03:08 pm

This is a simple example where you set up an array with the goal scoring times (in seconds):


goalTimes = [100,200,300,400]; // in seconds
score = 0;
for (i = 0; i < goalTimes.length; i++){
if (time > goalTimes[i])
score++
else
break;
}
score



Dan



Return to posts index

George Felix
Re: Change value of a field in a different composition.
on Jul 7, 2017 at 4:49:38 pm

I don't know how to thank you!!!!!!

It works great!!!!

Thanks

George


Return to posts index

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