instruct9r03 March 2006, 10:20 AMHi. I have one problem with writing expression for speeding up one deformer's offset. To be sure you will understand me i've attach file that contains simple scene Scene (http://www.creaturetd.com/forums/download.php?id=70) Play the scene then change the attribute "Speed" of the circle controler. It's working OK. But try to animate for example from 1 to 2, only while in incresasing process the deformer became really fast them its working ok.... Could someone fix this please?? 10x
03 March 2006, 10:35 AM
It's working fine here...

instruct9r
03 March 2006, 10:53 AM
try this.

Set key on the speed attr to 1 for frame 50, then set key on the attr to 2 for frame 100. go to frame 150 and play, see how it work, then go to frame 60 and play to see. Between frame 50 and 100 its running super fast then after frame 100 its normalized again. thats the problem.

03 March 2006, 11:41 AM
well, your graph looks like this...
I'm trying to figure out why.

instruct9r
03 March 2006, 11:50 AM
The scene should have only one Expression. Delete all keys and try again. I may forgot to delete something... sorry about that. I can't understand how to make this expression to wotk :banghead:

03 March 2006, 12:02 PM
the scene only has one expression. I just baked the offset.
What I'm thinking:
The value of the offset will always ascend because it's hooked up with time and when you key the speed you accellerate it, but when you stop increasing the speed it goes back to ascending at a smooth range wit the time as input only. Hence the graph. If you ditch the time and just key the speed you can see it run smoothly. So when you have ONE attribute ascending it will run smoothly, when you have TWO you kind of get a double translate.

Maybe this will work better:

sineAttrs.offset += ((ctrl.speed)/5);

instruct9r
03 March 2006, 01:03 PM
COOL man.. :scream:

I was thinkink the operator "+=" is for increasing. Thats why i didn't try with that.

Thank you.

cheers

03 March 2006, 01:11 PM
well, the += does only add itself + the value you put in.
e.g:

\$hello += 1;
is the same as
\$hello = \$hello + 1;

++ is for increasing

instruct9r
03 March 2006, 01:34 PM
yep... i have a lot to learn about MEL and expressions

thanks:applause: