Forum Replies Created

Page 11 of 16
  • Well, apparently that’s how it works.
    Shape layer’s boundaries don’t match comp boundaries but it does have the same size: it’s a 1920*1080 rectangle with top-left corner in the center of the comp.

    BTW, text layer is the same: it has the size of the comp and by default (when you double click on text icon) its top-left corner is in the center of the comp with zero anchor.

    I could speculate that layers with variable Source Rectangle like texts and shapes are this way for convenience of dealing with point of origin: if you don’t manually change anchor point it will mark the origin.
    Layers with fixed Source Rectangle like solids, nested comps, footages don’t need that cause origin is always marked as Source Rectanlge’s top-left corner.
    But those are just my guesses and lyrics.

    In the end of the day, all layers have it’s origin in their top-left corner and anchor point coordinates are giver with respect to it. The thing that differs is Anchor Point and Position default values.

  • Since a reference to non-existent property raises an exception, you can use try-catch:

    var someVar;
    try{
    someVar =thisComp.layer("SOURCE").effect("Face Track Points")("Right Pupil");
    }
    catch(err){
    someVar=[0,0];
    }

  • Oleg Pirogov

    March 5, 2019 at 1:21 am in reply to: Multiple versions of AE crash!!

    The last time I had smth like that was when I had a path value copied to a clipboard.
    That is cured by copying anything else to clipboard.

  • Oleg Pirogov

    March 5, 2019 at 1:17 am in reply to: Checkbox Control

    Perhaps I’m missing something, but is it thisComp you are looking for? Like
    if(thisComp.layer("Null 1").effect("Checkbox Control")("Checkbox")> 0) {100} else {0}

  • The usual workaround to get the number of lines is to divide sourceRect height by line height: https://forums.creativecow.net/thread/227/40793

    But since you are interested in sourceRect itself, you may duplicate your text layer and apply Animator for Character Value = 1 with Expression Selector textIndex<=4 ? 0 : 100 based on lines.

    What it does is it replaces all characters in lines after [for ex.] 4th with #1 Unicode character which is not displayed in AE (in your system too, hopefully). Effectively it means that only first 4 lines are displayed with sourceRect adjusted accordingly.

  • Oleg Pirogov

    March 4, 2019 at 3:27 pm in reply to: Number counter expression

    Yeah, it’s effect(“Slider Control”)(“Slider”).value
    This should work:

    function numberWithCommas(x) {
    var parts = x.toString().split(".");
    parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
    return parts.join(".");
    }

    var num = effect("Slider Control")("Slider").value
    num = numberWithCommas(num);
    [num]

  • Oleg Pirogov

    March 4, 2019 at 2:48 pm in reply to: Number counter expression

    Can you post the whole expression?

  • Oleg Pirogov

    March 4, 2019 at 1:58 pm in reply to: Number counter expression

    It’s an alternative to your function, so:

    function numberWithCommas(x) {
    var parts = x.toString().split(".");
    parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
    return parts.join(".");
    }

    var num = effect("Slider Control")("Slider")
    num = numberWithCommas(num);
    [num]

  • Oleg Pirogov

    March 4, 2019 at 1:30 pm in reply to: Number counter expression

    This:
    var parts = number.toString().split(".");
    gives you an array [‘1213′, ’37’], so you can apply your comma-separating function to parts[0] getting [‘1,213′, ’37’] and then rejoining them with:
    parts.join(".");

    Just for a reference, a regex code which does what you want:
    function numberWithCommas(x) {
    var parts = x.toString().split(".");
    parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
    return parts.join(".");
    }

    which I’ve found here: https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript

  • Oleg Pirogov

    March 3, 2019 at 3:44 am in reply to: Multiply Position; “Must be a scalar”

    Well, cause one of the arguments of * operation ‘must be a scalar’. Smth like that would work in Python but not in Javascript.

    [a[0], a[1]]*[1, -1] = [a[0], a[1]*(-1)] is element-wise multiplication. It exists in JS’s as math.dotMultiply(x, y) but is not implemented in AE’s expressions.

Page 11 of 16

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