• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Add roundness to slider control

Explorer ,
Mar 15, 2024 Mar 15, 2024

Copy link to clipboard

Copied

Is there any way to add shape roundness properties to slider control.

I created a subtitle background, using adjustment layer but can't able to find the way to add roundness to it.

TOPICS
Expressions , How to , Scripting

Views

95

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 16, 2024 Mar 16, 2024

You should not use an Adjustment layer to control the properties of a shape layer or any other layer's transform properties. Instead, apply expression controls to the layer itself or to a Null. That's better housekeeping and workflow practice.

 

The only time it is advisable to add expression controls to an Adjustment layer is when the adjustment layer also controls effects that effect all layers below it. 

 

If you can set a keyframe, you can add an expression. I add a little math for roundness

...

Votes

Translate

Translate
Community Expert ,
Mar 16, 2024 Mar 16, 2024

Copy link to clipboard

Copied

You should not use an Adjustment layer to control the properties of a shape layer or any other layer's transform properties. Instead, apply expression controls to the layer itself or to a Null. That's better housekeeping and workflow practice.

 

The only time it is advisable to add expression controls to an Adjustment layer is when the adjustment layer also controls effects that effect all layers below it. 

 

If you can set a keyframe, you can add an expression. I add a little math for roundness and an if statement, so a slider going from 0 to 100 will give you a roundness value that goes from square corners to round ends. 

 

Here's what it looks like if you add the sliders to the same shaped layer. If the Slider is on a null, then thisComp.layer("Layer Name"). would proceed the "effect("Roundness")("Slider") * .01 part of the expression.

 

rnd = effect("Roundness")("Slider")*.01;
box = content("Rectangle 1").content("Rectangle Path 1").size;
if (box[0] < box[1]){
	siz = box[0]/2;
}
else{
	siz = box[1]/2;
}
siz * rnd;
	

 

Roundness.gif

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

LATEST

Thank you @Rick Gerard ,

It helped, you are a life saver.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines