Forum Replies Created

  • Junior Ramos

    August 29, 2021 at 3:29 am in reply to: Break line expression to fit comp width

    Well,
    to create a paragraph text you need just set an “addBoxText”.
    The problem is that in the docs (https://ae-scripting.docsforadobe.dev/layers/layercollection/?highlight=addboxtext#layercollection-addboxtext) the “text” parameter is missing, and without it won’t work.

    So, to add point text:
    myTextLayer = comp.layers.addText(text);

    And for paragraph text:

    myTextLayer = parentComp.layers.addBoxText([width, height], text);

    Hope it helps anyone with the same problem.

  • Junior Ramos

    August 29, 2021 at 2:02 am in reply to: Break line expression to fit comp width

    Hi.

    thanks for the reply.

    I’m creating the text layer and inserting the text all by script.

    I could split at some white space or insert the \r. But one line can have 2 words and 7, then how to know when and where to break the line?

    The problem is that I just can see if the line is too long after seeing the screen.

    I’d like something similar to the auto-scale using expression but in this case the text size changes by each line and it’s not what I want.

    I need some simple way of restricting the textbox to the comp width, and once the text reaches this dimension, it breaks the line and so on.

    But I can just figure out a complicated one using a bunch of expressions.

  • Don’t know if I got the point.
    What do you mean by the Select, hold Alt replace method?

    Selecting the environment from an external file and replacing it in its location with another, renaming it, works as I expect. But since I’m working on a template I’d have to assume that the user has an external file (or could only work with an external file). And this isn’t exactly what I want.

  • Hi Graham.

    No, this would not solve.

    What I need is to link the environment set up between two or more layers.

    But in the properties controls from Element3D layer, you don’t have access to the environment you choose (e.g.: a great room, or an open landscape) you can access only some environment relative properties.

    I asked VideoCopilot support also, and they said that it’s not possible.

    You can check another discussion about this here (https://community.adobe.com/t5/after-effects/element-3d-apply-scene-setup-settings-to-different-element-3d-layers/m-p/12157839#M175214).

    Thanks anyway.

  • Hi Andrei.

    It worked.
    Besides using the method recursively for the case of CompItem, I think that the thing is to set the layer outPoint for the CompItem layer.
    But it still weird, because for that case I was setting the outPoint for my comps before calling the method.
    Thanks for the help anyways.

  • Yes. All the layers are extended also, ad I’m not using time remapping.
    And the problem occurs only with comp layers that already exist in the project or the timeline when I tried to extend the duration.
    If I create a comp by script setting the duration, it works normally.
    And is recreating the comps via script what I’m doing as a workaround for this.

    Below is the method that I use to loop through all the layers inside a comp.

    function setLayersDuration(comp, durationValue){
    comp.duration = durationValue;
    comp.startTime = 0;
    comp.outPoint = comp.inPoint + durationValue;
    for(var j=1; j<=comp.layers.length; j++){
    var layer = comp.layers[j];
    if (layer instanceof CompItem){
    $.writeln('we have a CompItem');
    // layer.source.duration = durationValue;
    layer.source.duration = durationValue;
    } else {
    $.writeln('we have a layer');
    layer.outPoint = layer.inPoint + durationValue;
    }
    }
    }

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