Search found 320 matches

by Dan Ebberts
March 16th, 2007, 11:36 am
Forum: Expression Discussion
Topic: linking only one axis position
Replies: 4
Views: 16738

Oops, sorry about that second one. "c" is just a variable that is set equal to the center's position. It's not necessary to do this, it just makes things a little easier to read (I think). All the work gets done in the next line: [value[0],c[1]]; For a 2D layer, the position value is an ar...
by Dan Ebberts
March 16th, 2007, 6:59 am
Forum: Expression Discussion
Topic: linking only one axis position
Replies: 4
Views: 16738

Try this:

// for horizontal layer
c = thisComp.layer("center").position;
[value[0],c[1]];



// for vertical layer
c = thisComp.layer("center");
[c[0],value[1]]


Dan
by Dan Ebberts
March 13th, 2007, 9:59 am
Forum: Expression Discussion
Topic: pendulum - with decay from www.motionscript.com
Replies: 2
Views: 8715

Just change Math.sin to Math.cos and it will start at the amplitude value:

freq = 1.0; //oscillations per second
amplitude = 50;
decay = 0.7;

amplitude*Math.cos(freq*time*2*Math.PI)/Math.exp(decay*time)


Dan
by Dan Ebberts
February 26th, 2007, 2:50 pm
Forum: Expression Discussion
Topic: reference a comp by something other than name
Replies: 3
Views: 10559

The best I can come up with is to have the expressions in the pre-comp pick up the master comp name from a local text layer. Then have the script update the text in the text layer after it creates the new copies of the comps. So your expressions would look something like this: compName = thisComp.la...
by Dan Ebberts
February 23rd, 2007, 11:49 pm
Forum: Expression Discussion
Topic: if/else in conjunction with degrees rotation and opacity?
Replies: 3
Views: 9667

It's a little more complicated than that. The problem is that since expressions have no memory, as soon as you move off the condition where the notches line up, the expression doesn't know that they were ever lined up. So what you have to do is create a loop that goes back frame-by-frame from the cu...
by Dan Ebberts
February 20th, 2007, 1:50 pm
Forum: Expression Discussion
Topic: fromWorld toWorld are confusing myWorld
Replies: 2
Views: 10367

I'm not in front of AE right now, but I think you'd need to do it like this:

p = thisComp.layer(index -1);
p.toWorld(p.anchorPoint)


Dan
by Dan Ebberts
February 14th, 2007, 6:03 pm
Forum: Expression Discussion
Topic: wiggle with probablility
Replies: 4
Views: 11070

Try this one and see if it gets you closer. It should randomly wiggle, then hold its position for a random time, the wiggle again, etc. freq = 5; // wiggle frequency amp = 100; // wiggle amplitude minOn = .5; // min wiggle time (seconds) maxOn = 1.5; minOff = .5; // min hold time maxOff = 1.5; seedR...
by Dan Ebberts
January 31st, 2007, 2:54 pm
Forum: Script requests
Topic: copy script source?
Replies: 3
Views: 9226

Not sure what I was thinking - this should work better:

eval(thisComp.layer("text expr").text.sourceText.toString())


Dan
by Dan Ebberts
January 31st, 2007, 9:55 am
Forum: Script requests
Topic: copy script source?
Replies: 3
Views: 9226

The only way I can think of to do it would be to put the expression in a text layer and then link your slave expressions to it with an expression like this:

eval("s = " +thisComp.layer("text expr").text.sourceText)



Dan
by Dan Ebberts
December 10th, 2006, 2:57 pm
Forum: Expression Discussion
Topic: Time remap a Precomp(loop), to sync to layer markers
Replies: 4
Views: 12252

Yikes! The forum formatting trashed my code. Let me try it again: L = thisComp.layer("marker layer"); p = 0; if (L.marker.numKeys > 0){ p = L.marker.nearestKey(time).index; if (L.marker.key(p).time > time){ p--; } } n = 0; if (L.marker.numKeys > 0){ n = L.marker.nearestKey(time).index; if ...
by Dan Ebberts
December 10th, 2006, 11:14 am
Forum: Expression Discussion
Topic: Time remap a Precomp(loop), to sync to layer markers
Replies: 4
Views: 12252

Try this one. It should get you close. Change "marker layer" to the name of your layer where the markers will be. L = thisComp.layer("marker layer"); p = 0; if (L.marker.numKeys > 0){ p = L.marker.nearestKey(time).index; if (L.marker.key(p).time > time){ p--; } } n = 0; if (L.mar...
by Dan Ebberts
November 28th, 2006, 2:03 pm
Forum: Expressions Library
Topic: Clock hands
Replies: 3
Views: 20236

Yes it is. You also get it with the pick whip and the default expression.

Dan
by Dan Ebberts
November 15th, 2006, 2:56 pm
Forum: Script requests
Topic: Can I control the mask pins with a Script?
Replies: 2
Views: 8934

Yes you can. You'll want to look up the Mask Property Group and Shapes in the Scripting Guide. The ShapeTimeInsanity.jsx script that comes in the demo scripts folder of AE has an example of how to create masks.

Dan
by Dan Ebberts
October 3rd, 2006, 3:20 pm
Forum: Expression Discussion
Topic: expression to key frame
Replies: 1
Views: 7032

Animation > Keyframe Assistant > Convert Expression to Keyframes But my guess is that's not really what you're after. If you want the results of your expression to be added to the keyframed value, you use something like this at the end of your expression: value + <result of your expression> Dan
by Dan Ebberts
October 3rd, 2006, 7:56 am
Forum: Scripts Discussion
Topic: run script command prompt
Replies: 3
Views: 11265

Lloyd, I think mads was talking about using a command line to force AE to run a script. The -s flag means the text of the script is in the command line, -r would be used to pass the path to a script file. The command line renderer is a different deal, and I do't know of any way to force it to run a ...