Copy link to clipboard
Copied
I have a script that accesses a plugin I use, and I'm able to change the parameters successfully except for the nested ones. Is there a standard format or character to use to access these, because I can't figure it out?!
Can provide more code if necessary, but essentially, I'm able to access the non-nested (e.g., `Random seed`)by using the correct title case as below, but not sure about the nested ones (e.g., Composite noise: Intensity):
var paramMapping = {
"random_seed": ["Random seed"],
"use_field": ["Use field"],
"filter_type": ["Lowpass filter type"],
"input_luma_filter": ["Input luma filter"],
"chroma_lowpass_in": ["Chroma low-pass in"],
"composite_preemphasis": ["Composite preemphasis"],
"composite_noise": ["Composite noise", "Composite noise"],
"composite_noise_intensity": ["Composite noise", "Intensity"],
"composite_noise_frequency": ["Composite noise", "Frequency"],
Any help or thoughts is appreciated, thanks.
If you write scripts that might be used on other language versions of AE, you learn to use match names because they're the same in all language versions, and, they're unique for each parameter. I use a wonderful script called rd_GimmePropPath.jsx by Jeff Almasol to collect the match names, but I don't know if it's still available anywhere.
You can throw together a quick script like this, which will give you the match names for all selected parameters:
function getProps(){
var comp = app.project
...
Copy link to clipboard
Copied
What do you mean by "nested"? If you're talking about parameter groups (with the little twirly things to expose parameters within), I think you just ignore the outer parameter names and use the inside parameter names directly.
Copy link to clipboard
Copied
Yes, grouping is what I meant, thank you.
So how would that work if grouped items had the same name, for example, there might be "Intensity" under "Composite noise", but also there might be an "Intensity" under "Luma noise"?
Copy link to clipboard
Copied
For reference, which plugin are you referring to?
Copy link to clipboard
Copied
Generally, you'll want to use the parameter's match name, which will be different for each parameter.
Copy link to clipboard
Copied
This is for NTSC-rs and you can see in the screenshot below how two different groups can have the same parameter name (Frequency):
Copy link to clipboard
Copied
The match name for the first "Frequency" is "ntsc-rs-0054" and the second one is "ntsc-rs-0021". Try those.
Copy link to clipboard
Copied
Oh that's very helpful. Do you mind if I ask how you discovered that? Then I can fill in the rest of the parameters. Is it in the source code somwhere?
Copy link to clipboard
Copied
If you write scripts that might be used on other language versions of AE, you learn to use match names because they're the same in all language versions, and, they're unique for each parameter. I use a wonderful script called rd_GimmePropPath.jsx by Jeff Almasol to collect the match names, but I don't know if it's still available anywhere.
You can throw together a quick script like this, which will give you the match names for all selected parameters:
function getProps(){
var comp = app.project.activeItem;
if (! comp || ! (comp instanceof CompItem)){
alert ("No comp active.");
return;
}
var props = comp.selectedProperties;
var txt = "";
for (var i = 0; i < props.length; i++){
txt += '"'+props[i].name + '" "' + props[i].matchName + '"\n';
}
alert (txt);
}
getProps();
Copy link to clipboard
Copied
That's so useful!
Thanks for all your help on this.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now