Forum Replies Created

Page 57 of 277
  • Filip Vandueren

    April 5, 2021 at 8:48 am in reply to: Paragraph leading expression

    Hi Jamel,

    The value is correct: it is the height of the sourceText. But you need to multiply a layer’s sourceRect height by scale[1]/100 to get the actual pixel-size of the layer.

    And if the layer is parented, you also need to take into account the scale of parents etc.

  • Filip Vandueren

    April 3, 2021 at 8:41 am in reply to: Electromagnetic Field Visualization

    value*strength*d;

    And tweak strength.

    Or, if you want to fine tune and limit it, use a linear() function something like:

    linear(d, 0,960, 10,100);

  • Filip Vandueren

    March 31, 2021 at 6:02 am in reply to: Paragraph leading expression

    Hi jamel, “style” is the current layer’s style, in your case it needs to be the other layer’s style.

    so the final line should be:

    txt.style.setFontSize(fs).setAutoLeading(false).setLeading(ld).setText(txt);

  • Filip Vandueren

    March 25, 2021 at 7:59 am in reply to: Text highlight (expression selector)

    So again to clarify: it doesn’t let another expression see inside the expression code of another property, but it’s a way to format the resulting string-value of a sourceText expression into something another expression can easily interpret.

  • Filip Vandueren

    March 25, 2021 at 7:57 am in reply to: Text highlight (expression selector)

    Hi Yoan,

    I use it to precompute some values in a text-layer, and then use the output of that textlayer as data in another expression.

    If the result of a textlayer is just string we need to use, or a number, then you can simply get the value or value.parseFloat() of the textlayer, but in some cases you want to precompute a list of values or a list of key/value pairs.

    a JSON type object is ideal for this.

    So the expression on my precompute text layer ends with JSON.stringify(myStuff);

    -> this turns the object or list of data I have into “readable/parseable” sourcecode including brackets, quotes,…

    And where I want to use that information, I do JSON.parse(textlayer.text.sourceText.value) to “read” the generated sourcecode of the data object, and so the data becomes part of the expression.

    Before the new Javascript engine, the alternative was to use eval(), which can do even more (it can actually execute functions and statements, not just import a data object)

  • Filip Vandueren

    March 22, 2021 at 3:21 pm in reply to: Using Layer Space Transforms Without a Layer?

    doesn’t toWorld() and fromWorld() work for this ?

  • Filip Vandueren

    March 19, 2021 at 5:23 pm in reply to: Dots to assemble a map

    Definitely take a look at Pastiche, it’s a very handy plugin to automatically place hundreds of layers within a shape.

  • Filip Vandueren

    March 18, 2021 at 9:28 am in reply to: Paragraph leading expression

    Here’s a small adjustment that will support auto leading:

    txt=text.sourceText;
    fs= txt.style.fontSize * 1000/effect("boxWidth")("Slider");
    ld = (txt.style.autoLeading ? fs*1.2 : txt.style.leading * 1000/effect("boxWidth")("Slider"));
    style.setFontSize(fs).setAutoLeading(false).setLeading(ld);
  • Filip Vandueren

    March 18, 2021 at 9:25 am in reply to: Paragraph leading expression

    Hi Jamel, try this:

    txt=text.sourceText;
    fs= txt.style.fontSize * 1000/effect("boxWidth")("Slider");
    ld = txt.style.leading * 1000/effect("boxWidth")("Slider");
    style.setFontSize(fs).setAutoLeading(false).setLeading(ld);

    Important: if you want to change leading or fontsize in the character palette, also first disable the sourceText expression!

    you can do it all in code too like this for 60/90 size/leading:

    txt=text.sourceText;
    fs= 60 * 1000/effect("boxWidth")("Slider");
    ld = 90 * 1000/effect("boxWidth")("Slider");
    style.setFontSize(fs).setAutoLeading(false).setLeading(ld);

  • Filip Vandueren

    March 12, 2021 at 4:10 pm in reply to: Right to left, top to bottom opacity animator

    Hi Andrei, it appears to be a bug or at least an oversight in the text animators.

    Let me think about a clever solution…

Page 57 of 277

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