Search found 320 matches
- March 10th, 2023, 10:25 am
- Forum: Expressions Tutorials
- Topic: Use sampleImage() to create a color picker
- Replies: 8
- Views: 155192
Re: Use sampleImage() to create a color picker
I'm not sure what you're looking for exactly, but maybe something like this: target = thisComp.layer("Color_gradient"); s = target.sampleImage(target.fromWorld(toWorld(anchorPoint)), [0.5,0.5], true, time); Math.round(s[0]*255) + ", " + Math.round(s[1]*255) + ", " + Mat...
- October 13th, 2017, 11:55 am
- Forum: Expressions Library
- Topic: Expression for sine wave modulation of filter intensity
- Replies: 2
- Views: 33926
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
freq = 1;
midVal = 20;
range = 10;
midVal + range*Math.sin(time*freq*Math.PI*2)
Dan
- February 3rd, 2016, 5:27 pm
- Forum: Expression Discussion
- Topic: Accessing text properties
- Replies: 3
- Views: 17128
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
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
- November 10th, 2015, 12:44 pm
- Forum: Expression Discussion
- Topic: guides - are they scriptable?
- Replies: 1
- Views: 14836
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
Dan
- October 19th, 2015, 12:46 pm
- Forum: Scripts Discussion
- Topic: How to check if an effect is missing
- Replies: 6
- Views: 21625
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
Dan
- March 22nd, 2015, 11:38 am
- Forum: Script requests
- Topic: Global quality switch to Draft?
- Replies: 4
- Views: 22963
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...
- March 18th, 2015, 10:36 pm
- Forum: Script requests
- Topic: Global quality switch to Draft?
- Replies: 4
- Views: 22963
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
- February 2nd, 2015, 6:38 pm
- Forum: Scripts Discussion
- Topic: Zoom Out via Javascript
- Replies: 2
- Views: 12820
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
Dan
- February 2nd, 2015, 4:31 pm
- Forum: Expressions Library
- Topic: Translate source text into a number?
- Replies: 2
- Views: 41561
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
txt = thisComp.layer("Text Layer").text.sourceText.value;
n = parseFloat(txt);
if (isNaN(n)) value else n;
Dan
- January 18th, 2015, 6:57 pm
- Forum: Expression Discussion
- Topic: Timestamp on Timelapse
- Replies: 2
- Views: 14348
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
Dan
- January 7th, 2015, 5:18 pm
- Forum: Expression Discussion
- Topic: Text layer and expression
- Replies: 3
- Views: 18096
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
Dan
- November 7th, 2014, 11:45 pm
- Forum: Expression Discussion
- Topic: Show Layer ID
- Replies: 1
- Views: 12040
Re: Show Layer ID
What info are you after exactly?
- November 6th, 2014, 3:05 pm
- Forum: Script requests
- Topic: Set keyframe at current time for highlighted property?
- Replies: 1
- Views: 12333
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); } } ...
- August 14th, 2014, 3:38 pm
- Forum: Scripts Discussion
- Topic: Detect if layer is a text layer
- Replies: 2
- Views: 13254
Re: Detect if layer is a text layer
This should work too:
if (myComp.layers[y] instanceof TextLayer)
Dan
if (myComp.layers[y] instanceof TextLayer)
Dan
- July 2nd, 2014, 9:27 am
- Forum: Expressions Library
- Topic: How rgbToHsl really works ?
- Replies: 4
- Views: 42508
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...