Forum Replies Created

Page 82 of 277
  • Mocha handles this very well as long as you can track other areas that are in the same plane and remain in view.
    So it would work for a picture frame on a wall if you include other parts of the wall in the track, but not so well for example a hand that’s moving out of frame.

  • Filip Vandueren

    August 18, 2020 at 1:36 pm in reply to: Set keyframe data on multiple layers from a CSV

    Something like this:

    csv:
    xfrom,yfrom,xto,yto
    476,379,197,475
    362,136,460,71
    491,5,414,317
    427,368,440,435
    …
    for 300 lines

    add the csv to a composition.

    select the csv-layer and then run this script:

    script:

    app.beginUndoGroup("300 dots");
    var comp = app.project.activeItem;
    l = comp.selectedLayers[0];

    var dotSize=[8,8];

    if (l && l.data && l.data.numProperties) {
    numDots = l.data(1).value;

    for (var i=1; i < numDots+1; i++) {
    fromPos = [ l.data(2)(1)(i).value, l.data(2)(2)(i).value];
    toPos = [ l.data(2)(3)(i).value, l.data(2)(4)(i).value];

    sh = comp.layers.addShape();
    el = sh("Contents").addProperty("ADBE Vector Shape - Ellipse");
    el("ADBE Vector Ellipse Size").setValue(dotSize);
    sh("Contents").addProperty("ADBE Vector Graphic - Fill");

    sh.transform.position.setValuesAtTimes([1,2],[fromPos, toPos]);

    sh.name = "dot "+i;
    }

    } else {
    alert("select .csv layer");
    }

    app.endUndoGroup();

    -> as manu shapelayers as lines in the csv with keyframes at 1second and 2 seconds

  • Filip Vandueren

    August 18, 2020 at 12:30 pm in reply to: Set keyframe data on multiple layers from a CSV

    Would the dots need to be created , or are these existing layers in your comp ?

    A script seems better for handling this many layers and data than an expression.
    Unfortunatley, scripts don’t have csv_parsing built in, but there are ways around that.

  • Depends, that would imply that the mask is only used for masking, could also be used for another effect (stroke, fill, reshape,…), or need to intersect with other masks,..
    Masks are also applied before effects while track mattes are applied after effects.
    So while track matting is a great tool in the arsenal, it’s not always an ideal replacement for masks

    It also doubles the amount of layers needed, which can be a drag. (Not that having every mask controlled by an expression is without its downsides…)

  • Put an Effect -> Expression Controls -> Point Control on your layer.

    Then give your mask’s Mask Path-property this expression:

    xy=effect("Point Control")("Point").value;
    createPath(points().map(pt=>pt+xy), inTangents(), outTangents(), isClosed());

    That would simply add the point’s x and y to every vertex.

    Alternatively, this version forces the mask to move so its center is around that point-control:

    xy=effect("Point Control")("Point").value;
    pts=points();
    avg = pts.reduce( (acc, pt) => acc+pt, [0,0]) / pts.length;
    pts=pts.map(pt=>pt+xy-avg);
    createPath(pts, inTangents(), outTangents(), isClosed());

  • Filip Vandueren

    August 15, 2020 at 4:39 pm in reply to: Use external text from csv file

    Maybe the problem is that the dropdownlist will only give you the number of it’s selection, not the actual string of that item.

  • Are all the lines on a separate layer ?

  • A compact Javascript way to add leading zeroes is to always add more than you need, then slice the string length to what you need from the right like this:

    (“00″+days).slice(-3);

    and

    (“0″+months).slice(-2);

    This works if you’re sure days is never more than 3 digits, months never more than 2
    Because for example
    (“00″+123).slice(-2)
    would return 23, not 123

  • Hi Tom, you can change the style of texts now with expressions, but only for the entire text-layer, not individual words. It is not supported (yet ?)

  • Filip Vandueren

    August 13, 2020 at 11:16 pm in reply to: Pause & continue to an expression

    Yes, sorry, problems with < and > characters.


    ch=effect("Freeze")("Checkbox"); // point to your checkbox
    n = ch.numKeys;

    // start-stop time variable adapted from Dan's Speed control integrator
    if (n < 2) {
    t=time * !ch.value;
    } else {
    t=ch.key(2).time * !ch.key(1).value;
    for(i=2; i < n ; i++) {
    if (ch.key(i).time > time) break;
    t+=(ch.key(i+1).time - ch.key(i).time) * !ch.key(i).value;
    }
    t+=!ch.value*(time-ch.key(i).time);
    }

    // fake loopOut(offset):
    if (numKeys>1 && t>key(numKeys).time) {
    k1 = key(1).time;
    knk = key(numKeys).time;
    delta = key(numKeys).value - key(1).value;

    // have to do stupid conversion to framenumbers because of % vs / rounding errors }:-(
    loopTime = timeToFrames(k1) + (timeToFrames(t-k1) % timeToFrames(knk-k1));
    loops = Math.floor(timeToFrames(t-k1) / timeToFrames(knk-k1));
    // now convert back
    l = valueAtTime(framesToTime(loopTime)) + (loops*delta);
    } else {
    l = valueAtTime(t);
    }

Page 82 of 277

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