Hi All,
I'm a bit of a beginner in expressions, but I'm looking for a way to keep the initial position of a layer when adding a wiggle expression to it. Let me try and illustrate what I'm meaning. Basically, say I have a circular shape layer at position 960,540 (centered). When I add the expression "wiggle(.5,100)" and apply it, the circle immediately jumps to another random position within the range of those 100 pixels (say 988,522). What I'm looking to do is be able to add that same expression, and have it continue it's random motion, but start initially from the position of 960,540 so that there's no jump when activating it. I'm aware of "valueAtTime" condition, but am unsure how to use it or if there's another/better/easier way to implement what I'm looking for (maybe just using "value")? Thanks for the help.
Magua
Preserve Initial Layer Position Prior to Wiggle
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
This should work:
freq = .5;
amp = 100;
wiggle(freq,amp) - wiggle(freq,amp,1,.5,inPoint) + value
Dan
freq = .5;
amp = 100;
wiggle(freq,amp) - wiggle(freq,amp,1,.5,inPoint) + value
Dan
Wow, lightning fast reply Dan. Yep, this works perfectly - thanks a lot, I really appreciate it. I'm wondering if you don't mind walking me through a portion of this expression though, just so I understand it. I get everything up until "wiggle(freq,amp,1,.5,inPoint)" in the third line, and more specifically, the "1,.5" portion of this. My understanding is that overall, the expression is negating the offset from it's inpoint value, but I'm not following those two values... especially the "1"... I ask in case I want to change/tweak the amplitude and frequency overall... Thanks in advance.
Cheers
EDIT: Ok, asked this before researching it. My understanding that those are the octave and amp_mult values. The octave makes sense to keep defaulted to 1 and my guess is that you want the amp_mult to match the frequency I'm using. I guess my question would then be, why even bother to define the octave if you're keeping it at the default... unless you need to pair the octave and amp_mult values?
Cheers
EDIT: Ok, asked this before researching it. My understanding that those are the octave and amp_mult values. The octave makes sense to keep defaulted to 1 and my guess is that you want the amp_mult to match the frequency I'm using. I guess my question would then be, why even bother to define the octave if you're keeping it at the default... unless you need to pair the octave and amp_mult values?
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
To get to wiggle's 5th parameter (time--which is how you accomplish valueAtTime for wiggle), you have to specify something for the 3rd and 4th parameters (number of octaves and octave amplitude multiplier) so I just plug in the defaults (1 and .5).
Dan
Dan