ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to set Audio Layer for ADBE Spectrum with script?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Arthur Smolnikov
How to set Audio Layer for ADBE Spectrum with script?
on Jan 31, 2018 at 11:19:00 am

0
down vote
favorite
I've added ADBE AudSpect effect to solid like so

getCompLayer('spectrum').Effects.addProperty('ADBE AudSpect')

Now I need to reference the Audio Layer to the actual audio layer. How can I do that with scripting? Manualy I could do that here (first dropdown): Manualy I could do that here:
http://take.ms/xZgdQ

I've tryed doing it this way:

getCompLayer('spectrum').property('ADBE AudSpect').property('AudioLayer') = getCompLayer('audio2');

I get read-only error. Also, getCompLayer() function looks like this

var activeComp = app.project.activeItem;

function getCompLayer(objname) {
for(var i=1; i<10000; i++) {
var nameMatch = activeComp.layer(i).name == objname;

if ( nameMatch ) {
return activeComp.layer(i);
}
}
}


Return to posts index

Dan Ebberts
Re: How to set Audio Layer for ADBE Spectrum with script?
on Jan 31, 2018 at 5:33:27 pm

Play with this:

var myComp = app.project.activeItem;
var audioLayer = myComp.layer("audio2");
var spectrumLayer = myComp.layer("spectrum");
var myProp = spectrumLayer.property("Effects").property("Audio Spectrum").property("Audio Layer");
myProp.setValue(audioLayer.index)


Dan



Return to posts index

Arthur Smolnikov
Re: How to set Audio Layer for ADBE Spectrum with script?
on Feb 1, 2018 at 2:30:24 pm

Worked like a charm! Thank you!

Didn't quite get what the (audioLayer.index) does, though.


Return to posts index

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