Forum Replies Created

Page 9 of 277
  • I think the problem lies not in the expression, but it looks like the anchorPoints of the individual layers are all near to the anchorpoint of the circle, instead of at their own center.

    Use the Pan-behind tool (Y) to reposition the anchorpoints of each cabin and it should work.

  • Filip Vandueren

    June 19, 2023 at 2:10 pm in reply to: Distance traveled

    Hello Melissa,

    if I understand correctly, the speed-slider is an actual “km per hour”. You would need to integrate that value to get a running total of the total distance travelled. But because expressions are recalculated every frame and they have no memory of what value they’ve had before, we need to explicitly loop through all previous valueAtTimes() like this:

    var totalDistance = 0;
    sliderCuentaKilometers = thisComp.layer("Controls Journey").effect("Speed")("Slider");
    const timeFactor = 1;
    for (t=0; t<time; t+=thisComp.frameDuration) {
    totalDistance+= sliderCuentaKilometers.valueAtTime(t)*timeFactor * (thisComp.frameDuration/3600);
    }
    totalDistance.toFixed(2);

    I’ve added a timeFactor, because I assume this may not be happening in realtime (otherwise, you would have to keep a steady speed of 120km/h to gain 1 km in 30 seconds).

    You may want to make that a higher value if you want to speed things up.

  • Hi Frank,

    I think you will have the most options if you convert the outline of the character to a shapelayer, then you can use multiple strokes (black and white) with modifiers such as Offset Paths and Wiggle Paths to get a jittery outline, and you still have the options to enhance that with roughen edges.

    To get more of an actual Photoshop-like Physical Media brush-stroke, is tougher. I don’t immediately know of a good way simple way to do that in After Effects.

    I’ve exaggerated the width of the outlines, I think it’s an important aspect of your reference Mario images

  • Filip Vandueren

    June 15, 2023 at 8:40 am in reply to: Weird Colour Artifacts with Colourama

    OK, the tricky part is this:

    you want to base it on Alpha, because the difference in opacity of the echoes is what you want to cause the different colors. But if you do that, After Effects also will interpret the pixels on the soft edges of each letter as different opacities, giving them different colors (the rainbow fringe)

    I think the best solution is having two layers:

    On the original text layer, you add a 1 pixel white outline, the echo, and the colorama.

    Duplicate the text layer, but you disable the outline and the colorama, and you use this as an alpha matte for the colorama layer: the rainbow fringes will now be hidden because the are 1 pixel outside of the matte.

  • Filip Vandueren

    June 15, 2023 at 8:19 am in reply to: Auto movement Y axis on outpoint

    Something along these lines:

    t1 = thisLayer.outPoint-framesToTime(20);
    t2 = thisLayer.outPoint;
    ease(time, t1,t2, value, value+[0,thisComp.height]);

    Or maybe ease() could be easeIn() or easeOut(), depending on the timing you want.
    If you need more control over the speed curve, then it can’t be done with a simple interpolation function.

  • Filip Vandueren

    June 14, 2023 at 6:19 pm in reply to: Weird Colour Artifacts with Colourama

    Yes, like I said: Alpha will guarantee there are rainbow fringes. You have to check that the white text doesn’t have a black outline. Set it to transparant, or white, not to 0 width. Because that’s actually 0,01 px and still enough to mix in a few slightly non white pixels which gets picked up by colorama.

    What are your actually trying to achieve? Because if everything is set up perfectly, you’ll just get red text 🙂

  • Filip Vandueren

    June 13, 2023 at 8:54 pm in reply to: Weird Colour Artifacts with Colourama

    Hey Michael, the Text is anti-aliased, and right now your Colorama is set up to color according to the intensity. I would only expect to see these artefacts if it was based on Alpha (because that’s where the anitaliasing is happening)

    This means that it is actually seeing some darker values in the edges of the text.

    My guess is that the White text has a very tiny black stroke of a pixel or even less. (even 0,01 will show up)

  • Filip Vandueren

    June 12, 2023 at 9:06 am in reply to: Replace words wrapped in asterisks with Bold

    Hi Jean-François,

    It’s unfortunately not yet possible to do a real font change of single words via expressions without doing a lot of complicated workarounds.

    Usually a text-animator is added that increases the stroke width of a selected word resulting in a “faux bold” look.

    Here’s a way to do it with text-animators:

    A first text-animator hides the asterisk symbols:

    • add a textanimator for scale
    • set the value to 0,0
    • remove the default range selector and replace it with an expression selector.
    • the amount property of that selector gets this expression:
    (text.sourceText.value.replace(/\r\n?|\n|\3/g,'')[textIndex-1]=="*") ? 100: 0;
    • Any asterisk will disappear, but they leave behind a blank gap that should be tightened, so also add a ‘tracking’ property to this same animator, and finetune it’s negative value, the exact value depends on your font and fontsize, for example Helvetica Neue light at 100pts needs about -36 tracking to remove the gap.
    • Now create the Faux bold look in a new Text-animator, with settings like for example:
      • Stroke Width: 4
      • Stroke Color: (explicitly set this to the same as the fill color)
      • Stroke Opacity: explicitly set to 100%
      • optionally a bit of positive tracking like +3,…
      • You could even finetune the scale and anchorpoint so the baseline and x-height of the characters stays the same eventhough they are now outline
    • remove the default range selector and replace it with an expression selector.
    • the amount property of that selector gets this expression:
    (text.sourceText.value.replace(/\r\n?|\n|\3/g,'').slice(textIndex-1).match(/\*/g)||[]).length % 2 ? 100 : 0;

    That should work, but again, it depends on the font and your settings if this looks OK, it’s still just a faux-bold solution.

    Some explanation on the expressions code:

    Text-animator ranges, when they are based on “characters”, start counting at 1 and don’t count linebreaks and soft-breaks as characters while Javascript strings do (ofcourse) count these as a characters and start from 0.
    So examining individual characters of the sourceText by directly using the internal counter of the expression selector (textIndex) is problematic.

    To combat that, I always first do a .replace(/\r\n?|\n|\3/g,”) to get a string that contains the sourceText without all (soft) linebreaks. Getting the [textIndex-1] item of that string, gives us the exact character the animator is evaluating.
    So if it is “*”, then (in the first animator) we want to fully apply the properties (100%) otherwise 0%. The properties are set up to hide the character (scale it to 0, and apply negative tracking to compress the gap)

    The second expression does the same linebreak -eplace, then looks at the substring (slice) of all the characters form the start of the string up to the current character.
    If an odd amount of “*” have occurred before the current character, we should be in bold, if an even amount of “*” have occurred, we shouldn’t be bold.

    The regexp .match() method returns a list of matches, so counting the length of that list and doing modulo %2 is a check for odd or even.

    But if there were no matches, the list is actually Null , and that doesn’t have a length so it would error the code.
    That’s why we add ||[] -> the result of the .match() OR an empty list. Null isn’t ‘true’ so this expression becomes an empty list in that case, and we can ask for the length of an empty list.

    if %2 is 1, we want to fully apply the properties of this animator (100%), otherwise 0. And the properties are set up to embolden the characters.

  • Filip Vandueren

    June 7, 2023 at 7:40 pm in reply to: Number of effects on a layer

    Hey Chris,

    this works I think:

    thisComp.layer("Black Solid 1")("Effects").numProperties
  • One way to do it: change to “based on index” instead of percentage, and animate for the ‘worst case scenario’: set keyframes that animate from 0 to 100 words, even if there are just a handful, Then if you add more words, the timing will be linearly proportional.

    Alternatively, an expression could look at the sourcetext, and calculate the percentage based ranges form that, which would work without keyframes.

Page 9 of 277

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