Search found 319 matches

by Dan Ebberts
October 13th, 2017, 11:55 am
Forum: Expressions Library
Topic: Expression for sine wave modulation of filter intensity
Replies: 2
Views: 1398

Re: Expression for sine wave modulation of filter intensity

Play with this:

freq = 1;
midVal = 20;
range = 10;

midVal + range*Math.sin(time*freq*Math.PI*2)


Dan
by Dan Ebberts
February 3rd, 2016, 5:27 pm
Forum: Expression Discussion
Topic: Accessing text properties
Replies: 3
Views: 2769

Re: Accessing text properties

I'm afraid you're out of luck. You can poke around a little with source text expressions like this:

prop = text;
prop.numProperties;

or,

prop = text;
prop(3)(1).name

But I don't think you'll find anything helpful. Different story with scripting though...

Dan
by Dan Ebberts
November 10th, 2015, 12:44 pm
Forum: Expression Discussion
Topic: guides - are they scriptable?
Replies: 1
Views: 2574

Re: guides - are they scriptable?

I don't think there's a way to do that. Scripting doesn't have much access to AE's UI. I think the most you could do would be to issue the menu command "Show Rulers", but that doesn't help much.

Dan
by Dan Ebberts
October 19th, 2015, 12:46 pm
Forum: Scripts Discussion
Topic: How to check if an effect is missing
Replies: 6
Views: 2886

Re: How to check if an effect is missing

Based on my limited sample size, it appears that maybe missing effects show up in the list with the category blank. Would that help in your case?

Dan
by Dan Ebberts
March 22nd, 2015, 11:38 am
Forum: Script requests
Topic: Global quality switch to Draft?
Replies: 4
Views: 3907

Re: Global quality switch to Draft?

That's a little trickier, but I think this works: var myComps = app.project.selection; var myComp; for (var i = 0; i < myComps.length; i++){ myComp = myComps[i]; if (myComp instanceof CompItem){ setLayers(myComp); } } function setLayers(theComp){ for (var i = 1; i <= theComp.numLayers; i++){ try{ th...
by Dan Ebberts
March 18th, 2015, 10:36 pm
Forum: Script requests
Topic: Global quality switch to Draft?
Replies: 4
Views: 3907

Re: Global quality switch to Draft?

I think this will work: var myComps = app.project.selection; var myComp; for (var i = 0; i < myComps.length; i++){ myComp = myComps[i]; if (! (myComp instanceof CompItem)) continue; for (var j = 1; j <= myComp.numLayers; j++){ try{ myComp.layer(j).quality = LayerQuality.DRAFT; }catch(err){ } } } Dan
by Dan Ebberts
February 2nd, 2015, 6:38 pm
Forum: Scripts Discussion
Topic: Zoom Out via Javascript
Replies: 2
Views: 2427

Re: Zoom Out via Javascript

Scripting doesn't have much control over the AE UI, and I don't know of any way to do what you're asking for. It's possible there's some kind of hack for it, but I'm not aware of one.

Dan
by Dan Ebberts
February 2nd, 2015, 4:31 pm
Forum: Expressions Library
Topic: Translate source text into a number?
Replies: 2
Views: 9201

Re: Translate source text into a number?

Something like this should work:

txt = thisComp.layer("Text Layer").text.sourceText.value;
n = parseFloat(txt);
if (isNaN(n)) value else n;


Dan
by Dan Ebberts
January 18th, 2015, 6:57 pm
Forum: Expression Discussion
Topic: Timestamp on Timelapse
Replies: 2
Views: 3093

Re: Timestamp on Timelapse

Expressions can't access metadata, but scripting can. Adobe's JavaScript Tools Guide has a chapter on it. It's not simple, but there are probably some good examples around.

Dan
by Dan Ebberts
January 7th, 2015, 5:18 pm
Forum: Expression Discussion
Topic: Text layer and expression
Replies: 3
Views: 4646

Re: Text layer and expression

I should point out that the latest version of AE CC 2014.2 (build 13.2.0.49) does support sourceRectAtTime() for expressions.

Dan
by Dan Ebberts
November 7th, 2014, 11:45 pm
Forum: Expression Discussion
Topic: Show Layer ID
Replies: 1
Views: 2945

Re: Show Layer ID

What info are you after exactly?
by Dan Ebberts
November 6th, 2014, 3:05 pm
Forum: Script requests
Topic: Set keyframe at current time for highlighted property?
Replies: 1
Views: 2872

Re: Set keyframe at current time for highlighted property?

Something like this should work: var myComp = app.project.activeItem; if (myComp && (myComp instanceof CompItem)){ var myProps = myComp.selectedProperties; if (myProps.length > 0){ for (var i = 0; i < myProps.length; i++){ if (myProps[i].canVaryOverTime){ myProps[i].addKey(myComp.time); } } }else{ a...
by Dan Ebberts
August 14th, 2014, 3:38 pm
Forum: Scripts Discussion
Topic: Detect if layer is a text layer
Replies: 2
Views: 2472

Re: Detect if layer is a text layer

This should work too:

if (myComp.layers[y] instanceof TextLayer)


Dan
by Dan Ebberts
July 2nd, 2014, 9:27 am
Forum: Expressions Library
Topic: How rgbToHsl really works ?
Replies: 4
Views: 5363

Re: How rgbToHsl really works ?

I'm not sure exactly what you're after, but I ran a quick test, and this slider expression always gives me 0.00 no matter what color I choose for the Fill effect: c = effect("Fill")("Color"); L1 = rgbToHsl(c)[2]; L2 = (Math.max(c[0],c[1],c[2]) + Math.min(c[0],c[1],c[2]))/2 L2 - L1 What version of AE...
by Dan Ebberts
July 1st, 2014, 7:11 pm
Forum: Expressions Library
Topic: How rgbToHsl really works ?
Replies: 4
Views: 5363

Re: How rgbToHsl really works ?

I think the luma/lightness channel is defined to be the average of the largest and smallest color channels. So pure red, blue or green would be 0.5 and white would be 1.0, etc.

Dan