Forum Replies Created

Page 69 of 1081
  • Dan Ebberts

    November 8, 2022 at 7:27 pm in reply to: Script adding effect too many times.

    I haven’t tested this at all, but I would set it up like this:

    function addPos(){

    function deselectAll(theComp);

    for (var i = 1; i <= theComp.numLayers; i++){

    theComp.layer(i).selected = false;

    }

    }

    app.beginUndoGroup("TEST");

    var myComp = app.project.activeItem;

    var myLayers = myComp.selectedLayers;

    var scriptFolderPath = File($.fileName).path;

    var colorFolderPath = scriptFolderPath + encodeURI("/fp_presets");

    var ffxFile = new File(colorFolderPath + encodeURI("/FP_position.ffx"));

    for (var i =0; i < myLayers.length; i++){

    deselectAll(myComp);

    myLayers[i].selected = true;

    myLayers[i].applyPreset(ffxFile);

    var myProp = myLayers[i].effect("FP - Position")("Position Offset");

    myProp.expressionEnabled = false;

    }

    app.endUndoGroup();

    }

    addPos();

  • I don’t think you’re going to be able to make that work. You’ll need to duplicate your Pattern_comp in the Project panel, not as a layer in your Base_comp, then you should be able to link each copy independently.

  • Dan Ebberts

    November 8, 2022 at 7:16 am in reply to: Need to trigger animation any time there is a marker.

    It looks like you’re calculating the first marker index of the current phrase, so it seems like the marker index for each word in the phrase would be currPhrasemarkerID + (textIndex-1)

  • Dan Ebberts

    November 8, 2022 at 3:54 am in reply to: Need to trigger animation any time there is a marker.

    I think textIndex starts over at each keyframe, so, assuming you have “Based On” set to Words, textIndex == 1 will refer the the first word of each keyframed phrase.

  • Add a null to your comp, name it “control” and add a Slider Control to it.

    For whatever property you’re animating, set a keyframe at time = 0 for the initial value, go forward one frame and set a keyframe for the final value. Then add this expression (don’t use the code from 2008–it got trashed when they updated the site)_:

    slider = thisComp.layer("control").effect("Slider Control")("Slider");
    sliderMin = 0;
    sliderMax = 100;
    myMin = valueAtTime(0);
    myMax = valueAtTime(thisComp.frameDuration);
    linear(slider,sliderMin,sliderMax,myMin,myMax)

    The slider should then control the animation.

  • Having never used Maya, I’m not sure how much help I can be…

  • Dan Ebberts

    November 2, 2022 at 10:03 pm in reply to: Reference Comp specifically (and dynamically)

    Possibly, but I think the script would need to give the new reference comp a new name and then update all expression references in the duplicate subcomps to point to the new reference comp. Not impossible, but not trivial.

  • Dan Ebberts

    November 2, 2022 at 9:32 pm in reply to: Reference Comp specifically (and dynamically)

    I don’t think there’s a way to make that work with expressions. Expressions reference comps by name and all expressions that reference the same comp name will get the same result, based on its order in the project panel.

  • Dan Ebberts

    November 2, 2022 at 4:43 pm in reply to: Isolating a string of text (within a larger paragraph)

    Hey Filip,

    Nice! What does the \3 do?

  • Dan Ebberts

    November 1, 2022 at 8:59 pm in reply to: Pulling multiple frames from a comp via expression

    To display multiple frames (letters) at once, you’d need multiple copies of the time remapped layer. You’d need time remapping and position expressions that would need to determine which character from the source text this layer would represent (probably based on layer index or layer name). Here’s a simple example that assumes your letter precomp layers are at the top of the layer stack in the timeline and that the letter precomp has been trimmed to be the same size as the letters. Your time remap expression for each letter precomp layer might look like this:

    txt = thisComp.layer("Text").text.sourceText.value.toUpperCase();
    myIdx = index - 1;
    myFrame = txt.charCodeAt(myIdx) - "A".charCodeAt(0);
    framesToTime(myFrame);

    and your position expression might look like this:

    myIdx = index - 1;
    value + [myIdx*width,0]

    Again, this is a simplified example and doesn’t do anything about kerning.

Page 69 of 1081

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