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

Wiggle expression

Community Beginner ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

HI! I have a few layers and I want to wiggle their position. Also I have a null object with wiggle expression on its position. When I pickwhip their position to the position of null object these layers changing their position but I need only wiggle effect without changing the position. How do I achieve that?

TOPICS
Expressions , FAQ

Views

1.8K

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

LEGEND , Sep 18, 2020 Sep 18, 2020

I think what you want to do is parent your other objects to the null object instead of pickwhipping to its position.

Votes

Translate

Translate
LEGEND ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

I think what you want to do is parent your other objects to the null object instead of pickwhipping to its position.

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 ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

You can use this expression 

 

var mSource = thisComp.layer("Null 1");
var P1 = transform.position.wiggle(5,10);// this this you layer wiggle value:
var P2 = thisComp.layer("Null 1").transform.position;
var P3 = thisComp.layer("Null 1").transform.position.valueAtTime(mSource.inPoint);
P1+P2-P3;

 

change the Null 1 to your Null name, it will look like this

 

Screen Shot 2020-09-19 at 8.53.03 AM.png

 

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 ,
Sep 19, 2020 Sep 19, 2020

Copy link to clipboard

Copied

If you want to wiggle a bunch of layers at the same time and maintain their relative position you have two very simple options. Parent all of the layers to a null with wiggle() applied to it or Pre-compose all the layers and apply wiggle to the pre-comp. Most of the time I would use parenting. 

 

Using an expression would require you to retrieve the difference between the comp center and the position of the layer that is wiggling and add that value to the current layer's position. The expression would look like this:

 

src=thisComp.layer("Null 1").transform.position;
ofst = src - [thisComp.width/2, thisComp.height/2];
value + ofst;

 

The expression given by OussK does not work. You could remove the wiggle from the null and a layer containing the expression would still wiggle. Apply the expression to multiple layers and they would all wiggle differently.

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 ,
Sep 19, 2020 Sep 19, 2020

Copy link to clipboard

Copied

I have an animation preset I call Parent Position to Master. All you have to do is change the layer name of the position only parent to Master. Feel free to download it and save it to your custom presets folder.

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 ,
Sep 19, 2020 Sep 19, 2020

Copy link to clipboard

Copied

LATEST

What I understand that they need to add 2 wiggle effects one on layer position and at the same time pickwhip to a null with wiggle expression, for that, I add .wiggle to the current position, so if you want simply wiggle the Null only you can remove the .wiggle from the P1, so the expression will look like this 

 

 

 

var mSource = thisComp.layer("Null 1");
var P1 = transform.position;
var P2 = thisComp.layer("Null 1").transform.position;
var P3 = thisComp.layer("Null 1").transform.position.valueAtTime(mSource.inPoint);
P1+P2-P3;

 

 

 also, all layers will wiggle the same 

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