3 - Let's try sine out. Grab the pStone and right-holdclick the translate Y attribute. Go to expressions... and set select filter to by expression name.
Call our new expression "stoneTranslateYSine" and press enter. Now write this into the expression - textfield.
pStone.translateY = sin(90); and click Create.
Maya returns the rather odd result 0.894 (read the translateY attribute, now marked purple/lilac because an expression is linked to it ) I'm not quite sure why this is, but I recon maya reads radians since sin(deg_to_rad(90)); returns 1
Fear not, we can use sind ( sinusdegrees ). sind(90) will return "1".
If we use sind(frame) instead of a set value maya will fill the current frame in. e.g. at frame 10; sin(10), at frame 90; sin(90) Try this one out and hit play.
pStone.translateY = sin(frame);
If you have the timerange set from 0 to 90 you can see that it takes 90 frames to get the translateY to "1" If you've been paying attention you should be able to guess this result before you saw it in Maya. We are getting somewhere now.
We want a higher frequence. Taking 90 frames to get half a sinecurve isn't quite usable. I tried a couple of values and this is what I am looking for:
pStone.translateY = sin(frame*56):
It's rather quick, but I'll use the vibrateValue to ease it in and out later. Now I want you do one last thing with the stone before we go to the plankBendDeformer.Go to "Edit - Keys - Bake Simulation/optionBox".
Reset the settings ( Edit - Reset Settings ) and change Channels to "From Channel Box". Set Time Range to "Start/End" and set Start Time to 0 and End Time to 90. Select pStone.translateY in the channelBox and hit Bake.
Maya will now bake the animation by reading the value at each frame and set a key. Let her finish and open
the graphEditor ( Window - Animation Editors - Graph Editor...) And... We're in sine-land: |