Forum Replies Created

Page 79 of 1081
  • Dan Ebberts

    September 8, 2022 at 8:29 pm in reply to: Marker comment to text in one line

    I’m not sure what you’re asking exactly, but maybe like this:

    txt = "";
    if (marker.numKeys > 0){
    for (i = 1; i <= marker.numKeys; i++){
    txt += marker.key(i).comment;
    }
    }
    txt
  • Dan Ebberts

    September 7, 2022 at 11:49 pm in reply to: Mogrt version of buzz words effect for Premiere Pro

    That one wasn’t quite right. This is better:

    numLayers = 20;
    startLayer = 1;
    buzz_words = "";
    for (var i = 0; i < numLayers; i++){
    buzz_words += thisComp.layer(startLayer + i).text.sourceText + (i < numLayers-1 ? "|" : "");
    }
    buzz_words
  • Dan Ebberts

    September 7, 2022 at 11:22 pm in reply to: Mogrt version of buzz words effect for Premiere Pro

    As an example, if the first 20 layers of your comp were the buzz words input layers, something like this should work:

    startLayer = 1;
    numLayers = 20;
    buzz_words = "";
    for (var i = startLayer; i <= numLayers; i++){
    buzz_words += thisComp.layer(i).text.sourceText + (i < numLayers ? "|" : "");
    }
  • Dan Ebberts

    September 7, 2022 at 8:16 pm in reply to: Mogrt version of buzz words effect for Premiere Pro

    What are the names of the 20 layers?

  • Dan Ebberts

    September 7, 2022 at 4:35 pm in reply to: Change checkbox True/False with a button (if/else?)

    I haven’t tested this, but it seems like you’d want to do it this way:

    myLayers[i].effect("APC Colorama").property(12).value
    ? myLayers[i].effect("APC Colorama").property(12).setValue(false)
    : myLayers[i].effect("APC Colorama").property(12).setValue(true);
  • Dan Ebberts

    September 7, 2022 at 6:31 am in reply to: Changing Position keyframes but keeping the speed graph

    It’s a little tricky, but I think this will work in most situations:

    newV1 = [100,200];
    newV2 = [200,300];
    if (numKeys > 1){
    v1 = key(1).value;
    v2 = key(numKeys).value;
    t1 = key(1).time;
    t2 = key(numKeys).time;
    if (time < t1){
    newV1;
    }else if (time > t2){
    newV2;
    }else{
    delta = v2 - v1;
    newDelta = newV2 - newV1;
    if (Math.abs(delta[0]) < .001){
    x = v1[0];
    }else{
    x = newV1[0] + ((value[0] - v1[0])/delta[0])*(newDelta[0]);
    }
    if (Math.abs(delta[1]) < .001){
    y = v1[1];
    }else{
    y = newV1[1] + ((value[1] - v1[1])/delta[1])*(newDelta[1]);
    }
    [x,y];
    }
    }else
    value
  • Dan Ebberts

    September 3, 2022 at 12:32 am in reply to: Trouble scripting Injecting expression on “Rotate”

    Like this, I think:

    (function () {
    if(app.project.activeItem == null || !(app.project.activeItem instanceof CompItem)) {
    alert("please select a valid item");
    return false;
    }
    var myComposition = app.project.activeItem;
    var myLayers = myComposition.selectedLayers;
    for (var i = 0; i < myLayers.length; i++){
    myLayers[i].property("ADBE Transform Group").property("ADBE Rotate Z").expression = 'value - parent.transform.rotation';
    }
    })();
  • This is a little test script that will apply my controls preset 3 times to layer 1 of my comp:

    function test(){
    function deselectAll(theComp){
    var mySelected = theComp.selectedLayers;
    for (var i = 0; i < mySelected.length; i++){
    mySelected[i].selected = false;
    }
    }
    var myPresetPath = "/c/test/Test_Controls.ffx";
    var numControls = 3;
    var myComp = app.project.activeItem;
    var myLayer = myComp.layer(1);
    for (var i = 1; i <= numControls; i++){
    deselectAll(myComp);
    myLayer.selected = true;
    myLayer.applyPreset(File(myPresetPath));
    }
    }
    test();
  • You can create a pseudo effect by editing AE’s PresetEffects.xml file to define your effect panel. Then you can apply that effect by script, using the effect’s match name. The problem is, doing it that way, the system where you run your script has to have your modifications to the xml file, so that’s not a vary viable method if anyone else needs to run your script. You can get around that issue by including “Pseudo/” at the beginning of your match name, but then you have to apply it as a .ffx file, with the constraints you mentioned.

    The other alternative is to create your control panel as a actual effect, using the AE SDK, but that has its own steep learning curve and installation issues.

    Having done many of these for various scripts, I’d recommend the .ffx route as being the most manageable.

  • I forgot to mention, as-is, you could use this to drive a time-remapped animation. If you wanted to use it to drive some other animated property, you’d probably want to change the last line to:

    valueAtTime(tMin == null ? 0 : tMin)
Page 79 of 1081

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy