Expressions/Scripts/Presets

Search found 319 matches

  • 1
  • 2
  • 3
  • 4
  • 5
  • 22
by Dan Ebberts
Fri Oct 13, 2017 11:55 am
Forum: Expressions Library
Topic: Expression for sine wave modulation of filter intensity
Replies: 2
Views: 301

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
Wed Feb 03, 2016 5:27 pm
Forum: Expression Discussion
Topic: Accessing text properties
Replies: 3
Views: 1618

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
Tue Nov 10, 2015 12:44 pm
Forum: Expression Discussion
Topic: guides - are they scriptable?
Replies: 1
Views: 1560

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
Mon Oct 19, 2015 12:46 pm
Forum: Scripts Discussion
Topic: How to check if an effect is missing
Replies: 6
Views: 2299

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
Sun Mar 22, 2015 11:38 am
Forum: Script requests
Topic: Global quality switch to Draft?
Replies: 4
Views: 2650

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
Wed Mar 18, 2015 10:36 pm
Forum: Script requests
Topic: Global quality switch to Draft?
Replies: 4
Views: 2650

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
Mon Feb 02, 2015 6:38 pm
Forum: Scripts Discussion
Topic: Zoom Out via Javascript
Replies: 2
Views: 1965

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
Mon Feb 02, 2015 4:31 pm
Forum: Expressions Library
Topic: Translate source text into a number?
Replies: 2
Views: 7163

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
Sun Jan 18, 2015 6:57 pm
Forum: Expression Discussion
Topic: Timestamp on Timelapse
Replies: 2
Views: 2299

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
Wed Jan 07, 2015 5:18 pm
Forum: Expression Discussion
Topic: Text layer and expression
Replies: 3
Views: 3804

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
Fri Nov 07, 2014 11:45 pm
Forum: Expression Discussion
Topic: Show Layer ID
Replies: 1
Views: 2375

Re: Show Layer ID

What info are you after exactly?
by Dan Ebberts
Thu Nov 06, 2014 3:05 pm
Forum: Script requests
Topic: Set keyframe at current time for highlighted property?
Replies: 1
Views: 2266

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); } } ...
by Dan Ebberts
Thu Aug 14, 2014 3:38 pm
Forum: Scripts Discussion
Topic: Detect if layer is a text layer
Replies: 2
Views: 2048

Re: Detect if layer is a text layer

This should work too:

if (myComp.layers[y] instanceof TextLayer)


Dan
by Dan Ebberts
Wed Jul 02, 2014 9:27 am
Forum: Expressions Library
Topic: How rgbToHsl really works ?
Replies: 4
Views: 4146

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 - L...
by Dan Ebberts
Tue Jul 01, 2014 7:11 pm
Forum: Expressions Library
Topic: How rgbToHsl really works ?
Replies: 4
Views: 4146

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 22