1 Reply Latest reply on Jun 5, 2018 3:06 PM by montanal5247998

    3D Camera Keyframes "Null is not an object"

    montanal5247998 Level 1

      I am attempting to use script to create keyframes for the 3D camera's position and point of interest. It gets through the script just fine until it hits the line prop3.setValuesAtTimes(addTheseKeysPoint,keyValuesPoint); towards the end for the Point of Interest keyframes and I get the "null is not an object" error. Anybody know what I'm doing wrong? Here is the script:

       

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

      var fourKeys = 9;

      var addTheseKeysCursor = new Array(1,2,3,4,5,6,7,8,9);

      var keyValuesCursor = new Array([487,108],[487,108],[190,151],[190,151],[372,180],[372,180],[655,266],[655,266],[48 5,29]);

       

       

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

      var positionKeys = 11;

      var addTheseKeysPosition = new Array (1,2,3,4,5,6,7,8,9,10,11);

      var keyValuesPosition = new Array ([375,217,-2667],[375,217,-2667],[252,217,-1633],[252,217,-1633],[375,217,-1633],[375,217 ,-1633],[511,217,-1633],[511,217,-1633],[511,129,-1633],[511,129,-1633],[375,217,-2667]);

       

       

      var prop3 = app.project.item(10).layer(1).property("ADBE Transform Group").property("ADBE Point of Interest");

      var positionKeys = 11;

      var addTheseKeysPoint = new Array (1,2,3,4,5,6,7,8,9,10,11);

      var keyValuesPoint = new Array ([375,217,0],[375,217,0],[252,217,0],[252,217,0],[375,217,0],[375,217,0],[511,217,0],[511 ,217,0],[511,129,0],[511,129,0],[375,217,0]);

       

       

      app.beginUndoGroup("Keys");

       

       

      prop1.setValuesAtTimes(addTheseKeysCursor,keyValuesCursor);

      prop2.setValuesAtTimes(addTheseKeysPosition,keyValuesPosition);

      prop3.setValuesAtTimes(addTheseKeysPoint,keyValuesPoint);

       

      app.endUndoGroup();

       

      alert("All Done");