Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I access Plugin parameters via scripting?

New Here ,
Oct 27, 2024 Oct 27, 2024

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.

TOPICS
Scripting
952
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 28, 2024 Oct 28, 2024

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
...
Translate
Community Expert ,
Oct 27, 2024 Oct 27, 2024

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 27, 2024 Oct 27, 2024

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"?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 27, 2024 Oct 27, 2024

For reference, which plugin are you referring to?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 27, 2024 Oct 27, 2024

Generally, you'll want to use the parameter's match name, which will be different for each parameter.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 28, 2024 Oct 28, 2024

This is for NTSC-rs and you can see in the screenshot below how two different groups can have the same parameter name (Frequency):

1211111.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 28, 2024 Oct 28, 2024

The match name for the first "Frequency" is "ntsc-rs-0054" and the second one is "ntsc-rs-0021". Try those.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 28, 2024 Oct 28, 2024

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 28, 2024 Oct 28, 2024

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();
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2024 Oct 29, 2024
LATEST

That's so useful!
Thanks for all your help on this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines