Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Please show or instruct how to create the arrayOfValues value parameter for setValuesAtTimes method?

$
0
0

Hello AEScriptComm,

 

                                   i have a few, small scripts that use the setValueAtTime method successfully placing a keyframe on the Layers existing maskPath, but as you could see in the scripts below, using setValueSatTimeS results in errors ie: "Array is not of the correct type", "Value is not an Array"  or "Null is not an object", depending on,..

 

A) which variable is used as Value parameter IE:

.maskPath;

.maskPath.value;

.maskPath.value.vertices

 

B) which type of array is used as Value parameter as in:

 

var addTheseKeys = new Array((1,2,3,4);    (as Time parameter),..

(with Either)

 

var keyValues = new Array([10,10],[100,100],[15,50],[100,120]);             ...." ]) "

(OR)

var keyValues = [[10,10],[100,100],[15,50],[100,120]];                               ...(Array of arrays? RE: " ]] " )

 

 

I've just read a "push" of values into an Array may be required?, but i hoped anyone familiar with setValuesAtTimes could please show,..

 

1) ..how to create the arrayOfValues value parameter for setValuesAtTimes method?

 

1a): WORKING setValueAtTime script...

 

// app.project.item(1).layer(1).property(“Masks”).property(“Mask 1”);

var myProperty    = app.project.item(1).layer(1).mask(1).maskPath;

myShape             = app.project.item(1).layer(1).mask(1).maskPath.value;

myProperty.setValueAtTime(1.0,myShape);

 

 

1b): FAILING setValuesAtTimes script...

 

// var prop1           = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Position");

var fourKeys           = 4;

var addTheseKeys = new Array(1,2,3,4,);

var keyValues         = new Array([10,10], [100,100], [15,50], [100,120]);

 

var myProperty      = app.project.item(1).layer(1).mask(1).maskPath;

myShape               = app.project.item(1).layer(1).mask(1).maskPath.value;

var myVertices       = app.project.item(1).layer(1).mask(1).maskPath.vertices;

myProperty.setValuesAtTimes(addTheseKeys, keyValues);

 

app.beginUndoGroup("Keys");

//~ for(var k=0; k<fourKeys; k++)

//~ {

//~ prop1.setValueAtTime(addTheseKeys[k], keyValues[k]);

//~ }

 

// myProperty.setValuesAtTimes(addTheseKeys, keyValues);

 

app.endUndoGroup();

 

 

 

..thanks for any advise\suggestions,

J


Viewing all articles
Browse latest Browse all 2143

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>