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

how to register access to the properties of the effect ID Matte through AE scripting?

New Here ,
Jul 15, 2019 Jul 15, 2019

Good afternoon...

Trying to record the settings for the effect ID Matte. How to switch property Aux.Cannel via AE Scripting

For example, I want to switch to ID Material mode....

------------------------------------------------------------------------------------------------------------------------------------------

var MyComp = app.project.activeItem;

var MyLayer = MyComp.layer(1)

myEffect = MyLayer.property("Effects").addProperty("ID Matte") ("Aux.Cannel").setValue(0);

---------------------------------------------------------------------------------------------------------------------------------------------

this code generates an error

Are there knowledgeable people ????

TOPICS
Scripting
1.8K
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

Participant , Jul 15, 2019 Jul 15, 2019

It's giving you an error beacuse AE can't add a property to effects. To solve this use match names instead. On the other hand, ID Mate aux chanel bbegins at index 1 not 0:

var myEffect = MyLayer.property("ADBE Effect Parade").addProperty("ADBE ID MATTE")("ADBE ID MATTE-0001").setValue(1);

Translate
LEGEND ,
Jul 15, 2019 Jul 15, 2019

I assume you meant to type "Aux.Channel".

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 ,
Jul 15, 2019 Jul 15, 2019

Yes, Aux.Channel. But the code still doesn't work...

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
Participant ,
Jul 15, 2019 Jul 15, 2019

It's giving you an error beacuse AE can't add a property to effects. To solve this use match names instead. On the other hand, ID Mate aux chanel bbegins at index 1 not 0:

var myEffect = MyLayer.property("ADBE Effect Parade").addProperty("ADBE ID MATTE")("ADBE ID MATTE-0001").setValue(1);

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 ,
Jul 15, 2019 Jul 15, 2019

Yeah, that code works!

Thank you.....

And how to set the ID Selection value?

I try

------------------------------------------------------------------------------------

var myEffect = MyLayer.property("ADBE Effect Parade").addProperty("ADBE ID MATTE")("ADBE ID MATTE-0001").setValue(1) ("ID Selection").setValue(1);

-------------------------------------------------------------------------------------------

But ........

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 ,
Jul 15, 2019 Jul 15, 2019

I found it myself

-------------------------------------------------------------------------

var myEffect = MyLayer.property("ADBE Effect Parade").addProperty("ADBE ID MATTE")("ADBE ID MATTE-0001").setValue(1) ("ID Selection").setValue(1);var MyComp = app.project.activeItem;

var MyLayer = MyComp.layer(1)

var myEffect = MyLayer.property("ADBE Effect Parade").addProperty("ADBE ID MATTE")("ADBE ID MATTE-0001").setValue(1) ;

MyLayer.property("ADBE Effect Parade").property("ADBE ID MATTE")("ID Selection").setValue(2);

MyLayer.property("ADBE Effect Parade").property("ADBE ID MATTE")("Feather").setValue(2);

MyLayer.property("ADBE Effect Parade").property("ADBE ID MATTE")("Invert").setValue(1);

---------------------------------------------------------------------------------------------------------------------------------------------------------

Thank you for your quick response !!!!

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
Participant ,
Jul 15, 2019 Jul 15, 2019

You can try this script to know match names, path routes etc...

You can aslo use below function to inspect properties directly on the debugger, so you can see max and min values, property type, and other usefull info:

function getProperties(parent, store) {

  var store = store || {};

  for(var i = 1, l = parent.numProperties; i <= l; i++) {

    var prop = parent.property(i);

    store[prop.matchName.replace(/\s/g, '')] = {source: prop}; //You can inspect on source prop the prop itself

    if(prop.numProperties > 0 ) {

      properties(prop, store[prop.matchName.replace(' ', '')])

    } else {

      store[prop.matchName.replace(/\s/g, '')] = prop

    }

  }

  return store

}

//Wrapper function to get clear debug panel without globals

function inspectProperties(layer){

  var props = properties(layer);

  $.bp()

}

var layer = app.project.activeItem.layers[1]

inspectProperties()

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 ,
Jul 16, 2019 Jul 16, 2019

Chose a layer in the composition with the effect, and ran your code

error on line 18,

function properties is undefined....

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
Participant ,
Jul 17, 2019 Jul 17, 2019

Ops, I've made some typos whilecoping the code, here is a corrected version:

function getProperties(parent, store) {

  var prop, propName; 

  var store = store || {}; 

  for(var i = 1, l = parent.numProperties; i <= l; i++) { 

    prop = parent.property(i); 

    propName = prop.matchName.replace(/\s/g, '');

    store[propName] = {source: prop}; //You can inspect on source prop the prop itself 

    if(prop.numProperties > 0 ) { 

      properties(prop, store[propName]) 

    }

  } 

  return store 

 

 

//Wrapper function to get clear debug panel without globals 

function inspectProperties(layer){ 

  var props = getProperties(layer); 

  $.bp() 

 

var layer = app.project.activeItem.layers[1] 

inspectProperties()

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 ,
Jul 17, 2019 Jul 17, 2019

terribly sorry, but

Chose a layer in the composition with the effect, and ran your code

error on line 04,

undefined is not an object....

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
Participant ,
Jul 17, 2019 Jul 17, 2019

I guess that no layer is being passed to the function. You have to pass the layer to inspectProperties(layer) on line 23

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 ,
Jul 17, 2019 Jul 17, 2019

Run your code by Adobe Extendscript Toolkit.

Last two string of the code look like

var TestLayer = app.project.activeItem.layers[1];

inspectProperties(TestLayer);

do I understand correctly, that the properties of an object to study, need to be looked through application Data Browser ???

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 ,
Jul 17, 2019 Jul 17, 2019

I tell this because the code execution stops and the application throws an error on line 9 of the code.

echo: Function properties undefined.

But the view of Object browser  changes. It shows a lot of unnecessary properties. I understand that only the properties of the selected layer should be shown..

????

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
Participant ,
Jul 17, 2019 Jul 17, 2019

Throws an erro because the same reason as before, change properties by getProperties on line 9 . It shows you all layer properties in the debugger, even if you can't see them in after effects interface.

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 ,
Jul 17, 2019 Jul 17, 2019
LATEST

For example, I want to explore the effect of Camera Lens Blur. What should I write in line 9?

properties(prop, store["Camera Lens Blur"])

In this writing, an error occurs

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