Forum Replies Created

Page 17 of 32
  • Yes it does make sense and i also understand that you try to build something like this for the reasons you said.

    But i think it is not a good direction, and even if you succed (honestly, i don’t see how) it would be so heavy that things won’t move.

    Your idea assumes driving, from a unique layer, a configuration of points (all the pins controlling one character) that normally (1) belong to layers that move with respect to each other, and (2) even pins that belong to the same layer can move with respect to eachother.
    Needless to say, you’ll need far more point controls than just head/torso/etc/
    Missing: all layer positions and anchorPoints, which are otherwise automatically handled by parenting to nulls.
    Then you’ll need a bunch of home-made transform expressions to reproduce the rig on this control layer, not only the pins relative transformations but also the layers relative transformations, and then undo everything with another bunch of layer.fromComp(controlLayer.toComp(point)) expressions to actually drive the art layers transformations and pins positions. It might be that i am exagerating the complexity, but it seems hopeless to me.

    Another thing which is easier to explain is that to encode over time a rotation around some point + a translation you need an angle, an anchor (center of rotation) and a position (related to the translation part of the thing), so 2 points and one angle. If you only specify one point (interpreted either as position or anchorPoint) you will miss some info.
    This is to explain (does it ?) why the child does not follow the parent when you move the parent.

    Xavier.

  • Xavier Gomez

    March 19, 2015 at 3:02 pm in reply to: Script mask shape to motion path

    Edit : if you already know that the property is 2D or 3D, you can also use p.value.length (the length of the value array). It’s clearer/faster.

  • Xavier Gomez

    March 19, 2015 at 2:59 pm in reply to: Script mask shape to motion path

    Use the propertyValueType attribute (see AE scripting guide at the “Property” section):

    p is a 2D property <====> p.propertyValueType === PropertyValueType[p.isSpatial ? “TwoD_SPATIAL” : “TwoD”];

    p is a 3D property <====> p.propertyValueType === PropertyValueType[p.isSpatial ? “ThreeD_SPATIAL” : “ThreeD”];

    Note that the dimension is not the same for expression and for scripting.
    In expression context, the position property is 2D for 2D layers, but for script it is always 3D.

    Scripting tolerates setting a 2D value in a 3D spatial prop, but there is no tolerance for spatial tangents and for temporal ease, so before setting spatial tangents and/or keyframease you really have to check the dimension.

    Xavier.

  • Xavier Gomez

    March 19, 2015 at 1:45 pm in reply to: Script mask shape to motion path

    Well, the original post was to copy of shape to a motion path in a position property, and position properties are 3D (even for a 2D layer). If you are copying to a true 2D property like a point control, then skip the part that imbeds 2D to 3D, ie that line:

    for (var k=0; k < numVerts; k++) inTan [k][2] = outTan[k][2] = 0;

    (remove it).

  • Xavier Gomez

    March 19, 2015 at 7:57 am in reply to: Script mask shape to motion path

    times is not an array of the form [minTime, maxTime] but an array of the form [keyTime(0), keyTime[1],…, keyTime[numVerts-1]]: as many keyframes in the position property as vertices in the shape.

    For instance:
    var step = 2/(numVerts-1);
    for (k=0; k<numVerts; k++) times[k] = k*step;

  • Hi Dustin,

    my answer was to help out for the rotation part.
    For the entire problem, i must say i don’t know, and actually i don’t understand it.

    So let’s say you have 2 point constrols or similar on a layer, C1 and C2. You apply your “rig” (a set of expression controls, with one point “P”, an angle “R” and may some other params like scale) on the same layer, and once set, when you move P, C1 and C2 move along, when you change R, the two children rotate around P, and may be also, if you change the scale params, the point configuration will scale out from P, and so on. Is that it ?

  • To rotate C around P by angle a (in radians):
    u=sub(C, P);
    c=Math.cos(a);
    s=Math.sin(a);

    x = c*u[0]-s*u[1];
    y = s*u[0]+c*u[1];

    [P[0]+x, P[1]+y]; // result (rotated C)

    That’s only valid in 2D if P and C’s coordinates are expressed in the same referential (for instance, point2D controls on the same layer).

    If they are not in the same referential, you should use the fromComp and toComp methods to convert back and forth to the same referential. And in 3D it is slightly more complicated.

  • On this site there is no forum dedicated to AE scripting,
    but elsewhere there is:
    https://forums.adobe.com/community/aftereffects_general_discussion/ae_scripting
    and (not super active but still helpful):
    https://aenhancers.com/

    Edit: forgot to say, there are scripting threads in the expression forum, and if you post here you’ll get an answer if someone knows…

    Xavier.

  • Xavier Gomez

    January 29, 2015 at 6:44 pm in reply to: Custom Scrollbar

    There is no no predefined property to show/hide the step buttons.

    Maybe use a Slider instead ?

    On AE CC the step buttons have disappeared though, and it’s not possible to show them !!

  • Xavier Gomez

    January 29, 2015 at 3:28 pm in reply to: Script to export PNG

    you forgot the “=”.

    // store old value
    var oldResFactor = comp.resolutionFactor;

    // set [1,1]
    comp.resolutionFactor = [1,1];

    /* DO STUFF WITH THE COMP */

    // at the end, restore the old value:
    comp.resolutionFactor = oldResFactor;

    Xavier

Page 17 of 32

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