*If you don't want to use nul apply* alt-click on the stopwatch icon of the stroke width and paste this into the expression field: value = value/(transform.scale[0]/100); (it will link the scale value of your layer to the stroke width)
Thanks, good tip. Heads up - when copying expressions you can right-click the property and select 'Copy Expression Only', then select the remaining properties and paste.
2021 Edition: Simply alt-click on the stopwatch icon of the stroke width and post this into the expression field: value / length(toComp([0,0]), toComp([0.7071,0.7071])) || 0.001; Done!
Is this because the expression language in AE changed? Or is it shorthand version? Asking because I know nothing of programming and I am still using the 2018 version.
This is a great workaround - thank you! With how much this is used you would think that Adobe would have implemented a solution by now. Although the expression works great, it more than doubles my layers since every single shape needs a Null Object. And, if I want to attach the parent null to another null, I have to copy the layer, split the two, and then parent it to another null.
thanks! but holy crap! can something SO simple in every other program really be SO convoluted in AE? you'd think adobe would have by now implemented a "maintain stroke width" check box
Yeah it's kind of dumb actually that it's not in there. Luckily this tutorial works but I agree Adobe should make more of these little things just standard in After Effects with a checkbox or something. But anyway, thanks for watching! :)
I believe this happens because AE uses scale as the size property, since you don't get the chance to use absolute width and height values. It annoys me that the same happens with the text size as well.
Probably because it's not so convoluted as this makes it out to be. You don't need any expressions to do this. Jut put all your paths in groups within the Shape Layer, and put your strokes below (after) anything you're wanting to scale. Then use the group transform controls instead of the layer transform controls.
That's a nice solution but it does't work if i want to scale something unproportionally. Do you have something on mind how this could be fixed - maybe just a minor change to the expression? I would really appreciate your help. I'm experimenting on a hairline typeface which can be given thickness by text shape and therefore stay monolinear when extended/condensed.
Hey! If you want to scale something unproportionally, I think you can change the '100' number to something else to do this. You can experiment with that a bit, maybe that will do the trick :)
So apparently, this method, and the '2021 Edition' mentioned below, only Works when you scale the object proportionally. So if i want to scale an object like a square for example, and transform it a into rectangle, the stroke width will not stay the same. Bummer.
Hey thanks for this one. But one more question : I am using sliders on the parent's null object (instead of the transform option) to scale my shape. Is there an other expression for that? Thanks a lot **
Do you have any idea how to adjust the expression to maintain the stroke width when the shape layer is scaled down and the proportion parameters are unlinked?
@@vfdifwfeljsvfghdf2054 Yeah you can ignore that message. In your expression you divide by the scale. Dividing by 0 is impossible so the error pops up. but if the scale is 0, the object won't be visible, so no problem there. Cheers!
please help! im new to ae and last week it was working fine and when i came back now, i cant scale! i can add a keyframe but i cant see the robot thing the slanting line thing near the layer or photo, is it a window, that thing on the right side of ur layer, (layer name) (robot like thingy) (bullet like thingy) (slanting line) and the fx they arent in my ae please help! i need ur help asap! T^T i cant see any tutorials on how to fix it or stuff! please help!
Hey! You need to right click on the bar above your layers (where it says 'Layer Name' and 'Mode' etc) and then you can turn those icons back on! Right click and then go to: Columns -> Switches. That should do it :)
*If you don't want to use nul apply*
alt-click on the stopwatch icon of the stroke width and paste this into the expression field:
value = value/(transform.scale[0]/100);
(it will link the scale value of your layer to the stroke width)
got to tattoo this to my forearm! literally every day I'm here because I can't remember these clever lines of code :)
or even
value = value/(transform.scale[0]/100);
is negativ/downscaling also covered by this expression?
ps. negativ and unproportional
you're a life-saver, many many thanx
Thanks, good tip. Heads up - when copying expressions you can right-click the property and select 'Copy Expression Only', then select the remaining properties and paste.
Thanks for watching and for the tip! :)
Thank you so much for this tutorial. I've been stuck on this for two days and this helped me finally solve the issue.
2021 Edition: Simply alt-click on the stopwatch icon of the stroke width and post this into the expression field:
value / length(toComp([0,0]), toComp([0.7071,0.7071])) || 0.001;
Done!
Is this because the expression language in AE changed? Or is it shorthand version?
Asking because I know nothing of programming and I am still using the 2018 version.
well done sir! why on earth adobe just done help out and give us a tick box for stuff like this i dont know
THANKS!!!!!! I had problem with negative scales values and your expression fixed it!
This is a great workaround - thank you! With how much this is used you would think that Adobe would have implemented a solution by now. Although the expression works great, it more than doubles my layers since every single shape needs a Null Object. And, if I want to attach the parent null to another null, I have to copy the layer, split the two, and then parent it to another null.
thanks! but holy crap! can something SO simple in every other program really be SO convoluted in AE?
you'd think adobe would have by now implemented a "maintain stroke width" check box
Yeah it's kind of dumb actually that it's not in there. Luckily this tutorial works but I agree Adobe should make more of these little things just standard in After Effects with a checkbox or something. But anyway, thanks for watching! :)
I believe this happens because AE uses scale as the size property, since you don't get the chance to use absolute width and height values. It annoys me that the same happens with the text size as well.
illustrator has that function
Probably because it's not so convoluted as this makes it out to be. You don't need any expressions to do this. Jut put all your paths in groups within the Shape Layer, and put your strokes below (after) anything you're wanting to scale. Then use the group transform controls instead of the layer transform controls.
@@CampKeyframetutorials not for me sadly :(
Lifesaver. This is a game changer. Thank you!!!!
Thank you for this tutorial! It really helped me. And also - your dutch accent, it's so beautiful, love it!
Лучший дядь, обнял, поднял, покружил
INCREDIBLY HELPFUL PROBLEM FIXED THANK YOU
Thank you so much! Your tutorial saved my skin on a project this evening. Exactly what I needed. Cheers!
Great. Very helpful. Thank you.
Very happy I found this channel. Keep up the great work!
Thanks for watching! :)
Thank you! Worked perfect for my project
Thanks, you really helped me for my project :)
That's a nice solution but it does't work if i want to scale something unproportionally. Do you have something on mind how this could be fixed - maybe just a minor change to the expression? I would really appreciate your help. I'm experimenting on a hairline typeface which can be given thickness by text shape and therefore stay monolinear when extended/condensed.
Hey! If you want to scale something unproportionally, I think you can change the '100' number to something else to do this. You can experiment with that a bit, maybe that will do the trick :)
Instead of animating the scale you can animate the Size property.
@@AmobeTv This is okay if you don't have something parented to the layer.
3 years too late but :
sfx = thisComp.layer("control").transform.scale[0]/100;
ovx = value[0];
nvx = ovx / sfx;
sfy = thisComp.layer("control").transform.scale[1]/100;
ovy = value[1];
nvy = ovy / sfy;
[nvx,nvy]
@@clemcast2852 “The result cannot be converted to a numeric value ”in the first line, how to resolve it?
DUDE THANKS A LOT! You literally saved me
Awesome! You're welcome :)
Thank you ! It's very helpful :)
You are a life saver.....thanks a lot
Yes! Glad I could help! :)
Well that worked brilliantly! Thanks!
Nice! Good to hear :)
Thanks mate!
Thanks for watching! :)
Thanks!
My problem solved 🙂
Great! :)
thank you for this quick expression tutorial
You're very welcome! And thanks for watching :)
Woa! Thank you so much for this tutorial!
You're very welcome! :)
Really useful, thank you!
Awesome, thanks! :)
So apparently, this method, and the '2021 Edition' mentioned below, only Works when you scale the object proportionally. So if i want to scale an object like a square for example, and transform it a into rectangle, the stroke width will not stay the same. Bummer.
Amazingg!!
Thank you so much you saved me with that Expression!
Awesome! Thanks for watching :)
great tutorial!
Very cool, but trying to figure out how to maintain stroke weight on a 3D object rotating on Y axis. C4D lite?
Thanks! You really help me!
Awesome! Good to hear :)
thanks
You're welcome :)
right button mouse click in expression parameter -->> copy expression only --> Then, select ALL the stroke width -->> edit / paste (or cmd+V)
More easily than one by one.. alt+click cmd+v... alt+click cmd+v... alt+click cmd+v... alt+click cmd+v...
alt+click cmd+v...
alt+click cmd+v...
alt+click cmd+v...
alt+click cmd+v...
alt+click cmd+v...
alt+click cmd+v...
alt+click cmd+v...
Thanks dudeeee
You are very welcome :)
Thanks so much man!!
You are welcome! :)
kan je hierna ook nog een slider control toevoegen aan de nul layer om de stroke width van alle slaved layers te wijzigen? zo ja hoe?
simple but nice
Thank you :)
will it work when we use on 3d layer and camera movements?
THANKS SO MUCH!!!
You're very welcome! :)
magic thank you
You're welcome! :)
is there a faster way?
omg i love you so much
you just made me level up my design so much
@@eti360 Thank you so much for watching :)
Hey thanks for this one. But one more question : I am using sliders on the parent's null object (instead of the transform option) to scale my shape. Is there an other expression for that? Thanks a lot **
does it only work for shape layers? I'm working with PNG files, thanks
How to use this with camera?
Do you have any idea how to adjust the expression to maintain the stroke width when the shape layer is scaled down and the proportion parameters are unlinked?
@Tom Pendleton not sure if you still need help but try parenting to a null object and changing the scale of that instead of the object itself
Thanks for the tutorial.. but it's not working in my case...
Hi, thanks for the tutorial. I keep getting this orange pop-up error message: "couldn't turn result into numeric value." how do i fix it?
Noticed the expression error hits when the parent scale is keyframed to 0%.
@@vfdifwfeljsvfghdf2054 Yeah you can ignore that message. In your expression you divide by the scale. Dividing by 0 is impossible so the error pops up. but if the scale is 0, the object won't be visible, so no problem there. Cheers!
please help! im new to ae and last week it was working fine and when i came back now, i cant scale! i can add a keyframe but i cant see the robot thing the slanting line thing near the layer or photo, is it a window, that thing on the right side of ur layer, (layer name) (robot like thingy) (bullet like thingy) (slanting line) and the fx they arent in my ae please help! i need ur help asap! T^T i cant see any tutorials on how to fix it or stuff! please help!
Hey! You need to right click on the bar above your layers (where it says 'Layer Name' and 'Mode' etc) and then you can turn those icons back on! Right click and then go to: Columns -> Switches. That should do it :)
@@CampKeyframetutorials OMG TYSM! YOU SAVEED ME
@@zn1481 Awesome! :)
The windmill is turning in the wrong direction.
Haha yeah you're right! Didn't notice it while I was animating ;)
4 minutes and 17 seconds to Scale Path and Maintain Stroke width... Thanks anyway.
Thank you!!
You're welcome! :)