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

Problem with expression slider

People's Champ ,
Jun 01, 2020 Jun 01, 2020

Copy link to clipboard

Copied

I'm using version 16.1.3 and trying to execute a very simple expression I've used many times before.

I'm a wiggle expression to a layer then using hte expression pickwhip to attach it to a slider control on a separate solid so i can turn it on and off.

The final expression looks like this: wiggle(40,25)*thisComp.layer("Royal Blue Solid 3").effect("Slider Control")("Slider")

Problem is that when I set the slider (multiplier) value, in addition to multiplying the wiggle it's also affecting the world position of the layer.

This has never happened to me before although maybe it's been so long since I used this I forgot something or something has changed?

I tried several forms of the expression besides the one I posted including putting both sides of the equation in parenthesis and terminating it with a semicolon.  I even tried scrapping the slider altogether and just testing "wiggle(40,25)*0"  and the layer still moved to 0,0 world position.  

Am I missing something?  Thanks for your help.

~Gutterfish
TOPICS
Error or problem , Expressions , How to , Performance , Scripting

Views

699

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
Mentor ,
Jun 01, 2020 Jun 01, 2020

Copy link to clipboard

Copied

This is completly expected.

You are effectivly turning your position to 0, not just the wiggle. Keep in mind that wiggle returns a value including your inital position, not just the wiggle-amount.

 

Instead of the multiplier, you can use the slider to control the wiggle amount. This way you can turn it off without loosing your inital position. wiggle(0,25) = inital position.

 

You can also read out your inital position and subtract it from the wiggle, add the striped wiggle and control it with the multiplier:

 

mypos = thisLayer.transform.position;

multi = thisComp.layer("Royal Blue Solid 3").effect("Slider Control")("Slider");

w = wiggle(40,25);

stripedw = w - mypos;

mywiggle = mypos + (stripew * multi);

 

*Martin

 

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
People's Champ ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

Thanks Martin.  I could swear I use to just pickwhip it and it worked but I can't always trust my own brain 🙂

 

~Gutterfish

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
Community Expert ,
Jun 01, 2020 Jun 01, 2020

Copy link to clipboard

Copied

You use this simple expression 

S=thisComp.layer("Royal Blue Solid 3").effect("Slider Control")("Slider");

wiggle(40*S,25*S);

 

-OussK

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
People's Champ ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

LATEST

Thanks for that 🙂  

~Paul

~Gutterfish

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