Forum Replies Created

Page 24 of 32
  • Xavier Gomez

    August 21, 2013 at 11:09 am in reply to: Mask size(width x hight)via script

    Hello,

    this is a draft version.
    Only few tools work and the code needs serious cleaning. Hopefully though, it can still help since the “box” tool is done: you can get the bounding box info by pressing the “?” button, or draw the bounding box on a new mask by pressing the “right arrow” button.
    Suggestions Welcome.

    Xavier.

    Unzip and drop the jsxbin + the icons folder in the ScriptUI Panels folder (not just Scripts, it won’t work). There is no debug yet in case the script cant’ find the icons. Also the script uses onClick events for Images: it works in Windows7/AE-CS5.5 but i’m not sure it does in all Platforms/AE versions.
    6433_maskbox.zip

  • Xavier Gomez

    August 20, 2013 at 7:08 pm in reply to: Mask size(width x hight)via script

    Actually i’m writitng a script that does things like this. I started a week ago or so, it’s not finished and i was wondering if it would be of any use. The tools include ‘draw b.box’ (on a new mask), align masks (similar to align layers), fit masks to something else (layer or the bbox of another mask), scale(%)/resize(px), rotate, flip, move to specific location, etc. At the moment most ui buttons wont work but the box one does.

    If you think it can help you i can try to make some fast clean up and post the current version.

    Xavier.

  • Xavier Gomez

    August 20, 2013 at 3:18 pm in reply to: Mask size(width x hight)via script

    Hi.

    You can press the “Shape…” text in front of the MaskPath property of the mask. It will show the coordinates (left, top, right, bottom) of the mask bounding box that is used for the “Free Transformations”.

    However the term “bounding box” is a little bit abusive since it is not the actual bounding box of the mask, but that of its control polygon (the smallest rectangle containing all the vertices and the tangents extremities).
    If your mask is simple enough (eg one of the template shapes of AE, or if all the tangents are null) the two “bounding boxes” will coincide, otherwise the one displayed by AE is bigger (and not very useful…)

    Now if you need the info in real time for use in an expression, it is possible but quite complicated and very slow.

    Can we know what you need it for ?

    Xavier.

  • Hi, i tried your code and it didnt work in CS5.5. I don’t know what the 3rd argument [“”] is supposed to be.
    However it does work with a ressource string:

    var layerList = myPanel.add("listbox{bounds: [0, 0, 150, 180], properties:{multiselect:false, numberOfColumns:3, showHeaders:true, closeButton:true, columnTitles: ['#', 'Layer Name', 'Duration' ], columnWidths: [20,80,40]}});

    Xavier

  • Xavier Gomez

    August 15, 2013 at 3:02 pm in reply to: Keeping linked scale positive

    hmm i’m really sorry. I was mostly answering the second question and didnt pay enough attention to the first one. This one is hopefully working better.

    s=comp(“Comp Name”).layer(“Layer Name”).transform.scale-index*[1,1];
    [Math.max(s[0],0), Math.max(s[1],0)];

    Xavier.

  • Xavier Gomez

    August 14, 2013 at 10:25 pm in reply to: Bal bouncing on floor

    It depends where you set the anchor points of the two layers (ball and floor), and particularly of the ball. And the choice depends on what to do after (is the ball spinning, is it squizzed when hitting the ground ?) For spinning you would set the ball’s anchor at its center, for squizzing/stretching at its bottom. None of that is fine, bot is “hard”…

    In the expression from your book, apparently the floor’s anchor should be on its top edge, and the ball’s anchor at its center. Also to account for an eventual change of scale you should change height by height*scale[1]/100;

    There are plenty of bounce expressions on MotionScript: https://www.motionscript.com/articles/bounce-and-overshoot.html.

    Xavier.

  • Xavier Gomez

    August 14, 2013 at 9:44 pm in reply to: Keeping linked scale positive

    I suppose you havent copied your expression properly in your first post and apparently you repeated it in your project.

    Scale is a 2D (or 3D) array, index is a number. So your original expression would have been
    comp("Comp Name").layer("Layer Name").transform.scale-index*something where ‘something’ is something only you can know what it was, but for sure an array of numbers. Probably [1,1].

    Xavier

  • Xavier Gomez

    August 11, 2013 at 11:12 pm in reply to: Keeping linked scale positive

    To get only positive values, you can do:
    x = (your expression);
    (x>0) ? x : 0; // equivalent to Math.max(x,0)

    For the other part, one way is to name your first layer “LEADER”, the last in the stack: “TAIL”, add 2 nulls, one called “Lead ctrls” and the other “Tail ctrls”, then paste this expression to every item’s scale in the stack

    leader = thisComp.layer(“LEADER”); leadctrls = thisComp.layer(“Lead ctrls”);
    tail = thisComp.layer(“TAIL”); tailctrls = thisComp.layer(“Tail ctrls”);
    linear(index, leader.index, tail.index, leadctrls.scale, tailctrls.scale);

    Then adjust the 2 nulls scales. It works the same way with other transform properties.

    Xavier.

  • propertyIndex is simpler: 4 for height, 5 for width.
    Change exEffect02(“Scale Height”) with exEffect02(4) (or exEffect02.property(4)), similarly for width. It will work in any situation and even in languages other than english if you plan to release it.

    Xavier.

  • The display name of the 2 scales properties change when you enable/disable uniform scale.
    If you change your alert to alert([exEffect02(4).name, exEffect02(5).name]) you get “Scale, “,
    but this gives AE some time to actualise the properties names and the script runs normally afterwards.
    If instead of alert you use $.writeln, “Scale, ” is displayed on the console but the names are not actualised and you still get an error.
    One can also try:
    exEffect02("Uniform Scale").setValue(false); //
    exEffect02 = thisLayer("Effects")(thisLayer("Effects").numProperties);
    $.writeln([exEffect02(4).name, exEffect02(5).name]);

    It doesn’t work: AE doesnt re-read exEffect02 (“Scale, ” is displayed);

    So, if you just want your script to be able to run, use propertyIndex or matchName instead of name.

    But if you have already realised all that and would like to know why the names are not properly actualised while the script is running, then sorry i don’t know (and i would also like to know).

    Xavier

Page 24 of 32

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