Copy link to clipboard
Copied
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 ????
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);
Copy link to clipboard
Copied
I assume you meant to type "Aux.Channel".
Copy link to clipboard
Copied
Yes, Aux.Channel. But the code still doesn't work...
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
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 ........
Copy link to clipboard
Copied
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 !!!!
Copy link to clipboard
Copied
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()
Copy link to clipboard
Copied
Chose a layer in the composition with the effect, and ran your code
error on line 18,
function properties is undefined....
Copy link to clipboard
Copied
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()
Copy link to clipboard
Copied
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....
Copy link to clipboard
Copied
I guess that no layer is being passed to the function. You have to pass the layer to inspectProperties(layer) on line 23
Copy link to clipboard
Copied
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 ???
Copy link to clipboard
Copied
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..
????
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now