Forum Replies Created

Page 2 of 32
  • Xavier Gomez

    May 25, 2017 at 7:38 am in reply to: Script onDraw Button ‘mouseup’ not triggered

    You can use a ui element of type ‘customView’ (the constructor name is : Custom)

    myBtn = myContainer.add(“customView”);

    or, within a resource string:

    res = “group{…,\
    myBtn : Custom{type: ‘customView’},\
    ….
    }”;

    They can be attached all sorts of mouse event listeners, nothing broken.
    But i think that if instead you take the ‘customButton’ type, ‘mouseup’ and ‘click’ are also broken.

    Xavier

  • Xavier Gomez

    May 23, 2017 at 11:48 am in reply to: item arrange script

    It’s a bit strange that the findPrecomps function calls moveToFolder().

    One would expect that the findPrecomps function returns an array of precomps (your function returns nothing), and that the moveToFolder function is called on the result of findPrecomps(), something like:

    moveToFolder(findPrecomps());

    Xavier

  • Xavier Gomez

    May 23, 2017 at 10:32 am in reply to: item arrange script

    The line : moveToFolder (curItem, findPrecompFolder ()) … is very wrong, because moveToFolder 1st argument is an array and you pass it a project item object, and also because you run the findPrecompFolder () as many times as there are comps in your project, while you only need to find it once (for a big project with thousands of items this would be extremely slow).

    Xavier

  • Xavier Gomez

    May 23, 2017 at 9:20 am in reply to: Advanced Time Expresion

    This should work:

    t0 = inPoint;
    period = 19; // frames
    spinDur = 4; // frames
    phase = 2; // frames

    t = timeToFrames(time-t0)-phase;
    n = Math.floor(t/period);
    t%=period;
    if (t<0) t+= period;

    n*360 + ease(t, 0, spinDur, 0, 360);

    Xavier

  • It’s not.

  • Xavier Gomez

    May 5, 2017 at 6:14 pm in reply to: Circle Chart – Expression

    Edit: forgot to mention that in the above expression, indexMax and radiusMax would depend on your slider control, again through a linear expression.

  • Xavier Gomez

    May 5, 2017 at 6:11 pm in reply to: Circle Chart – Expression

    It’s hard to give an explicit expression without knowing more about your setup, but it should be close to something like this:

    radiusMin = 50;
    radiusMax = 250;
    indexMin = // index of the layer closer to the center
    indexMax = // index of the external layer
    i = thisLayer.index; // index of this layer

    linear(i, indexMin, indexMax, radiusMin, radiusMax);

    Xavier

  • Xavier Gomez

    April 27, 2017 at 4:05 pm in reply to: Shape layer hierarchy confused

    In :

    thisLayer.content(“Group 2”).content(“Rectangle 1”).transform.opacity;

    you “get down 6 times” to go from the Layer to the Opacity.
    (Layer –> Contents —> “Group 2” —> Contents —-> Rectangle 1 —-> Transform —> Opacity

    Hence, the other way round, you need to climb up 6 times to go from the Opacity to the Layer.

    One thing to know is that every Shape Group inside a shape layer has a “Contents” and a “Transform”
    (similarly to the layer itself having a Contents and a Transform)
    The “Contents” step is hidden in the UI though, but it is still there somehow and must be accounted for.

    Xavier

  • Xavier Gomez

    April 27, 2017 at 12:55 pm in reply to: Shape layer hierarchy confused

    Maybe this:

    thisProperty.propertyGroup(6).content(“Group 2”).content(“Rectangle 1”).transform.opacity;

    or :

    thisLayer.content(“Group 2”).content(“Rectangle 1”).transform.opacity;

    Xavier

    thisProperty.propertyGroup(5)(“Group 2”).content(“Rectangle 1”).transform.opacity; would also work, but less clear imo.

  • I messed up my previous post. “var idx1 = myFx1.name;” should actually be:

    var name1 = myFx1.name;

    Xavier

Page 2 of 32

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