Skip to main content
krisenc
Participant
May 14, 2018
Answered

Keep strokes with trim paths in a comp constant regardless of scale?

  • May 14, 2018
  • 1 reply
  • 626 views

So I’m creating an animation with illustrations that have many animated strokes using trim path. Ive comped these Illustrations and would ideally like to scale the whole comp. However this obviously causes the strokes to scale up and down with the comp.

Adding the strokes to solid layers with masks instead of shape layers seems to solve the scale issue but then I don’t have the option to trim path animate the masks.

Anyone have a solution to this? Is there another method of adding scaling strokes that allows trim path or is there an expression to scale the strokes contained in a comp based on the scale value of the comp?

    This topic has been closed for replies.
    Correct answer Mylenium

    Sure. A simple linear(driver,driverMin,driverMax,drivenMin,drivenMax) expression can do it where "driver" is the scale of the layer in the parent comp. Ex.:

    mScale=comp("XYZ").layer("ABC").transform.scale[0];

    linear(mScale,100,200,5,2)

    Simply fill in the values as needed.

    Mylenium

    1 reply

    Mylenium
    MyleniumCorrect answer
    Legend
    May 14, 2018

    Sure. A simple linear(driver,driverMin,driverMax,drivenMin,drivenMax) expression can do it where "driver" is the scale of the layer in the parent comp. Ex.:

    mScale=comp("XYZ").layer("ABC").transform.scale[0];

    linear(mScale,100,200,5,2)

    Simply fill in the values as needed.

    Mylenium

    krisenc
    krisencAuthor
    Participant
    May 14, 2018

    Hi Mylenium. Thanks for the help! Unfortunately I have limited experience with expressions. This is the format of my test file:

    main (comp) > path (comp) > shape (shape layer).

    I've applied the expression to the Scale property of "path" like so:

    mScale=comp("path").layer("shape").transform.scale[0];

    linear(mScale,100,200,5,2)

    This gives me an error stating "expression result must be of dimension 2, not 1".

    Probably missing something real basic here, but would appreciate it greatly if you can help me out further!

    Jose Panadero
    Community Expert
    Community Expert
    May 14, 2018

    Hi Krisenc

    You can do it modifying the paths instead of using the scale parameter. Use the Quick Search Field in the Timeline and type PATH with your layer selected. All the paths for your shapes will be shown. Then, select every single path parameter and use CTRL(Win)/COMMAND(Mac)+T to use the Free Transform Points toll. Then, if you change the size of the paths, the width of your strokes will remain constant and your trim path animation will be preserved. Take a look at the screen capture and ask if you need further assistance. This needs to be done into the precomp.