How to modify parameters such as color temperature through api
I need to control component parameters like color temperature by calling the api and trying property.setValue but that doesn't seem to work. The strange thing is that setValue can control the motion position, how should I implement this function?
function _getSelectedClip() {
var selection = app.project.activeSequence.getSelection();
for (var i = 0; i < selection.length; i++) {
var clip = selection[i];
if (clip.mediaType === "Video") {
return clip;
}
}
return null;
}
var clip = _getSelectedClip();
$.writeln(clip.name);
// 查找组件
function findComponent(clip, matchName) {
var components = clip.components;
for (var i = 0; i < components.numItems; i++) {
if (components[i].matchName === matchName) {
return components[i];
}
}
return null;
}
// 查找属性
function findProperty(clip, matchName, propertyIndex) {
var component = findComponent(clip, matchName);
if (!component) return null;
var properties = component.properties,
property = properties[propertyIndex];
// return component.properties[propertyIndex];
return property;
}
var property = findProperty (clip, 'AE.ADBE Motion', 0);
var value = 0;
if(typeof property.getValue() == 'object') {
value = property.getValue()[0] + 1;
}
property.setValue([value,value]);
$.writeln(property.displayName + ':'+property.getValue());
